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
18
S
5
G
1
Posts: 153
Reputation: 2,060

Post » Sat Mar 21, 2015 12:30 am

Check out the time and date plugin so you can capture and save the system time.
Learning other engines, but C2 still rocks. Image Image Image Image
B
80
S
22
G
95
Posts: 2,419
Reputation: 57,675

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.
ImageImage

Take a look at my itch.io games
B
45
S
14
G
3
Posts: 167
Reputation: 5,204

Post » Sat Mar 21, 2015 8:26 am

Okay,thanks guys.
B
18
S
5
G
1
Posts: 153
Reputation: 2,060


Return to How do I....?

Who is online

Users browsing this forum: Kyatric, Metathronos, sinoscuras and 8 guests