How to control the amount of times an actor spawns?

I want to know if it's possible to control the amount of times an actor spawns in a given time period. For example let's say I want an actor to spawn once every 5 seconds and as the game goes on it'll spawn twice every 5 seconds and after 3, 4, 5, 6, until it spawns an actor once every

Comments

  • http_gamesaladhttp_gamesalad Member Posts: 1,340

    as the game get's harder I want it spawn more

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276
    edited March 2016

    Create a game attribute, call it spawncount.

    Every time you spawn, increase game.spawncount by 1.

    Now, put the spawner in a rule that says:
    -When game.spawncount < 10
    -spawn every 5 seconds

    Otherwise
    -if game.spawncount < 20
    -spawn every 4 seconds

    Otherwise
    -if game.spawncount < 30
    -spawn every 3 seconds.

    Etc...

    Hope this helped.

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    While you can do it with rules, there are better and easier ways to do it. Check out this thread from last year that asked the same question.

    http://forums.gamesalad.com/discussion/82113/need-help-with-increase-spawn-time-of-an-actor

  • http_gamesaladhttp_gamesalad Member Posts: 1,340
    edited March 2016

    @MentalDonkeyGames @Braydon_SFX

    How this is set up now is that everytime a floor spawns the object spawns also. I can't figure out to make it spawn less & start spawing more rapidly

  • http_gamesaladhttp_gamesalad Member Posts: 1,340

    Bump?

  • http_gamesaladhttp_gamesalad Member Posts: 1,340

    Sorry to bumb more than once .. but I can't solve this

  • ApprowApprow Member Posts: 703

    @http_gamesalad If you didn't understand @MentalDonkeyGames method, you can try this. I believe you can't change the timer during gameplay. So make a few rules, and say:

    Rule: when score =>0 and score <5
    timer: every 2.5 seconds spawn coin

    Rule: when score =>5 and score <10
    timer: every 2 seconds spawn coin

    Rule: when score =>10 and score <15
    timer: every 1.5 seconds spawn coin

    etc etc....

    It's really primitive but it should work:)

  • http_gamesaladhttp_gamesalad Member Posts: 1,340

    @approw instead of all those rules I tried to set the spawning on a timer. I noticed it doesn't work if I put the time to random timer. It does work if I put something like every one second. I checked the run to completion box also .. it doesn't work that great with it checked also.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Two people have given you suggestions for ways to set up custom timers but it sounds like you haven't tried either of them. :( The Timer behavior calculates the value in the expression (e.g. random(1,3)) and then uses that value for the timer. For more info and a workaround see http://forums.gamesalad.com/discussion/comment/464547/#Comment_464547.

  • Terrellort_GamingTerrellort_Gaming Member Posts: 93

    Hey!!! I like the new display picture!!!! The old one boring. Use this only

Sign In or Register to comment.