RegisterForDirectLOSLost - ScriptObject

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search

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[edit | edit source]

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

Parameters[edit | edit source]

  • 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[edit | edit source]

None

Examples[edit | edit source]

; 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")

Notes[edit | edit source]

See Also[edit | edit source]