A_Chase flag; wandering movement

Moderator: GZDoom Developers

User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

A_Chase flag; wandering movement

Post 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.
User avatar
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

Post 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 ;) ).
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

Re: A_Chase flag; wandering movement

Post 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.
User avatar
Caligari87
Admin
Posts: 6230
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: A_Chase flag; wandering movement

Post 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".

8-)
User avatar
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

Post by NeuralStunner »

One notable problem with that: It would be unaffected by MapInfo's ability to modify monster agressiveness.
User avatar
Ænima
Posts: 216
Joined: Thu Jul 08, 2010 10:39 pm

Re: A_Chase flag; wandering movement

Post 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?
User avatar
Enjay
 
 
Posts: 26991
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: A_Chase flag; wandering movement

Post by Enjay »

Yes.
User avatar
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

Post 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.
User avatar
The Ultimate DooMer
Posts: 2109
Joined: Tue Jul 15, 2003 5:29 pm
Location: Industrial Zone

Re: A_Chase flag; wandering movement

Post by The Ultimate DooMer »

I use it for skill settings.
User avatar
Ænima
Posts: 216
Joined: Thu Jul 08, 2010 10:39 pm

Re: A_Chase flag; wandering movement

Post by Ænima »

Okay then ... my bad. :P
User avatar
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

Post 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.
User avatar
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Re: A_Chase flag; wandering movement

Post by Zippy »

Why the A_Stop calls? A_Chase has a CHF_DONTMOVE flag that will prevent the actor from moving.
User avatar
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

Post by Cutmanmike »

Oh, that's even better then. Should make the code shorter. If only you could combine functions :ninja:
Ishiam
Posts: 3
Joined: Fri Aug 20, 2010 9:27 pm

Re: A_Chase flag; wandering movement

Post by Ishiam »

I agree it would allow for much smoother movement. :D
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Re: A_Chase flag; wandering movement

Post 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.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”