In the previous chapter, we learned how easy it was to give some life to the NPCs in our levels. The Half-Life series of games are classified as First-Person Shooters; what's the fun if we can't get some bullets flying? This chapter will guide you through setting up scripted battles with your NPCs. We could script nearly every footstep of every NPC if we wanted to, but that would take a long time, and the results wouldn't be great unless we spent even more time tweaking every detail. The Source engine has a fantastic AI system that we can manipulate through the use of assaults, squads, and hint nodes. Let's begin.
In this chapter, we will cover the following topics:
Using hint nodes to guide battles
Using assaults to assign battle goals
Using squads
Setting up lines of defense