How do I make a time that seemingly counts when game is off?

Get help using Construct 2

Post » Fri Aug 05, 2016 11:45 am

I am wanting to make a time based upgrade system for a game. I would like to know how, or be pointed into the right direction on how to make a timer that will seemingly count even if game is closed and can tell if device time has been changed.

I know you can do this by comparing the device time during game play and at start of game play and change accordingly, but not sure how to accomplish this.

Example: An hour timer is started. Player leaves game and does whatever with device. Player comes back in 55 minutes and timer has 5 minutes left. How do I achieve this and how do I detect if someone changed device time and/or daylight savings time clock change took place?
B
65
S
37
G
13
Posts: 240
Reputation: 12,703

Post » Fri Aug 05, 2016 12:39 pm

I would start with the rexrainbow plugin (https://dl.dropboxusercontent.com/u/577 ... _date.html ) to detect system date/time and I guess store the time on game exit and compare how long has passed when loading the game.

I guess you'll have to make use of local storage for save game data :
https://www.scirra.com/manual/188/local-storage
B
46
S
16
G
77
Posts: 2,165
Reputation: 45,845

Post » Mon Aug 08, 2016 1:54 pm

Or you can use a time API to retrieve time from a server.
how-do-i-trace-the-date-and-time-in-construct-2_t179942
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,418
Reputation: 4,830

Post » Mon Aug 08, 2016 10:23 pm

Speaking of server, tt seems like the only foolproof way to make a game like that is to store some info on a server.
ImageImageImage
B
40
S
23
G
11
Posts: 498
Reputation: 10,062

Post » Fri Aug 12, 2016 10:41 pm

Yea, sadly. JavaScript is very, VERY manipulable.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,418
Reputation: 4,830

Post » Fri Aug 12, 2016 11:20 pm

gumshoe2029 wrote:Yea, sadly. JavaScript is very, VERY manipulable.

@gumshoe2029
Any client application that depends on system time is manipulable

I remember changing time in the BIOS to bypass parental control when I was a kid
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Mon Aug 15, 2016 3:44 pm

Yea, like EA's Dragon Age: Inquisition can be hacked in that way too.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,418
Reputation: 4,830


Return to How do I....?

Who is online

Users browsing this forum: Euduardo and 25 guests