[PLUGIN] CSV, CSV2Array, CSV2Dictionary

Post your completed addons to share with the community

Post » Wed Dec 28, 2011 11:20 pm

OK !

Double ""...
That's why it didn't work... Thanks very much !
B
12
S
2
G
5
Posts: 73
Reputation: 3,570

Post » Sat Dec 31, 2011 5:30 pm

Would it be difficult to make it that it go read a file, instead of copying the CSV String in the Construct 2 code.
If we can point to a file, that way, we can change the file without having to copy it in C2.

Would that be difficult ?
Do you think it's not interesting ?
Does that bring security issues ?

Thx!
B
12
S
2
G
5
Posts: 73
Reputation: 3,570

Post » Sun Jan 01, 2012 1:48 am

@guicole

Any string can be read through AJAX.
To avoid double "", I am using AJAX, too. If you need to load more then one csv table, try BatchAJAX plugin.rexrainbow2012-01-01 01:57:07
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Sun Jan 01, 2012 2:00 am

I've been trying to get this to work, but haven't managed to. What I'm trying to do is set a bunch of values, convert that into a JSON string, set the result to a text box object, copy it, and then in the event editor, use it as an expression in the 'load table from JSON string' action. From one of your examples, it gets this:

{"HP":{"L1":"100","L2":"105","L3":"110"},"ATK":{"L1":"7","L2":"10","L3":"14"},"DEF":{"L1":"1","L2":"2","L3":"3"}}

If I paste that into the expression, it doesn't work at all. How can I get this to work?Arima2012-01-01 02:00:59
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Sun Jan 01, 2012 3:44 am

@Arima

If you copy the JSON string directly, you may get the problem about using single ". You need to replace single " to double "". The rule comes from C2 editor.
This problem is similar with this.rexrainbow2012-01-01 03:47:53
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Mon Jan 02, 2012 2:14 am

Yep, that works. Thanks!
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Thu Jan 05, 2012 9:24 am

This plugin is fantastic!
I was trying to come up with a way to import strings into my game from an external file, this will do!

Thanks rexrainbow!
B
107
S
40
G
10
Posts: 456
Reputation: 13,202

Post » Tue Jan 24, 2012 4:57 pm

Rereading this thread a few times I think I understood what this is all about. Is it me or is there practically no way to write the data back to an external csv file without using php? I was also checking this thread and got the idea that using the csv plugin for acquiring data only to resort to php to export data back to server is actually less convenient than going all for php as one would be doing as much work if not more when trying to utilize this plugin alongside php. Am I right? Can someone please guide me to a more feasible method that doesn't involve using php?
Wronghands2012-01-24 16:58:29
B
47
S
3
G
5
Posts: 56
Reputation: 4,630

Post » Wed Jan 25, 2012 8:37 am

@Wronghands

Try Hash table. It provides parsing JSON string into hash table/transfering hash table to JSON string.
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Sun Feb 19, 2012 11:45 am

Amazing plugin, I can't wait to use it properly in my project.

Actually, I think I did exactly what is done in your basic example...


... but it doesn't work (the game doesn't start anymore, I don't understand why).


I must have done something wrong but I don't get what... That's too bad, because your plugin could be really useful for my project.

Rag'
B
17
S
4
G
4
Posts: 137
Reputation: 3,767

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 0 guests