GetLineOfSight

From GECK
(Redirected from GetLOS)
Jump to: navigation, search
This article is incomplete. You can help by filling in any blank descriptions.
Further information might be found in a section of the discussion page. Please remove this message when no longer necessary.


A function included in the GECK for Fallout 3.

Description

Returns true if calling actor has line of sight to the specified object. Can only be called on actors.

Syntax

[help]
(bool) [actor:ref].GetLineOfSight target:ref 

Or:

(bool) [actor:ref].GetLOS target:ref

Example

testActor.GetLineOfSight TestMarker 

Notes

  • When called on a non-player actor, the supplied ObjectID must be another actor or getLOS will return false, even when the object is within line of sight.
  • When called on the player...
    • ...non-actors can be specified as an objectID.
      • If the objectID parameter is not an actor, however, this function is quite slow and should not be run every frame.
    • ...it returns true if the camera can see the object, not if the player-character can see the object. This means that in Third-Person, GetLOS may return true for objects behind the player, if they are close enough that they can be seen with the camera.
  • When called on a disabled actor, it crashes the game. May CTD if GetLOS is called by an actor that was disabled in the previous frame. A delay of a few frames after the actor is enabled will solve this issue.
  • The field of view for LOS is +/- 95 degrees from the 0 axis line in which the observer (non-player actor, player, or camera) is looking straight ahead.
    • All creatures and non-player actors have the same field of view for LOS, regardless of eye placement, or if they even have heads (zombies) or eyes (will-o-wisps).
  • Will return true with trigger volumes and collision volumes if they are in the calling actors field of view even though they normally aren't visible in game.
  • Will not return true when checking if a disabled reference is in view.