AllanR's Recent Forum Activity

  • when you create an object, the process doesn't complete until the next top level event.

    your "on start of layout" event loops through each spawner, creating a new tiledbackground object, but those objects wont be ready until event 4 is completely finished.

    so, in your code, event 3 was trying to pick the family object by its id2 variable, but that will fail because the new object is not ready yet. Only the pick last created, or pick by uid will work at that point.

    putting a wait 0 seconds as an action will defer other actions under that until the end of the current tick, by which time the new objects will be ready, but people quite often create other problems if they don't use that properly.

    you were using iid which is not as reliable as uid. iid for an object will change if you destroy an earlier instance of that object. the uid will not change, and is the same for the original object and the same object under the family name.

    so, picking by the variable would have worked fine - but not until the after the object is fully created.

  • well, baby steps... if you start getting anywhere near 1 billion you will have to do some major back end scaling and should be able to afford a large team of developers that you can delegate that task to.

  • sounds like you might have locked the layer the sprites are on. on the layer panel, see if you can click the little lock icon to unlock the layer.

  • you could set a limit of how many players can join a game, and have enough frames to cover that - 10, 20 50, whatever your limit is.

  • the reason you need the wait 0 is that object creation does not complete until the next top level event.

    so, in your case event one must completely finish before the objects created in the function can be picked by "normal" means. (you can pick by UID or Last Created before then)

    adding the wait 0 defers actions until the end of current tick - which means the event that created the objects has completed.

    you could add another event to call the second function, but to do that you would have to set up some kind of trigger for that, which would only add more trouble than the wait 0.

  • you are probably creating an infinite loop.

    make sure a while event has a way to get out.

    since the event sheet runs every tick there is also a very good chance you don't need while - as long as the main condition is true the event will keep running every tick without using while.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • see this thread, it shows how to do it and provides an example...

    https://www.construct.net/en/forum/construct-2/how-do-i-18/load-different-image-151138?kws=load%2bimage%2bframe

  • all instances of Sprite use the same image, so whatever the last one loaded is.

    load each image as a different animation frame and set accordingly.

  • just check the value in the array before you set the text output...

    if it is a code you want to behave differently, make it do what you want, else output the array value the way you were.

  • The event that is creating you sprite must be running every tick, so check the condition that makes the event happen - the condition is staying true so it keeps creating more instances. Either add a "Trigger Once While True" to the condition, or structure it some other way so that it can only run once.

    or post your code so we can see what is going on.

  • I made a quick sample...

    you need to push a new row into the array, and then access the proper Y element for each piece of information.

    it starts off blank because there is nothing in the array. I call a function at the start and after you click the add button. At the start it shows all elements in the array, after the add button is clicked it just adds the last row in the array. If you double tap then it restarts the layout but that happens so fast you can't see it...

    I use % (modulo) to wrap the objects to the screen.

    https://www.rieperts.com/games/forum/CreateObjects.c3p

  • you would do that with AJAX and request the file you want from your site server, or get data from a mySQL database on your site. You have to use SSL these days to make it work.

    there are some good tutorials to get you started, and if you get stuck there are plenty of us with lots of experience with this.

AllanR's avatar

AllanR

Member since 21 Nov, 2013

Twitter
AllanR has 23 followers

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

20/44
How to earn trophies