OnLostLOS - ScriptObject

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search

Member of: ScriptObject

Event called when a viewer goes from seeing the target, to not 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.

Syntax[edit | edit source]

Event OnLostLOS(ObjectReference akViewer, ObjectReference akTarget)

Parameters[edit | edit source]

Example[edit | edit source]

Function SomeFunction()
  RegisterForDetectionLOSLost(Game.GetPlayer(), Kettle) ; Before we can use OnLostLOS we must register.
EndFunction

Event OnLostLOS(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 lost, we'll only get this once /;
	Debug.Trace("Player just looked away from the kettle, so boil it!")
endEvent

Notes[edit | edit source]

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

See Also[edit | edit source]