L
lorewap3
Guest
I have a struct constructor like this:
that has various children like this
If I declare a variable:
state = new StateWalk();
How do I figure out the function by the variable itself? IE, "StateWalk" from only the state variable. I have a debugging function within State() constructor where I'm trying to output the name of the function used, but I'm not going to know which of the children was used to construct it.
Is there a way to do something like script_get_name(self)? I can't test it against every function with instanceof, that would be silly. I'm not sure of which built-in method would allow me to figure this out.
Thanks!
Will
GML:
function State() constructor {
}
GML:
function StateWalk(): State() constructor {
}
state = new StateWalk();
How do I figure out the function by the variable itself? IE, "StateWalk" from only the state variable. I have a debugging function within State() constructor where I'm trying to output the name of the function used, but I'm not going to know which of the children was used to construct it.
Is there a way to do something like script_get_name(self)? I can't test it against every function with instanceof, that would be silly. I'm not sure of which built-in method would allow me to figure this out.
Thanks!
Will