Monster moving and standing still

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
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Monster moving and standing still

Post by Ghastly »

Edit: Okay, I apparantly didn't know what +STANDSTILL did exactly. Is there a way to make a monster alternate between standing still (but still able to attack) and moving?
Nevermind this wrote:I'm trying to make a monster alternate between standing still and walking, and the only way I know of to make this is by using A_ChangeFlag to switch +STANDSTILL on and off.

Unfortunately, +STANDSTILL doesn't seem to be one of the flags A_ChangeFlag can change. So before I start up a feature suggestion thread, is there anything else I need to know about that flag that would make it not work?
User avatar
Kate
... in rememberance ...
Posts: 2975
Joined: Tue Jul 15, 2003 8:06 pm

Post by Kate »

The STANDSTILL flag will only affect a monster that does not have a target, that is, is wandering around aimlessly with nothing to attack. Once a monster wakes up, the flag has no effect.
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Post by Ghastly »

I know, I realized that 5 minutes after I posted. It was one of my not-so-rare stupid moments, lol.

But is there any way I can make this monster stand still while being able to attack? Like A_ExtChase with a don't move parameter? I need a speed value on it, so it can move, too.
User avatar
Skippy
Posts: 695
Joined: Sun Nov 20, 2005 9:57 am
Location: Belfast, NI

Post by Skippy »

[wiki]A_Look2[/wiki] might help you. Check out the Strife peasants for example usage.

EDIT: An alternative method, probably closer to what you need, is to use [wiki]ACS_ExecuteAlways[/wiki] in the monster's DECORATE to stop the actor from moving, by changing its speed with [wiki]SetActorProperty[/wiki]. This would be best done with a random state jump.

Code: Select all

States
{
   Spawn:
      TROO AB 4 A_Look
      Loop
   See:
      TNT1 A 0 A_Jump(128, "Standstill")
      Goto Move
   Standstill:
      TNT1 A 0 ACS_ExecuteAlways(100,0,0,0) // script sets actor's speed to 0
      TROO AAAA 4 A_Chase
      TNT1 A 0 A_Jump(128, "Move")
      Goto Standstill+1
   Move:
      TNT1 A 0 ACS_ExecuteAlways(101,0,0,0) // script sets actor's speed to 1.0
      TROO ABCD 4 A_Chase
      TNT1 A 0 A_Jump(128, "Standstill")
      Goto Move+1
   Missile:
      etc....
Might be worth a shot? I haven't tested it, and you'll need GZDoom or the SVN of ZDoom.
Locked

Return to “Editing (Archive)”