Page 1 of 1
question on inheritence

Posted:
Fri Jul 20, 2012 8:39 pm
by Fojam
I was making an inherited actor, and i made a create actor event in both of them, but since i made a create actor event in the child actor, it didnt run in the base actor. Do events override each other?
Re: question on inheritence

Posted:
Fri Jul 20, 2012 8:53 pm
by skydereign
If you have an actor inherit events from another, it will have all events that aren't duplicated. Since the child actor has a create actor, it will only use its own create actor event, even if the base actor has a different one.
Re: question on inheritence

Posted:
Fri Jul 20, 2012 10:50 pm
by Fojam
okay thanks. also, when you make an object a parent of another object, the child objects actor variables all become the same as the parents, right?
Re: question on inheritence

Posted:
Fri Jul 20, 2012 11:14 pm
by skydereign
Not all of them. The attributes the child adopts from the parent are zdepth, transp, VisibilityState, CollisionState, EventDisable, and the position becomes relative the the parent (and probably a few more). So while real x and y will change as the parent's position changes, the x and y won't change (this is just purely because the relative position doesn't change). But things like the velocity variables aren't shared, nor is angle. Actor variables that you create aren't shared as well. And while zdepth is shared, all actors parented to a specific actor can have different zdepths (but all have the same actual zdepth as the parent).