[PLUGIN] CSV, CSV2Array, CSV2Dictionary

  • rexrainbow sorry I never replied.

    using your plugin because it's just for loading data between layouts. It seemed easier than setting up a whole array.

    also, I think my problem was some sort of picking issue. I've moved on since I now have it working, Thanks!

  • Hey I know this thread is a little old, but I'm trying to use this plugin and I can't get my excel spreadsheet to convert to CSV. It just makes an identical excel file with all my data in it, am I missing something?

    EDIT: Nevermind, I realized what was up. My bad.

  • Hi rex, could you make better example for ajax2cvs? current one shows me asian signs in open office and I have no clue what's going on?! THX!

    Also, how exactly cvs2array works? Basically how my spreadsheet should be like in order to easily convert to array?

  • megatronx

    The content of ajax2cvs sample capx is

    ,a,b
    c,1,2
    d,3,4[/code:1zuv7poa]
    They are all ANSI imo, I am not sure why you got asian signs.
    
    CSV2Array maps 2d data in to array. 
    [code:1zuv7poa]cell00,cell01
    cell10,cell11[/code:1zuv7poa]
    The X/Y mapping could be set in parameter of action.
  • This is ridiculously awesome and easy to use, thanks!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Here is a local database (taffydb) plugin which supports querying and sorting.

  • Hi rexrainbow! Amazing plugin!

    Just a question: when I load a .csv file to an array, all strings that had a special character like â,ã,é and others like this had those characters changed to a "?" symbol in the array. In the .csv file, the characters are right, even in Project Imported Files of C2, but when they fill the array using your plugin, they change to "?". Is there any way to keep them as they are after loading them in the array? Anything I should write in the .csv file so the string is kept intact?

    Anyway, thanks for the great plugin!

    All the best to you!

  • rexrainbow Since the last C2 update I seem to be having issues with loading a CSV sting to an array via AJAX. If I load the CSV raw into CSV2Array it works fine. I pull the file of my server it loads fine. But when I go to put that string as AJAX.LastData into CSV2Array it buggers out. I will load about 88%-100% and the game will freeze. If I disable the 'Fill Array form CSV string' action it will run fine.

    I think this is either a bug or error on my part using LastData.

    Start Of layout->Ajax Request URL DOMAIN&"/Data/PoliticalMapCSV.txt"; Load CSV2Array "LastData" Row to X and Column to Y;Set Board to 10x10; Fill Board Tiles with "MapTile"

    For Each XY element in array & Pick Instance of "MapTile" = MapIndex-> Add 1 to MapIndex; Change Animation of "MapTile" = Array.CurValue;

    You can dump LastData into CSV2Array without any additional formatting right?

  • LuciusCD

    Sorry for missing this question.

    The question might come from encoding of characters. Change the setting of editor might solve it ( but I do not know how to set it )

  • CrazyVulcan

    I am not sure the whole procedure of your case. You might post a very simple capx file or a screen shot of events.

    I guess that you had missing "condition:On completed" in Ajax object.

  • CrazyVulcan

    I am not sure the whole procedure of your case. You might post a very simple capx file or a screen shot of events.

    I guess that you had missing "condition:On completed" in Ajax object.

    I managed a work around but it could vary well be error on my part. The missing OnCompleat step could be what was wrong.

  • I have same problem with the last version of c2.

    i put the CSV on my array. I'm waiting for the ajax to complete his request. The CSV is in the array without problem Then when i loop

    to put the sprite to the position in the array, some sprite doesn't appear and it seems to not recognize some sprite on the debug mode.

    here's the link of the capx. Go debug mode and push A on keyboard. Look for battle_box newly spawn sprite. Some Shouldn't appear.

    https://mega.nz/#!jct3mbwZ!JiA1YYRWIA30ipIR3rgSewetLTDCQua4hymjxf0hiwQ

  • Why csv is better than arrays? Only for the most easy edition? and the most important, it will not cause lag? I'm worried about it so I want to understand more...

    Sorry for be a noob.

  • cmee

    Official array is a 1d/2d/3d array indexed by number. My csv plugin is a 2d hash table indexed by string name.

    The performance might be almost the same I guess. ( I had not tested )

  • pirikos

    You might only check the array after loaded by CSV2Array in debug mode. It works fine in my computer. Only one thing, remove the last blank line.

    I had not checked other things since the CSV2Array could put data into array correctly.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)