My program doesn't have bugs. It just develops random features.

UE2:Controller (UT2004)

From Unreal Wiki, The Unreal Engine Documentation Site
Revision as of 09:56, 15 April 2010 by Wormbo (Talk | contribs) (added descriptions for latent functions)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
UT2004 Object >> Actor >> Controller
Package: 
Engine
Direct subclasses:
AIController, PlayerController
This class in other games:
U2, U2XMP, UE2Runtime, UT2003, UDK, UT3

Controller, the base class of players or AI.

Controllers are non-physical actors that can be attached to a Pawn to control its actions. PlayerControllers are used by human players to control pawns, while AIControllers implement the artificial intelligence for the pawns they control. Controllers take control of a pawn using their Possess() method, and relinquish control of the pawn by calling UnPossess().

Controllers receive notifications for many of the events occuring for the Pawn they are controlling. This gives the controller the opportunity to implement the behavior in response to this event, intercepting the event and superceding the Pawn's default behavior.

Constants[edit]

LATENT_MOVETOWARD[edit]

Value: 503

InLatentExecution() number for MoveToward() function.

Properties[edit]

Property group 'Controller'[edit]

PlayerReplicationInfoClass[edit]

Type: class<PlayerReplicationInfo>

This controller's default type of PlayerReplicationInfo. Note that certain game types, e.g. Onslaught and Assault, override this property through their default mutators, e.g. ONSDefaultMut and ASMutator.

Default value: Class'Engine.PlayerReplicationInfo'

Internal variables[edit]

See Controller internal variables.

Default values[edit]

Property Value
bHidden True
bHiddenEd True
bOnlyRelevantToOwner True
RemoteRole ROLE_None
RotationRate
Member Value
Pitch 3072
Roll 2048
Yaw 30000

Functions[edit]

Latent functions[edit]

FinishRotation[edit]

native(508) final latent function FinishRotation ()

Waits until the controlled Pawn's Rotation.Yaw reaches the DesiredRotation.Yaw ± 2000URU (about 11 degrees), or no longer controlling a Pawn.

MoveTo[edit]

native(500) final latent function MoveTo (Object.Vector NewDestination, optional Actor ViewFocus, optional bool bShouldWalk)

Sets up the Pawn to move towards the specified location, optionally specifying a focus actor the Pawn should face during the move. Template:SetWalking() is called if Pawn.bIsWalking doesn't match the bShouldWalk parameter.

The function determines the approximate movement time required to reach the target and sets MoveTimer accordingly. Then it waits until either the MoveTimer drops below zero (it is counted down automatically, but can also be set from UnrealScript) or the Pawn starts falling, e.g. due to getting thrown into the air by weapon fire.

MoveToward[edit]

native(502) final latent function MoveToward (Actor NewTarget, optional Actor ViewFocus, optional float DestinationOffset, optional bool bUseStrafing, optional bool bShouldWalk)

Sets up the Pawn to move towards the specified actor, optionally specifying a focus actor the Pawn should face during the move. Template:SetWalking() is called if Pawn.bIsWalking doesn't match the bShouldWalk parameter.

If the target actor is a NavigationPoint and either has bSpecialMove set to True, its SuggestMovePreparation() function is called.

That function is also called if the target NavigationPoint is reached via a forced path and has bSpecialForced set to True. Otherwise PrepareForMove() or Controller events.MayDodgeToMoveTarget() is called to prepare for the move.

The function determines the approximate movement time required to reach the target and sets MoveTimer accordingly. Then it waits until either the MoveTimer drops below zero (it is counted down automatically, but can also be set from UnrealScript) or the Pawn starts falling, e.g. due to getting thrown into the air by weapon fire, or the MoveTarget is cleared.

WaitForLanding[edit]

native(527) final latent function WaitForLanding ()

If the controlled Pawn is in falling physics, this function waits until the Pawn changes to another physics type. If falling lasts more than four seconds, LongFall() is called every tick until either GotoState() is used to stop latent function execution or the Pawn landed.

Exec functions[edit]

SwitchToBestWeapon[edit]

exec function SwitchToBestWeapon ()


Native functions[edit]

actorReachable[edit]

native(520) final function bool actorReachable (Actor anActor)


AddController[edit]

native(529) final function AddController ()


CanMakePathTo[edit]

native final function bool CanMakePathTo (Actor A)


CanSee[edit]

native(533) final function bool CanSee (Pawn Other)


EAdjustJump[edit]

native(523) final function Object.Vector EAdjustJump (float BaseZ, float XYSpeed)


EndClimbLadder[edit]

native function EndClimbLadder ()


FindBestInventoryPath[edit]

native(540) final function Actor FindBestInventoryPath (out float MinWeight)


FindBestSuperPickup[edit]

native final function Actor FindBestSuperPickup (float MaxDist)


FindPathTo[edit]

native(518) final function Actor FindPathTo (Object.Vector aPoint)


FindPathToIntercept[edit]

native final function Actor FindPathToIntercept (Pawn P, Actor RouteGoal, optional bool bWeightDetours)


FindPathToward[edit]

native(517) final function Actor FindPathToward (Actor anActor, optional bool bWeightDetours)


FindPathTowardNearest[edit]

native final function Actor FindPathTowardNearest (class<NavigationPointGoalClass, optional bool bWeightDetours)


FindRandomDest[edit]

native(525) final function NavigationPoint FindRandomDest ()


InLatentExecution[edit]

native final function bool InLatentExecution (int LatentActionNumber)


LineOfSightTo[edit]

native(514) final function bool LineOfSightTo (Actor Other)


PickAnyTarget[edit]

native(534) final function Actor PickAnyTarget (out float bestAim, out float bestDist, Object.Vector FireDir, Object.Vector projStart)


PickTarget[edit]

native(531) final function Pawn PickTarget (out float bestAim, out float bestDist, Object.Vector FireDir, Object.Vector projStart, float MaxRange)


PickWallAdjust[edit]

native(526) final function bool PickWallAdjust (Object.Vector HitNormal)


pointReachable[edit]

native(521) final function bool pointReachable (Object.Vector aPoint)


RemoveController[edit]

native(530) final function RemoveController ()


StopWaiting[edit]

native function StopWaiting ()


Events[edit]

See Controller events.

Other instance functions[edit]

See Controller instance functions.

States[edit]

Dead[edit]

Ignores: HearNoise, KilledBy, SeePlayer

Dead.PawnDied[edit]

function PawnDied (Pawn P)

Overrides: PawnDied (global)


Dead.ServerReStartPlayer[edit]

function ServerReStartPlayer ()

Overrides: ServerReStartPlayer (global)


GameEnded[edit]

Ignores: Falling, HearNoise, HitWall, KilledBy, NotifyBump, NotifyHeadVolumeChange, NotifyPhysicsVolumeChange, ReceiveWarning, SeePlayer, TakeDamage

GameEnded.BeginState[edit]

event BeginState ()

Overrides: Object.BeginState (global)


RoundEnded[edit]

Ignores: Falling, HearNoise, HitWall, KilledBy, NotifyBump, NotifyHeadVolumeChange, NotifyPhysicsVolumeChange, ReceiveWarning, SeePlayer, TakeDamage

RoundEnded.BeginState[edit]

event BeginState ()

Overrides: Object.BeginState (global)