How do I apply/replicate the "No save" behavior on Dictionary or JSON objects?

Not favoritedFavorited Favorited 0 favourites
  • 4 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • I use the built in save/load functionality for mid-game checkpoints. I also use a Dictionary and JSON object, both of which get written to a file, for game settings & permanent progress.

    Whenever I load a checkpoint, the state of my settings & save data also roll back. This means that if the player made any permanent progress, or changed a setting, these get undone.

    I am able to work around this by reloading these 2 things from the disk on load, but these are causing some order-of-operations headaches for me.

    Is there some way to simply prevent these objects from being written to/read from the saved state on save/load, similar to the No save behavior? Sadly, these 2 plugins don't allow me to add behaviors to them.

  • Yeah, it's annoying that we can't add the NoSave behavior to data objects.

    I usually work around this by keeping an invisible sprite with the NoSave behavior on the layout and storing all data that shouldn’t be affected by saving/loading in its instance variables - for example, Array.AsJSON. Then, in 'On load complete', I read it back into the array.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hmm, thanks for that. I suppose in a way it's similar to my own implementation, except it can happen synchronously. I'll keep that in mind.

  • I personally never use that build in save/load thing, in part because of that. Although it's a little more work to manually put together the saves and load them back, I think it's worth it. I "complained" about that before that the build in save/load is way too aggressive. If you think about it in most cases you really don't want to or need to save everything, but rather very few select things. Storing an entire savestate of the game... maybe there's a usecase out there, but I don't see it. I also have a gut feeling that storing/restoring possibly 100s of objects that don't need storing/restoring is just... error-prone and bad practice in general.

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