• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker Inheritance - bypass parent's parent

bluetrack

Member
Hi, Is there a way for a child to bypass inheriting it's parent's parent? In the diagaram below I would like for child1 to inherit everyhting from Parent2 but bypass everything from Parent1. Is this possible?

Parent1
|
Parent2
|
Child1
 

bluetrack

Member
In the parent check the object index before inheriting the event.
Thank you TheouAegis. I am not sure I understand what you mean. Do you mind elaborating a bit? Just to make sure I am clear on what I am asking:

parent1: is used for disabling all children when they are not in the view.
|
parent2: is a "wall_parent" and it is used for collisions mainly. (this is also a child of parent1)
|
child1: is a horizontal_moving_platform for which I want to inherit everything from parent2 (meaning collisions) but not inherit parent1(meaning ________not to be deactivated when out of view). I want this because it either gets stuck or does not pallindrome when out of view.
 

GMWolf

aka fel666
Rather than have the deactivation logic in a parent object, move it to a script that you call from each of the children objects that need deactivation.
(its kind of a flaw in GML)
 

bluetrack

Member
Rather than have the deactivation logic in a parent object, move it to a script that you call from each of the children objects that need deactivation.
(its kind of a flaw in GML)
Thanks for the reply GMWolf. That is an interesting idea. But ifI do this then I believe all the deactivated instances will not be able to be activated again since they will not be able to run any code once deactivated. Currently I check the instances of the parent I want to deactivate and store their IDs in a list so I can reactivate them later. If I do the same using a script then i need to have a way of checking only specific instances(i.e. children of an object). Wondering if this is somehow doable. Haven't figured it out yet...
 
Top