class

VisualScriptVM

Module
VisualScripting
Header
#include "VisualScripting/VisualScriptVM.h"
Namespace
Mowo

Public functions

ReturnsNameDescription
boolExecuteRun graph in ctx.
boolExecuteConvenience: no variable store, no latent.
boolCallGraphFunctionByName
boolResumeResume a suspended Delay continuation NOW (runs its saved stack).
boolAdvanceAdvance a continuation by dt seconds (call each frame).
voidSetDebugHookInstall/clear the process-wide debug hook.
voidClearDebugHook
voidSetRandomSeedSeed the RandomInt/RandomFloat/MultiGate-random stream for the CALLING thread (state is thread-local, so runs on other threads keep their own sequence).
uint32_tRandomBitsThe raw xorshift draw behind RandomInt / RandomFloat / MultiGate-random.
size_tPooledFrameCapacityNode-output slots held by the calling thread's reusable run frames.
uint64_tResolveCacheMissesName resolutions (reflected function or property by name) the calling thread did NOT find in its cache.
uint64_tDataPinCopiesData-pin reads on the calling thread that copied a value out of where it lives (a variable, a parameter, a stored output).

Function details

Execute

C++
static bool Execute(const VisualScriptGraph& graph, const VisualScriptContext& ctx, VisualScriptContinuation* outCont = nullptr)

Run graph in ctx. Returns true if it ran without error. If a Delay suspends the run AND outCont is non-null, *outCont is filled with the continuation (active=true) for the caller to schedule; pass ctx.allowLatent = true to enable that. Without a sink, Delays run instantly.

Execute

C++
static bool Execute(const VisualScriptGraph& graph, MObject* target, MClass* cls)

Convenience: no variable store, no latent.

CallGraphFunctionByName

C++
static bool CallGraphFunctionByName(const VisualScriptClass& cls, const std::string& functionName, const VisualScriptContext& ctx, const std::vector<VisualScriptValue>& args, VisualScriptValue& outReturn)

Resume

C++
static bool Resume(VisualScriptContinuation& cont, const VisualScriptContext& ctx)

Resume a suspended Delay continuation NOW (runs its saved stack). If it suspends again, cont stays active; otherwise cont.active becomes false.

Advance

C++
static bool Advance(VisualScriptContinuation& cont, float dt, const VisualScriptContext& ctx)

Advance a continuation by dt seconds (call each frame). Delays resume when their timer elapses; Timelines pulse their update exec every frame (alpha 0..1 on the timeline node's data-out) and finish at the end. Returns true if still active (keep it queued), false when done.

SetDebugHook

C++
static void SetDebugHook(const VisualScriptDebugHook& hook)

Install/clear the process-wide debug hook. Not thread-safe with concurrent VM runs — install while the game thread is idle.

ClearDebugHook

C++
static void ClearDebugHook()

SetRandomSeed

C++
static void SetRandomSeed(uint32_t seed)

Seed the RandomInt/RandomFloat/MultiGate-random stream for the CALLING thread (state is thread-local, so runs on other threads keep their own sequence). Deterministic replays and tests seed before executing; a seed of 0 restores the default stream.

RandomBits

C++
static uint32_t RandomBits()

The raw xorshift draw behind RandomInt / RandomFloat / MultiGate-random. Exposed so TRANSPILED classes draw from the same seeded per-thread stream the VM does — a native body with its own generator would diverge from the interpreted one the moment a test seeded it.

PooledFrameCapacity

C++
static size_t PooledFrameCapacity()

Node-output slots held by the calling thread's reusable run frames. A run borrows the frame for its nesting depth and hands it back emptied, so this stops growing once the deepest graph has run once.

ResolveCacheMisses

C++
static uint64_t ResolveCacheMisses()

Name resolutions (reflected function or property by name) the calling thread did NOT find in its cache. A graph calling the same function a thousand times resolves it once, until a class registers, unregisters or a Visual Script class is rebuilt.

DataPinCopies

C++
static uint64_t DataPinCopies()

Data-pin reads on the calling thread that copied a value out of where it lives (a variable, a parameter, a stored output). Node evaluation reads those in place; what is left here is the by-value API at the edges (call arguments, setters, the debugger).

Generated from VisualScripting/VisualScriptVM.h via visualscripting.json · Nov 5, 2026Version 1.0.0