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

0 favourites
  • 10 posts
From the Asset Store
An educational game for Times Table. An easy to use template for developers to build larger games
  • 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?

  • 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?

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

  • C'mon anybody?

  • What about you set up 'device time' after restart and than start your own 'time server', as it was mentioned in my first response?

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

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

  • 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?

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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Oh, I have put it in the wrong folder. Thanks

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)