Actor Spawn Timer problem
Hi all
I'm working on my next app and would like to ask for some help.
I have a spawner actor that spits out balls every 1 second. I have a attribute called spit that is set at 1 - so 1 for 1 second on the timer...so it goes 'Every 1 sec spawn ball'
Now, I would like it so as time goes by, the spawner starts to speed up the rate the balls are fired. I've tried Real and Integer with a rule that says - every 5 seconds change spit to spit -0.25
Now, I would have thought that would start to take 0.25 off the initial 1 second and start to speed the balls fire rate but it still seems to spit balls out every 1 second.
I've but a blank actor on screen to show myself the attribute value for spit and it does go less that 1 seconds but the rate doesn't speed up?
What am i doing wrong.
If i go and set up the spawner manually, say 0.25 seconds spit a ball it works fine then but when i have the 5 second timer read the current attribute and then take 0.25 secs off and repeat, the spit seems to stuck at 1 second?
Any clues and I think i've tried most things!
Many thanks guys
ZB
It takes a Zombie to know a Zombie!!!
Comments
So, you have a timer going off once per second, correct?
Then you have a variable called spit... that you are decrementing over time, correct?
How are the two related?
I would guess that you would want to have a counter...
counter = 0 (start at 0)
spit = 1.0 (1 second)
make a timer that goes off every .1
in the timer event, you need:
counter = counter + .1 (so each timer cycle (.1), the counter gets incremented)
if counter >= spit then spawn actor, reset counter to 0
Hi ook
Yeah I have a attribute called SPIT which is set to 1, I then tie that to my timer...
Timer - every game.spit spawn ball.
Now every 10 second I have change attribute command that says...
Change attribute game.spit to game.spit - 0.10
So my thinking is that every 1 second a ball is spawned and then every 10 seconds the change attribute command the takes 0.10 seconds so in theory the balls spawn faster but it's not taking anything off....the balls still spit out normal.
Any ideas?
It takes a Zombie to know a Zombie!!!
I'm having the exact same issue - I'm using an attribute as the value for a timer so every 'attribute' seconds, do something eg spawn actor. And I want to be able to change that attribute and therefore change the timer.
I've read that gamesalad doesn't allow this, it will only use the first value of the attribute when using it as a timer - it's apparently not a bug, just the way it is.
So I guess my question is, how else can we dynamically change the timer? Or is there another solution - I want to use this functionality to control waves that appear more frequently over time, I can't think of another way of doing that without getting messy and duplicating behaviours.
@Zombiebrains I'm at work so can't validate whether or not this solves the problem, but I've stumbled across this thread: http://forums.gamesalad.com/discussion/48566/timer-decrement
Might be worth checking it out? I'll take a look when I'm in front of a mac.
You could try a timerless timer, using a TimeChecker attribute(a placeholder you usually leave at .5 or something since the left side of the equation has to be an attribute) = self.time%(timer length) rule in place of a Timer Command.. and have the timer length attribute there be what you change. I think that would work
@imjustmike Use my custom interval timer method: http://forums.gamesalad.com/discussion/comment/464547/#Comment_464547
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks guys, all great responses...will try them out soon and see if I can get this think working.
It takes a Zombie to know a Zombie!!!