How do i reset value/global variables monthly?

0 favourites
  • 6 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • I dont have any idea how to reset value or Global Variables every month (Local)

    Tagged:

  • I don't understand - you expect that people will be running your game without closing it for several months?

    You can use Date object, use Date.GetMonth(Date.now) expression to get current month number. For example 0 is January, 1 is February etc.

    construct.net/en/make-games/manuals/construct-3/plugin-reference/date

  • I don't understand - you expect that people will be running your game without closing it for several months?

    You can use Date object, use Date.GetMonth(Date.now) expression to get current month number. For example 0 is January, 1 is February etc.

    https://www.construct.net/en/make-games/manuals/construct-3/plugin-reference/date

    Sorry.. i meant it was like what server sided games usually do.. its like there is a boolean value being true, and after a month if they did not open the game, the value will be false. Is that possible?

    Maybe if there there is something that can track real time locally that will make the system knows if the user were not touched the game for a month.

    Thank you for the answer

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Create a column called "month" in the database on the server. When the player logs into the game, load this value and compare with the current date

    if you need to update it automatically, create another column called "new month". Now the game needs to compare these two values. (old / new)

    Well, and then send a new value to the database.

  • Maybe if there there is something that can track real time locally that will make the system knows if the user were not touched the game for a month.

    See my first comment. Use Date plugin to get the current date or month. You can save the date in Local Storage and compare it with the current date when the game is started.

    1. 1. On start of your first layout check if "LastLaunch" item exists in Local Storage
    2. 2. If it doesn't - the game has never been played before. If it does - use Date plugin to calculate the difference between the current date and LastLaunch value.
    3. 3. Save the current date to "LastLaunch" item with Local Storage.
  • Thanks i got it.. I didnt realize i can do that

    5 Stars for both of you

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