Mod:Creation Kit/RegisterForDistanceGreaterThanEvent - ScriptObject

Member of: ScriptObject

Registers this script to receive a single OnDistanceGreaterThan event when two objects are farther then the specified distance apart. If the objects are already that far apart, 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 RegisterForDistanceGreaterThanEvent(ScriptObject akObj1, ScriptObject akObj2, float afDistance) native

Parameters

 * akObj1: The first object to check distance with. (Must be an ObjectReference or ReferenceAlias)
 * akObj2: The second object to check distance with. (Must be an ObjectReference or ReferenceAlias)
 * afDistance: How far apart the objects must be before the event is sent

Return Value
None

Examples
RegisterForDistanceGreaterThanEvent(Child, Father, 1000.0)
 * Register for an event when the father is farther than 1000 game units from the child or more