Player.MorphWeapon will remove weapon from inventory if identical when player unmorphs

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
User avatar
SPZ1
Posts: 368
Joined: Wed Aug 02, 2017 3:01 pm
Location: Illinois

Player.MorphWeapon will remove weapon from inventory if identical when player unmorphs

Post by SPZ1 »

I found that if you morph to a class that has it's Player.MorphWeapon set to the current weapon you are using when morphing, it will be removed from the player's inventory when the player unmorphs.
User avatar
Rachael
Posts: 13835
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: Player.MorphWeapon will remove weapon from inventory if identical when player unmorphs

Post by Rachael »

That is not a bug. If you're actively using the same weapon for both a morph and normal use - don't do that! Make some inherit variants, at least.
User avatar
SPZ1
Posts: 368
Joined: Wed Aug 02, 2017 3:01 pm
Location: Illinois

Re: Player.MorphWeapon will remove weapon from inventory if identical when player unmorphs

Post by SPZ1 »

OK. Well I'll get to it!
User avatar
MartinHowe
Posts: 2050
Joined: Mon Aug 11, 2003 1:50 pm
Location: Waveney, United Kingdom

Re: Player.MorphWeapon will remove weapon from inventory if identical when player unmorphs

Post by MartinHowe »

SPZ1 wrote: Mon Nov 04, 2024 12:51 pm I found that if you morph to a class that has it's Player.MorphWeapon set to the current weapon you are using when morphing, it will be removed from the player's inventory when the player unmorphs.
There's a style flag for that: MRF_LOSEACTUALWEAPON — When the player unmorphs, the actual weapon given by the Player.MorphWeapon property is taken away.

When a player unmorphs, the engine by default takes away whichever weapon the player is wielding at the time; the assumptions behind this are no longer valid due to enhancements to the game made by ZDoom. With the MRF_LOSEACTUALWEAPON flag, the player only loses the weapon given upon morphing; furthermore, if the weapon was one that the player already had before morphing, it is not taken away at all. This new behavior is actually a bug fix, but must be activated via a style flag because existing mods may depend upon the old behavior.
User avatar
SPZ1
Posts: 368
Joined: Wed Aug 02, 2017 3:01 pm
Location: Illinois

Re: Player.MorphWeapon will remove weapon from inventory if identical when player unmorphs

Post by SPZ1 »

I just noticed that none of these style flags are listed in the wiki (for MorphActor and UnMorphActor anyways). Also thanks for the tip!
User avatar
MartinHowe
Posts: 2050
Joined: Mon Aug 11, 2003 1:50 pm
Location: Waveney, United Kingdom

Re: Player.MorphWeapon will remove weapon from inventory if identical when player unmorphs

Post by MartinHowe »

SPZ1 wrote: Tue Nov 05, 2024 2:28 pm I just noticed that none of these style flags are listed in the wiki (for MorphActor and UnMorphActor anyways). Also thanks for the tip!
Yeah, they're in the entry for MorphProjectile because that's where it all started, originally with Heretic and HeXen; I'd suggest reading that whole page and everything morph-related that it links to, to give yourself a full overview of the morphing subsystem; the entry for (Un)MorphActor does reference them ("Except for tid, the parameters are the same special properties defined by the MorphProjectile class. They are summarised above; for full details and additional notes, please refer to the MorphProjectile class") but it's a lot to take in so you might have missed that bit. Have fun :)

Return to “Closed Bugs [GZDoom]”