Page 1 of 2
A_Chase flag; wandering movement
Posted: Fri Jul 16, 2010 8:52 pm
by Ceeb
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.
Re: A_Chase flag; wandering movement
Posted: Fri Jul 16, 2010 10:03 pm
by NeuralStunner
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
Posted: Fri Jul 16, 2010 10:35 pm
by Ceeb
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.
Re: A_Chase flag; wandering movement
Posted: Fri Jul 16, 2010 11:26 pm
by Caligari87
A_Wander with 0-length A_Jump statements could fake it fairly well, I think.
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
}
}
Seems to work "okay".

Re: A_Chase flag; wandering movement
Posted: Fri Jul 16, 2010 11:52 pm
by NeuralStunner
One notable problem with that: It would be unaffected by MapInfo's ability to modify monster agressiveness.
Re: A_Chase flag; wandering movement
Posted: Sat Jul 17, 2010 3:45 pm
by Ænima
NeuralStunner wrote:One notable problem with that: It would be unaffected by MapInfo's ability to modify monster agressiveness.
Does anybody actually make use of that anyways?
Re: A_Chase flag; wandering movement
Posted: Sat Jul 17, 2010 3:49 pm
by Enjay
Yes.
Re: A_Chase flag; wandering movement
Posted: Sat Jul 17, 2010 3:50 pm
by NeuralStunner
Ænima wrote:Does anybody actually make use of that anyways?
I do. It's awesome for increasing the difficulty without boosting the Health of monsters to ridiculous levels.
Re: A_Chase flag; wandering movement
Posted: Wed Jul 21, 2010 3:44 am
by The Ultimate DooMer
I use it for skill settings.
Re: A_Chase flag; wandering movement
Posted: Wed Jul 21, 2010 1:11 pm
by Ænima
Okay then ... my bad.

Re: A_Chase flag; wandering movement
Posted: Thu Jul 22, 2010 6:10 am
by Cutmanmike
Caligari_87 wrote:code
Try this:
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
}
}
You may want to call A_Chase/A_Stop more often though because it may not be aggressive enough.
Re: A_Chase flag; wandering movement
Posted: Thu Jul 22, 2010 6:38 am
by Zippy
Why the A_Stop calls? A_Chase has a CHF_DONTMOVE flag that will prevent the actor from moving.
Re: A_Chase flag; wandering movement
Posted: Thu Jul 22, 2010 7:16 am
by Cutmanmike
Oh, that's even better then. Should make the code shorter. If only you could combine functions

Re: A_Chase flag; wandering movement
Posted: Fri Aug 20, 2010 9:35 pm
by Ishiam
I agree it would allow for much smoother movement.

Re: A_Chase flag; wandering movement
Posted: Sat Aug 21, 2010 7:44 am
by Ghastly
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:
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
The 16 in the A_Chase is the CHF_DONTMOVE flag. This gives the wandering movement, but should attack as normal.