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

Get help using Construct 2

Post » Mon May 19, 2014 10:46 pm

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.
B
56
S
15
G
13
Posts: 826
Reputation: 17,675

Post » Mon May 19, 2014 11:16 pm

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.
B
46
S
23
G
7
Posts: 459
Reputation: 6,763

Post » Tue May 20, 2014 2:48 am

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.
B
56
S
15
G
13
Posts: 826
Reputation: 17,675


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 26 guests