Random Spawn Question

Harvick29Harvick29 Member Posts: 10
edited November -1 in Working with GS (Mac)
I have figured out how to set up the random spawn, however I would like to find out how to run through each spawned actor only once each. Example: If I have it set up as "game.spawnactor random (1,4)", how would I set it up so that if it uses spawn 3 as the first spawning,....it then can never spawn #3 again?

Comments

  • RodericRoderic Member Posts: 145
    The way I would do it would be to set up 4 attributes, and after a random number is selected, mark the associated attribute as used and then when the next random number is picked, do a check to see if that number is used already or not. I hope this helps.
  • rlehmrlehm Member Posts: 320
    Put a rule in actor three that say something like change attribute game.invisible to game.invisible+1

    then in the actor

    if game.invisible is > 0

    self.color/alpha = 0

    this will have a lot of extra actors though, so if they spawn often, this is not a good fix.. but may get you started???

    maybe add another rule..

    timer 0.5
    if self.color.alpha=0
    destroy?

    I've never done this.. may not work.. maybe some one with more skill can expand/fix my guess
  • Harvick29Harvick29 Member Posts: 10
    Great, thanks guys!! I'll give this a shot and let you know!

    Quick question: I already have within each actor a boolean attribute that automatically changes the actor to "false",...then when it's touched, it animates and then turns it to "true"
    Would I piggyback off this attribute, or create a new attribute for what I'm trying to accomplish?

    Thanks!
Sign In or Register to comment.