Using .csv data to generate objects in level
So the question title may be a bit misleading. I have a .csv file that contains times/information about notes for a music game I'm beginning development on.
I've imported the .csv as a DataTable into the Engine. What I want to do is use it to generate physical note objects in the level that I can then manipulate and save as part of the level in in the editor.
The reason I can't simply spawn them in the game and then use them from there is because, while this is a beat-matching music game, it takes on a path the player is running down that will have scenery in it and characters coming and going based upon different points in the song. With that in mind, we want to be able to edit and add this stuff in based upon where the notes are in the editor.
Anyone know of a good way to do this?
asked May 27 '14 at 10:18 PM in Using UE4
I don't think it's as simple as just importing the .CSV asset into the editor. There has to be a custom-written hook up, so far as I can gather from this: https://docs.unrealengine.com/latest/INT/Programming/Gameplay/DataDriven/index.html
In a forum post (https://forums.unrealengine.com/showthread.php?2925-Read-data-from-File-Some-kind-of-dynamic-level&p=25750&viewfull=1#post25750) Joe Conley writes: "The format the .csv files are in isn't well documented yet, nor is the process of defining the type of data for the columns in a Data Table, but I'm hoping to write a blog post on it sometime in the near future. Right now this is a C++ feature, but we're looking into making it more accessible from Blueprints and require less programming (or preferably none), but we have a fair amount of work to do in this regard."
answered Jun 15 '14 at 04:46 AM
I'm also very interested in this workflow. I came across RAMA's blueprint plugin library recently and there's a node in there called load string array from file. This lets you read in any txt file and seperate each line into an index to form an array. I tried using this to bring in transforms from Maya. It works for the most part, but I'm having an issue getting the rotations to match from Maya to UE4...
For anyone that's willing to help out, here's my mel script to save out transform data from Maya as a txt file
//STEP 1: // Define Your File Path // folder must exist for it to save the file.
string $filePath = "C:/mel/ue4CSV_test001.txt";
//STEP 2: // select all the objects you want to send then run this:
} fclose $fileId;
You can find Rama's plugin here: https://wiki.unrealengine.com/Rama%27s_Vertex_Snap_Editor_Plugin#All_Future_Updates
Here's my simple blueprint for getting the values from the txt file
This is what the layout looks like in Maya: notice how the shapes follow the pattern and don't intersect with one another
Here's my result in UE4: you can see that they follow for the most part, but some of them are rotated incorrectly and intersect with one another. This is a simple example, but it looks even worse trying to populate a scene as most of the objects are rotated incorectly.
I know Maya is Y up and UE4 is Z up, so thats why I have swapped the Y and Z inputs in the blueprint. I also found that inverting the yaw gave better results in some orientations, but broke in others...
I know this must be possible as things like mtu exist... https://forums.unrealengine.com/showthread.php?22515-m2u-interactive-sync-script-for-Maya-gt-UE4
If anyone could help out with a solution to this I would be very grateful! :D
answered Jul 06 '16 at 01:40 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here