N
Niall Edwards
Guest
OK, forgive me as I am new to GameMaker Studio 2 and the forums so I hope people understand what I am getting at.
Firstly, imagine the wonderful Variable Definitions option on Objects did not exist.
I had been using event_perform_object 'trick' to pull down clusters of variables from multiple 'parent' objects into a 'child' object, overriding values at the child object level, and on from there. Thus, lovely multiple inheritance. Of course, I had been setting out those various variables in the multiple 'parent' objects in the Create event Action, not the Variable Definitions.... hmmmm.
Then I started to wonder.
Could I rather set out those same 'parent' object variables in the 'parent' object 'Variable Definitions' area instead of the Create event Actions of the 'parent' object?
Here is the question though --- If I did that, which would otherwise be preferable, could I though 'inherit' those variables into a child object using the event_perform_object trick I had been using before? If so what event on a 'parent' object would I be calling from the Create event Action in the 'child' object? Indeed, with the 'parent' object, what is the event I would be calling to inherit variables if the variables are created in Variable Definitions and not in the Create event Action?
[edit] Also, can I set up a variable in the Create event Action AND also set up the very same variable in Variable Definitions? It's a massive effort, but, if possible, would this be a way around the above?
I really hope I am explaining myself enough here - probably not! As I say, I am new to GMS2.....
Firstly, imagine the wonderful Variable Definitions option on Objects did not exist.
I had been using event_perform_object 'trick' to pull down clusters of variables from multiple 'parent' objects into a 'child' object, overriding values at the child object level, and on from there. Thus, lovely multiple inheritance. Of course, I had been setting out those various variables in the multiple 'parent' objects in the Create event Action, not the Variable Definitions.... hmmmm.
Then I started to wonder.
Could I rather set out those same 'parent' object variables in the 'parent' object 'Variable Definitions' area instead of the Create event Actions of the 'parent' object?
Here is the question though --- If I did that, which would otherwise be preferable, could I though 'inherit' those variables into a child object using the event_perform_object trick I had been using before? If so what event on a 'parent' object would I be calling from the Create event Action in the 'child' object? Indeed, with the 'parent' object, what is the event I would be calling to inherit variables if the variables are created in Variable Definitions and not in the Create event Action?
[edit] Also, can I set up a variable in the Create event Action AND also set up the very same variable in Variable Definitions? It's a massive effort, but, if possible, would this be a way around the above?
I really hope I am explaining myself enough here - probably not! As I say, I am new to GMS2.....
Last edited by a moderator: