Patrolling monster issue

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
ant1991331
Posts: 598
Joined: Fri Jun 24, 2005 3:19 am
Location: Makin tracks with jetboots

Patrolling monster issue

Post by ant1991331 »

I've been using Thing_SetGoal for a monster of mine and for some reason, like something else I mentioned before, he has a "LOOKALLAROUND" flag automatically, and as soon as you're in his LOS (as in a 360 degree LOS), no matter the distance, he will start chasing you. Is there a way to get around this?

I've already made a custom state for him that makes him move slower using A_Chase without Active sounds.
User avatar
lukas
Posts: 586
Joined: Sun Apr 04, 2010 10:37 am
Location: Belgrade, Serbia

Re: Patrolling monster issue

Post by lukas »

This (http://zdoom.org/wiki/A_JumpIfCloser) might be the solution.
ant1991331
Posts: 598
Joined: Fri Jun 24, 2005 3:19 am
Location: Makin tracks with jetboots

Re: Patrolling monster issue

Post by ant1991331 »

He'll still stop patrolling to attack me. I had thought of using +FRIENDLY while he's patrolling, but then he'd still stop to follow me around.
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: Patrolling monster issue

Post by Graf Zahl »

You can set in the [wiki]Thing_SetGoal[/wiki] special if the monster is supposed to keep patrolling. You alternatively can use ACS, too, to change this behavior on the fly.

(Sometimes, reading the docs can actually be useful. ;))
ant1991331
Posts: 598
Joined: Fri Jun 24, 2005 3:19 am
Location: Makin tracks with jetboots

Re: Patrolling monster issue

Post by ant1991331 »

Ah I see. I didn't see that last argument, so would this mean it would break out of patrolling if it actually sees the target or would it ignore? I guess if it'll ignore I could use A_JumpIfTargetInLOS
ant1991331
Posts: 598
Joined: Fri Jun 24, 2005 3:19 am
Location: Makin tracks with jetboots

Re: Patrolling monster issue

Post by ant1991331 »

Bump.

I did some testing just recently, and I used that extra parameter in Thing_Hate and set it to 1. It does mostly what I want it to do - they don't leave their goal and still move towards it, and will only attack enemies nearby.

But

After they've reached their goal, and know of an enemy that is in sight, they will leave the goal and attack them. This completely ignores the monster's sight distance check in A_LookEx, is there a way I can prevent them from doing this? Even if I use A_ClearTarget they will still go towards the enemy.

Keep in mind, the enemy is far beyond 96 units away from the monster, and his sight range is 96.

EDIT: Using A_ClearTarget and forcing the monster back into the Spawn state does not fix this, and they'll still want to go attack something.
I forgot to mention that these monsters are spawned via a player, and are automatically given +FRIENDLY
Locked

Return to “Editing (Archive)”