Cleanup is going to take awhile, so the site is back up but editing has been disabled.

Ai Assaults

From HalfLife 2 Knowledge Base

Jump to: navigation, search

Contents


Introduction

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 split into two parts, a quckstart guide that runs through the absolute basics of setting up an assault, and a detailed tutorials which goes through all the various options and issues. Both tutorials assume basic knowledge of making rooms, adding entities and setting up outputs.

Quick Start Tutorial

NB: UPDATE, THIS PROCESS NOW WORKS WITH NPC'S OTHER THAN JUST COMBINE SOLDIERS

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. There are ways to check the node network is functional (expand later)

3. Place NPCs and player start. Add three npc_combine_s 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 in the other area, give them weapons and rotate them to face the direction from which the assault will come. Add a 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_rallypoint 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. Create an ai_goal_assault entity. This entity controls which NPC's will assault, and when. Set the name to 'triggerAssault' Rally Point to 'assault_rally_1', Actors to Effect to 'combine_1', Search Type to Entity Name, Start Active to Yes (this will make the NPC's move to the rally point immediately)

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 'triggerAssault' (your ai_goal_assault), using the input 'beginAssault'. Now when the button is pressed, it should signal the combine to proceed from their rally points to the assault point.

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.

As an alternative, you can set the ai_goal_assault to start inactive, in which case you can send it an 'activate' input which will cause the NPC's to move to their rally points, then start the assault with a beginAssault input.

Detailed tutorial

incomplete

Rally Points

Assault Points

Personal tools