How to import csv files using blueprints

Im creating a rhythm style game an im making maps that use csv. I know how to import them using the “import to game/blueprints” but i want the user to directly use csv files. So my full question is how can i import csv files using blueprints.

could you help me on how to use this? i dont fully understand it

pretty much all, i understand how its getting the file but idk how to write it into an array

to my knowledge there is no way (no nodes) to accomplish this by default, but it can be done using Rama’s Victory plugin. The way i’ve done it in the past was to get the file, then parse the data, and store as needed.

as you can see in the example below i create a file path by combining the default directory and a file name. then i load the string array (each line is a item in the array). then for each array item i break it down to the different parts by parsing the string based on comma separator.

i would also mention that importing csv can be finicky. any misspelling or misplaced commas can affect import. also making sure the file uses the right settings when saved is something to consider. as for the plugin itself google “rama’s victory plugin” and you should be able to find it. i think its on github and theres a version for each engine version (at least there was last i downloaded).

which part?

the load string into array is writing the file contents to the array. so that jobs basically done for you. from there you need to decide what to do with the information and process it accordingly.

what you intend to accomplish with a csv file for map purposes is a mystery to me.

your link doesnt work.

ok so for that data if you ran the script until the laod string array from file you would end up with an array with each index corresponding to a row of data.

  • index 0 = Data,XLoc,Yloc,Speed,Wait,KillKey
  • index 1 = 0,-241,90,84,0.86,W
  • etc etc.

then if you move along with the picture i posted, you get to the for each loop which does the script following it for every index in the array. there i break down the string even more. in the example i stored the data in a struct but how you use the data is up to you. the main thing here is that i broke the string down by the commas so index 0 (index 0 = Data,XLoc,Yloc,Speed,Wait,KillKey) becomes a new array

  • index 0 = Data
  • index 1 = XLoc
  • index 2 = YLoc

in this way its kinda like a 2d array or a matrix.

  • 0,0 = data
  • 0,1 = XLOC
  • 1,3 = 90

so for example if i had this in a csv file, Data,XLoc,Yloc,Speed,Wait,KillKey0,-241,90,84,0.86,W1,329,-112,139,0.53,D2 - Pastebin.com ,how could i add this to an array

added a link to the end by accident

i barely caught any of that heh

  • what structure would i want for this? they have different variable types to idk what i would do for it

ok that makes more sense, what is the “ADD” thing with data base info? there are hundreds of different structs

ok i thought i understood what was going on but i just confused myself more. i gtg for right now but can you still help me out later?

hmmm imagine you open microsoft excel. row one in excel will be the first row of your csv file (the titles). ok so the load string from array will treat that entire row as one long string (think single variable or run on sentence), then it will treat the second row as once string, and the third, etc.

ok so youve broken down a file into lines (rows), still not usable right. so we then need to break down each row into columns. to do this we take each row (index of the array) and we process it a second time using commas as the indicator to end the current string (column) and start the next hence csv comma separated values.

if you look at the file in terms of rows and columns then the excel analogy works. its a grid of information and you need a rational way to break it down in a sensible way.

the add node just creates a new index in the array of structs that i had. the actual underlying struct was a custom struct that i created. an array of structs is like creating your own data table.

I may not be around but i made a quick video showing how i setup things and created the struct. I also made a quick example game.

nvm i did know what i wa doing i just used a wrong node, ok, yah thi makes sense

ok so its showing “???Data,XLoc,Yloc,Speed,Wait,KillKey” when i do what it says at 1:20. There is no extra commas or data before it.

nvm, i found the problem. i wasnt using a spreadsheet i made a program in C# that i can put in a few things and it spits me out a map. that want in the right format