Using self.time - advantages over timer behaviours
AfterBurnett
Member Posts: 3,474
Hi guys,
Are there any advantages from using self.time over the timer behaviours? I've read that timers can kill the CPU... is this the same with manipulating an actor's self.time?
Are there any advantages from using self.time over the timer behaviours? I've read that timers can kill the CPU... is this the same with manipulating an actor's self.time?
Comments
Here is an old tip on the subject I wrote:
http://www.gsproforum.com/viewtopic.php?f=18&t=2
How would you implement that for every X seconds?
An every X is more complex...
I haven't done it...yet...but I imagine its possible.
One thought is...
When actor is spawned (or triggered):
setTime = TRUE
When setTime = TRUE
markTime = self.time
repeatMarkTime = markTime + 5 (or however many seconds you want for the loop)
setTime = FALSE (shutoff)
LOOP RULE:
when self.time > repeatMarkTime
[ insert rule sequence here for the loop function ]
the last behavior in the loop would be setTime=TRUE
(this would trigger the time marks to update and the loop would then wait for the next loop condition to become valid)
Its not proven (by me)...but seems like it would work theoretically.
I'm also not sure if it would be PERFECT in time execution or if it would work on VERY FAST loops...but on slow loops (over say 3 seconds) I would think it would work well...so long as the loop routine's lifespan doesn't exceed the loop amount (such as interpolations).
Mess around with it and you might find the sweet spot.
Rule:
When self.loop = ((floor(self.time)-1)%5)+1