Background for Fallout 4
Member of the ScriptObject script

Description

Wiki Description

Event called when a viewer goes from not seeing the target, to seeing the target - if this script is registered for it.

This event will only be sent to the specific script that registered for it. Other scripts attached to the same form/alias/active magic effect will not receive the event unless they also register.

Documentation Comment

LOS event, sent whenever the viewer first sees the target (after registering)


Caveats

CK Wiki - Notes

  • Aliases and quests will automatically unregister for this event when the quest stops. Active magic effects will automatically unregister when they are removed.

Parameters

  1. ObjectReferenceakViewer

    CK Wiki Description

    The ObjectReference that sees the target.

  2. ObjectReferenceakTarget

    CK Wiki Description

    The ObjectReference that the viewer can now see.


Examples

Function SomeFunction()
  RegisterForDetectionLOSGain(Game.GetPlayer(), SecretDocuments) ; Before we can use OnGainLOS we must register.
EndFunction

Event OnGainLOS(ObjectReference akViewer, ObjectReference akTarget)
    ;/ If other registrations had been done, we would want to check the viewer and target
       But since we only registered for one we know what it is
       Since we only did single los gain, we'll only get this once /;
    Debug.Trace("Player just saw the documents!")
endEvent

Auto-Generated Example

Scriptname MyCoolScript extends ScriptObject

event OnGainLOS(ObjectReference akViewer, ObjectReference akTarget)
    Debug.trace("Event received - OnGainLOS: akViewer = " + akViewer + " akTarget = " + akTarget)
endEvent

Related Pages


Additional References

View this event’s page on the Fallout 4 Creation Kit Wiki

Some data provided by the Fallout 4 Creation Kit Wiki. Licensed under the Creative Commons Attribution-Share Alike 4.0 license.