UnrealScript Game Programming Cookbook

(Chris Devlin) #1
Chapter 4

91

Fortunately, UDK has provided a great template for us to work from, so we'll be using what
they've provided and make additional changes to suit our needs.


Let's start by tracing the classes that our pickups will inherit from:


Actor is the base class of all gameplay objects. It offers functions for the animation, physics,
sounds, and networking for objects in UDK, which is explained as follows:


f NavigationPoint is organized into a network to provide AIControllers the
ability to determine paths to destinations throughout a level.
f PickupFactory is where our class finds begin to take shape. It becomes active when
touched by a valid toucher, or actor that we define should be able to accept this pickup.
f UDKPickupFactory is largely responsible for how our pickup is perceived inside the
game. Our materials are created from this class, as are other aesthetics such as how
frequently the base of our pickup pulses and whether or not our pickup can rotate.
f UTPickupFactory provides much of what is necessary for a first person shooter,
that is, it updates the player's HUD and inventory in Unreal Tournament, and an
additional bot AI is illustrated here.

From those base classes the PickupFactory splits into four distinct classes, each of which
provides unique functionality. These are given as follows:


f UTWeaponLocker and UTWeaponPickupFactory: Similar classes are used for
picking up new weapons
f UTPowerupPickupFactory: This adds power-ups, such as improved jumping,
quad damage, and temporary invulnerability
f UTItemPickupFactory: This contains health, ammo, and armor

The trick with creating your own pickups, or UnrealScript in general, is to find a template
that best suits your need, and either extend from that and override the functions and default
properties you need to change, or create your own pickup class that extends from UT or UDK
pickup factories.

Free download pdf