UE2:LineOfSightTrigger (UT2004): Difference between revisions
Auto-generated page |
added descriptions |
||
Line 5: | Line 5: | ||
| parent3 = Object | | parent3 = Object | ||
}} | }} | ||
The line-of-sight trigger fires an event if a player looks in the direction of a specified actor while being within a certain distance from the LOS trigger and having a clear line of sight to that actor. The distance limitation is relative to the LOS trigger's location, while the direction and line of sight is relative to the target actor location. | |||
'''Note:''' This actor only works offline and for the server player on a listen server, but not for any clients on a listen/dedicated server. It does not care whether that player actually participates in the game or is just a spectator. | |||
but that | |||
==Properties== | ==Properties== | ||
Line 17: | Line 14: | ||
'''Type:''' [[bool]] | '''Type:''' [[bool]] | ||
Whether the LOS trigger is ready to fire its event if the player sees it. | |||
'''Default value:''' True | '''Default value:''' True | ||
Line 24: | Line 21: | ||
'''Type:''' [[int]] | '''Type:''' [[int]] | ||
How directly (in degrees) a player must be looking at the center of the actor marked by {{tl|SeenActorTag}}. | |||
'''Default value:''' 15 | '''Default value:''' 15 | ||
Line 31: | Line 28: | ||
'''Type:''' [[float]] | '''Type:''' [[float]] | ||
Maximum distance player can be from the LOS trigger to activate it. | |||
'''Default value:''' 3000.0 | '''Default value:''' 3000.0 | ||
Line 38: | Line 35: | ||
'''Type:''' [[name]] | '''Type:''' [[name]] | ||
[[Match the Tag]] of an actor which activates this LOS trigger when seen with this property's value. The LOS trigger will not work if this doesn't match the Tag of an existing actor in the level. | |||
===Internal variables=== | ===Internal variables=== | ||
Line 44: | Line 41: | ||
'''Type:''' [[bool]] | '''Type:''' [[bool]] | ||
Whether the LOS trigger was already activated. | |||
====OldTickTime==== | ====OldTickTime==== | ||
'''Type:''' [[float]] | '''Type:''' [[float]] | ||
''Used internally.'' | |||
====RequiredViewDir==== | ====RequiredViewDir==== | ||
'''Type:''' [[float]] | '''Type:''' [[float]] | ||
How directly player must be looking at {{tl|SeenActor}}. 1.0 = straight on, 0.75 = barely on screen. This value is calculated automatically from the {{tl|MaxViewAngle}}. | |||
====SeenActor==== | ====SeenActor==== | ||
'''Type:''' {{cl|Actor}} | '''Type:''' {{cl|Actor}} | ||
The actor specified by {{tl|SeenActorTag}} that needs to be looked at in order to activate this LOS trigger. | |||
===Default values=== | ===Default values=== | ||
Line 74: | Line 71: | ||
{{code|event '''PlayerSeesMe''' ({{cl|PlayerController}} '''P''')}} | {{code|event '''PlayerSeesMe''' ({{cl|PlayerController}} '''P''')}} | ||
Fires the LOS trigger's {{tl|Event||Actor properties}} the first time a player sees the trigger after it was enabled. If you want this function to be called again later, you need to manually set {{tl|bTriggered}} to ''False'' from another [[UnrealScript]] function as there's no way to do that automatically. | |||
====PostBeginPlay==== | ====PostBeginPlay==== | ||
Line 81: | Line 78: | ||
'''Overrides:''' {{tl|PostBeginPlay|Actor|events}} | '''Overrides:''' {{tl|PostBeginPlay|Actor|events}} | ||
Initializes the {{tl|RequiredViewDir}} and {{tl|SeenActor}} variables from {{tl|MaxViewAngle}} and {{tl|SeenActorTag}} respectively. | |||
====Trigger==== | ====Trigger==== | ||
Line 88: | Line 85: | ||
'''Overrides:''' {{tl|Trigger|Actor|events}} | '''Overrides:''' {{tl|Trigger|Actor|events}} | ||
Enables the LOS trigger. Once enabled, there is no way to disable it again, apart from manually setting the {{tl|bEnabled}} property to ''False'' from another [[UnrealScript]] function. |
Latest revision as of 12:35, 20 December 2008
- Package:
- Engine
- This class in other games:
The line-of-sight trigger fires an event if a player looks in the direction of a specified actor while being within a certain distance from the LOS trigger and having a clear line of sight to that actor. The distance limitation is relative to the LOS trigger's location, while the direction and line of sight is relative to the target actor location.
Note: This actor only works offline and for the server player on a listen server, but not for any clients on a listen/dedicated server. It does not care whether that player actually participates in the game or is just a spectator.
Properties
Property group 'LineOfSightTrigger'
bEnabled
Type: bool
Whether the LOS trigger is ready to fire its event if the player sees it.
Default value: True
MaxViewAngle
Type: int
How directly (in degrees) a player must be looking at the center of the actor marked by SeenActorTag.
Default value: 15
MaxViewDist
Type: float
Maximum distance player can be from the LOS trigger to activate it.
Default value: 3000.0
SeenActorTag
Type: name
Match the Tag of an actor which activates this LOS trigger when seen with this property's value. The LOS trigger will not work if this doesn't match the Tag of an existing actor in the level.
Internal variables
bTriggered
Type: bool
Whether the LOS trigger was already activated.
OldTickTime
Type: float
Used internally.
RequiredViewDir
Type: float
How directly player must be looking at SeenActor. 1.0 = straight on, 0.75 = barely on screen. This value is calculated automatically from the MaxViewAngle.
SeenActor
Type: Actor
The actor specified by SeenActorTag that needs to be looked at in order to activate this LOS trigger.
Default values
Property | Value |
---|---|
bCollideActors | False |
Events
PlayerSeesMe
Fires the LOS trigger's Event the first time a player sees the trigger after it was enabled. If you want this function to be called again later, you need to manually set bTriggered to False from another UnrealScript function as there's no way to do that automatically.
PostBeginPlay
Overrides: Actor.PostBeginPlay
Initializes the RequiredViewDir and SeenActor variables from MaxViewAngle and SeenActorTag respectively.
Trigger
Overrides: Actor.Trigger
Enables the LOS trigger. Once enabled, there is no way to disable it again, apart from manually setting the bEnabled property to False from another UnrealScript function.