Skip to reading
Visual Scripting in Depth

28. Keep caller identity through nested work

Edition 0.86.4.3

0.86.4.3 edition with revised lessons, updated cross-references and new cinematic/camera-safety supplements. Earlier examples, screenshots and registry figures retain their stated edition context.

Download PDFView PDF page

A graph can call another graph or a text function, wait, then continue. The original caller is captured so that this continues to mean the owner that started that chain. Changing an action’s target does not make that target the new caller.

Code example
{
  "owner": {"$this":"id"},
  "name": {"$this":"name"},
  "item": {"$context":"itemId"}
}

Put that value in Return for a small diagnostic helper. Call it from two different switches and inspect the returned owner and name. Then call it through Call Script from another graph; the original switch identity should remain.

Source table from 28. Keep caller identity through nested work, page 32
ReferenceMeaning
thisCaptured event owner for the current call chain.
playerThe active player alias.
An explicit IDThe named entity or record.
{"$context":"entityId"}The entityId field in the call context.
{"$param":"target"}A named function argument, if declared and supplied.

An ownerless startup event has no this. A scene change does not silently retarget an old call to a new room object. Shared helpers should either require an owner or take an explicit entity parameter.

In GDScript, self continues to mean the script instance. this is PCA’s calling-record reference. They serve different purposes.

Page 32 of 93Permalink
Go to page