How do I get/load a unique users' data?

0 favourites
  • 4 posts
From the Asset Store
Data+ is the best Data Management solution for Construct 3. It contains 4 Addons (Plugin & Behavior).
  • "I am creating a game where certain values need to be stored individually for each user and restored to the previous game state when they return.

    For example:

    User A Mood: 50 Health: 35 Hunger: 65

    User B Mood: 30 Health: 45 Hunger: 25

    Could you please advise on how to achieve this? Thank you so much!

    some info:

  • When you need to save a user's state, create a unique key for each user. This could be a user ID or username.

    Use the Dictionary object to store values associated with this unique key.

    When a user returns, use their unique key to fetch their saved data from the Dictionary.

    To manage multiple users, you might use nested dictionaries or a JSON object where each user's data is stored under their unique key.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • When you need to save a user's state, create a unique key for each user. This could be a user ID or username.

    Use the Dictionary object to store values associated with this unique key.

    When a user returns, use their unique key to fetch their saved data from the Dictionary.

    To manage multiple users, you might use nested dictionaries or a JSON object where each user's data is stored under their unique key.

    May I ask if a Dictionary can be permanently saved like local storage? Because whenever I close the game and reload it, the previous Dictionary data disappears. I have to add a "logout" button in the game to save the data. However, in reality, I cannot prevent players from accidentally closing the game window.

  • You need to send your dictionary to local storage in order to make it persist.

    Here is an article explaining it:

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

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