Background for Fallout 4
Member of the ScriptObject script
voidfunctionRegisterForDetectionLOSGain(ActorakViewer, ObjectReferenceakTarget)Native

[DEV SERVER] Loading description...


Caveats

CK Wiki - Notes

  • The form that this function is called on doesn't have to be the viewer or the target. In this way you could have a quest that gets LOS events from between the player and the quest objective.
  • If the viewer is the player the target may be an actor, or an object. If the viewer is an actor that isn't the player, then the target must be an actor. Actors will simply do a single check (using the detection system) and the player will do three picks (low, medium, and high) clipped to the camera to see if they see it.
  • Since LOS picks are expensive, they are heavily throttled in code. The more scripts that register for LOS events, the more the delay each script will have in receiving its events. As a general rule, one pick will be done per frame - not counting objects that can be trivially determined not to see each other (example: player looking for something that is behind them). So for example, if 30 scripts register to know when the player can see something, and that something is in the camera view (but maybe hiding behind a log) then the script may not get a LOS event for a full second - or if the player looks away and then looks back within a second, no events will be sent.
  • A script can only be registered for one kind of LOS event per viewer/target pair. If you register for LOS lost or a direct LOS event between the same two objects, this registration will be dropped.
  • Aliases and quests will automatically unregister for this event when the quest stops. Active magic effects will automatically unregister when they are removed.

Parameters

ActorakViewer

CK Wiki Description

The Actor 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.


Examples

; Register for the first time that Me sees Spot
RegisterForDetectionLOSGain(Me, Spot)

Auto-Generated Example

Actor myActor__akViewer
ObjectReference myObjectReference__akTarget

myScriptObject__toCallFunctionOn.RegisterForDetectionLOSGain(myActor__akViewer, myObjectReference__akTarget)

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.