EDIT: I will update this soon when I've figured out the ai_battleline etc
In this tut I'll show you how to make a citizen with an RPG run to spot then aim said RPG using scripted sequences.
Start off with a room, playerstart and an npc_citizen. In the npc_citizen's object properties dialog give it a name of bob, and give him an RPG via the weapon property.
Next, put a scripted_sequence entity where you want your npc to run to.
Then open up the Object Properties dialog and enter this:
Name: a1
Target NPC: bob
Pre Action Idle Animation: Idle_RPG_Relaxed
Action Animation: Idle_RPG_Aim
Post Action Animation: Idle_RPG_Aim
Move to Position: Run
These (and the other boxes/options) will do the following:
NAME: The sequence's name
PARENT: If you want it to move about about set the parent to a tracktrain or something
PITCH YAW ROLL (YZX): It's orientation. The targeted NPCs will face in this direction after the sequence
TARGET NPC: Name of targeted npc (ie "bob") or npc type (ie npc_citizen)
PRE ACTION IDLE ANIMATION: the animation played before the sequence takes affect
ACTION ANIMATION: The animation played when the npc reaches the sequence
POST ACTION ANIMATION: the animation played afterwards
CUSTOM MOVE ANIMATION: Only used if the Custom Move option is used for the Move to Position box
SEARCH RADIUS: I think this if you put in something like npc_zombie instead of a specific entity name in the Target NPC box. Any npc of that type will move to here if its in this radius
REPEAT RATE MS: How long it will be repeated if the Repeatable Flag is checked I think. In miliseconds.
MOVE TO POSITION: How the npc will get to this position (run, walk etc). If set to Custom Animation it will use the anim in the Custom Move Animation box.
NEXT SCRIPT: The name of the next sequence that your npc will go to after this one
Then go to the Flags section and tick the following:
Start on Spawn
Override AI (AI scripted sequence!)
Loop in Post Idle
Start on Spawn will make the npc run the sequence as soon as it spawns
Override AI effectively makes it an ai_scripted_sequence from HL1
Loop in Post Idle makes the npc loop the post idle animation
The other flags do the following:
Repeatable: makes it possible for this to happen again. And again. And so on
Leave Corpse: Obvious. If the NPC dies it leaves a corpse if this is checked
No Script Movement: The NPC will not run to the sequence if this is checked
Priority Script: I think this makes the npc use this sequence's Post Idle Animation if there are multiple sequences.
And there you go!
In this tut I'll show you how to make a citizen with an RPG run to spot then aim said RPG using scripted sequences.
Start off with a room, playerstart and an npc_citizen. In the npc_citizen's object properties dialog give it a name of bob, and give him an RPG via the weapon property.
Next, put a scripted_sequence entity where you want your npc to run to.
Then open up the Object Properties dialog and enter this:
Name: a1
Target NPC: bob
Pre Action Idle Animation: Idle_RPG_Relaxed
Action Animation: Idle_RPG_Aim
Post Action Animation: Idle_RPG_Aim
Move to Position: Run
These (and the other boxes/options) will do the following:
NAME: The sequence's name
PARENT: If you want it to move about about set the parent to a tracktrain or something
PITCH YAW ROLL (YZX): It's orientation. The targeted NPCs will face in this direction after the sequence
TARGET NPC: Name of targeted npc (ie "bob") or npc type (ie npc_citizen)
PRE ACTION IDLE ANIMATION: the animation played before the sequence takes affect
ACTION ANIMATION: The animation played when the npc reaches the sequence
POST ACTION ANIMATION: the animation played afterwards
CUSTOM MOVE ANIMATION: Only used if the Custom Move option is used for the Move to Position box
SEARCH RADIUS: I think this if you put in something like npc_zombie instead of a specific entity name in the Target NPC box. Any npc of that type will move to here if its in this radius
REPEAT RATE MS: How long it will be repeated if the Repeatable Flag is checked I think. In miliseconds.
MOVE TO POSITION: How the npc will get to this position (run, walk etc). If set to Custom Animation it will use the anim in the Custom Move Animation box.
NEXT SCRIPT: The name of the next sequence that your npc will go to after this one
Then go to the Flags section and tick the following:
Start on Spawn
Override AI (AI scripted sequence!)
Loop in Post Idle
Start on Spawn will make the npc run the sequence as soon as it spawns
Override AI effectively makes it an ai_scripted_sequence from HL1
Loop in Post Idle makes the npc loop the post idle animation
The other flags do the following:
Repeatable: makes it possible for this to happen again. And again. And so on
Leave Corpse: Obvious. If the NPC dies it leaves a corpse if this is checked
No Script Movement: The NPC will not run to the sequence if this is checked
Priority Script: I think this makes the npc use this sequence's Post Idle Animation if there are multiple sequences.
And there you go!