help me with random timer please
![Oxygen](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
hello !!
Sorry to ask but even with the "how to" tutorial, i can't make my random timer works...
here is the problem :
- in my game, all the time, some actors have to spawn randomly (every random 4 and 10 seconds).
I try everything, with rules, without rules, with attribute in actors... and nothing works.
help me please thanks
Sorry to ask but even with the "how to" tutorial, i can't make my random timer works...
here is the problem :
- in my game, all the time, some actors have to spawn randomly (every random 4 and 10 seconds).
I try everything, with rules, without rules, with attribute in actors... and nothing works.
help me please thanks
Comments
1. create a integer attribute name it "randomizer" or what ever you want & a Boolean attribute name it "spawned" or whatever you want.
2. on your spawner place a rule when "spawned is false>>>change attribute>>randomizer = random (1,5); then put "change attribute spawned = true";
3. then place another rule again "when randomizer = 1 & spawned = true >> timer (after 4) >> spawn (your actor) then put "change attribute spawned = false "
4. do the rest with the other value of randomizer then change the time as well.
I havent check this one out as i type it in PC so let me know how it goes.
So if i want a randow between 4 and 10 second i have 7 rules !!! awesome !
on my spawner i put 2 attribute, timer as an integer and reseed as boolean then
IF self.reseed is true
THEN change self.timer to random(4,10)
after self.timer
spawn
change self.reseed to false
OTHERWISE
change self.timer to true