I’m working on a weapon system for a game I’m working on and have run into a bit of a roadblock. What I’m attempting to do is use a data table to house my items for quick data management using CSV files. I have a Stats struct that I’m using to house a number of the combat related pieces of information on the weapons. In the table, this struct ends up being a struct reference variable and when looking in the table, it is displaying each of the variables of that sub struct as one single clump.
I want to be able to create a CSV and drop each value in. Does this mean I’ll have to group a bunch of them together or is there a method that doesn’t suck to work with that I can use to enter the data cleanly and have it imported?
And I’ve created these 2 Data Tables. The problem comes with the “Stats” variable in the Main table. I created a second table from the second struct while trying to figure things out so I’ve included that as a “What the hell.” type of bonus.
Does this mean
I’ll have to group a bunch of them
together or is there a method that
doesn’t suck to work with that I can
use to enter the data cleanly and have
it imported?
The Z column above is a material struct that is a part of another struct - that would be the equivalent of your Stats. I created an empty Data Table, added a single row and exported it as CSV - this shows me how the formatting should look like for a nested struct.
As you can see, it spits out quite a bit of gibberish. Luckily this can be cleaned up, I did it for the the Opacity, Colour and Glow. This has to be done only once and once you have a clean line with correct formatting, it can be duplicated freely, populated cleanly-ish with the desired data and reloaded back into the Data Table. It is still a clump but I found it quite manageable.
In case you want to store arrays of structs inside another struct, avoid CVS. Go for *.jsons - way more manageable.
Also, there are some changes heading Data Table ways, some really needed QoL improvements, like copy-pasting rows.
I meant arrays specifically, there’s no clean-up needed and formatting is all neat and vertical. There used to be horrible mix ups with enumerators in csv, it may no longer be the case, though.