[Solved] Monster spawned by dead player attacks other mon...

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
Kostov
 
 
Posts: 2020
Joined: Thu Dec 26, 2013 3:26 pm

[Solved] Monster spawned by dead player attacks other mon...

Post by Kostov »

If spawned by console, the ResurrectedDoomPlayer behaves as intended, but if spawned from the player's corpse via A_SpawnItemEx, it attacks other monsters. Why?

Code: Select all

ACTOR ResurrectingDoomPlayer : DoomPlayer replaces DoomPlayer
{
	States
	{
	Death.Slime:
		TNT1 A 0 A_Jump(256, "Resurrection1", "Resurrection2", "Resurrection3", "Resurrection4")
	Resurrection1:
		PLAY H 10
		PLAY I 10 A_PlayerScream
		PLAY J 10 A_NoBlocking
		PLAY KLM 10
		PLAY N 525
		TNT1 A -1 A_SpawnItemEx("ResurrectedDoomPlayer", 0, 0, 0, 0, 0, 0, SXF_TELEFRAG|SXF_TRANSFERTRANSLATION)
		Stop
	Resurrection2:
		PLAY H 10
		PLAY I 10 A_PlayerScream
		PLAY J 10 A_NoBlocking
		PLAY KLM 10
		PLAY N 1050
		TNT1 A -1 A_SpawnItemEx("ResurrectedDoomPlayer", 0, 0, 0, 0, 0, 0, SXF_TELEFRAG|SXF_TRANSFERTRANSLATION)
		Stop
	Resurrection3:
		PLAY H 10
		PLAY I 10 A_PlayerScream
		PLAY J 10 A_NoBlocking
		PLAY KLM 10
		PLAY N 1575
		TNT1 A -1 A_SpawnItemEx("ResurrectedDoomPlayer", 0, 0, 0, 0, 0, 0, SXF_TELEFRAG|SXF_TRANSFERTRANSLATION)
		Stop
	Resurrection4:
		PLAY H 10
		PLAY I 10 A_PlayerScream
		PLAY J 10 A_NoBlocking
		PLAY KLM 10
		PLAY N 2100
		TNT1 A -1 A_SpawnItemEx("ResurrectedDoomPlayer", 0, 0, 0, 0, 0, 0, SXF_TELEFRAG|SXF_TRANSFERTRANSLATION)
		Stop
	}
}

ACTOR ResurrectedDoomPlayer : ZombieMan
{
	Health 200
	Obituary "$OB_KILLEDSELF"
	States
	{
	Spawn:
		RSPL K 10
		RSPL JIH 10
		Goto Idle
	Idle:
		RSPL AB 10 A_Look
		Loop
	See:
		RSPL AABBCCDD 4 A_Chase
		Loop
	Missile:
		RSPL E 10 A_FaceTarget
		RSPL F 8 A_PosAttack
		RSPL E 8
		Goto See
	Pain:
		RSPL G 3
		RSPL G 3 A_Pain
		Goto See
	Death:
		RSPL H 10
		RSPL I 10 A_Scream
		RSPL J 10 A_NoBlocking
		RSPL KLM 10
		RSPL N -1
		Stop
	XDeath:
		RSPL O 5
		RSPL P 5 A_XScream
		RSPL Q 5 A_NoBlocking
		RSPL RSTUV 5
		RSPL W -1
		Stop
	Raise:
		RSPL K 10
		RSPL JIH 10
		Goto See
	}
}
Last edited by Kostov on Wed Aug 06, 2014 8:37 am, edited 1 time in total.
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: Monster spawned by dead player attacks other monsters

Post by Graf Zahl »

Because it gets the player's friendliness information transferred, i.e. you create a friendly monster this way.
Kostov
 
 
Posts: 2020
Joined: Thu Dec 26, 2013 3:26 pm

Re: Monster spawned by dead player attacks other monsters

Post by Kostov »

Ah. Any way to prevent that? :)

EDIT:

Code: Select all

Spawn:
	RSPL K 10
	RSPL JIH 10
	TNT1 A 0 A_ChangeFlag("FRIENDLY", FALSE)
	Goto Idle
Resolved.
Locked

Return to “Editing (Archive)”