I don't need to test my programs. I have an error-correcting modem.

UE2:Controller events (UT2004)

From Unreal Wiki, The Unreal Engine Documentation Site
Revision as of 04:19, 10 April 2010 by Wormbo (Talk | contribs) (added (most) descriptions)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
UT2004 Object >> Actor >> Controller (events)
Controller events in other games:
Other member categories for this class:
instance functions, internal variables



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().)


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().)


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().)


event float Desireability (Pickup P)

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


simulated event Destroyed ()

Overrides: Actor.Destroyed

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


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.


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().


event LongFall ()

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


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.


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.


event MissedDodge ()


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().)


event bool NotifyBump (Actor Other)

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


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.


event bool NotifyHeadVolumeChange (PhysicsVolume NewVolume)

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


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.


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.


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.


event bool NotifyLanded (Object.Vector HitNormal)

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


event NotifyMissedJump ()


event bool NotifyPhysicsVolumeChange (PhysicsVolume NewVolume)

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


event NotifyPostLanded ()

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


event PostBeginPlay ()

Overrides: Actor.PostBeginPlay

Spawns and initializes the PlayerReplicationInfo, unless bIsPlayer is False.


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.


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.


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.


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.


event SeeMonster (Pawn Seen)

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


event SeePlayer (Pawn Seen)

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


event SetupSpecialPathAbilities ()

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


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.


event float SuperDesireability (Pickup P)

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