Update an array file with new info and still keep the player's data

0 favourites
  • 4 posts
From the Asset Store
Players follower. use it for anything which follows the player
  • Hi all! I keep my game's weapon info in an array file. The array contains both static info such as name, as well as player-specific info such as whether or not the player unlocked the item.

    I save the array to local storage when the player unlocks/equips it. The issue I'm having is that after the array is saved to local storage if I change the weapon info, the changes are not updated. For instance, if I change the weapon name to something else, the weapon name still shows up as the old one when I debug preview.

    Is it possible to update the static info while keeping the player's saved data in the array? Thanks!

    Tagged:

  • The obvious solution would be splitting it into two or more arrays/dictionaries. Some will store static data, and a separate array will store player-specific data.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The obvious solution would be splitting it into two or more arrays/dictionaries. Some will store static data, and a separate array will store player-specific data.

    Is there any other way to solve this problem?

    I thought about including some events to manually replace the static data, but that seems iffy if I want to change the static info for 20+ items in the future. Thanks!

  • I thought about including some events to manually replace the static data, but that seems iffy if I want to change the static info for 20+ items in the future.

    Yeah, either that or add a new array which will only contain the data you want to update. Say, a weapon code and a new price. And make an event which will compare both arrays and update the data in the main array if it's outdated.

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