- Found in:
- Vanilla
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
- Most of the time you actually want RegisterForDetectionLOSLost instead, as it takes some more things into account and may do a better pick.
- See the notes for RegisterForDirectLOSGain for limitations, speed considerations, and other notes.
Parameters
ObjectReferenceakViewer
CK Wiki Description
The ObjectReference that will be looking for the target.
ObjectReferenceakTarget
CK Wiki Description
The target the actor will be looking for. If the viewer is not the player, this must be an actor.
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:""
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
