Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
rabidrage

Monster decoys

Recommended Posts

So I've got this idea for an edit to a monster, and I'd like to determine how to make it work. Is it possible to have an invisible monster project an image of itself elsewhere? Like a holographic decoy or something? It would be absolutely perfect if this is possible. Anybody who can give me any idea of how it could be done--thanks in advance!

Share this post


Link to post

Depends on what exact way you want the decoy's actions to be synchronized with the real monster's actions at any moment or at particular moments. Would you describe closely what behavior you have in mind, in a way that isn't any vague, please?

Share this post


Link to post

It's more like I'll take what I can get, but if it just runs around randomly, that's perfect. The projection should not have an attack, but the monster should be able to attack while invisible.

Share this post


Link to post

Then you can just make the decoy be a separate actor with no attack and disappearing after a fixed number of walking or wandering states, and make your real monster to spawn the decoy.

Do you want the real monster to become temporarily invisible only after spawning a decoy and until the decoy disappears, or be invisible permanently and spawning decoys at random?

Share this post


Link to post

I'd like the monster to become invisible only when the decoy is spawned, and to only spawn one at a time. Are there any examples of someone doing this?

Share this post


Link to post

You can make a monster invisible by making it enter an alternative See animation of "TNT1" sprites (no sprite) instead of the monster's 4-letter sprite prefixes. You can use dummy inventory giving / taking / checking and jumping trickery to make the monster behave as intended, for example prevent it from becoming visible or spawning more decoys before it passed a given amount of states during which its dummy inventory sufficiently increases or decreases.

Share this post


Link to post

Alright, so basically, I suck. I'm basing this off the alien from PSXAVP Doom. I tried to make the projection a missile and added a second "see" state seen here:

Missile:
TNT1 A 0 A_SpawnItemEx ("Projection", 0, 45)
TNT1 A 0 A_JumpIfInventory("Projection", 0, "See2")
Goto See2
See2:
TNT1 A 0 A_Recoil(-1)
TNT1 AA 2 A_Chase
TNT1 A 0 A_Recoil(-1)
TNT1 AA 2 A_Chase
TNT1 A 0 A_Recoil(-1)
TNT1 A 0 A_JumpIf(128, "See")
Goto See //Loop

The projection is defined here:

actor Projection : Inventory
{
Inventory.Amount 1
Inventory.MaxAmount 1
}



Actor Projection
{
MaxStepHeight 600
MaxDropoffHeight 600
Scale 2.0
Health 3000
Speed 8
FastSpeed 10
Radius 20
Height 76
Mass 4000
+LOOKALLAROUND
+FIXMAPTHINGPOS
+CANUSEWALLS
+CANPUSHWALLS
+ACTIVATEIMPACT
+QUICKTORETALIATE
+SLIDESONWALLS
-SOLID
-SHOOTABLE

States
{
Spawn:
XENR A 0
XENR AB 10 A_Look
Goto Idle
Idle:
XENR AB 10 A_Look
Loop
See:
TNT1 A 0 A_GiveInventory("Projection", 1)
TNT1 A 0 A_Recoil(-1)
XENR BB 2 A_Chase
TNT1 A 0 A_Recoil(-1)
XENR CC 2 A_Chase
TNT1 A 0 A_Recoil(-1)
TNT1 A 0 A_JumpIf(128, "See")
Goto Spawn //Loop
Avoid:
XENR A 1 A_FaceTarget
XENR ABCB 2 A_FastChase
Goto See
}
}

The inventory is given in the monster's Spawn state like this:

Spawn:
XENR A 0 A_GiveInventory("Projection", 1)
XENR AB 10 A_Look
Goto Idle

Not sure where I'm messing up.

Share this post


Link to post

The first obvious problem I can see is that you have 2 different actors with the same name, one is the inventory and one is the decoy. Actor names should be unique, and the functions that take them as parameters aren't context sensitive to distinguish an inventory item from a solid thing anyway.

Share this post


Link to post

No. It suggests that you should give them different names. One name to represent the dummy inventory item for the Give/Take/JumpIf functions, and the other name to represent the decoy actor for the SpawnItemEx function. Those two are obviously different things that shouldn't share any properties or even actor names.

Share this post


Link to post

Okay, well that's fixed. But now the projection is just acting like any projectile int the sense that the monster seems able to spawn an unlimited number of them. What did I do wrong there?

Share this post


Link to post

