How do I Properly Use Array Conditions

Get help using Construct 2

Post » Thu Aug 13, 2015 2:33 am

Hi BlackHornet, and thanks for your time on this. The datafile in the capx is this (separated for clarity): https://www.dropbox.com/s/17n2tbu8351t6 ... .json?dl=0

It seems to be a standard .json format. It loads the array with the proper data, all of which are numbers, and I don't think they are in quotes. Is this the data you are referring to? I'm using a .csv to .json converter to get the data from a .csv into .json format. Maybe that is where the problem lies?
B
4
Posts: 29
Reputation: 264

Post » Thu Aug 13, 2015 2:46 am

Ok, I see the quotes you are referring to. I just thought that was how .json files worked. I wonder how they are getting placed there from the .csv file?
B
4
Posts: 29
Reputation: 264

Post » Thu Aug 13, 2015 3:00 am

I've been using the CSVtoArray plugin to copy the .csv file, which contains words along with numbers into an array, then downloading that array's data into a .json file. From then on, I only use the data in the .json file for the game, which has been working for me, thought with the added difficulties mentioned in the OP. Is there a better, easier way to get a large amount of data from a Excel file into an array for a game to use? I'd appreciate any help.
B
4
Posts: 29
Reputation: 264

Post » Thu Aug 13, 2015 3:02 am

If the data is out of you control, you can also use int() to convert the string to a number.
ImageImageImage
B
71
S
22
G
249
Posts: 3,763
Reputation: 138,577

Post » Thu Aug 13, 2015 3:11 am

I just went to one of those online .csv to .json converter websites and it is also putting all the numbers in quotations. Is this something that happens if there are words and numbers in the .csv? I'm using the 1st column of the spreadsheet for the name of each row's purpose. There are also rows used for dialog. Should I not be mixing words and numbers in the same .csv before converting to .json? Maybe I have to use quotation marks before and after any box that has a word or sentence in it on the spreadsheet? I'll have to experiment.
B
4
Posts: 29
Reputation: 264

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 47 guests