Mod:Creation Kit/RegisterForRemoteEvent - ScriptObject

Member of: Mod:Creation Kit/ScriptObject Script

Registers this script to receive the specified event from the source object whenever that source object receives the event. Calling the event directly on the source object will not relay the event to this script. The event will be relayed only to this script and will not be sent to other scripts attached to the same object, or to any aliases or magic effects attached to the object.

Syntax
Function RegisterForRemoteEvent(ScriptObject akEventSource, ScriptEventName asEventName) native

Parameters

 * akEventSource: The ScriptObject that receives the event we want to also receive.
 * asEventName: The event we want relayed to us. This must be a raw string literal and may not be a variable.

Return Value
None

Examples
Event OnInit ; Register for Activate event from the secret door RegisterForRemoteEvent(SecretDoor, "OnActivate") EndEvent

Event ObjectReference.OnActivate(ObjectReference akSender, ObjectReference akActionRef) Debug.Trace(akSender + " was activated by " + akActionRef) EndEvent
 * Special event to receive when the door is activated
 * Note the type in the event name matches the type of the first parameter, and is also the script where the
 * event is originally defined.