I love the smell of UnrealEd crashing in the morning. – tarquin
Difference between revisions of "UE2:Controller (UT2004)"
(Auto-generated page) |
m (added descriptions for latent functions) |
||
Line 5: | Line 5: | ||
| abstract = yes | | abstract = yes | ||
}} | }} | ||
− | |||
Controller, the base class of players or AI. | Controller, the base class of players or AI. | ||
− | Controllers are non-physical actors that can be attached to a | + | Controllers are non-physical actors that can be attached to a {{cl|Pawn}} to control |
− | its actions. | + | its actions. {{cl|PlayerController}}s are used by human players to control pawns, while |
− | + | {{cl|AIController}}s implement the artificial intelligence for the pawns they control. | |
− | Controllers take control of a pawn using their Possess() method, and relinquish | + | Controllers take control of a pawn using their {{tl|Possess||Controller instance functions}}() method, and relinquish |
− | control of the pawn by calling UnPossess(). | + | control of the pawn by calling {{tl|UnPossess||Controller instance functions}}(). |
Controllers receive notifications for many of the events occuring for the Pawn they | Controllers receive notifications for many of the events occuring for the Pawn they | ||
Line 18: | Line 17: | ||
in response to this event, intercepting the event and superceding the Pawn's default | in response to this event, intercepting the event and superceding the Pawn's default | ||
behavior. | behavior. | ||
− | |||
− | |||
==Constants== | ==Constants== | ||
Line 25: | Line 22: | ||
'''Value:''' 503 | '''Value:''' 503 | ||
− | + | {{tl|InLatentExecution}}() number for {{tl|MoveToward}}() function. | |
==Properties== | ==Properties== | ||
Line 32: | Line 29: | ||
'''Type:''' [[class]]<{{cl|PlayerReplicationInfo}}> | '''Type:''' [[class]]<{{cl|PlayerReplicationInfo}}> | ||
− | + | This controller's default type of PlayerReplicationInfo. Note that certain game types, e.g. [[liandri:Onslaught|Onslaught]] and [[liandri:Assault|Assault]], override this property through their default mutators, e.g. {{cl|ONSDefaultMut}} and {{cl|ASMutator}}. | |
'''Default value:''' [[Types#Class|Class]]'{{cl|PlayerReplicationInfo|Engine}}' | '''Default value:''' [[Types#Class|Class]]'{{cl|PlayerReplicationInfo|Engine}}' | ||
Line 78: | Line 75: | ||
{{code|native(508) final latent function '''FinishRotation''' ()}} | {{code|native(508) final latent function '''FinishRotation''' ()}} | ||
− | + | Waits until the controlled Pawn's Rotation.Yaw reaches the DesiredRotation.Yaw ± 2000[[URU]] (about 11 degrees), or no longer controlling a Pawn. | |
====MoveTo==== | ====MoveTo==== | ||
{{code|native(500) final latent function '''MoveTo''' ({{tl|Vector|Object|structs}} '''NewDestination''', optional {{cl|Actor}} '''ViewFocus''', optional [[bool]] '''bShouldWalk''')}} | {{code|native(500) final latent function '''MoveTo''' ({{tl|Vector|Object|structs}} '''NewDestination''', optional {{cl|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. {{SetWalking|Pawn|events}}() is called if {{tl|bIsWalking|Pawn|internal variables}} doesn't match the ''bShouldWalk'' parameter. | |
+ | |||
+ | The function determines the approximate movement time required to reach the target and sets {{tl|MoveTimer||Controller internal variables}} 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==== | ====MoveToward==== | ||
{{code|native(502) final latent function '''MoveToward''' ({{cl|Actor}} '''NewTarget''', optional {{cl|Actor}} '''ViewFocus''', optional [[float]] '''DestinationOffset''', optional [[bool]] '''bUseStrafing''', optional [[bool]] '''bShouldWalk''')}} | {{code|native(502) final latent function '''MoveToward''' ({{cl|Actor}} '''NewTarget''', optional {{cl|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. {{SetWalking|Pawn|events}}() is called if {{tl|bIsWalking|Pawn|internal variables}} doesn't match the ''bShouldWalk'' parameter. |
+ | |||
+ | If the target actor is a {{cl|NavigationPoint}} and either has {{tl|bSpecialMove||NavigationPoint}} set to <code>True</code>, its {{tl|SuggestMovePreparation||NavigationPoint}}() function is called. | ||
+ | |||
+ | That function is also called if the target NavigationPoint is reached via a [[forced path]] and has {{tl|bSpecialForced||NavigationPoint}} set to <code>True</code>. Otherwise {{tl|PrepareForMove||Controller events}}() or {{tl|MayDodgeToMoveTarget|Controller events}}() is called to prepare for the move. | ||
+ | |||
+ | The function determines the approximate movement time required to reach the target and sets {{tl|MoveTimer||Controller internal variables}} 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 {{tl|MoveTarget||Controller internal variables}} is cleared. | ||
====WaitForLanding==== | ====WaitForLanding==== | ||
{{code|native(527) final latent function '''WaitForLanding''' ()}} | {{code|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, {{tl|LongFall||Controller events}}() is called every tick until either {{tl|GotoState||Object}}() is used to stop latent function execution or the Pawn landed. | |
===Exec functions=== | ===Exec functions=== |
Latest revision as of 07:56, 15 April 2010
Contents
- 1 Constants
- 2 Properties
- 3 Functions
- 3.1 Latent functions
- 3.2 Exec functions
- 3.3 Native functions
- 3.3.1 actorReachable
- 3.3.2 AddController
- 3.3.3 CanMakePathTo
- 3.3.4 CanSee
- 3.3.5 EAdjustJump
- 3.3.6 EndClimbLadder
- 3.3.7 FindBestInventoryPath
- 3.3.8 FindBestSuperPickup
- 3.3.9 FindPathTo
- 3.3.10 FindPathToIntercept
- 3.3.11 FindPathToward
- 3.3.12 FindPathTowardNearest
- 3.3.13 FindRandomDest
- 3.3.14 InLatentExecution
- 3.3.15 LineOfSightTo
- 3.3.16 PickAnyTarget
- 3.3.17 PickTarget
- 3.3.18 PickWallAdjust
- 3.3.19 pointReachable
- 3.3.20 RemoveController
- 3.3.21 StopWaiting
- 3.4 Events
- 3.5 Other instance functions
- 4 States
- Package:
- Engine
- Direct subclasses:
- AIController, PlayerController
- This class in other games:
- UE2Runtime, U2, U2XMP, UT2003, UT3, UDK
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 |
|
Functions[edit]
Latent functions[edit]
FinishRotation[edit]
Waits until the controlled Pawn's Rotation.Yaw reaches the DesiredRotation.Yaw ± 2000URU (about 11 degrees), or no longer controlling a Pawn.
MoveTo[edit]
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]
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]
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]
Native functions[edit]
actorReachable[edit]
AddController[edit]
CanMakePathTo[edit]
CanSee[edit]
EAdjustJump[edit]
EndClimbLadder[edit]
FindBestInventoryPath[edit]
FindBestSuperPickup[edit]
FindPathTo[edit]
FindPathToIntercept[edit]
FindPathToward[edit]
FindPathTowardNearest[edit]
FindRandomDest[edit]
InLatentExecution[edit]
LineOfSightTo[edit]
PickAnyTarget[edit]
PickTarget[edit]
PickWallAdjust[edit]
pointReachable[edit]
RemoveController[edit]
StopWaiting[edit]
Events[edit]
See Controller events.
Other instance functions[edit]
See Controller instance functions.
States[edit]
Dead[edit]
Ignores: HearNoise, KilledBy, SeePlayer
Dead.PawnDied[edit]
Overrides: PawnDied (global)
Dead.ServerReStartPlayer[edit]
Overrides: ServerReStartPlayer (global)
GameEnded[edit]
Ignores: Falling, HearNoise, HitWall, KilledBy, NotifyBump, NotifyHeadVolumeChange, NotifyPhysicsVolumeChange, ReceiveWarning, SeePlayer, TakeDamage
GameEnded.BeginState[edit]
Overrides: Object.BeginState (global)
RoundEnded[edit]
Ignores: Falling, HearNoise, HitWall, KilledBy, NotifyBump, NotifyHeadVolumeChange, NotifyPhysicsVolumeChange, ReceiveWarning, SeePlayer, TakeDamage
RoundEnded.BeginState[edit]
Overrides: Object.BeginState (global)