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

UE2:Controller events (UT2004)

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
UT2004 Object >> Actor >> Controller (events)
Controller events in other games:
UT3, UDK
Other member categories for this class:
instance functions, internal variables


Events

AIHearSound

event AIHearSound (Actor Actor, int Id, Sound S, Object.Vector SoundLocation, Object.Vector Parameters, bool Attenuate)

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

event bool AllowDetourTo (NavigationPoint N)

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

event 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

event float Desireability (Pickup P)

Called by FindBestInventoryPath() to rate individual Pickups. By default this just forwards the call to Pickup.BotDesireability().

Destroyed

simulated event Destroyed ()

Overrides: Actor.Destroyed

Removes this Controller from the Level.ControllerList, notifies the GameInfo via Logout() and destroyes the PlayerReplicationInfo.

EnemyNotVisible

event 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

event HearNoise (float Loudness, Actor NoiseMaker)

Called for every noise this Controller's Pawn hears. Noises can be generated by any Actor with an Instigator via MakeNoise().

LongFall

event LongFall ()

Called during WaitForLanding() if the Pawn is still in PHYS_Falling after 4 seconds.

MayDodgeToMoveTarget

event 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

event 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

event MissedDodge ()


MonitoredPawnAlert

event 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

event bool NotifyBump (Actor Other)

Called before the Pawn's Bump() event. Return True to prevent Pawn.Bump() from being called.

NotifyFallingHitWall

event NotifyFallingHitWall (Object.Vector HitNormal, Actor Wall)

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

event bool NotifyHeadVolumeChange (PhysicsVolume NewVolume)

Called right before the Pawn's HeadVolumeChange() event. Return True to prevent Pawn.HeadVolumeChange() from being called.

NotifyHitMover

event NotifyHitMover (Object.Vector HitNormal, Mover Wall)

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

event bool NotifyHitWall (Object.Vector HitNormal, Actor Wall)

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

event 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

event bool NotifyLanded (Object.Vector HitNormal)

Called right before the Pawn's Landed() event. Return True to prevent Pawn.Landed() from being called.

NotifyMissedJump

event NotifyMissedJump ()


NotifyPhysicsVolumeChange

event bool NotifyPhysicsVolumeChange (PhysicsVolume NewVolume)

Called right after the Pawn's PhysicsVolumeChange() event.

NotifyPostLanded

event NotifyPostLanded ()

Called right after the Pawn's Landed() event if bNotifyPostLanded is True.

PostBeginPlay

event PostBeginPlay ()

Overrides: Actor.PostBeginPlay

Spawns and initializes the PlayerReplicationInfo, unless bIsPlayer is False.

PreBeginPlay

event 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

event PrepareForMove (NavigationPoint Goal, ReachSpec Path)

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

event ReceiveWarning (Pawn shooter, float projSpeed, Object.Vector FireDir)

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

simulated event RenderOverlays (Canvas Canvas)

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

event SeeMonster (Pawn Seen)

Called when seeing a Pawn with a Controller that has bIsPlayer set to False.

SeePlayer

event SeePlayer (Pawn Seen)

Called when seeing a Pawn with a Controller that has bIsPlayer set to True.

SetupSpecialPathAbilities

event SetupSpecialPathAbilities ()

Called during path finding. Bots use this to specify whether they can translocate or impact jump.

SoakStop

event SoakStop (string problem)

Used for debugging pathing problems, but not actually called from native code. Whenever bots run into a pathing problem, they call this function.

SuperDesireability

event float SuperDesireability (Pickup P)

Called by FindBestSuperPickup() to rate individual Pickups. By default this just forwards the call to Pickup.BotDesireability().