Saving instance variables into text file that can be loaded.

0 favourites
  • 3 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • Hello!

    I am trying to create a achievement system that is made up of descriptions, icons that can be unlocked, and information that can be typed in and saved for each achievement. Right now I am using the Webstorage plugin to save the state of the whole project and loading the state on a button press through Webstorage when the program is opened.

    My problem is that when I have updated and changed my project I want to be able to use the run time input from older versions of my program (so that I don't have to unlock all achievements again manually and keep track of progress etc.). My projects are exported as Node-webkit applications.

    So I suppose saving all instance variable states and content , such as which icons are unlocked, unique descriptions texts, notes written manually at run time, into a separate text file or XML file that then can be loaded into a updated version of my project would be ideal.

    But I have no idea where to begin, as I have about 100 achievements with about 4 instance variables I want to save each, and will create more as time progresses. How would I save them in a way that the variables can get loaded to their proper positions when loading the information from a external file? And how would I save the information in a good way in the first place? Some combination of ajax, xml, arrays and webstorage events and actions?

    Need some design guidance and overall understanding of plugins, events and actions that could be used in combination as I have not come up with a way myself (I am a pure beginner).

    Any good workflow ideas for such a system, or code hints would mean the world to me at this stage Hope my question is not to abstract and that my English is readable to some degree. Drawn a small image below to show to kind of info that would be saveable.

    Fantastic community btw!

  • You can use the node-webkit. Here is an example of how you can save and load data.

    EDIT: Sorry that was a really bad example, should probably have tested it first, it was not even near at being able to work

    Anyway here is a working version.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you so much!

    Definitively gives me a better idea of how to get thing working, will test it out this week.

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