Timers issues
RocketBrain
Member, PRO Posts: 269
i tried making the timer "every # seconds do this"
I made the # a variable and tried changing the variable after the game started. however no matter what i did nothing changed.
So far it seems like once the timer initiates you cant change that attribute later.
Is this true?
I made the # a variable and tried changing the variable after the game started. however no matter what i did nothing changed.
So far it seems like once the timer initiates you cant change that attribute later.
Is this true?
Comments
@RabidWeasel
Yes, technically this happens:
So, yes, once a timer is started, it will run at the initially defined interval.
You can use game.Time and rules to achieve what you want.
self.LastTimeStamp = game.Time
Rule: If self.LastTimeStamp + self.VariableInterval < game.Time then
do whatever
self.LastTimeStamp = game.Time
end of Rule
Now you can change the interval at will by changing self.VariableInterval
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
@Hopscotch
Brilliant illustration of the issue !
I asked the exact question a few moons ago...........
This illustration is great. You want what he gave you a "custom timer".
I struggled with the custom timer logic at first. So don't fret if it makes little sense at first. I think of "game.time" as a constantly changing variable.
I have to refer back to the example every time I use it....... I have a work around using timers, spawning actors but not good coding practice......