Book Image

Source SDK Game Development Essentials

By : Brett Joseph Bernier
Book Image

Source SDK Game Development Essentials

By: Brett Joseph Bernier

Overview of this book

Table of Contents (18 chapters)
Source SDK Game Development Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating squads


You'll probably notice that the NPCs fend for themselves. There's no communication, there's no guarding one another, they run as individuals, and they die alone. Squads can be used to change battle behavior and amplify the effect of a group in combat.

Your first squad

The only way to create a squad is to give a group of NPCs the same squad name. In fact, that's really all the work you have to do! NPCs within the same squad will call out enemies, cover each other, inform squad mates of enemy locations, and call for help when they need it. So long as you have a decent array of navigation and hint nodes, simply assigning NPCs to a squad is all the work needed to increase their effectiveness in the battle.

Scripting a flank

Using some entities we've learned about already, we can script a flank on the citizens inside the house. Select six of the combine soldiers and assign them the names alpha_soldier01-alpha_soldier06. Put them in a squad called alpha. We will be using a math_counter...