- Found in:
- Vanilla
eventOnDistanceLessThan(ObjectReferenceakObj1, ObjectReferenceakObj2, floatafDistance, intaiEventID)
[DEV SERVER] Loading description...
Caveats
CK Wiki - Notes
- The two objects are interchangeable. They always match the order they were registered in, assuming someone else didn't register with the opposite order first.
- Aliases and quests will automatically unregister for this event when the quest stops. Active magic effects will automatically unregister when they are removed.
Parameters
ObjectReferenceakObj1
CK Wiki Description
The first ObjectReference which the distance check was performed on.
ObjectReferenceakObj2
CK Wiki Description
The second ObjectReference which the distance check was performed on.
floatafDistance
CK Wiki Description
The exact distance between the two objects at the time the event fired.
intaiEventID
Examples
Function SomeFunction()
RegisterForDistanceLessThanEvent(Game.GetPlayer(), Bird) ; Before we can use OnDistanceLessThan we must register.
EndFunction
Event OnDistanceLessThan(ObjectReference akObj1, ObjectReference akObj2, float afDistance)
;/ If other registrations had been done, we would want to check the objects
But since we only registered for one we know what it is /;
Debug.Trace("Player is now " + afDistance + " units away from the bird - fly away!")
endEventAuto-Generated Example
Scriptname MyCoolScript extends ScriptObject
event OnDistanceLessThan(ObjectReference akObj1, ObjectReference akObj2, float afDistance, int aiEventID)
Debug.trace("Event received - OnDistanceLessThan: akObj1 = " + akObj1 + " akObj2 = " + akObj2 + " afDistance = " + afDistance + " aiEventID = " + aiEventID)
endEvent