Resetting Global variables daily

If there’s no previous game play, then the elapsed time will get evaluated to 0 and the rewards not given.

And I’ve just spotted a flaw in my events - if no storage entry exists, then it never gets written to at any time, so it will continue to not exist :expressionless:. Try this instead:

1 Like

Phew, so now I finally fixed the value of elapsed time. So if the elapsed time hits hour “24” and I get the rewards, will variable “elapsed time” return to 0 and count to 24 again based on the event sheet you provided for me?

Also another question, is it possible to get two different timestamps if i Put it in different storages?

Yes, it starts over again once the number of hours passed is greater than, or equal to, 24.


Yes. You can put the timestamps in the same storage, each with different group names. Or the same group name but different storage names.

You already have the group “Check” in storage “Time”. Just save to the same storage name, but use a different group name. Or same group name but different storage name.

image
Actually it doesnt :frowning: After 24 hours, my variables successfully resetted. But since my elapse time is still greater than 24 which is “26” in the picture. My variables continually reset.

Can you screen shot your events that load and save the timestamp? And the events that write the the text object in your screen shot in the previous post?

t
here it is…

image

It should be store as value in game_progress.LastPlayerTime.

It’s workingg! Thank you for everything MrMen :pray:

1 Like