Background for Fallout 4
Member of the ScriptObject script
voidfunctionRegisterForDirectLOSLost(ObjectReferenceakViewer, ObjectReferenceakTarget, stringasViewerNode="", stringasTargetNode="")Native

Description

Wiki Description

Registers this script to receive a single OnLostLOS based on a direct LOS pick. If the viewer can not currently see the target, the event will be sent immediately.

Only the script that registers for an event will receive it. Other scripts attached to the same form, alias, or magic effect will not receive the event unless they also register for it.

Documentation Comment

Register for only the first direct LOS lost event between the viewer and the target
If the viewer is already not looking at the target, an event will be received almost immediately


Caveats

CK Wiki - Notes


Parameters

  1. ObjectReferenceakViewer

    CK Wiki Description

    The ObjectReference that will be looking for the target.

  2. ObjectReferenceakTarget

    CK Wiki Description

    The target the actor will be looking for. If the viewer is not the player, this must be an actor.

  3. stringasViewerNode=""

    CK Wiki Description

    The node on the viewer to cast the LOS check from. If empty, will cast from the object's root.

    • Default:""
  4. stringasTargetNode=""

    CK Wiki Description

    The node on the target to cast the LOS check to. If empty, will cast to the object's root.

    • Default:""

Examples

; Register for when the player can't see the kettle
RegisterForDirectLOSLost(Game.GetPlayer(), Kettle)
; Register for when the player's head can't see the kettle
RegisterForDirectLOSLost(Game.GetPlayer(), Kettle, "Head")

Auto-Generated Example

ObjectReference myObjectReference__akViewer
ObjectReference myObjectReference__akTarget
string myString__asViewerNode
string myString__asTargetNode

myScriptObject__toCallFunctionOn.RegisterForDirectLOSLost(myObjectReference__akViewer, myObjectReference__akTarget, myString__asViewerNode, myString__asTargetNode)

Related Pages


Additional References

View this function’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.