| Home Page | Recent Changes | Preferences

Pawn (UT)

UT :: Actor (UT) >> Pawn (Package: Engine)

This is the base class for objects in the game that are controlled by players or AI: Players themselves, monsters, bots and objects like the team cannon.

The game automatically maintains a linked list of all Pawns in game, starting with Level.PawnList and pointing to the next Pawn with the NextPawn variable. (The native function AddPawn in the PreBeginPlay event adds a new pawn to that list, while the native function RemovePawn which is called in the Destroyed event removes it from the list.) Rather than using an expensive AllActors iterator loop to access all Pawn actors, traveling this list is much more efficient:

local Pawn ThisPawn;

for (ThisPawn = Level.PawnList; ThisPawn != None; ThisPawn = ThisPawn.NextPawn)
{
  // do something with ThisPawn
}

Note that this list only exists on the server. It's empty on network clients (but then again, they don't know of all Pawns in game all the time anyway; see Replication).

See Pawn for the UT200x version of this class.

AI Related Definitions (crap section name alert)

eAttitude
An enumerated type that describes a pawn's attitude towards another pawn (i.e. the player).
eIntelligence
An enumerated type that describes the pawn's ability to navigate around the level.

Known subclasses

States

Dying
The dying state. This function is called when the pawn has died or been killed. If the pawn is a player pawn then by default it is simply hidden. If this is not the case then the pawn is destroyed.
GameEnded
The state entered when the game has ended. This state is almost always used to place the pawn into an "inactive" mode e.g. the pawn will no longer run around the level searching for inventory items and targets but will stand still chilling out (just prior to nipping down the pub for a swift pint one presumes).

Functions

The functions of this class are being documented on the following subpages:

Related Topics

Discussion

Unknown: For ease of management the functions have been split into logical groups. Some of the functions are not quite in the right place but that will change over time as I spot which ones they are and then move them into the right place.

Because this is the abstract class for all pawns (monsters, bots, players, etc) in the Unreal game many functions and events exist here simply as placeholders. This then allows the implementation of specifc functionality within subclasses while still allowing the code to work at a very general level.

It's well worth reading through the creating actors and objects page to get a description of what happens when an Actor, the superclass of Pawn, is created.

SuperApe: This page could use a little filling in: Properties, important functions, etc.


Category Class (UT)

Category To Do – Fill in Properties and important functions.

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Image Uploads

Random Page

Recent Changes

Offline Wiki

Unreal Engine

Console Commands

Terminology

FAQs

Help Desk

Mapping Topics

Mapping Lessons

UnrealEd Interface

UnrealScript Topics

UnrealScript Lessons

Making Mods

Class Tree

Modeling Topics

Chongqing Page

Log In