How do I read card-based data?

Get help using Construct 2

Post » Thu Feb 26, 2015 2:13 am

I have a project that needs to load long strings of text in. They are passages of books, but I want to allow users to upload their own packs and download them in the game, so I need there to be an open way of loading up long strings of text in arrays. For example:

TITLE \ TEXT \ CATEGORY 1 \ CATEGORY 2

I need to allow for multiple sets of these, all downloaded and stored for offline use. Each column of data has to be separate from the other columns. Anyone have any suggestions?

I've tried using CSV files but I cannot seem to get anything to load in correctly into an array using Rex Rainbow's CSV2Array plugin. Also, my data has commas, colons, and semicolons galore which makes for impossible delineation. Any help would be greatly appreciated.
B
3
Posts: 2
Reputation: 229

Post » Thu Feb 26, 2015 3:27 am

What is the likelihood they would use this ~ or this ^?
B
22
S
4
G
2
Posts: 362
Reputation: 2,355

Post » Thu Feb 26, 2015 5:33 am

With the fact that there will be multiple categories, then it is better to use xml or json.

Commas, quotations etc. shouldn't really be a problem, they just need to be escaped.

If you are going to allow public contributions, you should write a script that will take the raw data and format it properly into xml/json or even csv. Then you can use it yourself to add your data and escape special characters properly, and allow users to run the script (eg in html frontend) and generate data that is structured correctly.
B
32
S
6
G
2
Posts: 317
Reputation: 2,771

Post » Fri Feb 27, 2015 11:56 pm

PhoenixNightly wrote:What is the likelihood they would use this ~ or this ^?

Very low; good point, I can try to use this. I also like IndieKiwi's suggestion for xml or json. I will look into those, too. Thanks, guys. (Or gals).
B
3
Posts: 2
Reputation: 229


Return to How do I....?

Who is online

Users browsing this forum: TommyR and 23 guests