Every call of A_Chase, regardless on where it was called from, can trigger a missile attack. You have to either set its parameters to prevent it from doing so (check A_Chase reference on zdoom wiki), or use the inventory trickery to redirect the code back to walking states when it tries to spawn more decoys prematurely.

Share this post


Link to post

It sounds like this should be doing the trick, then, but it isn't.

Missile:
TNT1 A 0 A_JumpIfInventory("Hologram", 0, "See2")
TNT1 A 0 A_SpawnItem("Projection", 0, 45)
TNT1 A 0 A_TakeInventory("Hologram", 1)
Goto See2
See2:
TNT1 A 0 A_Recoil(-1)
TNT1 AA 2 A_Chase
TNT1 A 0 A_Recoil(-1)
TNT1 AA 2 A_Chase
TNT1 A 0 A_Recoil(-1)
TNT1 A 0 A_JumpIf(128, "See")
Goto See

Share this post


Link to post

1. Elsewhere in your DECORATE, "Hologram" needs to be defined as an actor that inherits from Inventory and has a concrete Inventory.MaxAmount.
2. A_JumpIfInventory performs the jump if the calling actor has greater or equal amount of the inventory item in its inventory in comparison with the parameter. That number is always non-negative (if the actor has 0 inventory items, and you try to take 1 from him, he will still have 0), and every non-negative number is greater or equal to zero, so that the jump would always be performed.
3. I don't see any A_GiveInventory counterpart to the A_TakeInventory.

Share this post


Link to post

Yeah, I did fix the Inventory problem with this:

actor Hologram : Inventory
{
Inventory.Amount 1
Inventory.MaxAmount 1
}

I put A_GiveInventory in the Spawn state:

Spawn:
XENR A 0 A_GiveInventory("Hologram", 1)
XENR AB 10 A_Look
Goto Idle

That should cover 1 and 3, but it's already been in there and not working. I think I'm not understanding your second point. A_JumpIfInventory will jump if the monster has an amount of 1, when I specify 0?

Share this post


Link to post

Yes.

http://zdoom.org/wiki/A_JumpIfInventory said:

Checks the amount of inventorytype items in the actor's inventory. If there are at least amount, the jump is performed.

If amount is greater than the maximum amount, the jump will be performed.

Note that if amount is 0, the jump is only performed if the actor is carrying the maximum number of that item.

Share this post


Link to post

So what it sounds like is that I don't want to set up a missile state and have it jump if the monster doesn't have the projection in inventory. What it sounds like it that I want to set up a special "projection" state for firing the projection, and have it jump INTO that state if it DOES have 1 in inventory. Which I am trying, still to no avail. Now it just doesn't make any.

Share this post


Link to post

Due to an old bug that's intentionally maintained in the game, the very first state after an actor is spawned does not execute its function if it has one. So, your A_GiveInventory action will not be performed, unless you put yet another state right before the state with A_GiveInventory, even with zero duration.

Share this post


Link to post

Cool! So that works now. But the monster still doesn't go into its invisible state after the projection is spawned. At the end of the Projection state I put "Goto See2" and See2 is:

TNT1 A 0 A_Recoil(-1)
TNT1 AA 2 A_Chase
TNT1 A 0 A_Recoil(-1)
TNT1 AA 2 A_Chase
TNT1 A 0 A_Recoil(-1)
TNT1 A 0 A_JumpIf(128, "See2")
Goto See2

Share this post


Link to post

