class

AVisualScriptActor

Module
Game
Header
#include "Game/AVisualScriptActor.h"
Namespace
Mowo
Reflection
Reflected by MowoHeaderTool

Properties

TypeNameDescription
intscoreState a Visual Script graph can read/drive (reflected) Default 0.
inttickCountDefault 0.
uint64_tstampDefault 0.

Constructors

SignatureNameDescription
AVisualScriptActor() : m_visualScript(this, "AVisualScriptActor", true)AVisualScriptActor

Public functions

ReturnsNameDescription
FVisualScriptRuntime&GetVisualScriptRuntime
voidAddScore
intGetScore
voidRecordTick
intGetTickCount
Vec2GetScorePair
voidServerAddScoreRPC-annotated surface.
voidClientSetScore
voidMulticastSetStamp
voidMulticastVisualScriptVarsVisual Script variable replication (the receive half).
voidInstallVisualScriptActorFactoryVisual Script binding Adopt a synthetic class + its event graphs (called by the spawn path before BeginPlay).
voidBindVisualScriptClass
voidTryBindSpawn-path helper: bind iff actor is visual-script-backed (any backing class) and cls is a Visual Script synthetic class (cls->userData set).
boolIsVisualScriptBound
MClass*GetClassReport the synthetic Visual Script class when bound, else the native MClass.
voidOnConstruct
voidBeginPlay
voidTick
voidEndPlay
voidDestroyedSelf-events, the Blueprint set a graph can implement by naming an event graph after them.
floatTakeDamage
boolIsDeadA Visual Script class opts into death by declaring a Bool variable "IsDead"; without one the actor is never dead.
voidNotifyHit
boolCallVisualScriptFunctionRun one of this class's Visual Script functions in this actor's own context — what another actor's Call On Target lands on when the name is a Visual Script function rather than a reflected method.
voidAdvanceLatentsAdvance any pending latent (Delay) graph runs by dt seconds, resuming the ones whose timer elapses.
boolHasPendingLatents
voidReceivePinInput-pin entry: stores the payload in the "PinPayload" variable and runs pin as an event graph.
const VisualScriptValue*FindVarRead a per-instance Visual Script variable (inspector / tests).
voidSetVarSet a per-instance Visual Script variable.
boolFindVarTypeThe declared type of a variable anywhere in the class chain — false when the name isn't a declared class variable.
voidCollectVarOverridesEvery variable whose current value differs from the class-declared default: the Visual Script analog of a CDO delta.
boolIsAuthoredOverrideThe CDO-propagation rule, as one decision: is current authored instance state, or is it still the class default seeded handed this instance? Only the first survives a class-default edit — the second has to follow the new default, which is what makes raising a default in the Actor Editor reach every placed instance that never touched the field.
boolPushReplicatedVarsShip every replicated variable whose value differs from what this actor last got onto the wire.
voidSetComponentSlotOverridePer-instance component-slot overrides — the placed-actor half of LG10.
voidCollectComponentSlotOverrides
const VisualScriptValue*FindComponentSlotOverride
EntityIDFindSlotEntityBacking entity of a PLACED component slot (one that declared a transform or an attach parent), or INVALID_ENTITY.

Function details

AVisualScriptActor

C++
AVisualScriptActor() : m_visualScript(this, "AVisualScriptActor", true)

GetVisualScriptRuntime

C++
FVisualScriptRuntime& GetVisualScriptRuntime() override

AddScore

C++
void AddScore(int n)

GetScore

C++
int GetScore() const

RecordTick

C++
void RecordTick()

GetTickCount

C++
int GetTickCount() const

GetScorePair

C++
Vec2 GetScorePair() const

ServerAddScore

C++
void ServerAddScore(int32_t n)

RPC-annotated surface. A Visual Script graph calling these gets real routing: the VM ships a Server call to the authority, a Client/Multicast call to its client(s), through FNetSession — never the LG6 execute-locally trap. Concrete bodies double as the routing fixtures the self-tests pin.

ClientSetScore

C++
void ClientSetScore(int32_t value)

MulticastSetStamp

C++
void MulticastSetStamp(uint64_t value)

MulticastVisualScriptVars

C++
void MulticastVisualScriptVars(const std::string& blob)

Visual Script variable replication (the receive half). The authority packs every replicated Visual Script variable that changed into this blob and multicasts it; riding an RPC-flagged MFUNCTION is what gives the update the authority rule for free — FVisualScriptRpcCodec refuses a Multicast that did not arrive from the server, so a client cannot push variable state at its peers. A variable whose value actually changed and that declares a RepNotify runs that function afterwards, on the receiver only.

InstallVisualScriptActorFactory

C++
static void InstallVisualScriptActorFactory()

Visual Script binding Adopt a synthetic class + its event graphs (called by the spawn path before BeginPlay). After this GetClass() reports synthetic. Installs every backing class's factory into VisualScriptClassRegistry, keyed by the native base it stands in for, plus the runtime's hooks. Idempotent.

BindVisualScriptClass

C++
void BindVisualScriptClass(MClass* synthetic, VisualScriptClass* def)

TryBind

C++
static void TryBind(AActor* actor, MClass* cls)

Spawn-path helper: bind iff actor is visual-script-backed (any backing class) and cls is a Visual Script synthetic class (cls->userData set). A no-op for native actors/classes.

