keep contdown timer running even if the game was close
Before anything else, I would like to apologize for my bad english, I'm from Brazil.
I'm making a game for Mobile, and would like to make a countdown timer. Used to upgrade a weapon for example. (Okay, easy)
The problem is, my game will be offline and I wish to keep this countdown timer running even if the game was close.
is there any easy way to do this? If there was a way to get the schedule of the operating system. this has help me a lot. (although this could be easily cheated)
asked Jul 30 '14 at 12:53 AM in Blueprint Scripting
Get Accurate Real Time solve my problem !
This function returns the current time of the OS in seconds ! so i can compare the time when the player left the game with the time he joined.
answered Jul 30 '14 at 08:10 PM
Yes: Instead of storing "there's 20 seconds left," store "this upgrade will be available at time XX:XX GMT."
Then, when you display how much time is left, subtract from the target time, to see how much is left. If it's after that time in GMT, then the upgrade is available.
This needs access to a real clock that's set correctly, of course. Typically, this comes from servers, but if it's single player, you can use the normal PC clock. You might want to double-check that the clock doesn't jump around too much -- daylight savings time, leap seconds, CMOS batter replacement, and a bunch of other things may do weird things to time.
answered Jul 30 '14 at 02:56 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here