Is it possible to retrieve data from a dictionary instance variable using the dictionary's AsJSON ex

0 favourites
  • 4 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • I'm thinking about using the Globals 2.0 add-on, but if at all possible, I'd rather avoid using third-party add-ons. Therefore, I'm utilizing a global dictionary's instance variable to store game data instead, however AsJSON expressions don't seem to be able to access the dictionary's instance variable as I expected. Is there a way to do this. Or is there a future intention to convert Global 2.0 to an official addon? Thank you.

    Tagged:

  • Not sure exactly what you're trying to do, but you can use an array that's tied to the dictionary in a container to store sets of values, and array data can be retrieved as json. Or, you would simply just use keys within the dictionary, considering the dictionary itself is a data storage object to begin with...

  • No, AsJSON only stores the dictionary contents.

    I'm using an invisible global sprite to store a bunch of variables. (Instead of Globals addon). I'm saving Sprite.AsJSON to Local Storage, and this saves all its variables.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ashley I believe that would make more sense and prevent the need for global2.0 if you changed "AsJSON" to also include the dictionary's instance variable. Please let me know if you intend to implement this data store method because it is an essential part of my project. Thank you.

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