How do I Format a JSON for a 3D array?

0 favourites
  • 3 posts
From the Asset Store
Advanced inventory mechanics for your RPG game (Array-based). Take Items, split them, pick up them, read the description
  • I am still very confused on how to format a JSON file for a 3D array. Could someone give me small code example? I'd be in your debt.

    Let's use number for X. WeaponName for Y. WeaponStats for Z.

    Thank you,

    Stephen

    Edit:

    I probably wouldn't even need a 3D array. I could just load everything in a 2D array.

  • Personally I would do this as a 2D array.

    So if you had the following a Shotgun, with a clip size of 8, a damage of 15, range of 20 it would just be.

    Shotgun - 8 - 15 - 20

    The clip size of the shotgun can be got from the array at [0,1] and the range at [0,3]

    Also I wouldn't try to create and format a JSON myself you could make a small app to add your information to your weapon array and then "save as JSON" from inside Construct then you know it will be compatible. I have done this many times before and I tailor it to suit my specific needs.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you fir the advice. Ill try to figure out the export thing when I get home tonight.

    Edit

    Well, it took me forever but I was finally able to download the JSON file from my game. Worked great! I am gonna start loading the array with data tonight.

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