Skip to content

Latest commit

 

History

History
135 lines (77 loc) · 4.65 KB

globals.md

File metadata and controls

135 lines (77 loc) · 4.65 KB

Globals

Globals are variables that are always exposed to the Lua API.


The gMarioStates[] table is an array from 0 to (MAX_PLAYERS - 1) that contains a MarioState struct for each possible player.

It is indexed by the local playerIndex, so gMarioStates[0] is always the local player.

🔼


The gNetworkPlayers[] table is an array from 0 to (MAX_PLAYERS - 1) that contains a NetworkPlayer struct for each possible player.

It is indexed by the local playerIndex, so gNetworkPlayers[0] is always the local player.

🔼


The gActiveMods[] table is an array that starts at 0, and contains a Mod struct for each active mod.

🔼


The gCharacters[] table is an array from 0 to (CT_MAX - 1) that contains a Character struct for each possible character.

🔼


The gControllers[] table is an array from 0 to (MAX_PLAYERS - 1) that contains a Controller struct for each possible player.

🔼


The gTextures table contains references to textures. Listed in GlobalTextures.

🔼


The gObjectAnimations table contains references to object animations. Listed in GlobalObjectAnimations.

🔼


The gGlobalObjectCollisionData table contains references to object collision data. Listed in GlobalObjectCollisionData.

🔼


gLakituState's fields are listed in LakituState.

🔼


gServerSettings's fields are listed in ServerSettings.

NOTE: The fields in this struct do not sync well and changing them outside of init in if statements or functions can cause desyncs. Make sure the field gets changed on every player's end if you change it after init.

🔼

gNametagsSettings's fields are listed in NametagsSettings.

NOTE: The fields in this struct are not synced and are meant to be changed from Lua. If you want a change to sync for everyone, call it during init outside of any if statements and functions or make sure the field gets changed on every player's end.

🔼


gLevelValues's fields are listed in LevelValues.

🔼


gBehaviorValues's fields are listed in BehaviorValues.

🔼


gPaintingValues's fields are listed in PaintingValues.

🔼


gFirstPersonCamera's fields are listed in FirstPersonCamera.

NOTE: gFirstPersonCamera.enabled returns whether or not first person is enabled at all. get_first_person_enabled() also accounts for certain conditions that make the camera exit first person mode and will return false if so.

🔼


The gGlobalSyncTable is a table used for networking. Any field set inside of this table is automatically synchronized with all other clients. Do not use this table for player-specific variables, keep those in gPlayerSyncTable. Player-specific variable will desynchronize within this table since it doesn't automatically translate playerIndex.

🔼


The gPlayerSyncTable[] is an array from 0 to (MAX_PLAYERS - 1) that is used for networking. Any field set inside of this table is automatically synchronized with all other clients.

It is indexed by the local playerIndex, so gPlayerSyncTable[0] is always for the local player.

The underlying networking system will automatically translate the local playerIndex so that the field is set for the correct player.

🔼