A_Chase flag; wandering movement
Moderator: GZDoom Developers
A_Chase flag; wandering movement
I'm trying to make an enemy that acknowledges that it's chasing the player and should attack him, but wanders normally rather than chasing him, as if calling A_Wander. Can a flag be added to allow mindless wandering in A_Chase?
Edit:
I would suggest the name CHF_WANDER.
Edit:
I would suggest the name CHF_WANDER.
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: A_Chase flag; wandering movement
I like this idea. A monster could stop to shoot at the Player, but still move erratically (like the bats in those games
).

Re: A_Chase flag; wandering movement
Yeah.
This is meant for "friendly" marines who you can piss off, but they don't actively seek the player. Just shoot him on sight and keep on with their business.

- Caligari87
- Admin
- Posts: 6230
- Joined: Thu Feb 26, 2004 3:02 pm
- Preferred Pronouns: He/Him
- Contact:
Re: A_Chase flag; wandering movement
A_Wander with 0-length A_Jump statements could fake it fairly well, I think. Seems to work "okay".

Code: Select all
actor newzombie : zombieman replaces zombieman
{
States
{
See:
POSS AABB 4 A_Wander
POSS CCDD 4 A_Wander
TNT1 A 0 A_JumpIfTargetInLOS("Missile",360)
loop
Missile:
TNT1 A 0 A_Jump(128,"See")
POSS E 10 A_FaceTarget
POSS F 8 A_PosAttack
POSS E 8
goto See
}
}

- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: A_Chase flag; wandering movement
One notable problem with that: It would be unaffected by MapInfo's ability to modify monster agressiveness.
Re: A_Chase flag; wandering movement
Does anybody actually make use of that anyways?NeuralStunner wrote:One notable problem with that: It would be unaffected by MapInfo's ability to modify monster agressiveness.
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: A_Chase flag; wandering movement
I do. It's awesome for increasing the difficulty without boosting the Health of monsters to ridiculous levels.Ænima wrote:Does anybody actually make use of that anyways?
- The Ultimate DooMer
- Posts: 2109
- Joined: Tue Jul 15, 2003 5:29 pm
- Location: Industrial Zone
Re: A_Chase flag; wandering movement
I use it for skill settings.
Re: A_Chase flag; wandering movement
Okay then ... my bad. 

- Cutmanmike
- Posts: 11353
- Joined: Mon Oct 06, 2003 3:41 pm
- Operating System Version (Optional): Windows 10
- Location: United Kingdom
- Contact:
Re: A_Chase flag; wandering movement
Try this:Caligari_87 wrote:code
Code: Select all
actor newzombie : zombieman replaces zombieman
{
States
{
See:
POSS AABB 4 A_Wander
TNT1 A 0 A_Chase
TNT1 A 0 A_Stop
POSS CCDD 4 A_Wander
TNT1 A 0 A_Chase
TNT1 A 0 A_Stop
loop
}
}
Re: A_Chase flag; wandering movement
Why the A_Stop calls? A_Chase has a CHF_DONTMOVE flag that will prevent the actor from moving.
- Cutmanmike
- Posts: 11353
- Joined: Mon Oct 06, 2003 3:41 pm
- Operating System Version (Optional): Windows 10
- Location: United Kingdom
- Contact:
Re: A_Chase flag; wandering movement
Oh, that's even better then. Should make the code shorter. If only you could combine functions 

Re: A_Chase flag; wandering movement
I agree it would allow for much smoother movement. 

Re: A_Chase flag; wandering movement
Isham, quite a bump.
@Cutman: A_Stop wouldn't affect movement from A_Chase, since A_Chase movement is more akin to teleporting (it moves the actor's Speed every time it's called). Also, this would work better:
The 16 in the A_Chase is the CHF_DONTMOVE flag. This gives the wandering movement, but should attack as normal.
@Cutman: A_Stop wouldn't affect movement from A_Chase, since A_Chase movement is more akin to teleporting (it moves the actor's Speed every time it's called). Also, this would work better:
Code: Select all
See:
POSS A 0 A_Chase("", "Missile", 16)
POSS A 4 A_Wander
POSS A 0 A_Chase("", "Missile", 16)
POSS A 4 A_Wander
POSS B 0 A_Chase("", "Missile", 16)
POSS B 4 A_Wander
POSS B 0 A_Chase("", "Missile", 16)
POSS B 4 A_Wander
POSS C 0 A_Chase("", "Missile", 16)
POSS C 4 A_Wander
POSS C 0 A_Chase("", "Missile", 16)
POSS C 4 A_Wander
POSS D 0 A_Chase("", "Missile", 16)
POSS D 4 A_Wander
POSS D 0 A_Chase("", "Missile", 16)
POSS D 4 A_Wander
Loop