How to reset a running timer?
SoxProcs
Member Posts: 11
I recently watched a TSB tutorial which told me to use this specific equation to allow minutes, seconds, and milliseconds to appear when playing my game:
floor(floor((game.time%3600)/60)/10)..floor((floor(game.time%3600)/60)%10)..":"..floor((game.time%60)/10)..floor(game.time%10)..":"..(floor(game.time*10(%10)..floor(floor(game.time*100)%10)
This equation worked great for me, but the only problem is it is running constantly right from when I begin to preview my game (even when the timer is not in certain scenes) and I have no control when it starts, stops, pauses, and resets.
Can someone help me out?
floor(floor((game.time%3600)/60)/10)..floor((floor(game.time%3600)/60)%10)..":"..floor((game.time%60)/10)..floor(game.time%10)..":"..(floor(game.time*10(%10)..floor(floor(game.time*100)%10)
This equation worked great for me, but the only problem is it is running constantly right from when I begin to preview my game (even when the timer is not in certain scenes) and I have no control when it starts, stops, pauses, and resets.
Can someone help me out?
Answers
Another can be.
Set a game attribute
Boolean
Name it Timer on or off
Now add an actor!
Place it anywhere.
If timer on or off is true
do
Use values to the timer as the placement of values are acceptible!
Now inside the timer.
If timer on or off is false
do
using
change attribute
floor(floor((game.time%3600)/60)/10)..floor((floor(game.time%3600)/60)%10)..":"..floor((game.time%60)/10)..floor(game.time%10)..":"..(floor(game.time*10(%10)..floor(floor(game.time*100)%10)
to false
That should work
A lot of the time the mac version has the window running in the background.
But on the windows version it actually stops the timer!!
I have Simple ways of making the timer as well!! Something that can create minutes, seconds, milliseconds!!
Try adding a timer in an actor.
make a new game attribute
integer
Call it Timer
Make another integer
Call it Timer2
Then add another integer
call that timer 3
These will indicate all three values
Add 4 new actors and place them where ever you like
Timer 1
Timer 2
Timer 3
Timer Base
Are the names i have
Make a new rule
if game.timer2 = 60
do
change attribute
set game.timer 2 to 0
New rule
if game.timer 2 = 60
change attribute
set game.timer 1 to game.timer 1+1
New Rule
if game.timer 3 = 999
do
change attribute
set game.timer 3 to 0
Add a new timer
every 0.1 seconds check off run to completion
Change attribute
set game.timer 3 to game.timer 3+111
Make a new timer
Every 1 second check off run to completion
Change attribute
set game.timer 2 to game.timer 2+1
http://www.mediafire.com/?6574pf37o3bhfi6
There is the link to my template
Go ahead and check it out.
I hope this helps!!
Much easier way to have a timer set
And turn it off when you want to.
Thanks!
Sincerely,
DarkUndeadSpawn.
meaning, it starts counting then second you start your app.
Instead, just create a new game integer called Time.
and replace the preset game.time. Problem solved.
BRAINFART!!!