SoulReaver
Member
Hello All,
I am hoping this to be a very easy question that I may have overlooked in the manual, but I can't seem to find the answer. The title may be a little confusing so let me break it down.
Lets say I create this struct:
Keeping it basic ,but let's say I have multiple stats, and some containing additional structs. My goal is to be able to navigate to these using custom strings (for potential looping). This can be done in JSON very easily, but I am not sure this functionality exists within structs yet.
So I would want to navigate using something like this:
I should expect this to give me the value of stat0 which was 23; however, it fails when attempting this code. Again not sure if this is a feature yet, just wanted to make sure before moving on to another method.
Appreciate all the feedback, and if there are any questions or confusion regarding the post feel free to ask.
Thanks!
I am hoping this to be a very easy question that I may have overlooked in the manual, but I can't seem to find the answer. The title may be a little confusing so let me break it down.
Lets say I create this struct:
GML:
var stats =
{
stat0 : 23
stat1 : 24
}
Keeping it basic ,but let's say I have multiple stats, and some containing additional structs. My goal is to be able to navigate to these using custom strings (for potential looping). This can be done in JSON very easily, but I am not sure this functionality exists within structs yet.
So I would want to navigate using something like this:
GML:
var a = "stat" + string(0)
//Getting value from Struct
var statvalue = stats[a] //Should be the same as var statvalue = stats[stat0]
Appreciate all the feedback, and if there are any questions or confusion regarding the post feel free to ask.
Thanks!