IsVisualScriptBound

C++
bool IsVisualScriptBound() const

GetClass

C++
MClass* GetClass() const override

Report the synthetic Visual Script class when bound, else the native MClass.

OnConstruct

C++
void OnConstruct() override

BeginPlay

C++
void BeginPlay() override

Tick

C++
void Tick(float deltaSeconds) override

EndPlay

C++
void EndPlay() override

Destroyed

C++
void Destroyed() override

Self-events, the Blueprint set a graph can implement by naming an event graph after them. Each one is looked up in the class chain and skipped when the class has no graph of that name: "Destroyed" an explicit MWorld::Destroy, before EndPlay "AnyDamage" TakeDamage; DamageAmount / DamageInstigator set "OnHit" a physics contact begins on the backing entity or a placed slot; PinPayload = the other actor, HitLocation / HitNormal / HitImpulse set "InputAction.<Name>" the named input action Started this frame "InputAction.<Name>.Released" ... Completed "InputAction.<Name>.Held" ... Triggered (every firing frame) "OnTriggerEnter" / "OnTriggerExit" a Trigger slot's overlaps (existing) Input graphs are polled from Tick against the process-wide action system, like Blueprint's Auto Receive Input: no possession needed, and a later possession cannot wipe them the way a MPlayerInput binding would be.

TakeDamage

C++
float TakeDamage(float amount, AActor* instigator) override

IsDead

C++
bool IsDead() const override

A Visual Script class opts into death by declaring a Bool variable "IsDead"; without one the actor is never dead.

NotifyHit

C++
void NotifyHit(AActor* other, const Vec3& location, const Vec3& normal, float impulse)

CallVisualScriptFunction

C++
bool CallVisualScriptFunction(const std::string& functionName, const std::vector<VisualScriptValue>& args, VisualScriptValue* ret)

Run one of this class's Visual Script functions in this actor's own context — what another actor's Call On Target lands on when the name is a Visual Script function rather than a reflected method. ret takes the return value.

AdvanceLatents

C++
void AdvanceLatents(float dt)

Advance any pending latent (Delay) graph runs by dt seconds, resuming the ones whose timer elapses. Called from Tick; exposed for tests.

HasPendingLatents

C++
bool HasPendingLatents() const

ReceivePin

C++
void ReceivePin(const std::string& pin, const VisualScriptValue& payload)

Input-pin entry: stores the payload in the "PinPayload" variable and runs pin as an event graph. Called by MWorld's wire routing.

FindVar

C++
const VisualScriptValue* FindVar(const std::string& name) const

Read a per-instance Visual Script variable (inspector / tests). Nullptr when the name isn't declared anywhere in the class chain.

SetVar

C++
void SetVar(const std::string& name, const VisualScriptValue& value)

Set a per-instance Visual Script variable. The scene loader applies serialized overrides through here after BindVisualScriptClass seeded the class defaults.

FindVarType

C++
bool FindVarType(const std::string& name, FMValueType& outType) const

The declared type of a variable anywhere in the class chain — false when the name isn't a declared class variable. The loader types an override value with it.

CollectVarOverrides

C++
void CollectVarOverrides(std::vector<std::pair<std::string, VisualScriptValue>>& out) const

Every variable whose current value differs from the class-declared default: the Visual Script analog of a CDO delta. Runtime-only keys (PinPayload) and anything not declared in the class chain are skipped, so only authored variables round-trip through the scene.

IsAuthoredOverride

C++
static bool IsAuthoredOverride(const VisualScriptValue& current, const VisualScriptValue* seeded)

The CDO-propagation rule, as one decision: is current authored instance state, or is it still the class default seeded handed this instance? Only the first survives a class-default edit — the second has to follow the new default, which is what makes raising a default in the Actor Editor reach every placed instance that never touched the field. seeded is null when the class did not declare the variable at bind time, and a value nobody ever seeded is authored by definition.

PushReplicatedVars

C++
bool PushReplicatedVars(bool forceFull = false)

Ship every replicated variable whose value differs from what this actor last got onto the wire. Authority-only — a remote instance returns false without touching the net layer. forceFull re-sends the whole set (a peer that just joined has none of it). Returns true when an update actually left. Public so a headless test can drive one update without a frame loop.

SetComponentSlotOverride

C++
void SetComponentSlotOverride(const std::string& slotName, const std::string& propertyName, const VisualScriptValue& value)

Per-instance component-slot overrides — the placed-actor half of LG10. A key is "<slot>.<property>"; the value replaces the class default when ApplyComponentSlots runs. Set before OnConstruct (the loader's job) or call OnConstruct again after setting.

CollectComponentSlotOverrides

C++
void CollectComponentSlotOverrides(std::vector<std::pair<std::string, VisualScriptValue>>& out) const

FindComponentSlotOverride

C++
const VisualScriptValue* FindComponentSlotOverride(const std::string& slotName, const std::string& propertyName) const

FindSlotEntity

C++
EntityID FindSlotEntity(const std::string& slotName) const

Backing entity of a PLACED component slot (one that declared a transform or an attach parent), or INVALID_ENTITY. Tests and tooling resolve the child entity a slot produced through this.

Generated from Game/AVisualScriptActor.h via game.json · Nov 5, 2026Version 1.0.0