MorphActor flag?

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

Moderator: GZDoom Developers

User avatar
kevansevans
Spotlight Team
Posts: 418
Joined: Tue Oct 05, 2010 12:04 am
Graphics Processor: nVidia with Vulkan support

MorphActor flag?

Post by kevansevans »

I'm in a situation where I need to rapidly swap monsters around, but the swaps are only mild differences. IE I wanted to replace a zombieman with a shotgun attack temporarily, and do it without replacing the actor out right. Best solution I found for this is to call A_Morph on the actor and pass through a new actor with a slightly modified attack. This works a treat and causes no problems, however code wise, the replacing actor needs to inherit from morphed monster. In order for me to make slightly modified zombiemen, I need to copy the whole zombieman class into my mod and have that inherit from morphed monster. Making this check be a simple flag should allow me to more easily create morphed enemies that inherit without having to copy over whole definitions.
ZzZombo
Posts: 309
Joined: Mon Jul 16, 2012 2:02 am

Re: MorphActor flag?

Post by ZzZombo »

This issue is IIRC that the morph data and behavior is held by the monster itself, so this special class is used to keep it. I wonder why can't it be put into a separate thinker though. However, I also have code that sort of replicates morph code in ZScript, but the primary issue with it is that replacing all references to the morphed/morphee across all other object isn't robust. It may skip references that need to be fixed up and change those that are better left be as is.

Return to “Feature Suggestions [GZDoom]”