Spawn a certain number based off a set or a attribute.

cwbh10cwbh10 Member Posts: 52
edited November -1 in Tech Support
I know this isn;t a feature yet, but I thought I had my own work around it... I had a input which would be the desired amount, then I had the amount of actors on screen, would start as one, and I would make a rule saying: If input > Actors, spawn actor (Random location), and add actors+1 until they were the same. Unfortunately this isn't the case and it doesn't work at all. Much help would be nice as I NEED this for my app.

Will post screeny/video if needed.

Comments

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    i think something like this would work, lets say you have an attribute called actorsOnScreen and you have it set to 10, and another one spawnedActors

    have a rule that says:

    while spawnedActors is <= actorsOnScreen
    timer every .5 seconds
    spawn actor at random location
    spawnedActors = spawnedActors+1

    you need the timer for it to keep running, otherwise it'll just run though once
  • cwbh10cwbh10 Member Posts: 52
    Thanks sooooo much! I think I know what the problem is now... I did use a timer once, but thought that it didn't work so I posted here. Turns out they were spawning outside of the walls so i couldn't see them :/ Anyways. You way worked... with a little modifying... I did < not <=. <= cause an extra to be spawned because it is saying if the numbers are equal spawn again. Also i did

    While Gold # is > Gold on screen... Your code. :)
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    awesome, glad it helped.
  • diyajeediyajee Member Posts: 15
    It turns out that they were nesting outside the walls could not see: / Anyway. How much work ... with a little modification ...
Sign In or Register to comment.