How do I pick instances made programatically? [RESOLVED]

0 favourites
  • 3 posts
From the Asset Store
Make your own platformer for both the web and mobile easy with this Santas Platformer Template, FULLY DOCUMENTED
  • 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.

  • The event 18 has to be a sub event to the event 17 if you want to check every created map_square.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)