CouchPotato
Member
Hi guys,
In my game I am going through several rooms and copying instances from those rooms. Then I am kind of sticking together these instances to create a level. For this to work I need to copy some data from those instances and then recreate them in the new room.
Currently this copying works perfectly for position, scale, rotation, object type etc. but I want to expand my system to include the Variable Definitions aswell.
So my question is how to get the list of variables that can be accessed in the room editor and reference it in code?
I want to reference the names or the values from this specific list in code. I know about this: https://www.reddit.com/r/gamemaker/comments/70ny59 Which refers to these:
In my game I am going through several rooms and copying instances from those rooms. Then I am kind of sticking together these instances to create a level. For this to work I need to copy some data from those instances and then recreate them in the new room.
Currently this copying works perfectly for position, scale, rotation, object type etc. but I want to expand my system to include the Variable Definitions aswell.
So my question is how to get the list of variables that can be accessed in the room editor and reference it in code?
I want to reference the names or the values from this specific list in code. I know about this: https://www.reddit.com/r/gamemaker/comments/70ny59 Which refers to these:
- variable_instance_get_names(instance_id) - Returns an array of strings that contain all variable names for instance_id
- variable_instance_get(instance_id, string) - Returns the value of the variable named string of instance_id
- get_string(string, default) - Quick and dirty way to enter a string from the keyboard into GMS
- string(variable) - Sets variable type to a string
- real(variable) - Sets variable type to a real number
- variable_instance_set(instance_id, variable_name, value) - Sets the variable named variable_name of instance_id to value