I've read in a few threads that I can use Records to organize my Variables. But I can't figure out how to use them.
I've made a Record, created Variables inside it, but when I go to a trigger and use the Set Variable action I can't find the Record or the Variables inside it?
Oh ok. So I create a Variable of the type "- record". If I set the Variable to Array of 16, can I then have 16 different instances of the Record? So that Record[1].Integer and Record[2].Integer are different values, or will I have to do it like Record.Integer[1] and Record.Integer[2]?
Oh ok. So I create a Variable of the type "- record". If I set the Variable to Array of 16, can I then have 16 different instances of the Record? So that Record[1].Integer and Record[2].Integer are different values, or will I have to do it like Record.Integer[1] and Record.Integer[2]?
Record[1].Integer is the Integer member belonging to index 1 of the Record struct array.
Record.Integer[1] is the index 1 of the Integer array member belonging to Record struct.
"Records" in GUI translate to structs in galaxy. They define a type so cannot be used for storage directly. One has to create a variable of the type before it can be used for storage.
In real programing structs/classes have memory/access performance benefits over parallel arrays. I doubt these matter so much with galaxy.
Personally I see record like a "Folder of variable" with name "variable".
Record variable (Stats)
My variable 1 with array (Kill)
My variable 2 with array (Score)
etc.
So you could do like:
For eatch i from 1 to Number of active players
Set variable -> Record -> Stats.Kill[i] == xyz whatever.
So after when you want to find the variable kill, you know its inside the "folder" (record) Stats. And if you search for the var "Kill" itself in the list you won't see it. So you don't have a huge list of variable with generic names or super refined names. Just set the record, then whatever you want to store within it associated to that variable.
I've read in a few threads that I can use Records to organize my Variables. But I can't figure out how to use them.
I've made a Record, created Variables inside it, but when I go to a trigger and use the Set Variable action I can't find the Record or the Variables inside it?
You have to create a variable of the type record. Then you'll be able to reference it
Check out my kitbashes! Custom Campaign Initiative: Lots of great Custom Campaigns!! Check out and Support!!
Oh ok. So I create a Variable of the type "- record". If I set the Variable to Array of 16, can I then have 16 different instances of the Record? So that Record[1].Integer and Record[2].Integer are different values, or will I have to do it like Record.Integer[1] and Record.Integer[2]?
Personally I see record like a "Folder of variable" with name "variable".
Record variable (Stats)
So you could do like:
For eatch i from 1 to Number of active players
Set variable -> Record -> Stats.Kill[i] == xyz whatever.
So after when you want to find the variable kill, you know its inside the "folder" (record) Stats. And if you search for the var "Kill" itself in the list you won't see it. So you don't have a huge list of variable with generic names or super refined names. Just set the record, then whatever you want to store within it associated to that variable.
Working on projects: