real time clock / timer

Get help using Construct 2

Post » Tue Dec 24, 2013 10:52 am

When i open game, app should check what time it is and take appropriate action?
B
113
S
28
G
48
Posts: 1,882
Reputation: 36,478

Post » Tue Dec 24, 2013 10:57 am

What time it is where?

If you want to know the system time you could try using the system time and date plugin
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Dec 24, 2013 10:59 am

If i open app, app should check what time is it (on pc or smartphone) in your device prabably will be different timedelgado2013-12-24 11:00:14
B
113
S
28
G
48
Posts: 1,882
Reputation: 36,478

Post » Tue Dec 24, 2013 11:03 am

That is what system time means, the plugin I linked to gets the time from the system it is on (be it phone, tablet, pc).

So this should get you running in the right direction.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Dec 24, 2013 11:29 am

@LittleStain
thanks for reply, do you know this plugin? Its possible to create timer like this:
on first app start set hours (23) minutes (60) seconds(59)

and timer count down even if i turn off PC or smartphone ?

but when i turn on again after 25 hours (do for example message) and timer shows 22hour 60 minutes and 59seconds.


This is all what i need
B
113
S
28
G
48
Posts: 1,882
Reputation: 36,478

Post » Tue Dec 24, 2013 11:34 am

The plugin gets the time from your system. you should be able to get that on start of your first layout so after that the program takes over the time.
If you put the time into a variable and save it when closing the program on restart you could compare the saved time with the system time on startup and discover how much time has past.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Dec 24, 2013 11:38 am

Just to make things clear:
A timer can't continue to count down when the program is closed. A closed program does no calculations, so actually while closed nothing can be changed.
But on startup you can compare the timer with the system time and see how much time has passed. You would then have to make events to change everything that would have changed in the time past.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Dec 24, 2013 11:52 am

this is mindblowing but i accept challenge ;p
B
113
S
28
G
48
Posts: 1,882
Reputation: 36,478


Return to How do I....?

Who is online

Users browsing this forum: katzin, Yahoo [Bot] and 8 guests