C4 Engine
C4 Engine API Documentation


Defined in:  C4Scripts.h
Returns the initiator node for a script.

Node *GetInitiatorNode(voidconst;

The GetInitiatorNode function returns the node that originally caused the particular script instance represented by a ScriptState object to run. If a trigger caused the script to run, then the initiator node is the node that interacted with the trigger, activating it or deactivating it. If the script was started by direct activation through another script, then the initiator node is the node that caused that other script to run. The initiator node can be nullptr.

Note that if a particular method targets the trigger node, then it will be returned by the Method::GetTargetNode function.
See Also