Timer Help Please
Hi everyone, below is how i'm trying to create an increasingly fast spawn rate of objects coming down.. my hope is to get it to be faster and faster
I will want to get velocity the mix next, but before i do that, i feel I need to understand how to make the objects appear on the screen faster and faster over time. I can't figure out how else i could increase the spawn rate without a timer.
1. i have an actor "spawn_object"
2. in that actor i have a rule.. which is saying.. "stop spawning if player has 0 lives"
3. inside that rule i have a timer (the only one in the game so far) set to "every" game.objectspeed "seconds"
4. inside that timer i have two behaviors
- change attribute "game.objectspeed"-1 (the -1 will be modified with a more sloping math formula, but for now i'm just trying to get it to work period)
I have a counter on my screen that shows this value gradually going down.. all the while the rate of dropping stays the same.. it seems like the "e" next to the timer "every" field would indicate that this value can be updated continuously.. but for all my efforts the timer continues to listen to only the initial value given.
I would love to know another way to get this to work.
I will want to get velocity the mix next, but before i do that, i feel I need to understand how to make the objects appear on the screen faster and faster over time. I can't figure out how else i could increase the spawn rate without a timer.
1. i have an actor "spawn_object"
2. in that actor i have a rule.. which is saying.. "stop spawning if player has 0 lives"
3. inside that rule i have a timer (the only one in the game so far) set to "every" game.objectspeed "seconds"
4. inside that timer i have two behaviors
- change attribute "game.objectspeed"-1 (the -1 will be modified with a more sloping math formula, but for now i'm just trying to get it to work period)
I have a counter on my screen that shows this value gradually going down.. all the while the rate of dropping stays the same.. it seems like the "e" next to the timer "every" field would indicate that this value can be updated continuously.. but for all my efforts the timer continues to listen to only the initial value given.
I would love to know another way to get this to work.
Comments
drop some code in here to get the ball rolling. might be easier to review and hopefully find the solution you need.
cheers
One option is to use a rule instead of timer :
Create a "self" attribute , call it "timer for spawning" - integer - leave its value 0 !
Then make a rule:
When "timer for spawning" = self.time%"game.objectspeed"
Do what you want .
although it is highly Not recommended to spawn a lot through out the game ..
Give it a try .
Roy.
to P-O-M, I'm going to give this a go right now and see what i can do with it. i see what you mean about making a rule instead of a timer.. very cool!
http://part12studios.com/Temp/
Also this is a major part of the game.. driving the difficulty up over time having things move faster and faster..
i wanted to get clarity also. "Yes , timers in GS do behave like you said". In that validation, did you mean that once a timer value is put it is fixed and doesn't update? because I pretty much said both how i thought it should work and how it was working for me so far.
Thanks!
Caleb
i haven't been able to get mine to work, but this guy is definitely trying to do something in the same vein as what i'm trying to do..
i may just have to start over because i have other stuff going on that might be obfuscating this issue