Load JSON to Array Not Working

  • Hey there,

    I am trying to load my JSON file into my array. I used the exact same one that was exported and even a modified one. Neither work at all. Here's a screenshot to show you how I have it coded. Any insight? Something I over looked?

    Thank You

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Tekniko

    You'll need the JSON as a project file and also need to use the AJAX object to correctly load a JSON to array.

    I've added an example of a very simple array editor that I would create to fill in an array for any game I was making. In the "Load Array" layout & event sheet 2 are the correct events for loading data into an array from JSON. You'll have to run the layout in debug mode to see that the array is filled from my saved JSON.

    Hope that helps.

    Oh and you'll need the latest beta for anyone who wants the CAPX

  • Wow, I was way off haha. Thank you

    One last question. Why do you clear the array on start of layout?

  • No reason really.

    Just something I usually do make sure no un-needed outdated data is in there from other layouts. Probably don't need to just a habit I have of clearing my array before loading data into it.

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