I search for solutions in this order: Past Code, Unreal Source, Wiki, BUF, groups.yahoo, google, screaming at monitor. – RegularX
Difference between revisions of "UE2:Controller events (UT2004)"
(Auto-generated page) |
m (added (most) descriptions) |
||
Line 5: | Line 5: | ||
| parent2 = Object | | parent2 = Object | ||
}} | }} | ||
− | + | ||
==Events== | ==Events== | ||
====AIHearSound==== | ====AIHearSound==== | ||
{{code|event '''AIHearSound''' ({{cl|Actor}} '''Actor''', [[int]] '''Id''', {{cl|Sound}} '''S''', {{tl|Vector|Object|structs}} '''SoundLocation''', {{tl|Vector|Object|structs}} '''Parameters''', [[bool]] '''Attenuate''')}} | {{code|event '''AIHearSound''' ({{cl|Actor}} '''Actor''', [[int]] '''Id''', {{cl|Sound}} '''S''', {{tl|Vector|Object|structs}} '''SoundLocation''', {{tl|Vector|Object|structs}} '''Parameters''', [[bool]] '''Attenuate''')}} | ||
− | + | Called for every sound this Controller's {{tl|Pawn||Controller internal variables}} hears. {{cl|PlayerController}}s receive the {{tl|ClientHearSound||PlayerController}}() event instead, which natively forwards the sound to the audio subsystem for actual playback. (Also see {{tl|PlaySound|Actor|native functions}}().) | |
====AllowDetourTo==== | ====AllowDetourTo==== | ||
{{code|event [[bool]] '''AllowDetourTo''' ({{cl|NavigationPoint}} '''N''')}} | {{code|event [[bool]] '''AllowDetourTo''' ({{cl|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 {{tl|DetourWeight|NavigationPoint}}().) | |
====DelayedWarning==== | ====DelayedWarning==== | ||
{{code|event '''DelayedWarning''' ()}} | {{code|event '''DelayedWarning''' ()}} | ||
− | < | + | Called when a {{tl|WarningProjectile||Controller internal variables}} is set and the time index specified in {{tl|WarningDelay||Controller internal variables}} has passed. The WarningProjectile property is reset to <code>None</code> after this event returns to prevent it from firing again. (Also see {{tl|ReceiveProjectileWarning|Bot|instance functions}}().) |
====Desireability==== | ====Desireability==== | ||
{{code|event [[float]] '''Desireability''' ({{cl|Pickup}} '''P''')}} | {{code|event [[float]] '''Desireability''' ({{cl|Pickup}} '''P''')}} | ||
− | + | Called by {{tl|FindBestInventoryPath||Controller}}() to rate individual Pickups. By default this just forwards the call to {{tl|BotDesireability|Pickup}}(). | |
====Destroyed==== | ====Destroyed==== | ||
Line 32: | Line 32: | ||
'''Overrides:''' {{tl|Destroyed|Actor|events}} | '''Overrides:''' {{tl|Destroyed|Actor|events}} | ||
− | + | Removes this Controller from the Level.{{tl|ControllerList||LevelInfo}}, notifies the {{cl|GameInfo}} via {{tl|Logout||GameInfo instance functions}}() and destroyes the {{tl|PlayerReplicationInfo||Controller internal variables}}. | |
====EnemyNotVisible==== | ====EnemyNotVisible==== | ||
{{code|event '''EnemyNotVisible''' ()}} | {{code|event '''EnemyNotVisible''' ()}} | ||
− | + | If the Controller has a valid {{tl|Enemy||Controller internal variables}} the native code performs visibility checks (like the {{tl|LineOfSightTo||Controller}}() function) once in a while. If such a check fails, the EnemyNotVisible() event is called. | |
====HearNoise==== | ====HearNoise==== | ||
{{code|event '''HearNoise''' ([[float]] '''Loudness''', {{cl|Actor}} '''NoiseMaker''')}} | {{code|event '''HearNoise''' ([[float]] '''Loudness''', {{cl|Actor}} '''NoiseMaker''')}} | ||
− | + | Called for every noise this Controller's {{tl|Pawn||Controller internal variables}} hears. Noises can be generated by any Actor with an [[Instigator]] via {{tl|MakeNoise||Actor native functions}}(). | |
====LongFall==== | ====LongFall==== | ||
{{code|event '''LongFall''' ()}} | {{code|event '''LongFall''' ()}} | ||
− | < | + | Called during {{tl|WaitForLanding||Controller}}() if the Pawn is still in <code>PHYS_Falling</code> after 4 seconds. |
====MayDodgeToMoveTarget==== | ====MayDodgeToMoveTarget==== | ||
{{code|event '''MayDodgeToMoveTarget''' ()}} | {{code|event '''MayDodgeToMoveTarget''' ()}} | ||
− | + | May be called from {{tl|MoveToward||Controller}}() if the player could [[liandri:dodge|dodge]] towards the destination. Actual dodging should be performed here. The {{cl|Bot}} class, for example, also considers using "Translocator hopping" here, i.e. use the Translocator simply because it's faster than walking. | |
====MayFall==== | ====MayFall==== | ||
{{code|event '''MayFall''' ()}} | {{code|event '''MayFall''' ()}} | ||
− | < | + | Called when the Pawn approaches a ledge. By setting {{tl|bCanJump|Pawn}} to <code>False</code>, the Controller can prevent its Pawn from walking off the ledge. |
====MissedDodge==== | ====MissedDodge==== | ||
{{code|event '''MissedDodge''' ()}} | {{code|event '''MissedDodge''' ()}} | ||
− | + | {{expand}} | |
====MonitoredPawnAlert==== | ====MonitoredPawnAlert==== | ||
{{code|event '''MonitoredPawnAlert''' ()}} | {{code|event '''MonitoredPawnAlert''' ()}} | ||
− | + | Called if a {{tl|MonitoredPawn||Controller internal variables}} 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 {{tl|StartMonitoring||Controller instance functions}}().) | |
====NotifyBump==== | ====NotifyBump==== | ||
{{code|event [[bool]] '''NotifyBump''' ({{cl|Actor}} '''Other''')}} | {{code|event [[bool]] '''NotifyBump''' ({{cl|Actor}} '''Other''')}} | ||
− | + | Called before the Pawn's {{tl|Bump||Actor events}}() event. Return <code>True</code> to prevent Pawn.Bump() from being called. | |
====NotifyFallingHitWall==== | ====NotifyFallingHitWall==== | ||
{{code|event '''NotifyFallingHitWall''' ({{tl|Vector|Object|structs}} '''HitNormal''', {{cl|Actor}} '''Wall''')}} | {{code|event '''NotifyFallingHitWall''' ({{tl|Vector|Object|structs}} '''HitNormal''', {{cl|Actor}} '''Wall''')}} | ||
− | < | + | Called instead of {{tl|NotifyHitWall}}() if {{tl|bNotifyFallingHitWall||Controller internal variables}} is <code>True</code> and the Pawn hits a wall while falling. Could be used e.g. to implement wall dodges, like the {{cl|Bot}} class does. |
====NotifyHeadVolumeChange==== | ====NotifyHeadVolumeChange==== | ||
{{code|event [[bool]] '''NotifyHeadVolumeChange''' ({{cl|PhysicsVolume}} '''NewVolume''')}} | {{code|event [[bool]] '''NotifyHeadVolumeChange''' ({{cl|PhysicsVolume}} '''NewVolume''')}} | ||
− | + | Called right before the Pawn's {{tl|HeadVolumeChange||Pawn events}}() event. Return <code>True</code> to prevent Pawn.HeadVolumeChange() from being called. | |
====NotifyHitMover==== | ====NotifyHitMover==== | ||
{{code|event '''NotifyHitMover''' ({{tl|Vector|Object|structs}} '''HitNormal''', {{cl|Mover}} '''Wall''')}} | {{code|event '''NotifyHitMover''' ({{tl|Vector|Object|structs}} '''HitNormal''', {{cl|Mover}} '''Wall''')}} | ||
− | + | May be called during {{tl|MoveTo||Controller}}() or {{tl|MoveToward||Controller}}() if the Pawn (unexpectedly) walks up against a {{cl|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 {{cl|AIController}}s. | ||
====NotifyHitWall==== | ====NotifyHitWall==== | ||
{{code|event [[bool]] '''NotifyHitWall''' ({{tl|Vector|Object|structs}} '''HitNormal''', {{cl|Actor}} '''Wall''')}} | {{code|event [[bool]] '''NotifyHitWall''' ({{tl|Vector|Object|structs}} '''HitNormal''', {{cl|Actor}} '''Wall''')}} | ||
− | + | Called right before the Pawn's {{tl|HitWall||Pawn events}}() event, unless {{tl|bNotifyFallingHitWall||Controller internal variables}} is <code>True</code> and the Pawn hits a wall while falling. Return <code>True</code> to prevent Pawn.HitWall() from being called. | |
====NotifyJumpApex==== | ====NotifyJumpApex==== | ||
{{code|event '''NotifyJumpApex''' ()}} | {{code|event '''NotifyJumpApex''' ()}} | ||
− | < | + | Called if {{tl|bNotifyApex||Controller internal variables}} is <code>True</code> and the Pawn reached the highest point of its jump, i.e. the Pawn no longer moves upwards. Bots use this to implement [[liandri:double jump|double jump]] or [[liandri:dodge jump|dodge jump]]s. |
====NotifyLanded==== | ====NotifyLanded==== | ||
{{code|event [[bool]] '''NotifyLanded''' ({{tl|Vector|Object|structs}} '''HitNormal''')}} | {{code|event [[bool]] '''NotifyLanded''' ({{tl|Vector|Object|structs}} '''HitNormal''')}} | ||
− | + | Called right before the Pawn's {{tl|Landed||Pawn events}}() event. Return <code>True</code> to prevent Pawn.Landed() from being called. | |
====NotifyMissedJump==== | ====NotifyMissedJump==== | ||
{{code|event '''NotifyMissedJump''' ()}} | {{code|event '''NotifyMissedJump''' ()}} | ||
− | + | {{expand}} | |
====NotifyPhysicsVolumeChange==== | ====NotifyPhysicsVolumeChange==== | ||
{{code|event [[bool]] '''NotifyPhysicsVolumeChange''' ({{cl|PhysicsVolume}} '''NewVolume''')}} | {{code|event [[bool]] '''NotifyPhysicsVolumeChange''' ({{cl|PhysicsVolume}} '''NewVolume''')}} | ||
− | + | Called right after the Pawn's {{tl|PhysicsVolumeChange||Actor events}}() event. | |
====NotifyPostLanded==== | ====NotifyPostLanded==== | ||
{{code|event '''NotifyPostLanded''' ()}} | {{code|event '''NotifyPostLanded''' ()}} | ||
− | + | Called right after the Pawn's {{tl|Landed||Pawn events}}() event if {{tl|bNotifyPostLanded||Controller internal variables}} is <code>True</code>. | |
====PostBeginPlay==== | ====PostBeginPlay==== | ||
Line 124: | Line 126: | ||
'''Overrides:''' {{tl|PostBeginPlay|Actor|events}} | '''Overrides:''' {{tl|PostBeginPlay|Actor|events}} | ||
− | < | + | Spawns and initializes the {{tl|PlayerReplicationInfo||Controller internal variables}}, unless {{tl|bIsPlayer||Controller internal variables}} is <code>False</code>. |
====PreBeginPlay==== | ====PreBeginPlay==== | ||
Line 131: | Line 133: | ||
'''Overrides:''' {{tl|PreBeginPlay|Actor|events}} | '''Overrides:''' {{tl|PreBeginPlay|Actor|events}} | ||
− | + | Adds this Controller to the Level.{{tl|ControllerList||LevelInfo}} before allowing the usual Level.Game.BaseMutator.{{tl|CheckRelevance||Mutator}}() logic to modify the newly spawned Controller. | |
====PrepareForMove==== | ====PrepareForMove==== | ||
{{code|event '''PrepareForMove''' ({{cl|NavigationPoint}} '''Goal''', {{cl|ReachSpec}} '''Path''')}} | {{code|event '''PrepareForMove''' ({{cl|NavigationPoint}} '''Goal''', {{cl|ReachSpec}} '''Path''')}} | ||
− | + | Called by {{tl|MoveToward||Controller}} 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==== | ====ReceiveWarning==== | ||
{{code|event '''ReceiveWarning''' ({{cl|Pawn}} '''shooter''', [[float]] '''projSpeed''', {{tl|Vector|Object|structs}} '''FireDir''')}} | {{code|event '''ReceiveWarning''' ({{cl|Pawn}} '''shooter''', [[float]] '''projSpeed''', {{tl|Vector|Object|structs}} '''FireDir''')}} | ||
− | + | Called from {{tl|InstantWarnTarget|Controller|instance functions}}(), {{tl|ReceiveProjectileWarning|Controller|instance functions}}(), {{tl|AdjustAim|TurretController}}() and also {{cl|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==== | ====RenderOverlays==== | ||
Line 148: | Line 154: | ||
'''Overrides:''' {{tl|RenderOverlays|Actor|instance functions}} | '''Overrides:''' {{tl|RenderOverlays|Actor|instance functions}} | ||
− | + | 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==== | ====SeeMonster==== | ||
{{code|event '''SeeMonster''' ({{cl|Pawn}} '''Seen''')}} | {{code|event '''SeeMonster''' ({{cl|Pawn}} '''Seen''')}} | ||
− | < | + | Called when seeing a Pawn with a Controller that has {{tl|bIsPlayer||Controller internal variables}} set to <code>False</code>. |
====SeePlayer==== | ====SeePlayer==== | ||
{{code|event '''SeePlayer''' ({{cl|Pawn}} '''Seen''')}} | {{code|event '''SeePlayer''' ({{cl|Pawn}} '''Seen''')}} | ||
− | < | + | Called when seeing a Pawn with a Controller that has {{tl|bIsPlayer||Controller internal variables}} set to <code>True</code>. |
====SetupSpecialPathAbilities==== | ====SetupSpecialPathAbilities==== | ||
{{code|event '''SetupSpecialPathAbilities''' ()}} | {{code|event '''SetupSpecialPathAbilities''' ()}} | ||
− | + | Called during path finding. {{cl|Bot}}s use this to specify whether they can translocate or impact jump. | |
====SoakStop==== | ====SoakStop==== | ||
{{code|event '''SoakStop''' ([[string]] '''problem''')}} | {{code|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==== | ====SuperDesireability==== | ||
{{code|event [[float]] '''SuperDesireability''' ({{cl|Pickup}} '''P''')}} | {{code|event [[float]] '''SuperDesireability''' ({{cl|Pickup}} '''P''')}} | ||
− | + | Called by {{tl|FindBestSuperPickup||Controller}}() to rate individual Pickups. By default this just forwards the call to {{tl|BotDesireability|Pickup}}(). |
Latest revision as of 04:19, 10 April 2010
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[edit]
AIHearSound[edit]
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[edit]
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[edit]
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[edit]
Called by FindBestInventoryPath() to rate individual Pickups. By default this just forwards the call to Pickup.BotDesireability().
Destroyed[edit]
Overrides: Actor.Destroyed
Removes this Controller from the Level.ControllerList, notifies the GameInfo via Logout() and destroyes the PlayerReplicationInfo.
EnemyNotVisible[edit]
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[edit]
Called for every noise this Controller's Pawn hears. Noises can be generated by any Actor with an Instigator via MakeNoise().
LongFall[edit]
Called during WaitForLanding() if the Pawn is still in PHYS_Falling
after 4 seconds.
MayDodgeToMoveTarget[edit]
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[edit]
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[edit]
Please help improve this article or section by expanding it. |
MonitoredPawnAlert[edit]
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[edit]
Called before the Pawn's Bump() event. Return True
to prevent Pawn.Bump() from being called.
NotifyFallingHitWall[edit]
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[edit]
Called right before the Pawn's HeadVolumeChange() event. Return True
to prevent Pawn.HeadVolumeChange() from being called.
NotifyHitMover[edit]
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[edit]
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[edit]
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[edit]
Called right before the Pawn's Landed() event. Return True
to prevent Pawn.Landed() from being called.
NotifyMissedJump[edit]
Please help improve this article or section by expanding it. |
NotifyPhysicsVolumeChange[edit]
Called right after the Pawn's PhysicsVolumeChange() event.
NotifyPostLanded[edit]
Called right after the Pawn's Landed() event if bNotifyPostLanded is True
.
PostBeginPlay[edit]
Overrides: Actor.PostBeginPlay
Spawns and initializes the PlayerReplicationInfo, unless bIsPlayer is False
.
PreBeginPlay[edit]
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[edit]
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[edit]
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[edit]
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[edit]
Called when seeing a Pawn with a Controller that has bIsPlayer set to False
.
SeePlayer[edit]
Called when seeing a Pawn with a Controller that has bIsPlayer set to True
.
SetupSpecialPathAbilities[edit]
Called during path finding. Bots use this to specify whether they can translocate or impact jump.
SoakStop[edit]
Used for debugging pathing problems, but not actually called from native code. Whenever bots run into a pathing problem, they call this function.
SuperDesireability[edit]
Called by FindBestSuperPickup() to rate individual Pickups. By default this just forwards the call to Pickup.BotDesireability().