SMBX Global Memory
Jump to navigation
Jump to search
Note: This list is very much incomplete. For a more complete list, refer to the global defines page on GitHub: https://github.com/WohlSoft/LunaLua/blob/master/LunaDll/Defines.h#L404
| General Player Memory | |||
|---|---|---|---|
| Name | Memory address | Memory type | Description |
| Player Ptr | 0x00B25A20 | FIELD_DWORD | The pointer to the Player Array. Not needed directly by lua/autocode |
| Player Count | 0x00B2595E | FIELD_WORD | How many Players are in the level. |
| Player Editor Ptr | 0x00CF74D8 | FIELD_DWORD | The pointer to the Player for testing in the level Editor. Not needed directly by lua/autocode |
| General NPC Memory | |||
|---|---|---|---|
| Name | Memory address | Memory type | Description |
| NPC Ptr | 0x00B259E8 | FIELD_DWORD | The pointer to the NPC Array. Not needed directly by lua/autocode |
| NPC Count | 0x00B2595A | FIELD_WORD | The Number of NPCs in the level. |
| General Input Memory | |||
|---|---|---|---|
| Name | Memory address | Memory type | Description |
| Mouse cursor X | 0x00B2D6BC | FIELD_DFLOAT | The X position of the mouse cursor on the screen. |
| Mouse cursor Y | 0x00B2D6C4 | FIELD_DFLOAT | The Y position of the mouse cursor on the screen. |
| Mouse moving | 0x00B2D6D2 | FIELD_WORD | Whether or not the mouse is moving. |
| Mouse released | 0x00B2D6D0 | FIELD_WORD | Whether or not a mouse button is being released. |
| Mouse pressing | 0x00B2D6CC | FIELD_WORD | Whether or not a mouse button is being pressed. |
| Key released | 0x00B2C884 | FIELD_WORD | Whether or not a keyboard key is being released. |
| General UI Memory | |||
|---|---|---|---|
| Name | Memory address | Memory type | Description |
| HUD star count | 0x00B251E0 | FIELD_WORD | How many stars. WARNING: Changing this value will corrupt save files! |
| HUD coins count | 0x00B2C5A8 | FIELD_WORD | How many coins. |
| HUD lives count | 0x00B2C5AC | FIELD_FLOAT | How many lives. |
| HUD points count | 0x00B2C8E4 | FIELD_DWORD | How many points. (In SMBX2 B4+, it was replaced by Misc.score and Misc.givePoints) |
| Pause menu visible | 0x00B250E2 | FIELD_WORD | Is the pause menu or a text box visible? |
| Current menu choice | 0x00B2C880 | FIELD_WORD | Current menu choice. |
| World Settings Memory | |||
|---|---|---|---|
| Name | Memory address | Memory type | Description |
| Episode name | 0xB2C624 | FIELD_STRING | The name of the current episode. |
| Intro level path | 0xB25724 | FIELD_STRING | The filename of the intro (hub) level. |
| Hub-styled world flag | 0xB25728 | FIELD_BOOL | Controls whether the world map is loaded. |
| "Restart on death" flag | 0xB2572A | FIELD_BOOL | Controls whether the player restarts the current level after dying. |
| Episode Star Count | 0xB2C906 | FIELD_WORD | The total number of stars in the episode according to the .wld file. |
| Misc. Memory | |||
|---|---|---|---|
| Name | Memory address | Memory type | Description |
| Screen HDC | 0x00B25028 | FIELD_DWORD | The screen HDC. Not needed by lua/autocode |
| Is Paused | 0x00B250E2 | FIELD_WORD | If the pause menu is open. Not needed by lua/autocode |
| Intro Menu Overlay | 0x00B2C620 | FIELD_WORD | If set to -1, then the intro menu overlay is displayed. |
| Intro Mode | 0x00B2C89C | FIELD_DWORD | If set to -1, then the intro is played. |
| P-Switch Memory | |||
|---|---|---|---|
| Name | Memory address | Memory type | Description |
| P-Switch Timer | 0x00B2C62C | FIELD_WORD | The amount of time until the P-Switch effect is finished. |
| Stopwatch Timer | 0x00B2C62E | FIELD_WORD | The amount of time until the stopwatch effect is finished. |
| P-Switch/Stopwatch Player | 0x00B2C630 | FIELD_WORD | The index of the player that triggered the most recent p-switch or stopwatch. |
| P-Switch/Stopwatch Length | 0x00B2C87C | FIELD_WORD | The duration of the p-switch/stopwatch effect. |