States
{
Spawn:
XENR A 0
TNT1 A 0 A_GiveInventory("Hologram", 1)
XENR AB 10 A_Look
Goto Idle
Idle:
XENR AB 10 A_Look
Loop
See:
TNT1 A 0 A_JumpIfInventory("Hologram", 1, "Projection")
TNT1 A 0 A_Recoil(-1)
XENR BB 2 A_Chase
TNT1 A 0 A_Recoil(-1)
XENR CC 2 A_Chase
TNT1 A 0 A_Recoil(-1)
TNT1 A 0 A_JumpIf(128, "See")
Goto See //Loop
Melee:
XENR D 8 A_FaceTarget
TNT1 A 0 ThrustThingZ(0,20,0,1)
XENR E 8 A_Recoil(-15)
TNT1 A 0 A_CustomMissile("SRunnerAttack",20,0,0,0)
XENR F 8
Goto See
Projection:
XENR B 0 A_SpawnItem("Projection", 0, 45)
XENR B 0 A_TakeInventory("Hologram", 1)
Goto See2
See2:
TNT1 A 0 A_Recoil(-1)
TNT1 AA 2 A_Chase
TNT1 A 0 A_Recoil(-1)
TNT1 AA 2 A_Chase
TNT1 A 0 A_Recoil(-1)
TNT1 A 0 A_JumpIf(128, "See2")
Goto See2 //Loop
Pain:
XENR G 1 A_Pain
TNT1 A 0 A_Jump(200, "Avoid")
Goto See

Avoid:
XENR A 1 A_FaceTarget
XENR ABCB 2 A_FastChase
Goto See
Death.Poison:
TNT1 A 0 A_ClearTarget
XENR H 1
TNT1 A 0 A_SpawnItem("AlienBlood", 0, 45)
XENR H 8
XENR I 8 A_Scream
XENR J 4
XENR K 4 A_NoBlocking
XENR L -1
Stop
Death.Bleeding:
TNT1 A 0 A_ClearTarget
XENR H 1
TNT1 A 0 A_SpawnItem("AlienBlood", 0, 45)
XENR H 8
XENR I 8 A_Scream
XENR J 4
XENR K 4 A_NoBlocking
XENR L -1
Stop
Death:
TNT1 A 0 A_ClearTarget
TNT1 A 0 A_Jump(255, "Death1", "Death2", "Death3")
Death1:
Death2:
Death3:
XENR H 1
TNT1 A 0 A_SpawnItem("AlienBlood", 0, 45)
XENR H 8
XENR I 8 A_Scream
XENR J 4
XENR K 4 A_NoBlocking
XENR L -1
Stop
XDeath.Poison:
TNT1 A 0 A_ClearTarget
XENR H 1
TNT1 A 0 A_SpawnItem("AlienBlood", 0, 45)
XENR H 8
XENR I 8 A_Scream
XENR J 4
XENR K 4 A_NoBlocking
XENR L -1
Stop
XDeath.Bleeding:
TNT1 A 0 A_ClearTarget
XENR H 1
TNT1 A 0 A_SpawnItem("AlienBlood", 0, 45)
XENR H 8
XENR I 8 A_Scream
XENR J 4
XENR K 4 A_NoBlocking
XENR L -1
Stop
XDeath:
TNT1 A 0 A_ClearTarget
TNT1 A 0 A_Jump(255,"C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9", "C10")
C1:
TNT1 A 0 A_GiveToTarget("Comment1")
Goto XDeath2
C2:
TNT1 A 0 A_GiveToTarget("Comment2")
Goto XDeath2
C3:
TNT1 A 0 A_GiveToTarget("Comment3")
Goto XDeath2
C4:
TNT1 A 0 A_GiveToTarget("Comment4")
Goto XDeath2
C5:
TNT1 A 0 A_GiveToTarget("Comment5")
Goto XDeath2
C6:
TNT1 A 0 A_GiveToTarget("Comment6")
Goto XDeath2
C7:
TNT1 A 0 A_GiveToTarget("Comment7")
Goto XDeath2
C8:
TNT1 A 0 A_GiveToTarget("Comment8")
Goto XDeath2
C9:
TNT1 A 0 A_GiveToTarget("Comment9")
Goto XDeath2
C10:
TNT1 A 0 A_GiveToTarget("Comment10")
Goto XDeath2
XDeath2:
TNT1 AAA 0 A_SpawnItem("AlienBlood", 0, 45)
TNT1 A 0 A_PlaySound("misc/xdeath4c")
EXPL A 0 A_CustomMissile ("AlienGibTorsoRunner", 35, 0, random (0, 360), 2, random (10, 90))
EXPL A 0 A_CustomMissile ("AlienGibRunnerHead", 45, 0, random (0, 360), 2, random (10, 90))
EXPL A 0 A_CustomMissile ("AlienGibRunnerArm1", 35, 0, random (0, 360), 2, random (10, 90))
EXPL A 0 A_CustomMissile ("AlienGibRunnerArm2", 35, 0, random (0, 360), 2, random (10, 90))
EXPL AA 0 A_CustomMissile ("AlienGibRunnerLeg", 15, 0, random (0, 360), 2, random (10, 90))
EXPL A 0 A_CustomMissile ("AlienGibRunnerTail", 35, 0, random (0, 360), 2, random (10, 90))
EXPL AAAAA 0 A_CustomMissile ("FlyingAcidRidiculous", 45, 0, random (0, 360), 2, random (40, 90))
EXPL AAAAA 0 A_CustomMissile ("FlyingAcidBig1", 35, 0, random (0, 360), 2, random (10, 90))
EXPL AAAAA 0 A_CustomMissile ("FlyingAcidBig2", 35, 0, random (0, 360), 2, random (40, 90))
TNT1 A 0 A_Scream
TNT1 A 0 A_NoBlocking
Stop
Crush:
TNT1 A 0 A_ClearTarget
EXPL A 0 A_CustomMissile ("AlienGibRunnerHead", 45, 0, random (0, 360), 2, random (10, 90))
TNT1 A 0 A_PlaySound("misc/xdeath4c")
EXPL A 0 A_CustomMissile ("AlienGibRunnerArm1", 35, 0, random (0, 360), 2, random (10, 90))
EXPL A 0 A_CustomMissile ("AlienGibRunnerArm2", 35, 0, random (0, 360), 2, random (10, 90))
EXPL AA 0 A_CustomMissile ("AlienGibRunnerLeg", 15, 0, random (0, 360), 2, random (10, 90))
EXPL A 0 A_CustomMissile ("AlienGibRunnerTail", 35, 0, random (0, 360), 2, random (10, 90))
EXPL AAAAA 0 A_CustomMissile ("FlyingAcidRidiculous", 45, 0, random (0, 360), 2, random (40, 90))
EXPL AAAAA 0 A_CustomMissile ("FlyingAcidBig1", 35, 0, random (0, 360), 2, random (10, 90))
EXPL AAAAA 0 A_CustomMissile ("FlyingAcidBig2", 35, 0, random (0, 360), 2, random (40, 90))
Stop
}
}

