How do I add a timer

Get help using Construct 2

Post » Fri Mar 20, 2015 9:50 pm

like if I want that after 4 hours change from sun to moon.
Please help
B
15
S
4
Posts: 153
Reputation: 1,385

Post » Sat Mar 21, 2015 12:30 am

Check out the time and date plugin so you can capture and save the system time.
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
71
S
18
G
65
Posts: 2,196
Reputation: 41,527

Post » Sat Mar 21, 2015 1:57 am

Hmm, four hours is a long time. It would be... 864000 seconds. Having it count down from that should work, I suppose, but it is a big number, and I don't like big numbers in programming / scripting. Having a variable set to 864000 and subtracting dt from it should work so long as there aren't any strange rounding errors or anything. I would give it a try with a stopwatch or something.
Edit: Someone give some authority on this; is using the wait function for large amounts of time a a bad idea? I would guess using wait(864000) would produce some problems, but it's a guess.
B
39
S
13
G
3
Posts: 163
Reputation: 4,936

Post » Sat Mar 21, 2015 8:26 am

Okay,thanks guys.
B
15
S
4
Posts: 153
Reputation: 1,385


Return to How do I....?

Who is online

Users browsing this forum: Aquanex2, tarek2 and 1 guest