[PLUGIN] CSV, CSV2Array, CSV2Dictionary

  • I have already tried. somehow it does not work. maybe you have an example file.

    Thank you for your help.

  • I'll make that request before I even download your capx :) Thanks again, I really do get a lot more from the tutorials and built in examples and sample capx files than I do from the manual! Its the community support that C2 enjoys that makes it what it is!

    So very true. Sometimes it really helps to see the actual code and play with it to get a better understanding. Just like when asking for help on these forums it helps to also upload the capx in question.

    rexrainbow I am very grateful for this and all your plugins, really makes my life that much easier... <img src="smileys/smiley1.gif" border="0" align="middle" />

  • I'm going to have to be the dummy once again here!

    I've been trying to use this plug-in to store a script, since the game I'm making has a lot of dialogue. I thought keeping that dialogue in a separate text file rather than insert it all manually in events would be much better.

    I'm really stumped on how to load the table into this plug-in though, the example only shows using a manually typed string?

    I imported the .csv as a project file and used AJAX to load it, and from there I see people say a lot of things about turning it into a JSON string and loading it from there. I don't really know exactly how this works, and all the examples and discussions I find on it on the forums and tutorials talk about different methods and different results, so I can't really put them all together in something I can use.

    So far I have something as simple as this, which I'm sure is a far-shot from what I need:

    <img src="https://dl.dropboxusercontent.com/u/11716886/Untitled-1.jpg" border="0" />

    I bet the AJAX tag has nothing to do with the CSV string that the plugin wants.

    What do I do inbetween these two and actually being able to read the things in the csv table?

    I apologize for being a total noob on the subject.

  • Hi guys! :)

    I've managed to use the CSV2Array

    Transfer csv string into array object. To input data into an Array, that I later used to make an enemy move in a certain pattern.

    I really would like to learn how to use the CSV plugin and load a .csv file from the harddrive into Construct 2 and then make it into an array with the CSV plugin.

    Now I had to go the long way around. Using EXCEL, saving a csv file, open the file, copy/paste into the CSV2Array. I would love if I could skip some steps, and use the real CSV2Array plugin.

    I apologize for being a bit dum, and noob. Im not a programmer and have always had some troubles with all the expressions and syntax. And im having troubles pulling all the bits and pieces in the forums together to something I can use.

    I would really like to know in easy steps or from a little .capx file how I - Load the csv file into Construct 2, and then how to use the CSV2Array to load the data into an Array.

    Regards!

    ///Soulmachine!

  • Vati-nyan

    You did some mistake in "on Ajax completed"

    It should be

    Load table from csv string Ajax.Lastdata

  • Hey... what's up?

    i'm having difficulties using the csv plugin..

    i think it has to do with the way i'm loading the file..

    so this is my issue..

    my file is saved and imported to construct as "new list.csv" from an excel speadsheet

    then i did:

    On start of Layout: Load table from csv string "new list.csv"

    But that didn't load it cos when i requested for an item on the list after providing the index, it didn't show up...

    Then i tried the csv to array

    i did:

    On start of Layout: put csv data "new list.csv" into array, map row to x, col to y

    That didn't work either..

    so now i'm so bummed.. please i need help

  • it expects a string, so "new list.csv" will be entered in the first collum and row of the table as value. It does not take the file contents and reads them.

    You have two options:

    • open the .csv with a texteditor and copy the contents over to the "" of the plugin
    • use the ajax plugin, request your project file then upon request completed use ajax.lastdata in the csv plugin
  • Hello, user mindfaq (right above me <img src="smileys/smiley36.gif" border="0" align="middle" />) has directed me to this wonderful plugin from a topic I posted in the How Do I? forum, and I am very thankful to rexrainbow for developing it - however I seem to have difficulty opening the example files in r146. I have already installed the plugin properly in my install folder because I can open CSV2ARRAY.capx just fine, but for some reason I can't open both test_csv_basic.capx and test_csv_multipage.capx

    It says "Failed to open project [path to project], object type uses unknown plugin ID Under element: c2project\object-folder\object-type Line 21, column 9 The file may be invalid. Try checking the file in a text editor (projects are saved in XML format)"

    Am I missing a required plugin to open the two examples posted? Please tell me because I really want to learn how to use this wonderful plugin.

  • rexrainbow : would it possible to detect the the data type of each string automatically (with a tick box or something like that)? I need to convert the strings that are numbers to integers or floats manually inside of Construct 2 to make comparisons with other numbers (via system compare) work.

  • floatingsunfish

    there is CSV plugin and CSV2Array I believe, you would need both

  • Thanks! I thought I only needed the CSV2Array plugin. D'oh!

    That'll teach me to skim posts! <img src="smileys/smiley36.gif" border="0" align="middle" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You don't really need the CSV plugin to use the CSV2Array plugin, BUT the mentioned examples use the CSV plugin, so that's why they would not load.

  • A capx using the CSVtoArray-plugin to transform .csv to .json with multipage support (-> 3D-array) and number conversion (row, collumn or all), since the CSV2Array-plugin treats everything as string:

    capx

    Useful when you want to use only native plugins in your game (for example to upload it to scirra arcade) and look for a way to transport your excel data sheets to C2-conform .json.

  • its so confusing. so can i get some straight answer please.

    no one has a direct answer on a direct JSON solution, what gives??

    I have a JSON like below, (flat structure and all), then what is the best way to load it from URL and read the key/value? thanks

    [{"id":"42","pct":"691th","phone":"17222576211","fax":"","email":"","address":"9720 Foster Avenue","lat":"40.6484","lng":"-73.9049","borough":"queens","city":"nyc","state":"ny","distance":"0.5231590272587"},{"id":"38","precinct":"63rd Pct","phone":"17222584412","fax":"","email":"","address":"1844 Brooklyn Avenue","lat":"40.6281","lng":"-73.9414","borough":"queens","city":"jersey city","state":"ny","distance":"1.854571460077"}]

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