Share this post


Link to post

Next time post your code in between [code] tags, so that the "tab" characters won't get removed by the forum software and spoil the code's readability.

As you have it, it should work the very first time, but not ever again. "Hologram" is only given to the monster once, then removed immediately as it goes to See2. So, as soon as the monster leaves the See2 animation, it will have no opportunity to re-enter it. The monster may leave its See2 animation whenever it proceeds to perform a melee attack or goes to pain state (and as you can notice, both Melee and Pain animations end with "goto See"), so you should either prevent the monster from doing so while in See2, or use the inventory trickery to redirect them back to See2 after the end of Melee/Pain animations if the monster has no "Hologram" in its inventory.

Share this post


Link to post

So that's how to do that. Okay, understood. Next copy-paste will be clearer. In the meantime, I think I know what to do for a few more steps. I'll update the thread if I get lost. Thanks a lot! I'm making this WAD for a friend's birthday and the deadline is approaching. I will also be distributing it so others can enjoy. After all, this one's actually going to get finished. :P

Share this post


Link to post

Here's what I've got. It keeps becoming visible, I think mainly when it attacks.

States
	{
	Spawn:
		XENR A 0
		TNT1 A 0 A_GiveInventory("Hologram", 1)
		XENR AB 10 A_Look
		Goto Idle
	Idle:
		XENR AB 10 A_Look
		Loop
	See:
		TNT1 A 0 A_JumpIfInventory("Hologram", 1, "Projection")
		TNT1 A 0 A_Recoil(-1)
		XENR BB 2 A_Chase
		TNT1 A 0 A_Recoil(-1)
		XENR CC 2 A_Chase
		TNT1 A 0 A_Recoil(-1)
		TNT1 A 0 A_JumpIf(128, "See")		
      Goto See  //Loop
	Melee2:
		XENR D 8 A_FaceTarget
		TNT1 A 0 ThrustThingZ(0,20,0,1)
		XENR E 8 A_Recoil(-15)
		TNT1 A 0 A_CustomMissile("SRunnerAttack",20,0,0,0)
		XENR F 8
		Goto See
		Melee:
		TNT1 A 0 A_JumpIfInventory("Hologram", 1, "Melee2")
		TNT1 D 8 A_FaceTarget
		TNT1 A 0 ThrustThingZ(0,20,0,1)
		TNT1 E 8 A_Recoil(-15)
		TNT1 A 0 A_CustomMissile("SRunnerAttack",20,0,0,0)
		TNT1 F 8
		Goto See2
	Projection:
		XENR B 0 A_SpawnItem("Projection", 0, 45)
		XENR B 0 A_TakeInventory("Hologram", 1)
		Goto See2
	See2:
		TNT1 A 0 A_Recoil(-1)
		TNT1 BB 2 A_Chase
		TNT1 A 0 A_Recoil(-1)
		TNT1 CC 2 A_Chase
		TNT1 A 0 A_Recoil(-1)
		TNT1 A 0 A_JumpIf(128, "See2")		
      Goto See2  //Loop
	Pain2:
		XENR G 1 A_Pain
		TNT1 A 0 A_Jump(200, "Avoid2")
		Goto See
	Pain:
		TNT1 A 0 A_JumpIfInventory("Hologram", 1, "Pain2")
		TNT1 G 1 A_Pain
		TNT1 A 0 A_Jump(200, "Avoid")
		Goto See2
	
	Avoid2:
	    XENR A 1 A_FaceTarget
        XENR ABCB 2 A_FastChase
        Goto See
	Avoid:
		TNT1 A 0 A_JumpIfInventory("Hologram", 1, "Avoid2")
	    TNT1 A 1 A_FaceTarget
        TNT1 ABCB 2 A_FastChase
        Goto See2
	Death.Poison:
		TNT1 A 0 A_ClearTarget
		XENR H 1
		TNT1 A 0 A_SpawnItem("AlienBlood", 0, 45)
		XENR H 8
		XENR I 8 A_Scream
		XENR J 4
		XENR K 4 A_NoBlocking
		XENR L -1
		Stop
	Death.Bleeding:
		TNT1 A 0 A_ClearTarget
		XENR H 1
		TNT1 A 0 A_SpawnItem("AlienBlood", 0, 45)
		XENR H 8
		XENR I 8 A_Scream
		XENR J 4
		XENR K 4 A_NoBlocking
		XENR L -1
		Stop	
	Death:
		TNT1 A 0 A_ClearTarget
		TNT1 A 0 A_Jump(255, "Death1", "Death2", "Death3")
	Death1:
	Death2:
	Death3:
		XENR H 1
		TNT1 A 0 A_SpawnItem("AlienBlood", 0, 45)
		XENR H 8
		XENR I 8 A_Scream
		XENR J 4
		XENR K 4 A_NoBlocking
		XENR L -1
		Stop
	XDeath.Poison:
		TNT1 A 0 A_ClearTarget
		XENR H 1
		TNT1 A 0 A_SpawnItem("AlienBlood", 0, 45)
		XENR H 8
		XENR I 8 A_Scream
		XENR J 4
		XENR K 4 A_NoBlocking
		XENR L -1
		Stop
	XDeath.Bleeding:
		TNT1 A 0 A_ClearTarget
		XENR H 1
		TNT1 A 0 A_SpawnItem("AlienBlood", 0, 45)
		XENR H 8
		XENR I 8 A_Scream
		XENR J 4
		XENR K 4 A_NoBlocking
		XENR L -1
		Stop		
 	XDeath:
		TNT1 A 0 A_ClearTarget	
 	 	TNT1 A 0 A_Jump(255,"C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9", "C10")
 	C1:
  		TNT1 A 0 A_GiveToTarget("Comment1")
		Goto XDeath2	
	C2:	
		TNT1 A 0 A_GiveToTarget("Comment2")
		Goto XDeath2		
	C3:
		TNT1 A 0 A_GiveToTarget("Comment3")
		Goto XDeath2		
	C4:	
		TNT1 A 0 A_GiveToTarget("Comment4")
		Goto XDeath2		
	C5:	
		TNT1 A 0 A_GiveToTarget("Comment5")
		Goto XDeath2		
	C6:
  		TNT1 A 0 A_GiveToTarget("Comment6")
		Goto XDeath2		
	C7:	
		TNT1 A 0 A_GiveToTarget("Comment7")
		Goto XDeath2		
	C8:
		TNT1 A 0 A_GiveToTarget("Comment8")
		Goto XDeath2		
	C9:	
		TNT1 A 0 A_GiveToTarget("Comment9")
		Goto XDeath2		
	C10:	
		TNT1 A 0 A_GiveToTarget("Comment10")
		Goto XDeath2
	XDeath2:	
	    TNT1 AAA 0 A_SpawnItem("AlienBlood", 0, 45)
		TNT1 A 0 A_PlaySound("misc/xdeath4c")
		EXPL A 0 A_CustomMissile ("AlienGibTorsoRunner", 35, 0, random (0, 360), 2, random (10, 90))
		EXPL A 0 A_CustomMissile ("AlienGibRunnerHead", 45, 0, random (0, 360), 2, random (10, 90))
		EXPL A 0 A_CustomMissile ("AlienGibRunnerArm1", 35, 0, random (0, 360), 2, random (10, 90))
		EXPL A 0 A_CustomMissile ("AlienGibRunnerArm2", 35, 0, random (0, 360), 2, random (10, 90))
		EXPL AA 0 A_CustomMissile ("AlienGibRunnerLeg", 15, 0, random (0, 360), 2, random (10, 90))
		EXPL A 0 A_CustomMissile ("AlienGibRunnerTail", 35, 0, random (0, 360), 2, random (10, 90))
		EXPL AAAAA 0 A_CustomMissile ("FlyingAcidRidiculous", 45, 0, random (0, 360), 2, random (40, 90))
		EXPL AAAAA 0 A_CustomMissile ("FlyingAcidBig1", 35, 0, random (0, 360), 2, random (10, 90))
		EXPL AAAAA 0 A_CustomMissile ("FlyingAcidBig2", 35, 0, random (0, 360), 2, random (40, 90))
		TNT1 A 0 A_Scream
		TNT1 A 0 A_NoBlocking
		Stop
	Crush:
		TNT1 A 0 A_ClearTarget	
		EXPL A 0 A_CustomMissile ("AlienGibRunnerHead", 45, 0, random (0, 360), 2, random (10, 90))
		TNT1 A 0 A_PlaySound("misc/xdeath4c")
		EXPL A 0 A_CustomMissile ("AlienGibRunnerArm1", 35, 0, random (0, 360), 2, random (10, 90))
		EXPL A 0 A_CustomMissile ("AlienGibRunnerArm2", 35, 0, random (0, 360), 2, random (10, 90))
		EXPL AA 0 A_CustomMissile ("AlienGibRunnerLeg", 15, 0, random (0, 360), 2, random (10, 90))
		EXPL A 0 A_CustomMissile ("AlienGibRunnerTail", 35, 0, random (0, 360), 2, random (10, 90))
		EXPL AAAAA 0 A_CustomMissile ("FlyingAcidRidiculous", 45, 0, random (0, 360), 2, random (40, 90))
		EXPL AAAAA 0 A_CustomMissile ("FlyingAcidBig1", 35, 0, random (0, 360), 2, random (10, 90))
		EXPL AAAAA 0 A_CustomMissile ("FlyingAcidBig2", 35, 0, random (0, 360), 2, random (40, 90))
		Stop
	}
}	

