[Reopened] [ZScript] On(Un)Morph Virtual Function

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

Moderator: GZDoom Developers

[ZScript] On(Un)Morph Virtual Function

Postby Major Cooke » Wed Dec 21, 2016 10:47 am

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.
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

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

Postby ZzZombo » Thu Dec 22, 2016 7:48 pm

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.
ZzZombo
 
Joined: 16 Jul 2012

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

Postby Major Cooke » Tue Dec 27, 2016 9:52 am

Sounds reasonable... I like that idea!
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

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

Postby Graf Zahl » Tue Jan 10, 2017 4:26 pm

This is already in the tracker.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

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

Postby Rachael » Sun Apr 30, 2017 1:29 pm

User avatar
Rachael
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 11
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD with Vulkan Support


Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests