Player.MorphWeapon will remove weapon from inventory if identical when player unmorphs
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.
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.
-
- Posts: 368
- Joined: Wed Aug 02, 2017 3:01 pm
- Location: Illinois
Player.MorphWeapon will remove weapon from inventory if identical when player unmorphs
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.
-
- 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
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.
-
- 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
OK. Well I'll get to it!
-
- 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
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.
-
- 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
I just noticed that none of these style flags are listed in the wiki (for MorphActor and UnMorphActor anyways). Also thanks for the tip!
-
- 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
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