Hi All,
This is definitely a newbie question, but i'm currently doing a adding building function in my game. I have a catalogue called buildings that i am hoping to use to work out how long a building should take to build and the relative cost at each level of the building.
I have most of the other pieces of this function working but i am basically wanting to compare the inventory item's current level with the catalogue items build time and cost for that level.
I'll be storing the start build time in internal data read only and the finish time there as well inside of a key marked with the instanceID of the building im making.
The data being stored in my Catalog item looks like this:
In order to get finish time, i'm getting my catalog item:
then getting the custom data for that catalog item:
For now just to see what this data turns out as i've been pushing this to internal read only data to see what the result is.
I can see that if i push my catalogItemCustomData straight up like this:
Then i get a result like this:
That's great, so I thought okay, i now want to access point 0 in that array, so i changed my function to be:
Now it only returns the first character in the array which is "{"
How do i need to cast this to return the first point in the array? Ideally i'll be making that [0] the [currentlevel-1] from my instanceID's custom data.
Thanks,
Flarvain