Snarkpit Articles


This tutorial decribes how to use the assault behaviour to co-ordinate attacks from the Combine in single-player HL2 mapping. Assaults allow you to control where and when the Combine will attack, and how they will behave during the assault. This tutorial is a quckstart guide that runs through the absolute basics of setting up an assault, and assumes knowledge of making rooms, adding entities and setting up outputs.

1. Build yourself a quick environment for a firefight, it needs two areas for placing your opposing combatants so that they cant see eachother at map spawn. So a big box with a wall in the middle, or a pair of rooms with a couple of corridors between them will do fine.

2. Place info_node or info_node_hint entites at regular centres around the map, everywhere you want your npcs to be able to move. If the Combine cant work out the way to their assault point using the node network, the assault will fail.

3. Place NPCs and player start. Add three npc_combine_s entities in one area and give them all the same entity name, ie combine_1, and all the same squad name, ie. combine_squad_1. Add three npc_citizen entities in the other area, give them weapons and rotate them to face the direction from which the assault will come. Add an info_player_start in the citizen area where the Combine cant see you, or the Combine will attack you when the map starts.

4. Place the rally points and assault point. Each NPC that will take part in the assault needs it own rally point to begin at, so create 3 assault_rallypoints in front of the Combine soldiers, and give them all the same name, ie. assault_rally_1. Then create an assault_assaultpoint in the area where your citizens are, and give it a name, ie. assault_point_1. Go back to your rally points, select all of them (hold down ctrl) and set the assault point to assault_point_1.

5. Trigger the assault. Set up a basic func_button in front of the player start, and create a new output for it. Set the output to OnPressed, target the entity combine_1 (your Combine soldier squad), using the input 'assault', and type in the additional parameter as the name of the rally points- in this case assault_rally_1. Now when the button is pressed, it should signal the combine to proceed to their rally points, from whence they will begin their assault automatically.

6. Compile and run. Seeing as you are hiding where they cant see you, a good trick is to type sv_cheats 1 and mat_wireframe 1 in the console, then you can see the combines wireframes running around to the rally points before they get to you.

Note: So far I have only been able to get combine soldiers to carry out assault behaviours. Other npcs have an assault input, but the console reports 'input unhandled' if you try to order them to assault.


Post ReplyView Topic
Discussion
0 starsPosted by Flynn on Fri Jan 5th 2007 at 10:19am

Lol what's the point? As soon as the combine see you they assault you anyway :S
0 starsPosted by keved on Mon Nov 14th 2005 at 12:34am

Not entirely accurate because an ai_goal_assault is also needed.
0 starsPosted by Xsjado on Mon Feb 14th 2005 at 7:39pm

Nice work, very helpful.
0 starsPosted by Random on Thu Dec 30th 2004 at 8:14am

Thanks! very useful.
0 starsPosted by Guessmyname on Fri Dec 24th 2004 at 5:11pm

Damn, I've been having trouble with these - I couldn't figure out how to select the attacking squad. Good tut
Post ReplyView Topic