Spawning actors randomly with some of them being rarer than other

Hello all,

Having a little trouble, I haven't been using GameSalad in a while but have just recently got back into it and have forgotten some really basic stuff, here is what i am trying to do;

I have 3 actors actor 1, actor 2 and actor 3. I wish to spawn these actors randomly (which I can do easily) however I wish to make actor 1 spawn a lot every 3 seconds in fact. Actor 2 needs to be more rare than this so it spawns every 20 seconds (not exactly 20 seconds but around this) and actor 3 the same but being around 45 seconds ish.

Instead of doing timers I want them to spawn randomly but each one to be more rare than the other.

If this makes sense!! Again I haven't been on here in a while so this could be so basic and im just being an idiot.

-BA

Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    When you are picking your random amount to spawn adjust your random numbers as needed, for example:

    Spawn = Random (1,2)
    If spawn = 1 spawn the actor

    Will spawn and actor 1/2 of the time (approximately)

    While

    Spawn = Random (1,10)
    If spawn = 1 spawn the actor

    Will spawn and actor 1/10 of the time (approximately)

    Hope that helps.
  • Barking_AppsBarking_Apps Member Posts: 182
    Yeah it works now thanks a lot for your help @jamie_c
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    You're welcome :)
Sign In or Register to comment.