How do I base my date-time system on the real date-time?

Get help using Construct 2

Post » Fri Jun 23, 2017 6:28 pm

I want to use date and time in my project, but if I base it on the device time, the user can easily manipulate with it to gain extra stuff on the game or even bug it.
So, I want to make a server time, one same for all users which cannot be manipulated.
My question is, how do I do this and do I need to buy a host or something?
B
18
S
6
Posts: 138
Reputation: 1,643

Post » Fri Jun 23, 2017 7:16 pm

Did you consider to use 'wait' and variables for seconds, minutes and hours (days, years)? Add 1 every second to variable 'seconds', add 1 to minutes, when seconds=60 and so on?
B
13
S
5
G
1
Posts: 22
Reputation: 1,480

Post » Fri Jun 23, 2017 7:21 pm

That's not the problem. The problem is, after you close and re-open the game, the time needs to be updated, which means it has to be equal to the real time..
B
18
S
6
Posts: 138
Reputation: 1,643

Post » Sat Jun 24, 2017 7:58 pm

C'mon anybody?
B
18
S
6
Posts: 138
Reputation: 1,643

Post » Sun Jun 25, 2017 4:45 am

What about you set up 'device time' after restart and than start your own 'time server', as it was mentioned in my first response?
B
13
S
5
G
1
Posts: 22
Reputation: 1,480

Post » Sun Jun 25, 2017 8:51 pm

I don't really understand what you're trying to say.
I'm trying to add timers in my game that will countdown regardless if the game is running or not. So, is there a way to accomplish this without setting up an entire server for a single date and time?

I have found this plugin made by rex, but it's one of the old ones and although I have placed the files in the plugins folder I still can't get it to work...
B
18
S
6
Posts: 138
Reputation: 1,643

Post » Sun Jun 25, 2017 9:00 pm

It's just one of those things that can be manipulated. You can use rex's to relate to device time whereby you compare the time it was when the game was last saved and the time it is now and judge how much time has passed and award the stuff. It doesn't solve your problem about adjusting local system time but I don't recall anyone providing a way of doing this, usually it's just a local storage method. I don't think it's possible to read from a server using that plugin either but it might be possible to read from a server through some other method.
B
45
S
15
G
73
Posts: 2,006
Reputation: 43,394

Post » Sun Jun 25, 2017 9:21 pm

Right, but the plugin does not work. I have added it in the folder but can't find it in C2.. Do you have any idea what may I be doing wrong?
B
18
S
6
Posts: 138
Reputation: 1,643

Post » Sun Jun 25, 2017 9:34 pm

In its original exported folder, you place it in Construct 2\exporters\html5\plugins and then add it as an object in your project.
Go to the layout and insert object, then add rex's datetime or timeaway, whichever it is.
Then on the event sheet, if you make new events the rex plugin options are available.
B
45
S
15
G
73
Posts: 2,006
Reputation: 43,394

Post » Sun Jun 25, 2017 11:47 pm

Oh, I have put it in the wrong folder. Thanks
B
18
S
6
Posts: 138
Reputation: 1,643


Return to How do I....?

Who is online

Users browsing this forum: Mayfly and 16 guests