how do I create an internal clock?

Get help using Construct 2

Post » Sat Jul 09, 2016 8:37 pm

Is it possible to create an internal clock that will keep track of time even if the game is not being played?
Animal crossing for GameCube does this, and even games as primitive as Pokemon gold/silver kept time although I never found out how it worked. Can this be done without plugins?
B
11
S
2
Posts: 91
Reputation: 1,017

Post » Sun Jul 10, 2016 7:55 am

Yes, you need to save the time elapsed in local storage when game exits,
and load it on the next launch and continue from there
B
9
S
2
Posts: 76
Reputation: 739

Post » Mon Jul 11, 2016 1:44 am

you can try rex's timeaway plugin
"If you want to move a mountain tomorrow, you should start by lifting stones today."
B
64
S
14
G
2
Posts: 291
Reputation: 6,666

Post » Mon Jul 11, 2016 2:49 am

Without plugins: https://www.scirra.com/tutorials/940/ho ... -a-project

Advanced: Convert each part of the date/time to an integer (total time in seconds). You can then store or compare this value upon startup or save.

Dependent on system time, so can be cheated by adjusting date/time on system.

There may be a way to get the current date/time from a time server, but I am not familiar with the method.
Mistakes were made.
B
52
S
26
G
108
Posts: 1,606
Reputation: 61,133


Return to How do I....?

Who is online

Users browsing this forum: ST314 and 33 guests