| 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).

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:

Comments

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.


Category Class (UT)


Daemonica: It could just be me missing the point, but can Pawns utilise the Tick function, more specifically can player pawns? I can't seem to get it going :(

Foxpaw: Any actor can use Tick. I'm not sure about Objects below actor. If you are still having trouble with Tick you could post your code on the Help Desk page. I couldn't tell you what the problem you are having would be based on that description. Delete Reply When You See It.

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Image Uploads

Random Page

Recent Changes

Offline Wiki

Unreal Engine

Console Commands

Terminology

Mapping Topics

Mapping Lessons

UnrealEd Interface

Questions&Answers

Scripting Topics

Scripting Lessons

Making Mods

Class Tree

Questions&Answers

Modeling Topics

Questions&Answers

Log In