Mod:Creation Kit/RegisterForDirectLOSLost - ScriptObject

Member of: ScriptObject

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.

Syntax
Function RegisterForDirectLOSLost(ObjectReference akViewer, ObjectReference akTarget, string asViewerNode = "", \ string asTargetNode = "") native

Parameters

 * akViewer: The ObjectReference that will be looking for the target.
 * akTarget: The target the actor will be looking for. If the viewer is not the player, this must be an actor.
 * asViewerNode: The node on the viewer to cast the LOS check from. If empty, will cast from the object's root.
 * Default: ""
 * asTargetNode: The node on the target to cast the LOS check to. If empty, will cast to the object's root.
 * Default: ""

Return Value
None

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