My program doesn't have bugs. It just develops random features.
UE2:Controller events (UT2004)
Object >> Actor >> Controller (events) |
Contents
- 1 Events
- 1.1 AIHearSound
- 1.2 AllowDetourTo
- 1.3 DelayedWarning
- 1.4 Desireability
- 1.5 Destroyed
- 1.6 EnemyNotVisible
- 1.7 HearNoise
- 1.8 LongFall
- 1.9 MayDodgeToMoveTarget
- 1.10 MayFall
- 1.11 MissedDodge
- 1.12 MonitoredPawnAlert
- 1.13 NotifyBump
- 1.14 NotifyFallingHitWall
- 1.15 NotifyHeadVolumeChange
- 1.16 NotifyHitMover
- 1.17 NotifyHitWall
- 1.18 NotifyJumpApex
- 1.19 NotifyLanded
- 1.20 NotifyMissedJump
- 1.21 NotifyPhysicsVolumeChange
- 1.22 NotifyPostLanded
- 1.23 PostBeginPlay
- 1.24 PreBeginPlay
- 1.25 PrepareForMove
- 1.26 ReceiveWarning
- 1.27 RenderOverlays
- 1.28 SeeMonster
- 1.29 SeePlayer
- 1.30 SetupSpecialPathAbilities
- 1.31 SoakStop
- 1.32 SuperDesireability
- Controller events in other games:
- UT3, UDK
- Other member categories for this class:
- instance functions, internal variables
Events
AIHearSound
Called for every sound this Controller's Pawn hears. PlayerControllers receive the ClientHearSound() event instead, which natively forwards the sound to the audio subsystem for actual playback. (Also see Actor.PlaySound().)
AllowDetourTo
Called by the path finding logic to determine whether the player wants to take a detour to the specified NavigationPoint on its route to the actual destination. (Also see NavigationPoint.DetourWeight().)
DelayedWarning
Called when a WarningProjectile is set and the time index specified in WarningDelay has passed. The WarningProjectile property is reset to None
after this event returns to prevent it from firing again. (Also see Bot.ReceiveProjectileWarning().)
Desireability
Called by FindBestInventoryPath() to rate individual Pickups. By default this just forwards the call to Pickup.BotDesireability().
Destroyed
Overrides: Actor.Destroyed
Removes this Controller from the Level.ControllerList, notifies the GameInfo via Logout() and destroyes the PlayerReplicationInfo.
EnemyNotVisible
If the Controller has a valid Enemy the native code performs visibility checks (like the LineOfSightTo() function) once in a while. If such a check fails, the EnemyNotVisible() event is called.
HearNoise
Called for every noise this Controller's Pawn hears. Noises can be generated by any Actor with an Instigator via MakeNoise().
LongFall
Called during WaitForLanding() if the Pawn is still in PHYS_Falling
after 4 seconds.
MayDodgeToMoveTarget
May be called from MoveToward() if the player could dodge towards the destination. Actual dodging should be performed here. The Bot class, for example, also considers using "Translocator hopping" here, i.e. use the Translocator simply because it's faster than walking.
MayFall
Called when the Pawn approaches a ledge. By setting Pawn.bCanJump to False
, the Controller can prevent its Pawn from walking off the ledge.
MissedDodge
Please help improve this article or section by expanding it. |
MonitoredPawnAlert
Called if a MonitoredPawn is set and either this Controller's doesn't have a Pawn anymore (e.g. because it died) or the MonitoredPawn is moving away from this player's Pawn. (Also see StartMonitoring().)
NotifyBump
Called before the Pawn's Bump() event. Return True
to prevent Pawn.Bump() from being called.
NotifyFallingHitWall
Called instead of NotifyHitWall() if bNotifyFallingHitWall is True
and the Pawn hits a wall while falling. Could be used e.g. to implement wall dodges, like the Bot class does.
NotifyHeadVolumeChange
Called right before the Pawn's HeadVolumeChange() event. Return True
to prevent Pawn.HeadVolumeChange() from being called.
NotifyHitMover
May be called during MoveTo() or MoveToward() if the Pawn (unexpectedly) walks up against a Mover. Contact with lifts or doors is an expected contact when the AI wants to use them.
While being defined here, this event is actually only called for AIControllers.
NotifyHitWall
Called right before the Pawn's HitWall() event, unless bNotifyFallingHitWall is True
and the Pawn hits a wall while falling. Return True
to prevent Pawn.HitWall() from being called.
NotifyJumpApex
Called if bNotifyApex is True
and the Pawn reached the highest point of its jump, i.e. the Pawn no longer moves upwards. Bots use this to implement double jump or dodge jumps.
NotifyLanded
Called right before the Pawn's Landed() event. Return True
to prevent Pawn.Landed() from being called.
NotifyMissedJump
Please help improve this article or section by expanding it. |
NotifyPhysicsVolumeChange
Called right after the Pawn's PhysicsVolumeChange() event.
NotifyPostLanded
Called right after the Pawn's Landed() event if bNotifyPostLanded is True
.
PostBeginPlay
Overrides: Actor.PostBeginPlay
Spawns and initializes the PlayerReplicationInfo, unless bIsPlayer is False
.
PreBeginPlay
Overrides: Actor.PreBeginPlay
Adds this Controller to the Level.ControllerList before allowing the usual Level.Game.BaseMutator.CheckRelevance() logic to modify the newly spawned Controller.
PrepareForMove
Called by MoveToward if the Pawn can't take the current route directly, e.g. because the path is too narrow or involves falling that would hurt the Pawn.
This isn't used in stock code, but it could be used by custom AI to e.g. activate a teleportation device or prepare a jetpack for slowing down.
ReceiveWarning
Called from Controller.InstantWarnTarget(), Controller.ReceiveProjectileWarning(), TurretController.AdjustAim() and also ONSVehicle's native Tick code as a run-over warning. This can be used to dodge to the side, duck or jump to prevent being hit. If the shooter is an ONSVehicle, jumping or ducking should only be considered after making sure it's not a run-over warning.
A projSpeed of -1 means instant-hit, otherwise it's the speed of the incoming projectile or vehicle.
RenderOverlays
Overrides: Actor.RenderOverlays
This isn't actually a "real" event, i.e. it isn't called from native code and probably doesn't even have a native call stub because Actor defined it as standard function. It is empty here, just like in the Actor class.
SeeMonster
Called when seeing a Pawn with a Controller that has bIsPlayer set to False
.
SeePlayer
Called when seeing a Pawn with a Controller that has bIsPlayer set to True
.
SetupSpecialPathAbilities
Called during path finding. Bots use this to specify whether they can translocate or impact jump.
SoakStop
Used for debugging pathing problems, but not actually called from native code. Whenever bots run into a pathing problem, they call this function.
SuperDesireability
Called by FindBestSuperPickup() to rate individual Pickups. By default this just forwards the call to Pickup.BotDesireability().