K
KH-SOS
Guest
Is there a built-in variable or function you can use to determine an object's parent?
For example, if I have an object that generates other objects into the room, and I have a number of different enemies (Black dragons, red dragons, shoe salesmen, existential guilt, etc...). If I had those enemies assigned to different parents (DragonsParent, SalesmenParent, etc), and I choose an exact enemy type to generate, is there some way to determine its Parent to allow for some enemy-class conditions?
I know there's lots of ways to handle the problem in other ways (like make a parentis variable in every enemy type's Create code), but for my specific use it would really just be easier to use object.parent or parentis = object_get_parenttype(instance), but I don't see anything built-in. Obviously the system has this function/variable, but it doesn't seem to be made accessible to programmers.
For example, if I have an object that generates other objects into the room, and I have a number of different enemies (Black dragons, red dragons, shoe salesmen, existential guilt, etc...). If I had those enemies assigned to different parents (DragonsParent, SalesmenParent, etc), and I choose an exact enemy type to generate, is there some way to determine its Parent to allow for some enemy-class conditions?
I know there's lots of ways to handle the problem in other ways (like make a parentis variable in every enemy type's Create code), but for my specific use it would really just be easier to use object.parent or parentis = object_get_parenttype(instance), but I don't see anything built-in. Obviously the system has this function/variable, but it doesn't seem to be made accessible to programmers.