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.
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,207
Reputation: 43,836

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
42
S
14
G
3
Posts: 165
Reputation: 5,115

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: AndreasR, evillair, vankizzle and 8 guests