How do I load JSON files into memory?

0 favourites
  • 5 posts
From the Asset Store
Test and challenge your memory in this amazing Christmas themed memory game!
  • Hi there, so I think we've discovered a little bug in Construct 3's Ajax object when loading JSON files to run dialogue.

    Because the AJAX is asynchronous and the Players actions arent, there are times when a player interacting with an item / character to trigger loading a JSON file fails completely.

    Is there a method to load JSON files into memory from the start of a layout? So we can ensure that everything can be accessed quick-sharp :)

  • I usually load all required files in a Loader layout. Once they are loaded, you can continue to the main game screen.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi there dop2000, thanks so much for checking this one.

    I understand the concept of the loader layout, however because the JSON files aren't on the layout we're loading (they're files that get called), is there a method of forcing them into memory too?

  • Not sure what you mean. Of course the files are not on the layout, but you should be able to load them in any layout you want. So I prefer to pre-load all files in the Loader layout (while I display game logo), and after that move to the main game menu.

  • I feel like we exchanged mails recently. Haha !

    What dop2000 means is that you usually preload all JSON data on the loader layout, storing it in either variables, global dictionary and such to be parsed later, or you can also load the data directly in its corresponding object.

    However, knowing what your use is, you will probably have to end up storing the JSON as text, and parse it on demand depending on what files (dialogues) you currently need.

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