How to make only 2 copies of an active spawn per level?

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I have a collectible object (an active) in my new game, and I want to put many spawn points on the map, but have only 2 of those locations spawn (or be created) per level, and have it randomly choose which 2 spawn points to create.

    I'm disabled and need help determining the method for achieving this that would require the smallest amount of code. I'm reasonably experienced, but have been unable to use a computer for 5 years due to injuries, so I'm very rusty.

    All help is appreciated, thanks!

  • you can do this a number of ways, and its up to you how you would like to do it. i have done something like this in the past by, all those possible locations, you have an invisible spawn location marker (all duplicates)
    if its just 2 objects to place. then,

    start of frame:
    [pick] a spawn location at random
    + [collectable active] is NOT overlapping the [spawn location marker]
    > create [collectable active] at 0,0 of the [spawn location marker

    start of frame:
    [pick] a spawn location at random
    + [collectable active] is NOT overlapping the [spawn location marker]
    > create [collectable active] at 0,0 of the [spawn location marker


    *just copy that event twice.
    if you wanted to place many, then you could do a loop; but for 2 just copy the event and paste it again, so it runs the condition twice.

  • I would also have to have a condition ensuring that the collectible active isn't overlapping itself, correct? Or alternatively, delete the spawn marker that is used for the first collectible spawn? Which would be simpler? I ask, because I can only work on the game for 30-60 minutes a day, due to my injuries.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!