GetLOS

From the Fallout3 GECK Wiki
(Redirected from GetLineOfSight)
Jump to navigation Jump to search

Link to TES4 Construction Set Wiki: GetLOS.

Syntax:

[ActorID.]GetLOS ObjectID 

Example:

testActor.GetLOS TestMarker


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

Notes[edit | edit source]

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