Page 1 of 1

[ZScript] On(Un)Morph Virtual Function

Posted: Wed Dec 21, 2016 10:47 am
by Major Cooke
Two virtual functions called whenever an (un)morph happens. Has two different cases for both of these based on if the actor to change from and the actor to change into.

I.e. a marine turns into a mega chicken.

Marine:
  • Calls OnMorph before changing into the morph.
  • Calls OnUnmorph after returning to the player self.
Mega Chicken:
  • Calls OnMorph just after switching bodies.
  • Calls OnUnmorph just before switching bodies.

Re: [ZScript] On(Un)Morph Virtual Function

Posted: Thu Dec 22, 2016 7:48 pm
by ZzZombo
You know what I think? Alongside those functions must exist some event system to signal them globally. This way we don't have to create subclasses when we aren't going to change implementation, and more importantly allows to capture events in Actor cleanly.

Re: [ZScript] On(Un)Morph Virtual Function

Posted: Tue Dec 27, 2016 9:52 am
by Major Cooke
Sounds reasonable... I like that idea!

Re: [ZScript] On(Un)Morph Virtual Function

Posted: Tue Jan 10, 2017 4:26 pm
by Graf Zahl
This is already in the tracker.

Re: [ZScript] On(Un)Morph Virtual Function

Posted: Sun Apr 30, 2017 1:29 pm
by Rachael