Share this post


Link to post

I couldn't find out why he would become visible, I'm under an impression that he theoretically shouldn't. Try the following:
- Move the Melee2, Pain2 and Avoid2 blocks below their Melee, Pain and Avoid counterparts.
- Remove the lines with "TNT1 A 0 A_JumpIf(128, "See")" and "TNT1 A 0 A_JumpIf(128, "See2")", they're redundant.
- Post the rest of the actor's definition (everything above States{}, including the actor header), maybe it uses some esoteric flags or properties that would explain the odd behavior, or if it inherits from a different actor, it may be inheriting undesired Missile states or something.

Share this post


Link to post

Actually, no need. You were right. It inherits from another actor that had an empty "missile" state. I deleted "missile" from its description, and voila!

The next question is this: Can I make it so that the decoy distracts monsters that are infighting with my monster?

Share this post


Link to post

I'm afraid that you can't. There is no function that would automatically affect all monsters (or even detect any of them) that currently targeted the monster who called the function. At most, you would get a reference to the one (and only one) monster/player whom your monster itself is targeting at the moment, and possibly do something to affect that one monster/player.

Share this post


Link to post

That would actually be good enough. How would that work? Also--I'm trying to use A_KillChildren to make the projection vanish when the monster dies. Doesn't seem to be working. If you review the code I posted, I was using A_SpawnItem to make it appear, but I did change it to A_SpawnItemEx like the wiki instructs. Anything else I need to do?

Share this post


Link to post

In A_SpawnItemEx, set SXF_SETMASTER flag to enable KillChildren function, and possibly SXF_TRANSFERPOINTERS to make the decoy go after the monster's target. Then you can also make the decoy to somehow (regardless of distance) deal 0 damage to the target upon being spawned or periodically, which itself should distract the target.

Share this post


Link to post

So far SXF_SETMASTER isn't working. Is there a step I'm missing? The Projection spawns just like it's supposed to, and I put A_KillChildren in every single death state the parent has. I'm not sure what else is required, but true to form for my luck, something else is. Could it be because I'm using inventory?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×