FWolangScripting
- Module
- Scripting
- Header
#include "Scripting/WolangScripting.h"- Namespace
Mowo
Public functions
| Returns | Name | Description |
|---|---|---|
std::vector<FWolangDiagnostic> | ParseDiagnostics | Splits a vm's rendered diagnostics ("error[E0026]: ..." then " --> file:7:16") into entries. |
void | ReportDiagnostics | The diagnostics of the last load or reload that reported any, and of the last CheckProject; empty after one that compiled. |
std::vector<FWolangDiagnostic> | GetDiagnostics | |
uint32_t | GetDiagnosticsRevision | |
bool | HasErrors | |
bool | CheckProject | Compiles every script package of the project (and the engine classes' shims) in a vm of its own and reports what it found; the editor runs it when a script is saved and before Play. |
bool | IsAvailable | False on a platform the Wolang library is not vendored for; every script actor then logs that once and does nothing. |
bool | HasEmbeddedPackages | Whether this module carries the engine's own package and Wolang's standard library as data (loaded from memory, never from a folder); false when it was built without the bindings. |
std::filesystem::path | GetScriptsDirectory | Where the project's script packages are: <project>/Scripts, or <package root>/Scripts in a packaged game (which opens no project; mbt package copies the folder there). |
std::filesystem::path | FindPackage | A script path as an actor names it — project-relative or absolute, a package folder or a .wo file inside one — to the folder holding its wolang.toml; empty when there is none. |
FWolangVm* | Acquire | |
void | Release | |
FWolangVm* | Find | |
FWolangVm* | FindAny | Any world's vm, for calls that come with no world (a Visual Script library node); null when no world runs scripts. |
size_t | GetVmCount | |
bool | IsHotReloadEnabled | wolang.HotReload: whether a playing world reloads a saved script. |
uint64_t | GetCallBudget | wolang.CallBudget: the ticks one call into a script may spend. |
void | AdvanceTasks | The world's script tasks (task fun, wait Wait(seconds)) advance by the game's dt, once per frame however many script objects call this; a paused world does not call it and slow motion passes a smaller dt. |
int32_t | GetDebugPort | |
void | SetDebugPort |
Function details
ParseDiagnostics
static std::vector<FWolangDiagnostic> ParseDiagnostics(const std::string& text)Splits a vm's rendered diagnostics ("error[E0026]: ..." then " --> file:7:16") into entries.
ReportDiagnostics
static void ReportDiagnostics(const std::string& text)The diagnostics of the last load or reload that reported any, and of the last CheckProject; empty after one that compiled. The revision bumps on every change, which is what the editor's Message Log page and status bar item poll.
GetDiagnostics
static std::vector<FWolangDiagnostic> GetDiagnostics()GetDiagnosticsRevision
static uint32_t GetDiagnosticsRevision()HasErrors
static bool HasErrors()CheckProject
static bool CheckProject(std::vector<FWolangDiagnostic>* out = nullptr)Compiles every script package of the project (and the engine classes' shims) in a vm of its own and reports what it found; the editor runs it when a script is saved and before Play. True when everything compiled.
IsAvailable
static bool IsAvailable()False on a platform the Wolang library is not vendored for; every script actor then logs that once and does nothing.
HasEmbeddedPackages
static bool HasEmbeddedPackages()Whether this module carries the engine's own package and Wolang's standard library as data (loaded from memory, never from a folder); false when it was built without the bindings.
GetScriptsDirectory
static std::filesystem::path GetScriptsDirectory()Where the project's script packages are: <project>/Scripts, or <package root>/Scripts in a packaged game (which opens no project; mbt package copies the folder there). Empty when there is neither.
FindPackage
static std::filesystem::path FindPackage(const std::string& scriptPath)A script path as an actor names it — project-relative or absolute, a package folder or a .wo file inside one — to the folder holding its wolang.toml; empty when there is none.
Acquire
static FWolangVm* Acquire(const MWorld* world)Release
static void Release(const MWorld* world)Find
static FWolangVm* Find(const MWorld* world)FindAny
static FWolangVm* FindAny()Any world's vm, for calls that come with no world (a Visual Script library node); null when no world runs scripts.
GetVmCount
static size_t GetVmCount()IsHotReloadEnabled
static bool IsHotReloadEnabled()wolang.HotReload: whether a playing world reloads a saved script.
GetCallBudget
static uint64_t GetCallBudget()wolang.CallBudget: the ticks one call into a script may spend.
AdvanceTasks
static void AdvanceTasks(const MWorld* world, double dt, uint64_t frame)The world's script tasks (task fun, wait Wait(seconds)) advance by the game's dt, once per frame however many script objects call this; a paused world does not call it and slow motion passes a smaller dt.
GetDebugPort
static int32_t GetDebugPort()SetDebugPort
static void SetDebugPort(int32_t port)