[PLUGIN] CSV, CSV2Array, CSV2Dictionary

Post your completed addons to share with the community

Post » Sun May 06, 2012 7:11 am

Hmmm, here's a demo of what I'm doing - right now it's stored in an array - it's just a question of how to save it out and load it in as elegant a fashion as possible without too many complications.

http://www.johnnysix.net/games/BangEdit/

In my haste I created a completely new project for the editor, and I don't think it'd be that easy to copy/paste it all across, or if it's possible at all.

I guess saving to an external file, then opening of a url from the editor and sending a variable via the url to tell the page/game loaded to grap the corresponding .csv/.xml is what I'll be doing.

Image
B
27
S
9
G
5
Posts: 487
Reputation: 11,939

Post » Sun May 06, 2012 10:49 am

@JohnnySix

Official array plugin now could save data to string/file ( array <-> JSON string ). So you might still use array object.
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Sun May 06, 2012 8:47 pm

I'll give it a go, thanks! I was hoping to use CSV as it'd mean data as easily editable outside the program, but not a massive issue.

Keep up the awesome work. :)
Image
B
27
S
9
G
5
Posts: 487
Reputation: 11,939

Post » Tue May 22, 2012 10:38 pm

@rexrainbow

I'm having trouble with this plugin. I have made a very simple capx and it work perfectly. Then i put the same code in a already made game and it doesn't work.

When i say it doesn't work, i mean that 4 instances of the sprite are created at cordinates in the table when it works and all of them at 0,0 when it doesn't.

rfisher2012-05-22 23:20:26
B
17
S
9
G
7
Posts: 249
Reputation: 6,922

Post » Wed May 23, 2012 10:29 am

@rfisher

try this.
http://dl.dropbox.com/u/5779181/csv_create_sprite.capx

In your capx, the problem might be that:
variable "l" is started at 0. However, the csv table seems not have "0" entry.


Edit:
It might be useful if there has "condition: for each row", I will think about that.rexrainbow2012-05-23 10:34:02
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Wed May 23, 2012 11:05 am

Update:

Add "condition:For each row".
Now there have two kinds of "for each":
- For each col
- For each row

You could use one of them to retrieve csv table.
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Wed May 30, 2012 9:11 am

Hello rexrainbow

Is it possible to load the data in directly from a .csv file in the same directory ?

Thanks in advance
B
14
S
3
G
3
Posts: 30
Reputation: 3,435

Post » Wed May 30, 2012 9:14 am

@egos

Try ajax plugin for loading external files.rexrainbow2012-05-30 09:14:48
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Tue Jun 05, 2012 8:37 pm

@RexRainbox For a project i'm working on i was wondering if i could load a column, but not specify what the content of the row is. Eg.


      Column 1, Column 2,
Sprite       1,        3,


Then use
                                 Column1
                           Sprite      1
System > Compare two Values / if csvData = 1 Then Create Sprite1
B
4
Posts: 11
Reputation: 372

Post » Wed Jun 06, 2012 7:01 am

Update:

Add expression: ColName, RowName to get col name by number.


@fixer368

You might use these new expressions to get a col name, or using "condition:For each col" to get each row name in order.rexrainbow2012-06-06 07:02:19
B
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 5 guests