(Solved) How to create a "played time"

Hi, i was trying to create a text object, and then make it show all the time played, as i don’t know how to do it, i create a global variable “because i have some diferent stages” and then i make:

Do +TimeDelta to variable play_time_seconds. if play_time_seconds it =60 then play_time_seconds =0 play_time_minutes +1 if play_time_minutes=60 then play_time_minutes =0 play_time_hours +1 and Do "play_time:" +ToString(GlobalVariable(play_time_hours)) ":" +ToString(GlobalVariable(play_time_minutes)) ":" +ToString(round(GlobalVariable(play_time_seconds)))

It doesn’t change to 60 to 0 in seconds also not to 0 to 1 in minutes… BUUUUTTT
I suppose there is a normal and better way to do it :laughing: :laughing: … like in my picture, but working :cry: :cry: :cry:
Thanks for the help.
how_to_playtime.jpg

Try this as an external event:


Here, I’m using 3 text objects to display seconds, minutes and hour and 3 global variables to count seconds, minutes and hours elapsed since the beginning of the game.
At the beginning, first I update each text object with global variables and then I add +1 each second to the global variable ‘seconds’ and update the text object ‘seconds’.

When the value of ‘seconds’ is >=60, I do +1 to the variable minutes and set the value of ‘seconds’ back to 0 and update the text object ‘minutes’.

When the value of ‘minutes’ is >=60, I do +1 to the variable ‘hour’ and set the variable ‘minutes’ back to 0 and update the text object ‘hour’ and ‘minutes’

Use this event as an external event and simply link the external event in to your scenes using a Link:
link_event.png

Thanks ddabrahim, like my logic but this one is working :laughing: .
Also need to add the storage actions for save it thru all the play times :smiley: and the conrresponding read from fil save.txt or whatever