FVisualScriptSpawnParams
- Module
- VisualScripting
- Header
#include "VisualScripting/VisualScriptSpawnParams.h"- Namespace
Mowo
Type aliases
| Alias | Description |
|---|---|
using Applier = void (*)(void* user, MObject* spawned, const std::vector<std::pair<std::string, VisualScriptValue>>& values) | Write the collected values onto a freshly spawned instance. Returns false when no applier is installed (or the object is null), which is how a headless host that never brought up the gameplay layer stays quiet instead of pretending the values landed. |
Public functions
| Returns | Name | Description |
|---|---|---|
int32_t | ClassNameParamIndex | Index of the class-name parameter of a spawn-shaped reflected function, or -1 when the function is not spawn-shaped. |
std::string | ResolveClassName | The class name a node's class-name input carries: the literal when the pin holds a String constant, or the referenced name when it is wired to a ClassRef node. |
std::vector<const VisualScriptVariable*> | ForNode | The exposed variables a CallFunction/CallOn node carries as extra input pins, in pin order. |
std::vector<const VisualScriptVariable*> | ForClassName | Same, resolved straight from a class name — the editor uses this when it already knows the class (rail drag, node creation). |
void | SetApplier | |
void | ClearApplier | |
bool | HasApplier | |
bool | Apply | |
bool | HasPending | A spawn is in flight on this thread and its values are still unclaimed. |
bool | ConsumePending | Take the armed values and write them onto spawned. |
Function details
ClassNameParamIndex
static int32_t ClassNameParamIndex(const FMFunctionInfo& fn)Index of the class-name parameter of a spawn-shaped reflected function, or -1 when the function is not spawn-shaped. Spawn-shaped means "a Spawn* verb that returns an object and takes the class by name": the name begins with Spawn, the return type is Object, and the FIRST parameter is a String. Deliberately a rule rather than a hardcoded MGameplayStatics::SpawnActorByClass — a game module adding its own spawn verb gets the pins with no engine change. The name is part of the rule because reflection carries no parameter names (MowoHeaderTool emits types only) and because signature shape alone cannot tell a spawn from a lookup: MActorStatics::GetActorOfClassAt is also "returns an actor, takes a class name first".
ResolveClassName
static std::string ResolveClassName(const VisualScriptGraph& graph, const VisualScriptNode& node, int32_t inputIndex)The class name a node's class-name input carries: the literal when the pin holds a String constant, or the referenced name when it is wired to a ClassRef node. Empty for anything else — a class computed at run time cannot shape edit-time pins, so such a node keeps the declared parameters only.
ForNode
static std::vector<const VisualScriptVariable*> ForNode(const VisualScriptGraph& graph, const VisualScriptNode& node, const FMFunctionInfo& fn, int32_t argOffset)The exposed variables a CallFunction/CallOn node carries as extra input pins, in pin order. Empty when the node is not spawn-shaped, when the class is not a registered Visual Script class, or when it exposes nothing. argOffset is 1 for a CallOn node (inputs[0] is the target) and 0 otherwise, matching VisualScriptVM::InvokeCall.
ForClassName
static std::vector<const VisualScriptVariable*> ForClassName(const std::string& className)Same, resolved straight from a class name — the editor uses this when it already knows the class (rail drag, node creation).
SetApplier
static void SetApplier(Applier applier, void* user)ClearApplier
static void ClearApplier()HasApplier
static bool HasApplier()Apply
static bool Apply(MObject* spawned, const std::vector<std::pair<std::string, VisualScriptValue>>& values)HasPending
static bool HasPending()A spawn is in flight on this thread and its values are still unclaimed.
ConsumePending
static bool ConsumePending(MObject* spawned)Take the armed values and write them onto spawned. Called by the gameplay layer's spawn path at the pre-BeginPlay seam; false means there was nothing armed, it was already taken, or no applier is installed.