[PLUGIN] CSV, CSV2Array, CSV2Dictionary

0 favourites
From the Asset Store
[C2] [C3] support C3 build service | support Banner ads, Interstitial ads, Rewared video ads.
  • rexrainbow

    I tried to get a grip over this plugin, but it looks like it has troubles when the table has got 0 columns (or rows)

    As briefly explained in "how do i[]?", I need to build a table that can expand itself indefinitely, and a search engine that automatically, to every new column chooses a name such as csv.colcnt+1 & "th"

    This is a screenshot of my current try. (The CSV with the street fighters is just an exercise i did to understand the engine, anyway in Italian, "statura" means height and "Peso" means weight)

    <img src="http://img19.imageshack.us/img19/664/csv.png" border="0" />

    So the questions are:

    1) Can i retrieve a column by asking her position, without knowing the name?

    2) Can i start the layout with an empty table or should i create a ghost column?


    Should i start a CSV table filled with zeros and "empty" ?

  • P.S.

    The tool is wonderful, i realize by myself that my needs are a little odd, stay assured i'm not passively waiting the greek gods to do my job for me, and i'll continue to try by myself to get a solution

  • Puffolotti

    Array , CSV, and Hash table can provide 2d data structure. It depends on what you need --

    • array: using number index, sorting
    • hash table: using string index, can not loop retrieve yet. Easy to start with empty.
    • csv: using when you have a lot of initial value. You can edit initial value by excel.

    So you might try array or hash table if you need to start with an empty table.

    About question 1, hash table can not "loop thru a hashtable" yet, but array can do that.

  • Hi rex,

    I have a problem with csv plugin, when i load data from JSON string and i try to get CSV.ColCnt or CSV.RowCnt the value is 0. But i can get value with CSV.At(""). why ?

  • PeaceCopathe

    Could you provide more hint? A test capx file is better.



    Try Hash table or Load JSON if you want to pare any JSON string.

  • Ok i try Hash table, i need a "loop for each col" for my JSON string but i think find a idea, i add a "index" with my "JSON table" for loop on. Thank's you for your response. :)

  • Update:

    Fix bug when transfer JSON string into table.

    Thank you for finding this bug, Please download plugin again, it could work on your test capx.

    Note: this fix might cause incompatible with older JSON load action. Please let me know if you have problem.

  • it works ! :)

    You have changed the JSON string to CSV.TableToString if i understand ?

    you added "key" and "item" for index row and col ?

    thank's you for fix :)

  • PeaceCopathe

    Yes, so that I can recover these information.

    But JSON string saved at older version still could not get these information. Sorry.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks a lot <img src="smileys/smiley1.gif" border="0" align="middle" />, that's exactly what I want.

    I have a question with: it this plugin can be used when we make a offline game?

    Just to confirm...

    Thanks again

  • nothing1969

    Yes. The source of CSV is a string, you can use AJAX to load this string.

  • Hm...

    But how exactly can i load data from the external file?

  • raptor0723


  • I read through all pages, and I couldn't find any reference, if I've repeated a previous question apologies!

    So - I was thinking I could use this to create 3d array (row,column,page) , with the x/y storing a number/string to reference a particular tile, and the page to reference the level loaded.

    I just have one question though, can you look up rows/columns without using strings as headers for row/columns?



    rather than

    CSV.At("THIEF", "ATK")

    I did try, but I got an error saying it requires a string not an integer - so was wondering if there was a different action perhaps?

  • JohnnySix

    You got it, rows/columns only accepted string. So you might use str(num) to transfer integer index to string index.

    BTW, TMX importer might be a better choice to create a tile map.

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