Core group


Classes

MwSArray Base array structure type used in ManiaPlanet. Can not be modified right now.

MwFastArray Array type used in ManiaPlanet.

MwFastBuffer Buffer type used in ManiaPlanet.

MwFastBufferCat Buffer cat type used in ManiaPlanet.

MwRefBuffer Reference buffer type used in ManiaPlanet, which contains a static 32 item buffer.

MwNodPool An allocated pool of nods.

array The main array type used in Openplanet.

string The string class used in Openplanet as well as Maniaplanet.

wstring The wide string class used primarily in Maniaplanet for unicode strings.

dictionary The main dictionary type used in Openplanet.

MemoryBuffer A buffer of memory. Can be used in IO or Import calls. You can write to this or read from it, which moves the cursor within the buffer.

Global functions

string string::Join(const string[]&in arr, const string&in delimiter) Join an array of strings into a single where each item is separated using the given delimiter.

void trace(const string&in) Prints a trace to Openplanet's log.

void print(const string&in) Prints a line to Openplanet's log.

void warn(const string&in) Prints a warning to Openplanet's log.

void error(const string&in) Prints an error to Openplanet's log.

void throw(const string&in) Throws a script exception.

void sleep(uint64 ms) Yields the current execution for a given period of time. Execution will be resumed after that time.

void yield() Yields the current execution. Execution will be resumed the next game tick.

void startnew(CoroutineFunc@ func) Starts a new yieldable coroutine from the given function. Function should be a declaration of 'void Func()'.

void startnew(CoroutineFuncUserdata@ func, ref userdata) Starts a new yieldable coroutine from the given function which also provides a userdata handle parameter. Function should be a declaration of 'void Func(ref@)'.

void ExploreNod(const string&in name, const ?&in) Opens the Nod Explorer with the given nod and the given tab name.

void ExploreNod(const string&in name, const ?&in, const Reflection::MwClassInfo@ classInfo) Opens the Nod Explorer with the given nod, the given tab name, and the given class info. Only use this for exploring structs.

void ExploreNod(const ?&in) Opens the Nod Explorer with the given nod.

bool OpenplanetHasFullPermissions() Returns true if Openplanet has full permissions. (On Trackmania, this means having the Club Edition of the game.)

bool OpenplanetHasPaidPermissions() Returns true if Openplanet has (at least) paid permissions. (On Trackmania, this means having the Standard or Club Edition of the game.)

CGameCtnApp@ GetApp() Gets the main game app object.

CSystemFid@ GetFidFromNod(const ?&in) Gets the fid of the given nod, if it's set.

string GetLocalLogin() Gets the logged in user's username.

void RegisterLoadCallback(uint id) Tells the scripting to invoke the currently executing plugin when nods are loaded with the given class ID.

void UnregisterLoadCallback(uint id) Tells the scripting to stop invoking the currently executing plugin when nods are loaded with the given class ID.

void OpenBrowserURL(const string&in url) Opens the default web browser with the given URL.