How do I pick instances made programatically? [RESOLVED]

Get help using Construct 2

Post » Sat Dec 26, 2015 5:48 am

I have one instance of a generic map tile object outside of the viewable area.

Once the map size is determined (width and height) I generate map tiles to fill in the play area.

I then want to go through and set some of the instance variables in certain conditions. But it appears that construct 2 doesn't think the map tiles exist yet! If I follow up my creation loop with a map_tile.x >= 0 and then an action of "Set DeploymentZone = 1", it only applies to the very first map tile created on the layout and not any of the ones that were automatically generated. (In fact if I replace the x>=0 condition by a system pick all the same functionality happens, it's as if the objects created in the loop above simply do not exist)

Any thoughts?


So while this code should set the DeploymentZone to 1 for ALL of the map tiles created it actually only applies it to the initial one on the layout, and any other ones that I create in the designer view.
Last edited by lschulte on Sat Dec 26, 2015 4:56 pm, edited 1 time in total.
Posts: 2
Reputation: 204

Post » Sat Dec 26, 2015 10:32 am

The event 18 has to be a sub event to the event 17 if you want to check every created map_square.
Banned User
Posts: 105
Reputation: 1,170

Post » Sat Dec 26, 2015 4:55 pm

Thanks! This helps a lot. I'm trying to do some loading work that only happens at the beginning so I didn't want there to be a number of events that were always checking conditions to decide whether or not to initialize these map tiles.
Posts: 2
Reputation: 204

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 18 guests