Make Enemies Lose/Un- Target

Status
Not open for further replies.

spellwiz

Member
Hey, I'm looking for a way to make enemies that have already targeted the character to lose target. At the moment, I have custom 3 make the player 80% translucent, and have the flag PF_INVIS. Unfortunately, the flag PF_INVIS only stops enemies who have not yet targeted you, from targeting you. But any enemy who already has you targeted, continues chasing. Any ideas? :) :D <3
 
try checking for an enemy who has already targeted you and set their target to nil. then, enemies that have targeted you will stop targeting you until PF_INVIS is taken off of the player
 
Thanks for the idea!! This is what I ended with if anyone is wondering lol. Works perfectly, or I haven't ran into any bugs yet :P

//--------------------------------START OF INVISIBLE
if (player.cmd.buttons & BT_CUSTOM3)
and player.inviscd == 0
player.inviscd = 8
if player.invis == false
player.invis = true
for mobj in thinkers.iterate("mobj")
if (mobj.flags & MF_ENEMY or mobj.flags & MF_BOSS)
and mobj.target == player.mo
mobj.target = nil
end
end
else
player.invis = false
player.mo.flags2 = $1 & ~(MF2_SHADOW)
player.pflags = $1 & ~(PF_INVIS)
end
end
if player.inviscd == nil
player.inviscd = 0
elseif player.inviscd > 0
player.inviscd = $1-1
end
if player.invis == true
player.mo.flags2 = $1|MF2_SHADOW
player.pflags = $1|PF_INVIS
elseif player.invis == nil
player.invis = false
end

I do plan on adding in a time limit type system, just stoked I got it to work first =D
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top