UnrealScript Game Programming Cookbook

(Chris Devlin) #1

Crafting Pickups


90

Moving is one of the categories in which actions for AI fall into, while the other is anything
that is not moving. Moving may be as simple as following another pawn, or tracking a freshly
spawned health pickup, while the other category contains things such as aiming or firing
a weapon.


The bots, or computer controlled pawns, can be configured to have a multitude of
preconfigured attitudes or reactions towards events. For example, you can write a script that
instructs the bot to run for cover after taking damage, or to only fire after being fired upon.


We won't cover any of that in depth, but we will cover how to attract pawns towards our
newly created pickups in this chapter, and we'll get more in depth with their intelligence
in the following chapter.


Pickups


Pickups in UDK are similar to pickups in just about any other game; however, they can serve
a variety of purposes. In a first person area shooter, such as the Unreal Tournament series
or Quake III Arena, they can be used to adjust a pawn's properties by temporarily increasing
a weapon's damage, providing invulnerability, or even invisibility.


They are generally used in games to add an item to a pawn's inventory, such as ammunition
for a particular weapon, additional armor for protection, or restoring a player's health, like the
following example:


We can not only change what a pickup offers a player, but also how it looks, whether or not it
is animated, who can/cannot acquire the item, and how attracted an AI bot is to it. We'll be
covering all of those things in the following chapter.

Free download pdf