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.
Patrolling monster issue
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.
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.
-
- Posts: 598
- Joined: Fri Jun 24, 2005 3:19 am
- Location: Makin tracks with jetboots
Re: Patrolling monster issue
This (http://zdoom.org/wiki/A_JumpIfCloser) might be the solution.
-
- Posts: 598
- Joined: Fri Jun 24, 2005 3:19 am
- Location: Makin tracks with jetboots
Re: Patrolling monster issue
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.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49234
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Patrolling monster issue
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.
)
(Sometimes, reading the docs can actually be useful.

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