Friendly morphed monster

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.
Post Reply
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3199
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Friendly morphed monster

Post by drfrag »

At least since ZDoom 2.3.1 to GZDoom 3.0.1. When you morph someone into a friendly monster the guy is still friendly after unmorphing, since the friendly flag is ignored you must use changeflag in the see states. In 3.0.1 sometimes the guy stays morphed and plays the pain sound instead. Please see code. To reproduce load morphfriendtest.wad in Heretic and type 'summon artiegg2'. Now i've noticed that may be you were never intended to morph someone into a friendly monster (this decorate code was really old). So not a bug but a feature request then?

Code: Select all

ACTOR ArtiEgg2 : CustomInventory
{
  +COUNTITEM
  +FLOATBOB
  +INVENTORY.INVBAR
  +INVENTORY.PICKUPFLASH
  +INVENTORY.FANCYPICKUPSOUND
  Inventory.Icon "ARTIEGGC"
  Inventory.PickupSound "misc/p_pkup"
  Inventory.PickupMessage "Alternate Morph Ovum"
  Inventory.DefMaxAmount
  Tag "$TAG_ARTIEGG"
  States
  {
  Spawn:
    EGGC ABCB 6
    Loop
  Use:
    TNT1 A 0 A_FireCustomMissile("EggFX2", -15, 0, 0, 0, 1)
    TNT1 A 0 A_FireCustomMissile("EggFX2", -7.5, 0, 0, 0, 1)
    TNT1 A 0 A_FireCustomMissile("EggFX2", 0, 0, 0, 0, 1)
    TNT1 A 0 A_FireCustomMissile("EggFX2", 7.5, 0, 0, 0, 1)
    TNT1 A 0 A_FireCustomMissile("EggFX2", 15, 0, 0, 0, 1)
    Stop
  }
}

ACTOR EggFX2 : MorphProjectile
{
  Radius 8
  Height 8
  Speed 18
  MorphProjectile.MonsterClass "FriendlyBeast"
  MorphProjectile.MorphStyle MRF_FULLHEALTH
  MorphProjectile.Duration 1000
  States
  {
  Spawn:
    EGGM ABCDE 4
    Loop
  Death:
    FX01 F 3 Bright
    FX01 FGH 3 Bright
    Stop
  }
}

ACTOR FriendlyBeast : MorphedMonster
{
	Health 220
	Radius 32
	Height 74
	Mass 200
	Speed 14
	Painchance 100
	Monster
	+FLOORCLIP
	+FRIENDLY // this is ignored
	+DROPOFF
	+NOBLOCKMONST
	-COUNTKILL
	SeeSound "beast/sight"
	AttackSound "beast/attack"
	PainSound "beast/pain"
	DeathSound "beast/death"
	ActiveSound "beast/active"
	Obituary "$OB_BEAST"
	States
	{
	Spawn:
		BEAS AB 10 A_Look
		Loop
	See:
		BEAS A 0 // this line can be commented out but must exist
		BEAS A 0 A_ChangeFlag("FRIENDLY",1) // hack
		BEAS ABCDEF 3 A_Chase
		Loop
	Melee:
	Missile:
		BEAS H 10 A_FaceTarget
		BEAS I 10 A_CustomComboAttack("BeastBall", 32, random[BeastAttack](1,8)*3, "beast/attack")
		Goto See
	Pain:
		BEAS G 3
		BEAS G 3 A_Pain
		Goto See
	Death:
		BEAS R 6
		BEAS S 6 A_Scream
		BEAS TUV 6
		BEAS W 6 A_NoBlocking
		BEAS XY 6
		BEAS Z -1
		Stop
	XDeath:
		BEAS J 5
		BEAS K 6 A_Scream
		BEAS L 5
		BEAS M 6
		BEAS N 5
		BEAS O 6 A_NoBlocking
		BEAS P 5
		BEAS Q -1
		Stop
	}
}
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Friendly morphed monster

Post by Graf Zahl »

This looks a bit odd. Unmorphing preserves the FRIENDLY flag, but morphing does not. It should be consistent, but what way?
User avatar
Rachael
Posts: 13960
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Friendly morphed monster

Post by Rachael »

Shouldn't it follow Hexen's behavior?

I think the ultimate answer would be is if Mr. Minotaur tries to kill you after you hit him with a porkalator in Vanilla Hexen. :P In which case - if he does, then FRIENDLY flag should only be preserved for the unmorphed actor - and if he doesn't, then it needs to be transferred while morphing. (AFAIR, Hexen had no idea of a 'friendly' flag as such, so the morphed minotaurs will probably try to kill you)

Considering the age of this bug, though, a compatibility fix may be required in order to preserve this buggy behavior since there's been many mods released since ZDoom 2.3.1.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3199
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: Friendly morphed monster

Post by drfrag »

Graf Zahl wrote:Unmorphing preserves the FRIENDLY flag, but morphing does not. It should be consistent, but what way?
Both? The original monster was not friendly, only the morphed monster is.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Friendly morphed monster

Post by Graf Zahl »

Yes, what happens is that morphing does not transfer this flag to the morphed monster.
Unmorphing, on the other hand, transfers the flag from the morphed monster to the unmorphed one.

This was most certainly intended as a bugfix, but only half of that fix was actually implemented
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Friendly morphed monster

Post by Graf Zahl »

Looking through the code in detail I think I see where the actual problem lies:

Morphing transfers friendliness forth and back to and from the morphed monster. but the FriendlyBeast overrides the original setting - and that override gets transferred back to the main version of the monster. Looking through the entire change history this is entirely by design and not a bug.

Whether this warrants a new feature is another discussion, though. It may require a scripted callback but it hasn't been decided how to handle that.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3199
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: Friendly morphed monster

Post by drfrag »

Graf Zahl wrote:Morphing transfers friendliness forth and back to and from the morphed monster
Then why is the +FRIENDLY flag ignored? Right now there's no way to implement friendly morphed monsters in DECORATE without that override.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Friendly morphed monster

Post by Graf Zahl »

Morphing is designed to preserve any allegiance the monster-to-be-morphed has.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3199
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: Friendly morphed monster

Post by drfrag »

Okay, understood.
Post Reply

Return to “Closed Bugs [GZDoom]”