[ZScript] On(Un)Morph Virtual Function

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

[ZScript] On(Un)Morph Virtual Function

Post 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.
ZzZombo
Posts: 315
Joined: Mon Jul 16, 2012 2:02 am

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

Post 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.
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

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

Post by Major Cooke »

Sounds reasonable... I like that idea!
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

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

Post by Graf Zahl »

This is already in the tracker.
User avatar
Rachael
Posts: 13558
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

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

Post by Rachael »

Post Reply

Return to “Feature Suggestions [GZDoom]”