I love the smell of UnrealEd crashing in the morning. – tarquin

Difference between revisions of "Legacy:Pawn (UT)"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
m
m (Moved "Skill" from ScriptedPawn to Pawn, added hint concerning range)
 
(One intermediate revision by one other user not shown)
Line 8: Line 8:
 
local Pawn ThisPawn;
 
local Pawn ThisPawn;
  
for (ThisPawn = Level.PawnList; ThisPawn != None; ThisPawn = ThisPawn.NextPawn) {
+
for (ThisPawn = Level.PawnList; ThisPawn != None; ThisPawn = ThisPawn.NextPawn)
 +
{
 
   // do something with ThisPawn
 
   // do something with ThisPawn
 
}
 
}
Line 30: Line 31:
 
*[[Legacy:ScriptedPawn|ScriptedPawn]] – Monsters, basically
 
*[[Legacy:ScriptedPawn|ScriptedPawn]] – Monsters, basically
 
*[[Legacy:StationaryPawn|StationaryPawn]] – Cannons
 
*[[Legacy:StationaryPawn|StationaryPawn]] – Cannons
 +
 +
==Properties==
 +
 +
===AI===
 +
; Skill: Defines how good the pawn is at fighting. This stretches from their aim to the way and speed they move at. The higher number the better the pawn is. ''Level.Game.Difficulty'' influences this value also.<br />The event ''PreBeginPlay'' clamps the Skill between 0 and 3.
 +
  
 
==States ==
 
==States ==
Line 58: Line 65:
 
It's well worth reading through the [[Legacy:Creating_Actors_And_Objects|creating actors and objects]] page to get a description of what happens when an [[Legacy:Actor|Actor]], the superclass of Pawn, is created.
 
It's well worth reading through the [[Legacy:Creating_Actors_And_Objects|creating actors and objects]] page to get a description of what happens when an [[Legacy:Actor|Actor]], the superclass of Pawn, is created.
  
 +
'''SuperApe:''' This page could use a little filling in: Properties, important functions, etc.
 +
 +
----
 +
 +
[[:Category:Legacy Class (UT)]]
 +
 +
[[:Category:Legacy To Do]] &ndash; Fill in Properties and important functions.
 
[[Category:Legacy Class (UT)|{{PAGENAME}}]]
 
[[Category:Legacy Class (UT)|{{PAGENAME}}]]
 +
[[Category:Legacy To Do|{{PAGENAME}}]]

Latest revision as of 11:56, 11 June 2018

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)[edit]

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[edit]

Properties[edit]

AI[edit]

Skill
Defines how good the pawn is at fighting. This stretches from their aim to the way and speed they move at. The higher number the better the pawn is. Level.Game.Difficulty influences this value also.
The event PreBeginPlay clamps the Skill between 0 and 3.


States[edit]

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[edit]

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

Related Topics[edit]

Discussion[edit]

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:Legacy Class (UT)

Category:Legacy To Do – Fill in Properties and important functions.