I love the smell of UnrealEd crashing in the morning. – tarquin
Difference between revisions of "Legacy:Pawn (UT)"
(A little editing. Added to do.) |
|||
(One intermediate revision by the same 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 48: | Line 47: | ||
* See [[Legacy:Pawn (UT)/Functions|other functions]] for the rest of the functions available to a pawn. | * See [[Legacy:Pawn (UT)/Functions|other functions]] for the rest of the functions available to a pawn. | ||
− | == | + | ==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. | 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. | ||
Line 59: | Line 55: | ||
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. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:Legacy Class (UT)|{{PAGENAME}}]] | [[Category:Legacy Class (UT)|{{PAGENAME}}]] | ||
− |
Revision as of 04:03, 28 November 2004
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.
Contents
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
- Bot (UT) – Unreal Tournament bots
- Bots – Unreal 1 bots
- FlockMasterPawn
- FlockPawn
- PlayerPawn – This means you
- Scout
- ScriptedPawn – Monsters, basically
- StationaryPawn – Cannons
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:
- See graphics and animation functions for the list of functions used to handle pawn animations and graphics.
- See movement functions for the list of functions used to handle pawn movement.
- See AI functions for the list of functions used by the AI system to bring the pawns to life.
- See events for the list of events available to pawns.
- See sound functions for the list of functions used to handle sounds
- See inventory functions for the functions available to a pawn when it needs to manipulate its inventory.
- See other functions for the rest of the functions available to a pawn.
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.