Still trying to understand picking

This forum is currently in read-only mode.
From the Asset Store
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
  • Hello,

    another picking question from me.

    In my event sheet, I have a section "Setup", where there are several "Start of Layout"-events.

    One of them is setting up the gameworld, creating planets at random positions, then going through all the players and picking a random planet for them to have as homeworld.

    At a later stage, I trigger a an event "Every 1000 milliseconds", where I try to go through all the planets and update their gamestate. However, it seems that the script only picks a single planet: the one that's been last picked by the setup event (the homeworld of the last player added to the game in this case).

    Is there a way for me to manually tell Construct to forget about previously picked objects and start picking from scratch?

  • You can always call functions which forget picked objects. Or if you want to pick every instance of an object which has been previously picked in an event tree, you could simply use a family for that purpose.

  • Oh, totally sorry - was my fault. I created my Player-Object in the wrong line (before the loop that actually determines how many players there are).

    Yeah, I've been working 24hours straight on this now. I should take a break.

    Thanks for the help though

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • For the record, the best way to reset picking is simply in another event (like you say with multiple start of level events). However, if that's tricky, like if you're several subevents deep, then you can call a function with the function object, and specify that picked objects should be forgotten.

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