FWolangScriptInstance
- Module
- Scripting
- Header
#include "Scripting/WolangScriptInstance.h"- Namespace
Mowo
Constructors
| Signature | Name | Description |
|---|---|---|
FWolangScriptInstance(AActor* owner, MActorComponent* component) | FWolangScriptInstance | |
~FWolangScriptInstance() override | ~FWolangScriptInstance | |
FWolangScriptInstance(const FWolangScriptInstance&) = delete | FWolangScriptInstance |
Public functions
| Returns | Name | Description |
|---|---|---|
FWolangScriptInstance& | operator= | |
void | Bind | Adopts the class: every declared variable starts from its default, keeping the value of one this instance already had (same name and type). |
const FWolangScriptClass* | GetScriptClass | |
void | SetOwner | |
AActor* | GetOwner | |
MActorComponent* | GetComponent | |
FWolangScriptInstance* | Of | The instance of a backing actor or component, else null. |
std::string | GetHostKey | IScriptVariableHost |
std::string | GetSectionName | |
std::string | GetSerializedNodeName | |
void | CollectVariables | |
const VisualScriptValue* | FindVariable | |
bool | SetVariable | |
void | CollectActions | |
bool | InvokeAction | |
std::string | GetRedirectTypeName | |
void | BeginPlay | Lifecycle, forwarded by the backing class. |
void | Tick | |
void | EndPlay | |
void | NotifyDestroyed | |
void | NotifyHit | |
void | NotifyOverlap | |
void | NotifyDamage | |
bool | IsPlaying | |
bool | CallHook | A method of the script object called by name, count arguments built from the engine's values the way a hook's are. |
bool | HasMethod | |
int64_t | SetTimer | Timers on the world's FTimerManager (game time: pause and time dilation apply), cleared at EndPlay. |
bool | ClearTimer | |
void | ClearTimers | |
const void* | GetObjectValue | The Wolang object's value as an opaque pointer (a WolangValue the Scripting module reads), for the value bridge between instances. |
FWolangVm* | GetVm | The vm the object lives in while playing, else null; and a method of the object called with values the caller built (Visual Scripting's calls). |
bool | CallMethodValues | |
bool | SaveState | The object's @Save fields as the bytes std.save writes; false when the instance is not playing. |
bool | RestoreState | |
bool | ReadField | One field of the playing object, read (the Wolang value into the engine's) or written, whether or not Details edits it: the replication reads the fields it sends and writes the ones it receives through these. |
bool | WriteField | |
uint32_t | GetReloadCount | The vm's reload count the object was last seen under, 0 when not playing. |
IScriptVariableHost* | GetReplicationHost | The Details section listing the replicated fields and RPCs; null for a class that declares none. |
FWolangNetState* | GetNetState | |
FWolangNetState& | EnsureNetState | |
void | ClearNetState | |
const std::unordered_map<std::string, VisualScriptValue>& | GetValues | The values the instance holds, overrides and defaults alike. |
Function details
FWolangScriptInstance
FWolangScriptInstance(AActor* owner, MActorComponent* component)~FWolangScriptInstance
~FWolangScriptInstance() overrideFWolangScriptInstance
FWolangScriptInstance(const FWolangScriptInstance&) = deleteoperator=
FWolangScriptInstance& operator=(const FWolangScriptInstance&) = deleteBind
void Bind(const FWolangScriptClass* script)Adopts the class: every declared variable starts from its default, keeping the value of one this instance already had (same name and type).
GetScriptClass
const FWolangScriptClass* GetScriptClass() constSetOwner
void SetOwner(AActor* owner)GetOwner
AActor* GetOwner() constGetComponent
MActorComponent* GetComponent() constOf
static FWolangScriptInstance* Of(MObject* object)The instance of a backing actor or component, else null.
GetHostKey
std::string GetHostKey() const overrideIScriptVariableHost
GetSectionName
std::string GetSectionName() const overrideGetSerializedNodeName
std::string GetSerializedNodeName() const overrideCollectVariables
void CollectVariables(std::vector<FScriptVariableDesc>& out) const overrideFindVariable
const VisualScriptValue* FindVariable(const std::string& name) const overrideSetVariable
bool SetVariable(const std::string& name, const VisualScriptValue& value) overrideCollectActions
void CollectActions(std::vector<FScriptActionDesc>& out) const overrideInvokeAction
bool InvokeAction(const std::string& name) overrideGetRedirectTypeName
std::string GetRedirectTypeName() const overrideBeginPlay
void BeginPlay()Lifecycle, forwarded by the backing class.
Tick
void Tick(float deltaSeconds)EndPlay
void EndPlay()NotifyDestroyed
void NotifyDestroyed()NotifyHit
void NotifyHit(AActor* other)NotifyOverlap
void NotifyOverlap(AActor* other, bool begin)NotifyDamage
void NotifyDamage(float amount, AActor* instigator)IsPlaying
bool IsPlaying() constCallHook
bool CallHook(const std::string& method, AActor* other = nullptr, float number = 0.0f, bool flag = false, const std::string& text = std::string())A method of the script object called by name, count arguments built from the engine's values the way a hook's are. False when there is no object or the call failed.
HasMethod
bool HasMethod(const std::string& method) constSetTimer
int64_t SetTimer(float seconds, const std::string& method, bool repeat)Timers on the world's FTimerManager (game time: pause and time dilation apply), cleared at EndPlay. Answers a handle the script can clear with.
ClearTimer
bool ClearTimer(int64_t handle)ClearTimers
void ClearTimers()GetObjectValue
const void* GetObjectValue() constThe Wolang object's value as an opaque pointer (a WolangValue the Scripting module reads), for the value bridge between instances.
GetVm
FWolangVm* GetVm() constThe vm the object lives in while playing, else null; and a method of the object called with values the caller built (Visual Scripting's calls).
CallMethodValues
bool CallMethodValues(const std::string& method, const WolangValue* arguments, int32_t count, WolangValue* out)SaveState
bool SaveState(std::vector<uint8_t>& out)The object's @Save fields as the bytes std.save writes; false when the instance is not playing. RestoreState replaces the object with one loaded from such bytes (fields by name) and calls the script's OnLoaded, if it has one; asked from inside a script call it waits for the next Tick, because the object that is running cannot be swapped under itself. See WolangSaveGame.h.
RestoreState
bool RestoreState(const std::vector<uint8_t>& bytes)ReadField
bool ReadField(const FScriptVariableDesc& desc, VisualScriptValue& out) constOne field of the playing object, read (the Wolang value into the engine's) or written, whether or not Details edits it: the replication reads the fields it sends and writes the ones it receives through these. Both answer false when the instance is not playing or the type has no accessor.
WriteField
bool WriteField(const FScriptVariableDesc& desc, const VisualScriptValue& value)GetReloadCount
uint32_t GetReloadCount() constThe vm's reload count the object was last seen under, 0 when not playing.
GetReplicationHost
IScriptVariableHost* GetReplicationHost()The Details section listing the replicated fields and RPCs; null for a class that declares none.
GetNetState
FWolangNetState* GetNetState() constEnsureNetState
FWolangNetState& EnsureNetState()ClearNetState
void ClearNetState()GetValues
const std::unordered_map<std::string, VisualScriptValue>& GetValues() constThe values the instance holds, overrides and defaults alike.