I made text-only and easy-to-read LunaLua referance sheets

Need help with any SMBX game-related issues? Ask your questions here.
lostdarkwolf
Shy Guy
Shy Guy
Posts: 8
Joined: Fri Mar 01, 2019 1:04 am
Chat Username: Jus_Sum_Guy

I made text-only and easy-to-read LunaLua referance sheets

Postby lostdarkwolf » Thu Mar 21, 2019 1:51 am

Maybe this should be stickied? :?: (Maybe not idk lol.)
I didn't know where to put this. It was a toss up between the "General" section and the "Help and Support" section, but I figured it fit in better here. It bugged me that the LunaLua reference stuff was all online and in a bunch of web pages, so I went through the trouble of manually converting all of the reference stuff to an easy-to-read and text-only format that can easily be saved for offline referencing to LunaLua.

SMBX Player Offsets
Spoiler: show
SMBX Player Offsets (0x184 bytes, unused addresses omitted)
Source: https://wohlsoft.ru/pgewiki/SMBX_Player_Offsets

Untitled Content Below
--------------------------------------------------------------------------------------------

- Name:
SMBX PC+0x00
- Memory address:
PC+0x00
- Memory type:
FIELD_BOOL
- Description:
Toad doublejump ready (FFFF true)

- Name:
SMBX PC+0x02
- Memory address:
PC+0x02
- Memory type:
FIELD_WORD
- Description:
Star sparkling effect on player

- Name:
SMBX PC+0x04
- Memory address:
PC+0x04
- Memory type:
FIELD_WORD
- Description:
Horizontal and ducking disabled (?)

- Name:
SMBX PC+0x06
- Memory address:
PC+0x06
- Memory type:
FIELD_BOOL
- Description:
Ducking enabled?

- Name:
SMBX PC+0x08
- Memory address:
PC+0x08
- Memory type:
FIELD_WORD
- Description:
# of bomb Link has in his inventory

- Name:
SMBX PC+0x0A
- Memory address:
PC+0x0A
- Memory type:
FIELD_BOOL
- Description:
Is on slippery ground

Link Content Below
--------------------------------------------------------------------------------------------

- Name:
SMBX PC+0x0C
- Memory address:
PC+0x0C
- Memory type:
FIELD_BOOL
- Description:
Is a fairy

- Name:
SMBX PC+0x0E
- Memory address:
PC+0x0E
- Memory type:
FIELD_BOOL
- Description:
Fairy already used this jump

- Name:
SMBX PC+0x10
- Memory address:
PC+0x10
- Memory type:
FIELD_WORD
- Description:
Frames until fairy runs out

- Name:
SMBX PC+0x12
- Memory address:
PC+0x12
- Memory type:
FIELD_BOOL
- Description:
Link has a key

- Name:
SMBX PC+0x14
- Memory address:
PC+0x14
- Memory type:
FIELD_WORD
- Description:
Link slash cooldown timer

- Name:
SMBX PC+0x16
- Memory address:
PC+0x16
- Memory type:
FIELD_WORD
- Description:
# of hearts (all characters)

Peach Content Below
--------------------------------------------------------------------------------------------

- Name:
SMBX PC+0x18
- Memory address:
PC+0x18
- Memory type:
FIELD_BOOL
- Description:
Princess hover is available

- Name:
SMBX PC+0x1A
- Memory address:
PC+0x1A
- Memory type:
FIELD_BOOL
- Description:
Holding jump button

- Name:
SMBX PC+0x1C
- Memory address:
PC+0x1C
- Memory type:
FIELD_WORD
- Description:
Princess hover timer

- Name:
SMBX PC+0x1E
- Memory address:
PC+0x1E
- Memory type:
FIELD_WORD
- Description:
Unused (not cleared on level load)

- Name:
SMBX PC+0x20
- Memory address:
PC+0x20
- Memory type:
FIELD_FLOAT
- Description:
Princess hover Y tremble speed

- Name:
SMBX PC+0x24
- Memory address:
PC+0x24
- Memory type:
FIELD_WORD
- Description:
Princess hover Y tremble direction

Misc Content Below
--------------------------------------------------------------------------------------------

- Name:
SMBX PC+0x26
- Memory address:
PC+0x26
- Memory type:
FIELD_WORD
- Description:
Ground item pull-up timer

- Name:
SMBX PC+0x28
- Memory address:
PC+0x28
- Memory type:
FIELD_FLOAT
- Description:
Ground item pull-up momentum save

- Name:
SMBX PC+0x2A
- Memory address:
PC+0x2A
- Memory type:
FIELD_WORD
- Description:
Unused (not cleared on level load)

Climbing Content Below
--------------------------------------------------------------------------------------------

- Name:
SMBX PC+0x2C
- Memory address:
PC+0x2C
- Memory type:
FIELD_DFLOAT
- Description:
Index of NPC currently climbed on (-1 if climbing on a net bgo)

Water Content Below
--------------------------------------------------------------------------------------------

- Name:
SMBX PC+0x34
- Memory address:
PC+0x34
- Memory type:
FIELD_WORD
- Description:
2 when in water or quicksand; can be used to force the player into an underwater state

- Name:
SMBX PC+0x36
- Memory address:
PC+0x36
- Memory type:
FIELD_BOOL
- Description:
Is underwater

- Name:
SMBX PC+0x38
- Memory address:
PC+0x38
- Memory type:
FIELD_WORD
- Description:
Water stroke timer (can't stroke again until 0)

Misc Content Below
--------------------------------------------------------------------------------------------

- Name:
SMBX PC+0x3A
- Memory address:
PC+0x3A
- Memory type:
FIELD_WORD
- Description:
Unknown hover timer

- Name:
SMBX PC+0x3C
- Memory address:
PC+0x3C
- Memory type:
FIELD_BOOL
- Description:
Is sliding

- Name:
SMBX PC+0x3E
- Memory address:
PC+0x3E
- Memory type:
FIELD_BOOL
- Description:
Is generating sliding smoke puffs

- Name:
SMBX PC+0x40
- Memory address:
PC+0x40
- Memory type:
FIELD_WORD
- Description:
Climbing state (3 climbing, 2 pushed up against edge of climbable area)

- Name:
SMBX PC+0x42
- Memory address:
PC+0x42
- Memory type:
FIELD_WORD
- Description:
Unknown timer42

- Name:
SMBX PC+0x44
- Memory address:
PC+0x44
- Memory type:
FIELD_BOOL
- Description:
Flag for riding a rainbow shell

- Name:
SMBX PC+0x46
- Memory address:
PC+0x46
- Memory type:
FIELD_WORD
- Description:
Unknown46 (powerup pickup related)

- Name:
SMBX PC+0x48
- Memory address:
PC+0x48
- Memory type:
FIELD_WORD
- Description:
Slope modifier

Tanooki Suit Content Below
--------------------------------------------------------------------------------------------

- Name:
SMBX PC+0x4A
- Memory address:
PC+0x4A
- Memory type:
FIELD_BOOL
- Description:
Tanooki suit statue flag

- Name:
SMBX PC+0x4C
- Memory address:
PC+0x4C
- Memory type:
FIELD_WORD
- Description:
Statue transform cooldown frame timer

- Name:
SMBX PC+0x4E
- Memory address:
PC+0x4E
- Memory type:
FIELD_WORD
- Description:
Frames spent as statue

Spin jump Content Below
--------------------------------------------------------------------------------------------

- Name:
SMBX PC+0x50
- Memory address:
PC+0x50
- Memory type:
FIELD_BOOL
- Description:
Spinjump flag

- Name:
SMBX PC+0x52
- Memory address:
PC+0x52
- Memory type:
FIELD_WORD
- Description:
Spinjump state counter

- Name:
SMBX PC+0x54
- Memory address:
PC+0x54
- Memory type:
FIELD_WORD
- Description:
Spinjump land direction (will face this direction when landing)

State Content Below
--------------------------------------------------------------------------------------------

- Name:
SMBX PC+0x56
- Memory address:
PC+0x56
- Memory type:
FIELD_WORD
- Description:
Current enemy kill combo count

- Name:
SMBX PC+0x58
- Memory address:
PC+0x58
- Memory type:
FIELD_WORD
- Description:
Ground sliding smoke puffs state

- Name:
SMBX PC+0x5A
- Memory address:
PC+0x5A
- Memory type:
FIELD_WORD
- Description:
Index/id of intersecting warp entrance

- Name:
SMBX PC+0x60
- Memory address:
PC+0x60
- Memory type:
FIELD_BOOL
- Description:
Has jumped

Unknown Content Below
--------------------------------------------------------------------------------------------

- Name:
SMBX PC+0x62
- Memory address:
PC+0x62
- Memory type:
FIELD_WORD
- Description:
Unknown62

Yoshi Content Below
--------------------------------------------------------------------------------------------

- Name:
SMBX PC+0x64
- Memory address:
PC+0x64
- Memory type:
FIELD_BOOL
- Description:
Yoshi has earthquake(yellow shell)

- Name:
SMBX PC+0x66
- Memory address:
PC+0x66
- Memory type:
FIELD_BOOL
- Description:
Yoshi has flight (blue shell)

- Name:
SMBX PC+0x68
- Memory address:
PC+0x68
- Memory type:
FIELD_BOOL
- Description:
Yoshi has fire breath (red shell)

- Name:
SMBX PC+0x6A
- Memory address:
PC+0x6A
- Memory type:
FIELD_WORD
- Description:
Wings' current frame (Yoshi and Kuribo's Shoe))

- Name:
SMBX PC+0x6C
- Memory address:
PC+0x6C
- Memory type:
FIELD_WORD
- Description:
Wings' animation timer (Yoshi and Kuribo's Shoe)

- Name:
SMBX PC+0x6E
- Memory address:
PC+0x6E
- Memory type:
FIELD_WORD
- Description:
Yoshi Head X-Offset

- Name:
SMBX PC+0x70
- Memory address:
PC+0x70
- Memory type:
FIELD_WORD
- Description:
Yoshi Head Y-Offset

- Name:
SMBX PC+0x72
- Memory address:
PC+0x72
- Memory type:
FIELD_WORD
- Description:
Yoshi's head animation frame(0-4 is left, 5-9 is right)

- Name:
SMBX PC+0x74
- Memory address:
PC+0x74
- Memory type:
FIELD_WORD
- Description:
Yoshi swallow timer

- Name:
SMBX PC+0x76
- Memory address:
PC+0x76
- Memory type:
FIELD_WORD
- Description:
Unknown/Unused? (Seems to be a constant -4)

- Name:
SMBX PC+0x78
- Memory address:
PC+0x78
- Memory type:
FIELD_WORD
- Description:
Yoshi-related offset value

- Name:
SMBX PC+0x7A
- Memory address:
PC+0x7A
- Memory type:
FIELD_WORD
- Description:
Yoshi's body animation frame (0-6 is left, 7-13 is right)

- Name:
SMBX PC+0x7C
- Memory address:
PC+0x7C
- Memory type:
FIELD_WORD
- Description:
Yoshi animation frame timer (rapidly increments from 0 to 32, freezes in the air, resets to 0 when pressing down; probably used to to move body and head with the animation)

- Name:
SMBX PC+0x7E
- Memory address:
PC+0x7E
- Memory type:
FIELD_WORD
- Description:
Unknown/Unused?

- Name:
SMBX PC+0x80
- Memory address:
PC+0x80
- Memory type:
FIELD_DFLOAT
- Description:
Tongue X-Position

- Name:
SMBX PC+0x88
- Memory address:
PC+0x88
- Memory type:
FIELD_DFLOAT
- Description:
Tongue Y-Position

- Name:
SMBX PC+0x90
- Memory address:
PC+0x90
- Memory type:
FIELD_DFLOAT
- Description:
Tongue Width

- Name:
SMBX PC+0x98
- Memory address:
PC+0x98
- Memory type:
FIELD_DFLOAT
- Description:
Tongue Height

- Name:
SMBX PC+0xA0
- Memory address:
PC+0xA0
- Memory type:
FIELD_WORD
- Description:
Unknown/Unused?

- Name:
SMBX PC+0xA8
- Memory address:
PC+0xA8
- Memory type:
FIELD_WORD
- Description:
Unknown/Unused?

- Name:
SMBX PC+0xB0
- Memory address:
PC+0xB0
- Memory type:
FIELD_FLOAT
- Description:
Tongue X-Start/End Position

- Name:
SMBX PC+0xB4
- Memory address:
PC+0xB4
- Memory type:
FIELD_WORD
- Description:
Tongue X-Offset from Start/End

- Name:
SMBX PC+0xB6
- Memory address:
PC+0xB6
- Memory type:
FIELD_BOOL
- Description:
Whether Tongue is retracting

- Name:
SMBX PC+0xB8
- Memory address:
PC+0xB8
- Memory type:
FIELD_WORD
- Description:
Index of NPC currently on the tongue (0 if no NPC)

Unknown Content Below
--------------------------------------------------------------------------------------------

- Name:
SMBX PC+0xBA
- Memory address:
PC+0xBA
- Memory type:
FIELD_WORD
- Description:
Unknown/Unused?

- Name:
SMBX PC+0xBC
- Memory address:
PC+0xBC
- Memory type:
FIELD_WORD
- Description:
Unknown timer after exiting the clown car.

- Name:
SMBX PC+0xBE
- Memory address:
PC+0xBE
- Memory type:
FIELD_WORD
- Description:
Unknown/Unused?

Position Content Below
--------------------------------------------------------------------------------------------

- Name:
SMBX PC+0xC0
- Memory address:
PC+0xC0
- Memory type:
FIELD_DFLOAT
- Description:
Player X position (absolute coordinates within level)

- Name:
SMBX PC+0xC8
- Memory address:
PC+0xC8
- Memory type:
FIELD_DFLOAT
- Description:
Player Y position (absolute coordinates within level)

- Name:
SMBX PC+0xD0
- Memory address:
PC+0xD0
- Memory type:
FIELD_DFLOAT
- Description:
Player height or hitbox related

- Name:
SMBX PC+0xD8
- Memory address:
PC+0xD8
- Memory type:
FIELD_DFLOAT
- Description:
Player width or hitbox related

- Name:
SMBX PC+0xE0
- Memory address:
PC+0xE0
- Memory type:
FIELD_DFLOAT
- Description:
Player X speed

- Name:
SMBX PC+0xE8
- Memory address:
PC+0xE8
- Memory type:
FIELD_DFLOAT
- Description:
Player Y speed

- Name:
SMBX PC+0xF0
- Memory address:
PC+0xF0
- Memory type:
FIELD_WORD
- Description:
Player identity index (0 Nothing! Don't use, 1 Mario/Demo, 2 Luigi/Iris, 3 Peach/Princess, 4 Toad, 5 Link/Sheath)

Input Content Below
--------------------------------------------------------------------------------------------

- Name:
SMBX PC+0xF2
- Memory address:
PC+0xF2
- Memory type:
FIELD_BOOL
- Description:
U key pressing

- Name:
SMBX PC+0xF4
- Memory address:
PC+0xF4
- Memory type:
FIELD_BOOL
- Description:
D key pressing

- Name:
SMBX PC+0xF6
- Memory address:
PC+0xF6
- Memory type:
FIELD_BOOL
- Description:
L key pressing

- Name:
SMBX PC+0xF8
- Memory address:
PC+0xF8
- Memory type:
FIELD_BOOL
- Description:
R key pressing

- Name:
SMBX PC+0xFA
- Memory address:
PC+0xFA
- Memory type:
FIELD_BOOL
- Description:
J key pressing

- Name:
SMBX PC+0xFC
- Memory address:
PC+0xFC
- Memory type:
FIELD_BOOL
- Description:
SJ key pressing

- Name:
SMBX PC+0xFE
- Memory address:
PC+0xFE
- Memory type:
FIELD_BOOL
- Description:
X key pressing

- Name:
SMBX PC+0x100
- Memory address:
PC+0x100
- Memory type:
FIELD_BOOL
- Description:
RN key pressing

- Name:
SMBX PC+0x102
- Memory address:
PC+0x102
- Memory type:
FIELD_BOOL
- Description:
SEL key pressing

- Name:
SMBX PC+0x104
- Memory address:
PC+0x104
- Memory type:
FIELD_BOOL
- Description:
STR key pressing

- Name:
SMBX PC+0x106
- Memory address:
PC+0x106
- Memory type:
FIELD_WORD
- Description:
Direction faced (-1 left)

Mount Content Below
--------------------------------------------------------------------------------------------

- Name:
SMBX PC+0x108
- Memory address:
PC+0x108
- Memory type:
FIELD_WORD
- Description:
Mount identity (0 no mount, 1 boot, 2 clowncar, 3 yoshi)

- Name:
SMBX PC+0x10A
- Memory address:
PC+0x10A
- Memory type:
FIELD_WORD
- Description:
Mount color

- Name:
SMBX PC+0x10C
- Memory address:
PC+0x10C
- Memory type:
FIELD_WORD
- Description:
Yoshi: Whether Yoshi's tongue is out.
Shoes: Whether player is able to jump while hopping

- Name:
SMBX PC+0x10E
- Memory address:
PC+0x10E
- Memory type:
FIELD_WORD
- Description:
Yoshi: Y offset (Unknown reference).
Shoes: Turns 0 when ducking, goes 5 from -6 and its value is related with player Y speed.

- Name:
SMBX PC+0x110
- Memory address:
PC+0x110
- Memory type:
FIELD_WORD
- Description:
Current frame for Shoe/Clown Car, unused for Yoshi.

State Content Below
--------------------------------------------------------------------------------------------

- Name:
SMBX PC+0x112
- Memory address:
PC+0x112
- Memory type:
FIELD_WORD
- Description:
Current power-up

- Name:
SMBX PC+0x114
- Memory address:
PC+0x114
- Memory type:
FIELD_WORD
- Description:
Current player sprite index being displayed. Chart for values

- Name:
SMBX PC+0x116
- Memory address:
PC+0x116
- Memory type:
FIELD_WORD
- Description:
Unused

- Name:
SMBX PC+0x118
- Memory address:
PC+0x118
- Memory type:
FIELD_FLOAT
- Description:
X momentum assumption (used when determining how to draw the sprite)

- Name:
SMBX PC+0x11C
- Memory address:
PC+0x11C
- Memory type:
FIELD_WORD
- Description:
Current upward jumping force (2 byte integer representation)

- Name:
SMBX PC+0x11E
- Memory address:
PC+0x11E
- Memory type:
FIELD_WORD
- Description:
Holding jump button (-1 is Can Jump. 1 is Can't Jump)

- Name:
SMBX PC+0x120
- Memory address:
PC+0x120
- Memory type:
FIELD_BOOL
- Description:
Holding spinjump button

- Name:
SMBX PC+0x122
- Memory address:
PC+0x122
- Memory type:
FIELD_WORD
- Description:
Forced animation state:
1: Powering up to "Big" state
2: Powering down to "Small" state
3: Entering a pipe
4: Powering up to "Fire Flower" state
5: Powering up to "Leaf" state
6: Respawning in 2-Player mode (Careful with this one)
7: Entering a door
8: Invisible/Immobile/Intangible state (Turning into a fairy or a different character)
9: On another player's Yoshi's tongue
10: In another player's Yoshi's mouth
11: Powering up to "Tanooki" state
12: Powering up to "Hammer" state
41: Powering up to "Ice Flower" state
227: Powering down from "Fire Flower" state with 3 hearts to "Big" state
228: Powering down from "Ice Flower" state with 3 hearts to "Big" state
500: Tanooki Statue poof state
WARNING! BE CAREFUL WHEN SETTING THESE VALUES. SMBX will sometimes crash depending on which values are set or if certain values are set on the same tick as others. Also note that there are no additional states for powering down from "Leaf", "Tanooki", or "Hammer" states with 3 hearts to "Big".

- Name:
SMBX PC+0x124
- Memory address:
PC+0x124
- Memory type:
FIELD_DFLOAT
- Description:
Forced animation timer

- Name:
SMBX PC+0x12C
- Memory address:
PC+0x12C
- Memory type:
FIELD_BOOL
- Description:
Down button mirror (redundant?)

- Name:
SMBX PC+0x12E
- Memory address:
PC+0x12E
- Memory type:
FIELD_BOOL
- Description:
In ducking state

- Name:
SMBX PC+0x130
- Memory address:
PC+0x130
- Memory type:
FIELD_BOOL
- Description:
Select button mirror (redundant?)

- Name:
SMBX PC+0x132
- Memory address:
PC+0x132
- Memory type:
FIELD_BOOL
- Description:
True when the collected-powerup invincibility animation ends.

- Name:
SMBX PC+0x134
- Memory address:
PC+0x134
- Memory type:
FIELD_BOOL
- Description:
Down button pressed this frame (reset next frame)

- Name:
SMBX PC+0x136
- Memory address:
PC+0x136
- Memory type:
FIELD_BOOL
- Description:
Was spit out of Yoshi's mouth

- Name:
SMBX PC+0x138
- Memory address:
PC+0x138
- Memory type:
FIELD_FLOAT
- Description:
X momentum push (eg. pushed by a bully)

- Name:
SMBX PC+0x13C
- Memory address:
PC+0x13C
- Memory type:
FIELD_BOOL
- Description:
Player death state

- Name:
SMBX PC+0x13E
- Memory address:
PC+0x13E
- Memory type:
FIELD_WORD
- Description:
Player death animation timer

- Name:
SMBX PC+0x140
- Memory address:
PC+0x140
- Memory type:
FIELD_WORD
- Description:
Powerup blinking timer (Decrements from 50 (powerup) or 150 (hurt) back to 0, player is invulnerable when this is nonzero)

- Name:
SMBX PC+0x142
- Memory address:
PC+0x142
- Memory type:
FIELD_BOOL
- Description:
Powerup blinking state (flickers between true and false)

- Name:
SMBX PC+0x144
- Memory address:
PC+0x144
- Memory type:
FIELD_WORD
- Description:
Unknown144

Layer Content Below
--------------------------------------------------------------------------------------------

- Name:
SMBX PC+0x146
- Memory address:
PC+0x146
- Memory type:
FIELD_WORD
- Description:
Bottom state (0 not on the ground, standing on sprite, during power-up/power-down and foot contact with a slope, 2 foot contact with a solid layer)

- Name:
SMBX PC+0x148
- Memory address:
PC+0x148
- Memory type:
FIELD_WORD
- Description:
Left state (0 no left contact, 1 half or pushed back by a solid layer, 2 pushing against layer)

- Name:
SMBX PC+0x14A
- Memory address:
PC+0x14A
- Memory type:
FIELD_WORD
- Description:
Top state (0 no top contact, 1 half or pushed back by a solid layer, 2 pushing against layer)

- Name:
SMBX PC+0x14C
- Memory address:
PC+0x14C
- Memory type:
FIELD_WORD
- Description:
Right state (0 no right contact, 1 half or pushed back by a solid layer, 2 pushing against layer)

- Name:
SMBX PC+0x14E
- Memory address:
PC+0x14E
- Memory type:
FIELD_WORD
- Description:
Pushed by a moving layer (0 not pushed by any, 2 being pushed to the left or right)

- Name:
SMBX PC+0x150
- Memory address:
PC+0x150
- Memory type:
FIELD_WORD
- Description:
Unused150

- Name:
SMBX PC+0x152
- Memory address:
PC+0x152
- Memory type:
FIELD_WORD
- Description:
Unused152

Misc Content Below
--------------------------------------------------------------------------------------------

- Name:
SMBX PC+0x154
- Memory address:
PC+0x154
- Memory type:
FIELD_WORD
- Description:
Index of sprite being held (index to a specific sprite object that was generated only, -1 can't carry anything)

- Name:
SMBX PC+0x156
- Memory address:
PC+0x156
- Memory type:
FIELD_BOOL
- Description:
Whether or not the player can grab anything

- Name:
SMBX PC+0x158
- Memory address:
PC+0x158
- Memory type:
FIELD_WORD
- Description:
Powerup box contents (0 no item)

Section Content Below
--------------------------------------------------------------------------------------------

- Name:
SMBX PC+0x15A
- Memory address:
PC+0x15A
- Memory type:
FIELD_WORD
- Description:
Current section

- Name:
SMBX PC+0x15C
- Memory address:
PC+0x15C
- Memory type:
FIELD_WORD
- Description:
Warp cooldown timer (can't warp / pipe until 0)

- Name:
SMBX PC+0x15E
- Memory address:
PC+0x15E
- Memory type:
FIELD_WORD
- Description:
Target warp exit index/id (not reset after finished warping)

Projectile Content Below
--------------------------------------------------------------------------------------------

- Name:
SMBX PC+0x160
- Memory address:
PC+0x160
- Memory type:
FIELD_WORD
- Description:
Projectile timer (fireballs, hammers, link slash..)

- Name:
SMBX PC+0x162
- Memory address:
PC+0x162
- Memory type:
FIELD_WORD
- Description:
Projectile timer 2 (link projectiles)

- Name:
SMBX PC+0x164
- Memory address:
PC+0x164
- Memory type:
FIELD_WORD
- Description:
Tail swipe timer

- Name:
SMBX PC+0x166
- Memory address:
PC+0x166
- Memory type:
FIELD_WORD
- Description:
Unknown166

Flight Content Below
--------------------------------------------------------------------------------------------

- Name:
SMBX PC+0x168
- Memory address:
PC+0x168
- Memory type:
FIELD_FLOAT
- Description:
Run speed aggregate until flight achieveable

- Name:
SMBX PC+0x16C
- Memory address:
PC+0x16C
- Memory type:
FIELD_BOOL
- Description:
Can fly

- Name:
SMBX PC+0x16E
- Memory address:
PC+0x16E
- Memory type:
FIELD_BOOL
- Description:
Is flying

- Name:
SMBX PC+0x170
- Memory address:
PC+0x170
- Memory type:
FIELD_WORD
- Description:
Flight time remaining

- Name:
SMBX PC+0x172
- Memory address:
PC+0x172
- Memory type:
FIELD_BOOL
- Description:
Holding flight run button

- Name:
SMBX PC+0x174
- Memory address:
PC+0x174
- Memory type:
FIELD_BOOL
- Description:
Holding flight button

Misc Content Below
--------------------------------------------------------------------------------------------

- Name:
SMBX PC+0x176
- Memory address:
PC+0x176
- Memory type:
FIELD_WORD
- Description:
Index of sprite being stood on (stores the index into the NPC array + 1. 0 when not standing on an NPC)

- Name:
SMBX PC+0x178
- Memory address:
PC+0x178
- Memory type:
FIELD_WORD
- Description:
Unknown X momentum with sprites

- Name:
SMBX PC+0x17A
- Memory address:
PC+0x17A
- Memory type:
FIELD_BOOL
- Description:
Usually forced to true
Level and Overworld events:
Spoiler: show
Level and Overworld events:
(Every function here retuns nil.)

- Function:
onStart()
- Description:
Runs the first frame of the level loading. (Level and Overworld) (LunaLua ≥ v0.7.3)

- Function:
onLoad()
- Description:
*DEPRECATED* (use onStart instead if you're using LunaLua ≥ V0.7.3) onLoad is called when the level editor or the game engine loads the level. (Level and Overworld)

- Function:
onTick()
- Description:
This is called before SMBX gameplay logic each tick (right after onInputUpdate). (Level and Overworld) (LunaLua ≥ v0.7.3)

- Function:
onTickEnd()
- Description:
This is called after SMBX gameplay logic each tick. (Level and Overworld) (LunaLua ≥ v0.7.3)

- Function:
onDraw()
- Description:
This is called just before drawing each frame. (Level and Overworld) (LunaLua ≥ v0.7.3)

- Function:
onDrawEnd()
- Description:
This is called just after drawing each frame. (Level and Overworld) (LunaLua ≥ v0.7.3)

- Function:
onLoop()
- Description:
*DEPRECATED* (Use onTick instead if you're using LunaLua ≥ V0.7.3) Immediately at the start of each frame while the game runs onLoop is called. (Level and Overworld)

- Function:
onLoopSection#(int playerIndex)
- Description:
On each frame while the game runs in the specific section # onLoopSection# is called. Replace # with the sectionnumber 0-20. Note: This function is called per player. If you are in 2-player-mode this function is called twice! (Level only)

- Function:
onLoadSection(int playerIndex)
- Description:
In the first frameloop of a new section onLoadSection is called. Note: This function is called per player. If you are in 2-player-mode this function is called twice! (Level only)

- Function:
onLoadSection#(int playerIndex)
- Description:
In the first frameloop of section # onLoadSection# is called. Replace # with the sectionnumber 0-20. Note: This function is called per player. If you are in 2-player-mode this function is called twice! (Level only)

- Function:
onJump(int playerIndex)
- Description:
When the player starts to jump, onJump is called. playerIndex is the index of the player (Player 1: playerIndex = 1; Player 2: playerIndex = 2). Please note that only big jumps are recognized! (Level only)

- Function:
onJumpEnd(int playerIndex)
- Description:
When the player hits the surface (jump ends), onJumpEnd is called. playerIndex is the index of the player (Player 1: playerIndex = 1; Player 2: playerIndex = 2). Please note that only big jumps are recognized! (Level only)

- Function:
onKeyDown(int keycode, int playerIndex)
- Description:
When a key is getting hit, onKeyDown is called. Keycode can be compared with the constants. playerIndex is the index of the player (Player 1: playerIndex = 1; Player 2: playerIndex = 2). (Level only)

- Function:
onKeyUp(int keycode, int playerIndex)
- Description:
When a key is getting released, onKeyUp is called. Keycode can be compared with the constants. playerIndex is the index of the player (Player 1: playerIndex = 1; Player 2: playerIndex = 2). (Level only)

- Function:
onEvent(string eventName)
- Description:
This event is called when a SMBX event is called. (Level only)

- Function:
onEventDirect(Event eventObj, string eventName)
- Description:
This event is called when a SMBX event is called. You can also cancel this event, meaning that the SMBX event will not processed by SMBX.
NOTE: This function is not sync with the normal event loop. Changes in the SMBX memory may not affect or work with SMBX! (Level only)

- Function:
onExitLevel()
- Description:
This event is called when the player exits the level (including exit by menu).
(Level only) (LunaLua ≥v0.7)

- Function:
onInputUpdate()
- Description:
This event is called every frame, like onTick, but you can overwrite the Player.**KeyPressing fields here!
(Level and Overworld) (LunaLua ≥v0.7)

- Function:
onMessageBox(Event eventObj, string message)
- Description:
This event is called before a message box is opened. (Level and Overworld)

- Function:
onHUDDraw()
- Description:
This event is called when the HUD is drawn. (Level and Overworld)

- Function:
onNPCKill(Event eventObj, NPC killedNPC, number killReason)
- Description:
This event is called when a NPC is killed.

Killreasons:
1 - Default kill
2 - Bonked from Below
3 - Shell, bomb, squish, hammer, most thrown NPCs
4 - Projectile hitting something else (the NPC referred to being projectile itself in this case, not what it hit)
5 - Killed by some types of enemy being held by the player (not a thrown enemy)
6 - Lava
7 - Tail kill
8 - Spinjump
9 - Despawn or NPC eaten (ie powerups) = Vanish
10 - Link Slash or Link Fireball
(Level only) (LunaLua ≥ v0.7.2.3)

- Function:
onCameraUpdate(Event eventObj, number cameraIndex)
- Description:
This event is called when the camera data is updated. With this event you can overwrite the camera data. (Level only) (LunaLua ≥ v0.7.3)

- Function:
onKeyboardPress(number vk)
- Description:
This event is called when a key on the keyboard is pressed. vk is the virtual-key code. You can find more about the virtual-key code here: Virtual-Key Codes. You can directly use the constants given on this page including constants with letters and numbers (i.e. VK_4) (Level and Overworld) (LunaLua ≥ v0.7.3)

- Function:
onKeyboardPressDirect(Event eventObj, number vk)
- Description:
This event is called when a key on the keyboard is pressed. Unlike onKeyboardPress, this event will work while the game is frozen with Misc.pause().
NOTE: This function is not sync with the normal event loop. Changes in the SMBX memory may not affect or work with SMBX! (Level and Overworld) (LunaLua ≥ v0.7.3)
Constants
Spoiler: show
----- Constants: -----

--- Constant: ---
GAME_ENGINE
--- Used in: ---
"Used in" not availible.
--- Description: ---
Equal to "LunaLUA" string (since v0.7.2). If this script will be ran on PGE Engine, it will be equal to "PGE_Engine". Use this constant to make cross-engine scripts which would be used with both PGE-Lua and LunaLUA

--- Constant: ---
LUNALUA_VER
--- Used in: ---
"Used in" not availible.
--- Description: ---
Contains current version of LunaLUA (since v0.7.2)

--- Constant: ---
player
--- Used in: ---
"Used in" not availible.
--- Description: ---
The first player.

--- Constant: ---
player2
--- Used in: ---
"Used in" not availible.
--- Description: ---
The second player. Is only constructed if the level runs in two player mode.

--- Constant: ---
FIND_ANY
--- Used in: ---
findnpcs
--- Description: ---
Is used to skip one of the filter.

--- Constant: ---
DIR_RIGHT
--- Used in: ---
NPC.direction
--- Description: ---
Represents the direction right.

--- Constant: ---
DIR_RANDOM
--- Used in: ---
NPC.direction
--- Description: ---
Represents the direction random.

--- Constant: ---
DIR_LEFT
--- Used in: ---
NPC.direction
--- Description: ---
Represents the direction left.

--- Constant: ---
PLAYER_SMALL
--- Used in: ---
Player.powerup
PlayerSettings.get
--- Description: ---
No powerup/Small

--- Constant: ---
PLAYER_BIG
--- Used in: ---
Player.powerup
PlayerSettings.get
--- Description: ---
Mushroom powerup/Big

--- Constant: ---
PLAYER_FIREFLOWER
--- Used in: ---
Player.powerup
PlayerSettings.get
--- Description: ---
Fireflower powerup

--- Constant: ---
PLAYER_LEAF
--- Used in: ---
Player.powerup
PlayerSettings.get
--- Description: ---
Leaf powerup

--- Constant: ---
PLAYER_TANOOKIE
--- Used in: ---
Player.powerup
PlayerSettings.get
--- Description: ---
Tanookie powerup

--- Constant: ---
PLAYER_HAMMER
--- Used in: ---
Player.powerup
PlayerSettings.get
--- Description: ---
Hammer powerup

--- Constant: ---
PLAYER_ICE
--- Used in: ---
Player.powerup
PlayerSettings.get
--- Description: ---
Ice powerup

--- Constant: ---
CHARACTER_MARIO
--- Used in: ---
PlayerSettings.get
--- Description: ---
Mario/Demo character

--- Constant: ---
CHARACTER_LUIGI
--- Used in: ---
PlayerSettings.get
--- Description: ---
Luigi/Iris character

--- Constant: ---
CHARACTER_PEACH
--- Used in: ---
PlayerSettings.get
--- Description: ---
Peach/Kood character

--- Constant: ---
CHARACTER_TOAD
--- Used in: ---
PlayerSettings.get
--- Description: ---
Toad/Raocow character

--- Constant: ---
CHARACTER_LINK
--- Used in: ---
PlayerSettings.get
--- Description: ---
Link/Sheath character

--- Constant: ---
HARM_TYPE_JUMP
--- Used in: ---
NPC:harm
--- Description: ---
Damage dealt by player jumps

--- Constant: ---
HARM_TYPE_FROMBELOW
--- Used in: ---
NPC:harm
--- Description: ---
Damage dealt by block bumps from below

--- Constant: ---
HARM_TYPE_NPC
--- Used in: ---
NPC:harm
--- Description: ---
Damage dealt by a thrown npc or bomb explosion

--- Constant: ---
HARM_TYPE_PROJECTILE_USED
--- Used in: ---
NPC:harm
--- Description: ---
Damage dealt to projectiles like fireballs, etc. when they hit something

--- Constant: ---
HARM_TYPE_LAVA
--- Used in: ---
NPC:harm
--- Description: ---
Damage dealt by contact with lava

--- Constant: ---
HARM_TYPE_HELD
--- Used in: ---
NPC:harm
--- Description: ---
Damage dealt by an npc held by the player

--- Constant: ---
HARM_TYPE_TAIL
--- Used in: ---
NPC:harm
--- Description: ---
Damage dealt by the player's tail

--- Constant: ---
HARM_TYPE_SPINJUMP
--- Used in: ---
NPC:harm
--- Description: ---
Damage dealt by player spin jumps

--- Constant: ---
HARM_TYPE_OFFSCREEN
--- Used in: ---
NPC:harm
--- Description: ---
Damage dealt when an npc is despawned

--- Constant: ---
HARM_TYPE_SWORD
--- Used in: ---
NPC:harm
--- Description: ---
Damage dealt by Link's sword

--- Constant: ---
HARM_TYPE_EXT_FIRE
--- Used in: ---
NPC:harm
--- Description: ---
Damage dealt by player-thrown fireballs

--- Constant: ---
HARM_TYPE_EXT_ICE
--- Used in: ---
NPC:harm
--- Description: ---
Damage dealt by player-thrown iceballs

--- Constant: ---
HARM_TYPE_EXT_HAMMER
--- Used in: ---
NPC:harm
--- Description: ---
Damage dealt by player-thrown hammers

--- Constant: ---
FIELD_BYTE
--- Used in: ---
mem
Player:mem
NPC:mem
--- Description: ---
Byte field (1 byte field representing an integer)

--- Constant: ---
FIELD_WORD
--- Used in: ---
mem
Player:mem
NPC:mem
--- Description: ---
Word field (2 byte field representing an integer)

--- Constant: ---
FIELD_DWORD
--- Used in: ---
mem
Player:mem
NPC:mem
--- Description: ---
DWord field (4 byte field representing an integer)

--- Constant: ---
FIELD_FLOAT
--- Used in: ---
mem
Player:mem
NPC:mem
--- Description: ---
Float field (4 byte field representing a decimal value)

--- Constant: ---
FIELD_DFLOAT
--- Used in: ---
mem
Player:mem
NPC:mem
--- Description: ---
DFloat field aka. Double field (8 byte field representing a decimal value)

--- Constant: ---
FIELD_STRING
--- Used in: ---
mem
Player:mem
NPC:mem
--- Description: ---
String field (VBStr)

--- Constant: ---
KEY_UP
--- Used in: ---
keycode
--- Description: ---
Up key

--- Constant: ---
KEY_DOWN
--- Used in: ---
keycode
--- Description: ---
Down key

--- Constant: ---
KEY_LEFT
--- Used in: ---
keycode
--- Description: ---
Left key

--- Constant: ---
KEY_RIGHT
--- Used in: ---
keycode
--- Description: ---
Right key

--- Constant: ---
KEY_JUMP
--- Used in: ---
keycode
--- Description: ---
Jump key

--- Constant: ---
KEY_SPINJUMP
--- Used in: ---
keycode
--- Description: ---
Spinjump key

--- Constant: ---
KEY_X
--- Used in: ---
keycode
--- Description: ---
X key

--- Constant: ---
KEY_RUN
--- Used in: ---
keycode
--- Description: ---
Run key

--- Constant: ---
KEY_SEL
--- Used in: ---
keycode
--- Description: ---
Sel key

--- Constant: ---
KEY_STR
--- Used in: ---
keycode
--- Description: ---
Str key

--- Constant: ---
isOverworld
--- Used in: ---
"Used in" not availible.
--- Description: ---
True, if the script is run on the overworld
Global Functions
Spoiler: show
Global Functions:
Source: https://wohlsoft.ru/pgewiki/LunaLua_global_functions


----- General Functions -----


--- Function ---
mem(address, fieldtype, value)
--- Return values ---
nil
--- Description ---
Sets the memory of the given type. (Overworld and Level)


--- Function ---
mem(address, fieldtype)
--- Return values ---
object
--- Description ---
Returns the value of the given address of the given type. (Overworld and Level)


----- Text Functions -----


--- Function ---
Text.windowDebug(string debugText)
--- Return values ---
nil
--- Description ---
Writes debugText in a message box and shows it to the user. (Overworld and Level)


--- Function ---
Text.print(string, number x, number y)
--- Return values ---
nil
--- Description ---
Prints data at x, y with font-type 3. Characters are, by default, each 18px wide and 20px high. data can be every lua object which supports the tostring operator. (Overworld and Level)


--- Function ---
Text.print(string, int type, number x, number y)
--- Return values ---
nil
--- Description ---
Prints data at x, y with font-type type. data can be every lua object which supports the tostring operator. (Overworld and Level)


--- Function ---
Text.printWP(string, number x, number y, number priority)
--- Return values ---
nil
--- Description ---
Prints data at x, y with font-type 3. data can be every lua object which supports the tostring operator. The rendering of the text is prioritized. Read more about the LunaLua Render Priority. (Overworld and Level)


--- Function ---
Text.printWP(string, int type, number x, number y, number priority)
--- Return values ---
nil
--- Description ---
Prints data at x, y with font-type type. data can be every lua object which supports the tostring operator. The rendering of the text is prioritized. Read more about the LunaLua Render Priority. (Overworld and Level)


--- Function ---
Text.showMessageBox(string)
--- Return values ---
nil
--- Description ---
Displays a SMBX Message Box. (Level only)


----- Misc Functions -----


--- Function ---
Misc.npcToCoins()
--- Return values ---
nil
--- Description ---
Converts every npc on screen to coins. (Like you would hit the exit.) (Level only)


--- Function ---
Misc.doPOW()
--- Return values ---
nil
--- Description ---
Starts the "POW"-Effect (like if the POW-Block hits the floor) (Level only)


--- Function ---
Misc.cheatBuffer()
--- Return values ---
string
--- Description ---
Gets the current cheat buffer text. (Overworld and Level)


--- Function ---
Misc.cheatBuffer(string cheatBufferText)
--- Return values ---
nil
--- Description ---
Sets the current cheat buffer text. (Overworld and Level)


--- Function ---
Misc.listFiles(string path)
--- Return values ---
table of string
--- Description ---
Returns a list of files in the given path. The paths starts from the SMBX-Directory. If path is an empty string, then the files in the SMBX-Directory are returned. (Overworld and Level)


--- Function ---
Misc.listLocalFiles(string path)
--- Return values ---
table of string
--- Description ---
Returns a list of files in the given path. The paths starts from the custom folder of the level (when in a level) or the current episode folder (when in the overworld). If path is an empty string, then the files in the custom folder (or episode folder when in overworld) are returned. If you want to access the episode folder from the level code you can use Misc.listLocalFiles(".."). (Overworld and Level)


--- Function ---
Misc.resolveFile(string path)
--- Return values ---
string or nil
--- Description ---
Searches for a file given by the path in following directories:

Custom level folder
Episode folder
{SMBX root path}/LuaScriptsLib
{SMBX root path}

... in that order. The full absoulte path will be returned or nil if not found. (LunaLua ≥ v0.7.1) (Overworld and Level)


--- Function ---
Misc.resolveGraphicsFile(string path)
--- Return values ---
string or nil
--- Description ---
Searches for a file given by the path in following directories:

Custom level folder
Episode folder
{SMBX root path}/graphics

... in that order. The full absoulte path will be returned or nil if not found. (LunaLua ≥ v0.7.3.1) (Overworld and Level)


--- Function ---
Misc.resolveDirectory(string path)
--- Return values ---
string or nil
--- Description ---
Searches for a directory given by the path in following directories:

Custom level folder
Episode folder
{SMBX root path}/LuaScriptsLib
{SMBX root path}

... in that order. The full absoulte path will be returned or nil if not found. (LunaLua ≥ v0.7.1) (Overworld and Level)


--- Function ---
Misc.openPauseMenu()
--- Return values ---
nil
--- Description ---
Opens the pause menu.
Fun fact: Kevsoft implemented that while trying to implement the Misc.loadEpisode function. Only recommended for trolling! (Overworld and Level)


--- Function ---
Misc.saveGame()
--- Return values ---
nil
--- Description ---
Saves the game to the current save slot. (Overworld and Level)


--- Function ---
Misc.exitGame()
--- Return values ---
nil
--- Description ---
Exits the game to the main menu. (Overworld and Level)


--- Function ---
Misc.loadEpisode(string episodeTitle)
--- Return values ---
boolean
--- Description ---
Loads another episode given by the episode title. If the episode was not found then false is returned. If succeeded, then true is returned. However the actual episode switch is done, when SMBX gets the control back from LunaLua. Additional code may run after the Misc.loadEpisode function. Also note that holding the run button may interrupt the process and the game may stay at the title screen. (Overworld and Level)


--- Function ---
Misc.doBombExplosion(number x, number y, number type)
--- Return values ---
nil
--- Description ---
Will do a bomb explosion. For type you can use following values:

0 - Peach bomb
2 - SMB2 explosion
3 - SMB3 explosion
(LunaLua ≥ v0.7.2.3) (Level)


--- Function ---
Misc.doBombExplosion(number x, number y, number type, Player fromPlayer)
--- Return values ---
nil
--- Description ---
Will do a bomb explosion. fromPlayer is used for the peach bomb in battle mode (The other players will take damage). For type you can use following values:

0 - Peach bomb
2 - SMB2 explosion
3 - SMB3 explosion
(LunaLua ≥ v0.7.2.3) (Level)


--- Function ---
Misc.doPSwitch()
--- Return values ---
nil
--- Description ---
This will execute or stop the full P-Switch effect (including music and timer), depending on the P-Switch timer. If the P-Switch effect is not active, then this function will activate it. Otherwise it will stop this effect.(LunaLua ≥ v0.7.2.3) (Level)


--- Function ---
Misc.doPSwitch(boolean activate)
--- Return values ---
nil
--- Description ---
This will execute or stop the full P-Switch effect (including music and timer), depending on the activate parameter.(LunaLua ≥ v0.7.2.3) (Level)


--- Function ---
Misc.doPSwitchRaw(boolean activate)
--- Return values ---
nil
--- Description ---
This will execute the raw P-Switch effect. Neither music nor the P-Switch timer is affected. (LunaLua ≥ v0.7.2.3) (Level)


--- Function ---
Misc.pause()
--- Return values ---
nil
--- Description ---
This will pause the whole game. (LunaLua ≥ v0.7.3) (Overworld and Level)


--- Function ---
Misc.unpause()
--- Return values ---
nil
--- Description ---
This will unpause the whole game. (LunaLua ≥ v0.7.3) (Overworld and Level)


--- Function ---
Misc.isPausedByLua()
--- Return values ---
boolean
--- Description ---
If the whole game is paused via Misc.pause (LunaLua ≥ v0.7.3) (Overworld and Level)


--- Function ---
getSMBXPath()
--- Return values ---
string
--- Description ---
Returns the absolute path to smbx.exe. (Overworld and Level)


--- Function ---
triggerEvent(string eventName)
--- Return values ---
nil
--- Description ---
Triggers an SMBX event by the given name. (Level Only)


----- Graphics Functions -----


--- Function ---
Graphics.activateHud(boolean showHud)
--- Return values ---
nil
--- Description ---
Toggels the hud on/off (Level only)


--- Function ---
Graphics.loadImage(string filename)
--- Return values ---
LuaImageResource
--- Description ---
Loads a image in the resource memory, returning a reference to it. (Overworld and Level)


--- Function ---
Graphics.loadImageResolved(string filename)
--- Return values ---
LuaImageResource
--- Description ---
Searches for a file given by the path in following directories:

Custom level folder
Episode folder
{SMBX root path}/graphics

... in that order and loads it in the resource memory, returning a reference to it. (Overworld and Level) (LunaLua ≥ v0.7.3.1)


--- Function ---
Graphics.loadAnimatedImage(string filename)
--- Return values ---
table of LuaImageResource, number
--- Description ---
Loads an animated image (i.e. gifs) and returns a table of each frame in the animated image. The second return argument is the average frame speed (SMBX frames per frame switch) given by the gif metadata. If no gif metadata is found then the average speed is 0.09s * 65 SMBX frames. (Overworld and Level)


--- Function ---
Graphics.getPixelData(LuaImageResource img)
--- Return values ---
table of number, number, number
--- Description ---
Extracts all image data from the image resources in an array with the BGRA-Format.

The first return-value is the array with BGRA pixel values (is width * height * 4 big)
The second return-value is the width
The third return-value is the height
(LunaLua ≥ v0.7.1) (Overworld and Level)


--- Function ---
Graphics.drawImage(LuaImageResource img, number x, number y)
--- Return values ---
nil
--- Description ---
Draws the image resource for a frame. (LunaLua ≥ v0.7.1) (Overworld and Level)


--- Function ---
Graphics.drawImage(LuaImageResource img, number x, number y, float opacity)
--- Return values ---
nil
--- Description ---
Draws the image resource for a frame, with an opacity from 0.0 to 1.0. (LunaLua ≥ v0.7.1) (Overworld and Level)


--- Function ---
Graphics.drawImage(LuaImageResource img, number x, number y, number sourceX, number sourceY, number width, number height)
--- Return values ---
nil
--- Description ---
Draws the image resource for a frame. Only a part of the pictures is drawn given by sourceX and sourceY with the specific width and height. (LunaLua ≥ v0.7.1) (Overworld and Level)


--- Function ---
Graphics.drawImage(LuaImageResource img, number x, number y, number sourceX, number sourceY, number width, number height, number opacity)
--- Return values ---
nil
--- Description ---
Draws the image resource for a frame, with an opacity from 0.0 to 1.0. Only a part of the pictures is drawn given by sourceX and sourceY with the specific width and height. (LunaLua ≥ v0.7.1) (Overworld and Level)


--- Function ---
Graphics.drawImageWP(LuaImageResource img, number x, number y, number priority)
--- Return values ---
nil
--- Description ---
Draws the image resource for a frame. The rendering of the image is prioritized. Read more about the LunaLua Render Priority. (LunaLua ≥ v0.7.2) (Overworld and Level)


--- Function ---
Graphics.drawImageWP(LuaImageResource img, number x, number y, number opacity, number priority)
--- Return values ---
nil
--- Description ---
Draws the image resource for a frame, with an opacity from 0.0 to 1.0. The rendering of the image is prioritized. Read more about the LunaLua Render Priority. (LunaLua ≥ v0.7.2) (Overworld and Level)


--- Function ---
Graphics.drawImageWP(LuaImageResource img, number x, number y, number sourceX, number sourceY, number width, number height, number priority)
--- Return values ---
nil
--- Description ---
Draws the image resource for a frame. Only a part of the pictures is drawn given by sourceX and sourceY with the specific width and height. The rendering of the image is prioritized. Read more about the LunaLua Render Priority. (LunaLua ≥ v0.7.2) (Overworld and Level)


--- Function ---
Graphics.drawImageWP(LuaImageResource img, number x, number y, number sourceX, number sourceY, number width, number height, number opacity, number priority)
--- Return values ---
nil
--- Description ---
Draws the image resource for a frame, with an opacity from 0.0 to 1.0. Only a part of the pictures is drawn given by sourceX and sourceY with the specific width and height. The rendering of the image is prioritized. Read more about the LunaLua Render Priority. (LunaLua ≥ v0.7.2) (Overworld and Level)


--- Function ---
Graphics.drawImageToScene(LuaImageResource img, number x, number y)
--- Return values ---
nil
--- Description ---
Draws the image resource for a frame. The x and y are coordinates on the level/overworld. (LunaLua ≥ v0.7.1) (Overworld and Level)


--- Function ---
Graphics.drawImageToScene(LuaImageResource img, number x, number y, number opacity)
--- Return values ---
nil
--- Description ---
Draws the image resource for a frame, with an opacity from 0.0 to 1.0. The x and y are coordinates on the level/overworld. (LunaLua ≥ v0.7.1) (Overworld and Level)


--- Function ---
Graphics.drawImageToScene(LuaImageResource img, number x, number y, number sourceX, number sourceY, number width, number height)
--- Return values ---
nil
--- Description ---
Draws the image resource for a frame. Only a part of the pictures is drawn given by sourceX and sourceY with the specific width and height. The x and y are coordinates on the level/overworld. (LunaLua ≥ v0.7.1) (Overworld and Level)


--- Function ---
Graphics.drawImageToScene(LuaImageResource img, number x, number y, number sourceX, number sourceY, number width, number height, number opacity)
--- Return values ---
nil
--- Description ---
Draws the image resource for a frame, with an opacity from 0.0 to 1.0. Only a part of the pictures is drawn given by sourceX and sourceY with the specific width and height. The x and y are coordinates on the level/overworld. (LunaLua ≥ v0.7.1) (Overworld and Level)


--- Function ---
Graphics.drawImageToSceneWP(LuaImageResource img, number x, number y, number priority)
--- Return values ---
nil
--- Description ---
Draws the image resource for a frame. The x and y are coordinates on the level/overworld. The rendering of the image is prioritized. Read more about the LunaLua Render Priority. (LunaLua ≥ v0.7.2) (Overworld and Level)


--- Function ---
Graphics.drawImageToSceneWP(LuaImageResource img, number x, number y, number opacity, number priority)
--- Return values ---
nil
--- Description ---
Draws the image resource for a frame, with an opacity from 0.0 to 1.0. The x and y are coordinates on the level/overworld. The rendering of the image is prioritized. Read more about the LunaLua Render Priority. (LunaLua ≥ v0.7.2) (Overworld and Level)


--- Function ---
Graphics.drawImageToSceneWP(LuaImageResource img, number x, number y, number sourceX, number sourceY, number width, number height, number priority)
--- Return values ---
nil
--- Description ---
Draws the image resource for a frame. Only a part of the pictures is drawn given by sourceX and sourceY with the specific width and height. The x and y are coordinates on the level/overworld. The rendering of the image is prioritized. Read more about the LunaLua Render Priority. (LunaLua ≥ v0.7.2) (Overworld and Level)


--- Function ---
Graphics.drawImageToSceneWP(LuaImageResource img, number x, number y, number sourceX, number sourceY, number width, number height, number opacity, number priority)
--- Return values ---
nil
--- Description ---
Draws the image resource for a frame, with an opacity from 0.0 to 1.0. Only a part of the pictures is drawn given by sourceX and sourceY with the specific width and height. The x and y are coordinates on the level/overworld. The rendering of the image is prioritized. Read more about the LunaLua Render Priority. (LunaLua ≥ v0.7.2) (Overworld and Level)


--- Function ---
Graphics.activateOverworldHud(int worldHudType)
--- Return values ---
nil
--- Description ---
Manages the overworld hud control. Following values can be used:

WHUD_ALL - All hud elements are visible.
WHUD_ONLY_OVERLAY - Only the hud overlay is visible. Text and icons are hidden.
WHUD_NONE - No overlay, text or icons are visible.
(World only)


--- Function ---
Graphics.isOpenGLEnabled()
--- Return values ---
boolean
--- Description ---
Returns whether the OpenGL renderer is active or not.


--- Function ---
Graphics.isHudActivated()
--- Return values ---
boolean
--- Description ---
Returns if the default Level HUD is activated. (Level only)


--- Function ---
Graphics.getOverworldHudState()
--- Return values ---
int
--- Description ---
Returns if the overworld state. Following values can be returned:

WHUD_ALL - All hud elements are visible.
WHUD_ONLY_OVERLAY - Only the hud overlay is visible. Text and icons are hidden.
WHUD_NONE - No overlay, text or icons are visible.
(LunaLua ≥ v0.7.2) (Overworld only)


--- Function ---
Graphics.sprites.####[*]
--- Return values ---
SpriteOverride
--- Description ---
Accesses an overrideable graphic. With this function you can overwrite SMBX graphics at runtime.

#### represents the graphics group. The different graphics groups are named after the folders in the graphics folder.
* is the id of the object.
See more: SpriteOverride class
(Level and Overworld) (LunaLua ≥ v0.7.3.1)
(Level only in LunaLua 0.7.3)


--- Function ---
Graphics.draw{Named Args}
--- Return values ---
nil
--- Description ---
This function accepts a table with named arguments for drawing purpose. (LunaLua ≥ v0.7.3)


--- Function ---
Graphics.glDraw{Named Args}
--- Return values ---
nil
--- Description ---
This function accepts a table with named arguments for OpenGL drawing operations. (LunaLua ≥ v0.7.3)
Fields
Spoiler: show
SMBX Fields:
Source: https://wohlsoft.ru/pgewiki/SMBX_Fields

----- SMBX Fields -----

Since LunaLua v0.6.1 you can use these powerful defines to modify SMBX values. They are safe to use and will reset on every level. Defines can be simply assigned like a variable.

Here is a example of changing the gravity:

function onStart()
Defines.gravity = 6 -- Half of the default gravity.
end


---- Movement ----


--- Name of Define ---
Defines.gravity
--- Type ---
WORD
--- Default value ---
12
--- Min/Max Size ---
Min. Value: 0
--- Description ---
The maximum falling speed of the player. Note that gravity is a bit of a misnomer.

--- Name of Define ---
Defines.earthquake
--- Type ---
WORD
--- Default value ---
0
--- Min/Max Size ---
Min. Value: 0
--- Description ---
The earthquake factor of the Level. It resets to 0 after time.

--- Name of Define ---
Defines.jumpheight
--- Type ---
WORD
--- Default value ---
20
--- Min/Max Size ---
Min. Value: 0
--- Description ---
The upward force for a jumping player. Counts down each tick during the jump.

--- Name of Define ---
Defines.jumpheight_bounce
--- Type ---
WORD
--- Default value ---
20
--- Min/Max Size ---
Min. Value: 0
--- Description ---
The upward force for a player when bouncing of a enemy. Counts down each tick during the jump.

--- Name of Define ---
Defines.player_runspeed
--- Type ---
FLOAT
--- Default value ---
6
--- Min/Max Size ---
Min. Value: 0
--- Description ---
The normal top running speed for a player.

--- Name of Define ---
Defines.player_walkspeed
--- Type ---
FLOAT
--- Default value ---
3
--- Min/Max Size ---
Min. Value: 0
--- Description ---
The normal top walking speed for a player.

--- Name of Define ---
Defines.player_grav
--- Type ---
FLOAT
--- Default value ---
0.4
--- Min/Max Size ---
Min. Value: 0
--- Description ---
The gravitational force for players.

--- Name of Define ---
Defines.npc_grav
--- Type ---
FLOAT
--- Default value ---
0.26
--- Min/Max Size ---
Min. Value: 0
--- Description ---
The gravitational force for NPCs.


---- Effect Modification ----


--- Name of Define ---
Defines.effect_NpcToCoin
--- Type ---
BYTE
--- Default value ---
11
--- Min/Max Size ---
Min. Value: 0
--- Description ---
The effect ID of the npc-to-coins function (default is the coinflip effect). The npc-to-coins function is executed when the player hits an exit, which transforms the npcs into coins.

--- Name of Define ---
Defines.effect_Zoomer_killEffectEnabled
--- Type ---
BOOLEAN
--- Default value ---
true
--- Min/Max Size ---
none
--- Description ---
If the explosion effect is enabled for the zoomer (NPC-ID: 205)


---- Sound Modification ----


--- Name of Define ---
Defines.sound_NpcToCoin
--- Type ---
BYTE
--- Default value ---
14
--- Min/Max Size ---
Min. Value: 0
--- Description ---
The sound ID of the npc-to-coins function (default is the coin sound). The npc-to-coins function is executed when the player hits an exit, which transforms the npcs into coins.


---- Game Exit ----


--- Name of Define ---
Defines.npcToCoinValue
--- Type ---
BYTE
--- Default value ---
1
--- Min/Max Size ---
Min. Value: 0
Max. Value: 99
--- Description ---
The coin-value for every destroyed npc in the npc-to-coins function. The npc-to-coins function is executed when the player hits an exit, which transforms the npcs into coins.

--- Name of Define ---
Defines.npcToCoinValueReset
--- Type ---
BYTE
--- Default value ---
100
--- Min/Max Size ---
Min. Value: 1
Max. Value: 100
--- Description ---
How many coins get subtracted from the coin-value when the coin value hits 100 coins. The npc-to-coins function is executed when the player hits an exit, which transforms the npcs into coins.

--- Name of Define ---
Defines.smb3RouletteScoreValueStar
--- Type ---
DWORD
--- Default value ---
10
--- Min/Max Size ---
Min. Value: 1
Max. Value: 12
--- Description ---
The score value of smb3 roulette star

--- Name of Define ---
Defines.smb3RouletteScoreValueMushroom
--- Type ---
DWORD
--- Default value ---
6
--- Min/Max Size ---
Min. Value: 1
Max. Value: 12
--- Description ---
The score value of smb3 roulette mushroom

--- Name of Define ---
Defines.smb3RouletteScoreValueFlower
--- Type ---
DWORD
--- Default value ---
8
--- Min/Max Size ---
Min. Value: 1
Max. Value: 12
--- Description ---
The score value of smb3 roulette flower


---- Coin Value ----


--- Name of Define ---
Defines.coinValue
--- Type ---
BYTE
--- Default value ---
1
--- Min/Max Size ---
Min. Value: 0
Max. Value: 99
--- Description ---
How much a coin npc is worth as coins. It will affect every coin-npc which has a 1-coin value as default (except the npc-to-coins function).

--- Name of Define ---
Defines.coin5Value
--- Type ---
BYTE
--- Default value ---
5
--- Min/Max Size ---
Min. Value: 0
Max. Value: 99
--- Description ---
How much a 5-coin npc is worth as coins.

--- Name of Define ---
Defines.coin20Value
--- Type ---
BYTE
--- Default value ---
20
--- Min/Max Size ---
Min. Value: 0
Max. Value: 99
--- Description ---
How much a 20-coin npc is worth as coins.


---- Level ----


--- Name of Define ---
Defines.levelFreeze
--- Type ---
BOOLEAN
--- Default value ---
false
--- Min/Max Size ---
none
--- Description ---
If the level is frozen. (Only you can move!)


---- Cheats ----


--- Name of Define ---
Defines.cheat_shadowmario
--- Type ---
BOOLEAN
--- Default value ---
None
--- Min/Max Size ---
none
--- Description ---
If the cheat shadowmario/ghostytime is active. If this cheat is active, then the player can go through blocks.

--- Name of Define ---
Defines.cheat_ahippinandahoppin
--- Type ---
BOOLEAN
--- Default value ---
None
--- Min/Max Size ---
none
--- Description ---
If the cheat ahippinandahoppin/jumplikesomething is active. This cheat grants infinite double jumps.

--- Name of Define ---
Defines.cheat_sonictooslow
--- Type ---
BOOLEAN
--- Default value ---
None
--- Min/Max Size ---
none
--- Description ---
If the cheat sonictooslow/chipmunktimes is active. This cheat makes the player run very fast.

--- Name of Define ---
Defines.cheat_illparkwhereiwant
--- Type ---
BOOLEAN
--- Default value ---
None
--- Min/Max Size ---
none
--- Description ---
If the cheat illparkwhereiwant is active. If this cheat is active, then you can move freely on the world map.

--- Name of Define ---
Defines.cheat_wingman
--- Type ---
BOOLEAN
--- Default value ---
None
--- Min/Max Size ---
none
--- Description ---
If the cheat wingman/peawing is active. This cheat makes the player/yoshi fly infinitly.

--- Name of Define ---
Defines.cheat_captainn
--- Type ---
BOOLEAN
--- Default value ---
None
--- Min/Max Size ---
none
--- Description ---
If the cheat captainn/juststop is active. If this cheat is active, then you can freeze time with the PAUSE-Button.

--- Name of Define ---
Defines.cheat_flamerthrower
--- Type ---
BOOLEAN
--- Default value ---
None
--- Min/Max Size ---
none
--- Description ---
If the cheat flamerthrower/mchammerdude is active. If this cheat is active, then you can spam projectiles very fast (i.e Fireball, Iceball, Hammer).

--- Name of Define ---
Defines.cheat_moneytree
--- Type ---
BOOLEAN
--- Default value ---
None
--- Min/Max Size ---
none
--- Description ---
If the cheat moneytree/havemoney is active. If this cheat is active, then you can spam projectiles very fast (i.e Fireball, Iceball, Hammer).

--- Name of Define ---
Defines.cheat_speeddemon
--- Type ---
BOOLEAN
--- Default value ---
None
--- Min/Max Size ---
none
--- Description ---
If the cheat speeddemon/maytoofast is active. This values is the same as the "Max FPS" setting. If this is active, then there is no frame limit.

--- Name of Define ---
Defines.cheat_donthurtme
--- Type ---
BOOLEAN
--- Default value ---
None
--- Min/Max Size ---
none
If the cheat donthurtme/strategyyo is active. This values is the same as the "God Mode" setting. If this is active, then the player has god mode active and cannot be killed.

--- Name of Define ---
Defines.cheat_stickyfingers
--- Type ---
BOOLEAN
--- Default value ---
None
--- Min/Max Size ---
none
--- Description ---
If the cheat stickyfingers/tenacioustoes is active. This values is the same as the "Grab All" setting. If this is active, then player can grab every npc.

--- Name of Define ---
Defines.player_hasCheated
--- Type ---
BOOLEAN
--- Default value ---
None
--- Min/Max Size ---
none
--- Description ---
This is the indicator if the player has cheated (used on of the cheat codes). If this is the case then saving is deactivated. However with the cheat redigitiscool/raocowisswell you can activate cheating again. How lucky that you can deactivate it again :)


---- Player Settings General ----


--- Name of Define ---
Defines.player_grabSideEnabled
--- Type ---
BOOLEAN
--- Default value ---
true
--- Min/Max Size ---
none
--- Description ---
If grabbing from the side is enabled!

--- Name of Define ---
Defines.player_grabTopEnabled
--- Type ---
BOOLEAN
--- Default value ---
true
--- Min/Max Size ---
none
--- Description ---
If grabbing from top is enabled!

--- Name of Define ---
Defines.player_grabShellEnabled
--- Type ---
BOOLEAN
--- Default value ---
true
--- Min/Max Size ---
none
--- Description ---
If grabbing shells is enabled!


---- Player Settings: Link ----


--- Name of Define ---
Defines.player_link_shieldEnabled
--- Type ---
BOOLEAN
--- Default value ---
true
--- Min/Max Size ---
none
--- Description ---
If the shield of link is enabled.

--- Name of Define ---
Defines.player_link_fairyVineEnabled
--- Type ---
BOOLEAN
--- Default value ---
true
--- Min/Max Size ---
none
--- Description ---
If the vine fairy is enabled


---- Block Modification ----


--- Name of Define ---
Defines.block_hit_link_rupeeID1
--- Type ---
WORD
--- Default value ---
251
--- Min/Max Size ---
Min. Value: 0
Max. Value: 300
--- Description ---
The npc id for Link's main coin when hitting the block. (Default would be the green rupee.)

--- Name of Define ---
Defines.block_hit_link_rupeeID2
--- Type ---
WORD
--- Default value ---
252
--- Min/Max Size ---
Min. Value: 0
Max. Value: 300
--- Description ---
The npc id for Link's secondary coin when hitting the block (chance 20:3). (Default would be the blue rupee.)

--- Name of Define ---
Defines.block_hit_link_rupeeID3
--- Type ---
WORD
--- Default value ---
253
--- Min/Max Size ---
Min. Value: 0
Max. Value: 300
--- Description ---
The npc id for Link's tertiary coin when hitting the block (chance 60:3). (Default would be the red rupee.)


---- Kill Modification ----


--- Name of Define ---
Defines.kill_drop_link_rupeeID1
--- Type ---
WORD
--- Default value ---
251
--- Min/Max Size ---
Min. Value: 0
Max. Value: 300
--- Description ---
The npc id for Link's main coin when killing an enemy. (Default would be the green rupee.)

--- Name of Define ---
Defines.kill_drop_link_rupeeID2
--- Type ---
WORD
--- Default value ---
252
--- Min/Max Size ---
Min. Value: 0
Max. Value: 300
--- Description ---
The npc id for Link's secondary coin when killing an enemy. (chance 15:3). (Default would be the blue rupee.)

--- Name of Define ---
Defines.kill_drop_link_rupeeID3
--- Type ---
WORD
--- Default value ---
253
--- Min/Max Size ---
Min. Value: 0
Max. Value: 300
--- Description ---
The npc id for Link's tertiary coin when killing an enemy. (chance 40:3). (Default would be the red rupee.)


---- P-Switch Settings ----


--- Name of Define ---
Defines.pswitch_music
--- Type ---
BOOLEAN
--- Default value ---
true
--- Min/Max Size ---
none
--- Description ---
If P-Switch music is enabled.
Global Sound and Music functions
Spoiler: show
global Sound and Music functions:
Source: https://wohlsoft.ru/pgewiki/LunaLua_glo ... _functions

---- Music common functions ----

--- Function ---
Audio.MusicChange(int section, string fileName, int fadeInDelayMs = -1)
--- Return values ---
nil
--- Description ---
Changes custom music of given section and sets it to play when player is in given section. File path is relative to episode folder (where level file is placed). The fadeInDelayMs argument receiving a millisecond delay of fade in effect. When it equal to zero or it's less, playing of song will be started normally.
Note: Some music formats are supports extra arguments (for example, track number in the music file, or synthesizer flags, more detail info and how to use here)
(LunaLua-master ≥ 2018-09-13)

--- Function ---
Audio.MusicChange(int section, int musicId, int fadeInDelayMs = -1)
--- Return values ---
nil
--- Description ---
Changes current music given section and sets it to play when player is in given section. The fadeInDelayMs argument receiving a millisecond delay of fade in effect. When it equal to zero or it's less, playing of song will be started normally. (LunaLua-master ≥ 2018-09-13)

--- Function ---
Audio.MusicFadeOut(int section, int fadeOutDelayMs)
--- Return values ---
nil
--- Description ---
Stops the music of given section with fade out effect (when player is in given section), and sets the section music to silence. (LunaLua-master ≥ 2018-09-13)

--- Function ---
Audio.MusicTitle()
--- Return values ---
string
--- Description ---
Returns music title from ID3/VorbisComment tag (if title tag is empty, filename will be returned) [works for OGG, FLAC, MP3, MIDI, and tracker musics like MOD, IT, XM, S3M, etc.] (LunaLua ≥ v0.7.1)

--- Function ---
Audio.MusicTitleTag()
--- Return values ---
string
--- Description ---
Returns music title from ID3/VorbisComment tag (if title tag is empty, returns empty string) [works for OGG, FLAC, MP3, MIDI, and tracker musics like MOD, IT, XM, S3M, etc.] (LunaLua ≥ v0.7.1)

--- Function ---
Audio.MusicArtistTag()
--- Return values ---
string
--- Description ---
Returns music artist from ID3/VorbisComment tag (if title tag is empty, returns empty string) [works for OGG, FLAC, MP3, MIDI, and tracker musics like MOD, IT, XM, S3M, etc.] (LunaLua ≥ v0.7.2.1)

--- Function ---
Audio.MusicAlbumTag()
--- Return values ---
string
--- Description ---
Returns music album from ID3/VorbisComment tag (if title tag is empty, returns empty string) [works for OGG, FLAC, MP3, MIDI, and tracker musics like MOD, IT, XM, S3M, etc.] (LunaLua ≥ v0.7.2.1)

--- Function ---
Audio.MusicCopyrightTag()
--- Return values ---
string
--- Description ---
Returns music copyright from ID3/VorbisComment tag (if title tag is empty, returns empty string) [works for OGG, FLAC, MP3, MIDI, and tracker musics like MOD, IT, XM, S3M, etc.] (LunaLua ≥ v0.7.2.1)

--- Function ---
Audio.MusicClock()
--- Return values ---
string
--- Description ---
Returns the time starts from begin of the current music track playback (in seconds). The time resets to 0 when music track was changed.

--- Function ---
Audio.AudioClock()
--- Return values ---
string
--- Description ---
Returns the total time of played music starts from SMBX game launching (in seconds).

--- Function ---
Audio.MusicIsPlaying()
--- Return values ---
bool
--- Description ---
Returns true if any music is currently playing

--- Function ---
Audio.MusicIsPaused()
--- Return values ---
bool
--- Description ---
Returns true if any music was paused

--- Function ---
Audio.MusicIsFading()
--- Return values ---
bool
--- Description ---
Returns true if any music is currently fading

--- Function ---
Audio.MusicVolume(int volume)
--- Return values ---
nil
--- Description ---
Sets the music volume level (from 0 to 128)

---- Music advanced functions ----
NOTE: There are advanced music functions are giving an ability to work with SDL Mixer X library's music API directly: open any song, start/pause/resume it as you want. However, to use them, you must seize the section stream! Otherwise, SMBX Engine will override your playing music by that which is set as a music of section. (The very next section of text covers this.)

--- Function ---
Audio.MusicOpen(string fileName)
--- Return values ---
nil
--- Description ---
Loads a music file into stream. File path is relative to custom music section.
Note: Some music formats are supports extra arguments (for example, track number in the music file, or synthesizer flags, more detail info and how to use here)

--- Function ---
Audio.MusicPlay()
--- Return values ---
nil
--- Description ---
Starts playback of the music file which currently loaded into stream

--- Function ---
Audio.MusicPlayFadeIn(int milliseconds)
--- Return values ---
nil
--- Description ---
Starts playback of the music file which currently loaded into stream with Fade-IN effect in milliseconds

--- Function ---
Audio.MusicStop()
--- Return values ---
nil
--- Description ---
Stops the current music playback

--- Function ---
Audio.MusicStopFadeOut(int milliseconds)
--- Return values ---
nil
--- Description ---
Stops the current music playback with Fade-OUT effect in milliseconds

--- Function ---
Audio.MusicPause()
--- Return values ---
nil
--- Description ---
Pauses the current music playback

--- Function ---
Audio.MusicResume()
--- Return values ---
nil
--- Description ---
Continues paused music

---- Music special functions ----

--- Function ---
Audio.SeizeStream(int sectionID)
--- Return values ---
nil
--- Description ---
Seizing control of music stream from SMBX Engine for specific section ID (from 0 to 20. If -1, then will be seized music stream for all sections).

--- Function ---
Audio.ReleaseStream(int sectionID)
--- Return values ---
nil
--- Description ---
Returns control of music stream to specific section ID (from 0 to 20. If -1, then will be seized music stream for all sections). SMBX Engine will can play it's musics in stream.

--- Function ---
Audio.resetMciSections()
--- Return values ---
nil
--- Description ---
Releases stream for all seized sections

---- Sound Effects functions ----

--- Function ---
Audio.newMix_Chunk()
--- Return values ---
Mix_Chunk
--- Description ---
Constructs the null Mix_Chunk pointer which pointing to specific sound file - chunk. Use this function always when you wish to create global variable for sound chunkcs.

--- Function ---
Audio.clearSFXBuffer()
--- Return values ---
nil
--- Description ---
Removes all custom sound effects from buffer and stops all currently playing sounds and loops.
Warning: Don't call this function if you have working loops with using of Mix_Chunk pointers!

--- Function ---
Audio.playSFX(int index)
--- Return values ---
nil
--- Description ---
Plays a SMBX Sound by the SMBX Sound ID

--- Function ---
Audio.playSFX(string fileName)
--- Return values ---
nil
--- Description ---
Once plays the sound effect file. Path to file is relative to level custom directory.

--- Function ---
Audio.SfxOpen(string fileName)
--- Return values ---
Mix_Chunk
--- Description ---
Loads sound effect file into buffer and returns pointer to them which you can use later to play it with using of loops and effects

--- Function ---
Audio.SfxPlayObj(Mix_Chunk sfxFile, int loops)
--- Return values ---
PlayingSfxInstance
--- Description ---
Plays sound file by chunk pointer. Sound will be played with defined number of loops (If 0 then once, if -1 then forever, else 1 play twice or 2 play thrice, etc.). Returns an object that can be used to control the sound clip as it plays/loops

--- Function ---
Audio.SfxPlayObjVol(Mix_Chunk sfxFile, int loops, int volume)
--- Return values ---
PlayingSfxInstance
--- Description ---
Plays sound file by chunk pointer with giving of initial volume value. Sound will be played with defined number of loops (If 0 then once, if -1 then forever, else 1 play twice or 2 play thrice, etc.). Returns an object that can be used to control the sound clip as it plays/loops
(LunaLua-master ≥ 2018-11-19)

--- Function ---
Audio.SfxPlayObjTimed(Mix_Chunk sfxFile, int loops, int ticks)
--- Return values ---
PlayingSfxInstance
--- Description ---
Plays sound file by chunk pointer with time limit (ticks in milliseconds, -1 is forever) in the specific channel (if -1 then will be used any free channel.. Sound will be played with defined number of loops (If 0 then once, if -1 then forever, else 1 play twice or 2 play thrice, etc.). Returns an object that can be used to control the sound clip as it plays/loops

--- Function ---
Audio.SfxPlayObjTimedVol(Mix_Chunk sfxFile, int loops, int ticks, int volume)
--- Return values ---
PlayingSfxInstance
--- Description ---
Plays sound file by chunk pointer with giving of initial volume value and with time limit (ticks in milliseconds, -1 is forever) in the specific channel (if -1 then will be used any free channel.. Sound will be played with defined number of loops (If 0 then once, if -1 then forever, else 1 play twice or 2 play thrice, etc.). Returns an object that can be used to control the sound clip as it plays/loops
(LunaLua-master ≥ 2018-11-19)

--- Function ---
Audio.SfxFadeInObj(Mix_Chunk sfxFile, int loops, int fade_ms)
--- Return values ---
PlayingSfxInstance
--- Description ---
Plays sound file by chunk pointer with fade-in effect. You can use any channels from 1 to 18 [total 32 but is not recommends to use more than 18 channels]). Sound will be played with defined number of loops (If 0 then once, if -1 then forever, else 1 play twice or 2 play thrice, etc.). Returns an object that can be used to control the sound clip as it plays/loops

--- Function ---
Audio.SfxFadeInObjVol(Mix_Chunk sfxFile, int loops, int fade_ms, int volume)
--- Return values ---
PlayingSfxInstance
--- Description ---
Plays sound file by chunk pointer with giving initial volume value and with fade-in effect. You can use any channels from 1 to 18 [total 32 but is not recommends to use more than 18 channels]). Sound will be played with defined number of loops (If 0 then once, if -1 then forever, else 1 play twice or 2 play thrice, etc.). Returns an object that can be used to control the sound clip as it plays/loops
(LunaLua-master ≥ 2018-11-19)

--- Function ---
Audio.SfxFadeInObjTimed(Mix_Chunk sfxFile, int loops, int fade_ms, int ticks)
--- Return values ---
PlayingSfxInstance
--- Description ---
Plays sound file by chunk pointer with fade-in effect and time limit (ticks in milliseconds, -1 is forever). Sound will be played with defined number of loops (If 0 then once, if -1 then forever, else 1 play twice or 2 play thrice, etc.). Returns an object that can be used to control the sound clip as it plays/loops

--- Function ---
Audio.SfxFadeInObjTimedVol(Mix_Chunk sfxFile, int loops, int fade_ms, int ticks, int volume)
--- Return values ---
PlayingSfxInstance
--- Description ---
Plays sound file by chunk pointer with fade-in effect and giving initial volume value and time limit (ticks in milliseconds, -1 is forever). Sound will be played with defined number of loops (If 0 then once, if -1 then forever, else 1 play twice or 2 play thrice, etc.). Returns an object that can be used to control the sound clip as it plays/loops
(LunaLua-master ≥ 2018-11-19)

--- Function ---
Audio.SfxPlayCh(int Channel, Mix_Chunk sfxFile, int loops )
--- Return values ---
int
--- Description ---
Plays sound file by chunk pointer in the specific channel (if -1 then will be used any free channel. You can use any channels from 1 to 18 [total 32 but is not recommends to use more than 18 channels]). Sound will be played with defined number of loops (If 0 then once, if -1 then forever, else 1 play twice or 2 play thrice, etc.). Returns the number of channel where sound is playing/looping

--- Function ---
Audio.SfxPlayChVol(int Channel, Mix_Chunk sfxFile, int loops, int volume )
--- Return values ---
int
--- Description ---
Plays sound file by chunk pointer with giving initial volume value in the specific channel (if -1 then will be used any free channel. You can use any channels from 1 to 18 [total 32 but is not recommends to use more than 18 channels]). Sound will be played with defined number of loops (If 0 then once, if -1 then forever, else 1 play twice or 2 play thrice, etc.). Returns the number of channel where sound is playing/looping
(LunaLua-master ≥ 2018-11-19)

--- Function ---
Audio.SfxPlayChTimed(int Channel, Mix_Chunk sfxFile, int loops, int ticks)
--- Return values ---
int
--- Description ---
Plays sound file by chunk pointer with time limit (ticks in milliseconds, -1 is forever) in the specific channel (if -1 then will be used any free channel. You can use any channels from 1 to 18 [total 32 but is not recommends to use more than 18 channels]). Sound will be played with defined number of loops (If 0 then once, if -1 then forever, else 1 play twice or 2 play thrice, etc.). Returns the number of channel where sound is playing/looping

--- Function ---
Audio.SfxPlayChTimedVol(int Channel, Mix_Chunk sfxFile, int loops, int ticks, int volume)
--- Return values ---
int
--- Description ---
Plays sound file by chunk pointer with giving initial volume value and with time limit (ticks in milliseconds, -1 is forever) in the specific channel (if -1 then will be used any free channel. You can use any channels from 1 to 18 [total 32 but is not recommends to use more than 18 channels]). Sound will be played with defined number of loops (If 0 then once, if -1 then forever, else 1 play twice or 2 play thrice, etc.). Returns the number of channel where sound is playing/looping
(LunaLua-master ≥ 2018-11-19)

--- Function ---
Audio.SfxFadeInCh(int Channel, Mix_Chunk sfxFile, int loops, int fade_ms)
--- Return values ---
int
--- Description ---
Plays sound file by chunk pointer with fade-in effect in the specific channel (if -1 then will be used any free channel. You can use any channels from 1 to 18 [total 32 but is not recommends to use more than 18 channels]). Sound will be played with defined number of loops (If 0 then once, if -1 then forever, else 1 play twice or 2 play thrice, etc.). Returns: the channel the sample is played on. On any errors, -1 is returned.

--- Function ---
Audio.SfxFadeInChVol(int Channel, Mix_Chunk sfxFile, int loops, int fade_ms, int volume)
--- Return values ---
int
--- Description ---
Plays sound file by chunk pointer with fade-in effect in the specific channel (if -1 then will be used any free channel. You can use any channels from 1 to 18 [total 32 but is not recommends to use more than 18 channels]) and with giving initial volume value. Sound will be played with defined number of loops (If 0 then once, if -1 then forever, else 1 play twice or 2 play thrice, etc.). Returns: the channel the sample is played on. On any errors, -1 is returned.
(LunaLua-master ≥ 2018-11-19)

--- Function ---
Audio.SfxFadeInChTimed(int Channel, Mix_Chunk sfxFile, int loops, int fade_ms, int ticks)
--- Return values ---
int
--- Description ---
Plays sound file by chunk pointer with fade-in effect and time limit (ticks in milliseconds, -1 is forever) in the specific channel (if -1 then will be used any free channel. You can use any channels from 1 to 18 [total 32 but is not recommends to use more than 18 channels]). Sound will be played with defined number of loops (If 0 then once, if -1 then forever, else 1 play twice or 2 play thrice, etc.). Returns: the channel the sample is played on. On any errors, -1 is returned.

--- Function ---
Audio.SfxFadeInChTimedVol(int Channel, Mix_Chunk sfxFile, int loops, int fade_ms, int ticks, int volume)
--- Return values ---
int
--- Description ---
Plays sound file by chunk pointer with fade-in effect and time limit (ticks in milliseconds, -1 is forever) in the specific channel (if -1 then will be used any free channel. You can use any channels from 1 to 18 [total 32 but is not recommends to use more than 18 channels]) and with giving initial volume value. Sound will be played with defined number of loops (If 0 then once, if -1 then forever, else 1 play twice or 2 play thrice, etc.). Returns: the channel the sample is played on. On any errors, -1 is returned.
(LunaLua-master ≥ 2018-11-19)

--- Function ---
Audio.SfxPause(int Channel)
--- Return values ---
nil
--- Description ---
Pauses sound or sound loop in the specific channel. If -1 then pause sounds in the all channels

--- Function ---
Audio.SfxResume(int Channel)
--- Return values ---
nil
--- Description ---
Resume paused sound or sound loop in the specific channel. If -1 then resume sounds in the all channels

--- Function ---
Audio.SfxStop(int Channel)
--- Return values ---
int
--- Description ---
Stops sound or sound loop in the specific channel. If -1 then stops sounds in the all channels. Returns always 0

--- Function ---
Audio.SfxExpire(int Channel, int ticks)
--- Return values ---
int
--- Description ---
Change the timed stoppage of a channel

--- Function ---
Audio.SfxFadeOut(int Channel, int fade_ms)
--- Return values ---
int
--- Description ---
Fading out and stops playing sound or sound loop in specific channel with fade in lenght in milliseconds. Returns: The number of channels set to fade out.

--- Function ---
Audio.SfxIsPlaying(int Channel)
--- Return values ---
int
--- Description ---
Tells you if channel is playing, or not. Returns: Zero if the channel is not playing. Otherwise if you passed in -1, the number of channels playing is returned. If you passed in a specific channel, then 1 is returned if it is playing.

--- Function ---
Audio.SfxIsPaused(int Channel)
--- Return values ---
int
--- Description ---
Tells you if channel is paused, or not. Returns: Zero if the channel is not paused. Otherwise if you passed in -1, the number of paused channels is returned. If you passed in a specific channel, then 1 is returned if it is paused.

--- Function ---
Audio.SfxIsFading(int Channel)
--- Return values ---
int
--- Description ---
Tells you if which channel is fading in, out, or not. Does not tell you if the channel is playing anything, or paused, so you'd need to test that separately. Returns: the fading status. Never returns an error.

--- Function ---
Audio.SfxVolume(int Channel, int volume)
--- Return values ---
int
--- Description ---
Sets volume (from 0 to 128) to the specific channel. Returns: current volume of the channel. If channel is -1, the average volume is returned.

--- Function ---
Audio.SfxSetPanning(int Channel, int left, int right)
--- Return values ---
int
--- Description ---
Panning stereo effects. This effect will only work on stereo audio. Meaning you called Mix_OpenAudio with 2 channels. The easiest way to do true panning is to call SfxSetPanning(channel, left, 254 - left); so that the total volume is correct, if you consider the maximum volume to be 127 per channel for center, or 254 max for left, this works, but about halves the effective volume.

This Function registers the effect for you, so don't try to Mix_RegisterEffect it yourself.
Notes:

Setting both left and right to 255 will unregister the effect from channel. You cannot unregister it any other way, unless you use Mix_UnregisterAllEffects on the channel.
Using this function on a mono audio device will not register the effect, nor will it return an error status.

Returns: Zero on errors, such as bad channel, or if Mix_RegisterEffect failed.

--- Function ---
Audio.SfxSetDistance(int Channel, int distance)
--- Return values ---
int
--- Description ---
This effect simulates a simple attenuation of volume due to distance. The volume never quite reaches silence, even at max distance.
Note: Using a distance of 0 will cause the effect to unregister itself from channel. You cannot unregister it any other way, unless you use Mix_UnregisterAllEffects on the channel.
Returns: Zero on errors, such as an invalid channel, or if Mix_RegisterEffect failed.

--- Function ---
Audio.SfxSet3DPosition(int Channel, int angle, int distance)
--- Return values ---
int
--- Description ---
This effect emulates a simple 3D audio effect. It's not all that realistic, but it can help improve some level of realism. By giving it the angle and distance from the camera's point of view, the effect pans and attenuates volumes. If you are looking for better positional audio, using OpenAL is suggested.
Note: Using angle and distance of 0, will cause the effect to unregister itself from channel. You cannot unregister it any other way, unless you use Mix_UnregisterAllEffects on the channel.
Returns: Zero on errors, such as an invalid channel, or if Mix_RegisterEffect failed.

--- Function ---
Audio.SfxReverseStereo(int Channel, int flip)
--- Return values ---
int
--- Description ---
Simple reverse stereo, swaps left and right channel sound.
Note: Using a flip of 0, will cause the effect to unregister itself from channel. You cannot unregister it any other way, unless you use Mix_UnregisterAllEffects on the channel.
Returns: Zero on errors, such as an invalid channel, or if Mix_RegisterEffect failed.

--- Function ---
Audio.sounds[*]
--- Return values ---
SoundOverride
--- Description ---
Accesses an overrideable sound. With this you can override SMBX sounds at runtime.

* is the id of the sound.
See more: SoundOverride class
(Level only) (LunaLua ≥ v0.7.3)
Lastly, the classes. All merged into one BIG document (with 4881 lines!).
Spoiler: show
ALL classes as of SMBX (beta 3).
Source 1 (and subpages): https://wohlsoft.ru/pgewiki/Category:LunaLua_classes
Source 2 (and subpages): https://wohlsoft.ru/pgewiki/Category:Lu ... es_(world)

--------- Level classes: ---------

------- The Animation Class -------

Animation
This class provides fields/functions for managing animations/effects in the current level.

----- Static Animation Functions -----

--- Function ---
Animation.count()
--- Return values ---
number
--- Description ---
How many effects are in the level.

--- Function ---
Animation.get()
--- Return values ---
table of Animation
--- Description ---
Returns all running effects.

--- Function ---
Animation.get(number or table ids)
--- Return values ---
table of Animation
--- Description ---
Returns all running effects with the matching ids. Only running effects with the same id given by ids will be returned.

--- Function ---
Animation.getIntersecting(number x1, number y1, number x2, number y2)
--- Return values ---
table of Animation
--- Description ---
Returns all effects which are intersecting with an area from x1/y1 to x2/y2.

--- Function ---
Animation.spawn(number effectID, number x, number y)
--- Return values ---
Animation
--- Description ---
Runs/Starts a new effect.)

--- Function ---
Animation.spawn(number effectID, number x, number y, number variant)
--- Return values ---
Animation
--- Description ---
Runs/Starts a new effect. variant is choosen effect variant (some effects have various version of a effect).

--- Function ---
Animation(number index)
--- Return values ---
Animation
--- Description ---
Returns the Animation object at position index in the global Animation table. Use this constructor with caution! Use Animation.get or Animation.getIntersecting instead!! (See above)

----- Instance functions -----

These fields and functions are part of Animation Objects and have to be called for that object. Trying to call them from the static Animation class will result in an error. Example (feel free to copy it into your lua file to see how it works):

function onTick()
for index,myAnimation in ipairs(Animation.get()) do
myAnimation.id = 2
end
end

----- Animation Class -----

--- Type ---
Function
--- Function/Field ---
Animation:mem(int offset, int fieldtype, object value)
--- Return values/Value type ---
nil
--- Description ---
Sets a value of the Animation struct at a specific address-offset.

--- Type ---
Function
--- Function/Field ---
Animation:mem(int offset, int fieldtype)
--- Return values/Value type ---
object
--- Description ---
Returns a value of the Animation struct at a specific address-offset.

--- Type ---
Field
--- Function/Field ---
Animation.x
--- Return values/Value type ---
double
--- Description ---
The x coordinate of the animation.

--- Type ---
Field
--- Function/Field ---
Animation.y
--- Return values/Value type ---
double
--- Description ---
The y coordinate of the animation.

--- Type ---
Field
--- Function/Field ---
Animation.speedX
--- Return values/Value type ---
double
--- Description ---
The x-speed of the animation.

--- Type ---
Field
--- Function/Field ---
Animation.speedY
--- Return values/Value type ---
double
--- Description ---
The y-speed of the animation.

--- Type ---
Field
--- Function/Field ---
Animation.id
--- Return values/Value type ---
int
--- Description ---
The animation-id of the animation.

--- Type ---
Field
--- Function/Field ---
Animation.width
--- Return values/Value type ---
int
--- Description ---
The width of the animation.

--- Type ---
Field
--- Function/Field ---
Animation.height
--- Return values/Value type ---
int
--- Description ---
The height of the animation.

--- Type ---
Field
--- Function/Field ---
Animation.subTimer
--- Return values/Value type ---
int
--- Description ---
The sub-timer. Some effects use it in addition to the normal timer. If modifying "Animation.timer" doesn't work you may need to modify this value too.

--- Type ---
Field
--- Function/Field ---
Animation.timer
--- Return values/Value type ---
int
--- Description ---
The timer (frames until finished) of the animation.

--- Type ---
Field
--- Function/Field ---
Animation.animationFrame
--- Return values/Value type ---
int
--- Description ---
The current animation frame.

--- Type ---
Field
--- Function/Field ---
Animation.npcID
--- Return values/Value type ---
int
--- Description ---
The npcID for effects like yoshis egg.

--- Type ---
Field
--- Function/Field ---
Animation.drawOnlyMask
--- Return values/Value type ---
boolean
--- Description ---
If true, then only the mask will be drawn.

------- The BGO Class -------

BGO
This class provides fields/functions for managing BGOs in the current level. (LunaLua ≥v0.7)

----- Static BGO Functions (Level only) -----

--- Function ---
BGO.count()
--- Return values ---
number
--- Description ---
How many BGOs are in the level.

--- Function ---
BGO.get()
--- Return values ---
table of BGO
--- Description ---
Returns all BGOs

--- Function ---
BGO.get(number or table ids)
--- Return values ---
table of BGO
--- Description ---
Returns all BGOs with the matching ids. Only the BGOs with the same id given by ids will be returned.

--- Function ---
BGO.getIntersecting(number x1, number y1, number x2, number y2)
--- Return values ---
table of BGO
--- Description ---
Returns all BGOs which are intersecting with an area from x1/y1 to x2/y2.

--- Function ---
BGO(number index)
--- Return values ---
BGO
--- Description ---
Returns the BGO object at position index in the global BGO table. Use this constructor with caution! Use BGO.get or BGO.getIntersecting instead!! (See above)

----- Instance functions -----

These fields and functions are part of BGO Objects and have to be called for that object. Trying to call them from the static BGO class will result in an error. Example (feel free to copy it into your lua file to see how it works):

function onTick()
for index,myBGO in ipairs(BGO.get()) do
myBGO.x = myBGO.x + 1
end
end

----- BGO class -----

--- Type ---
Field
--- Function/Field ---
BGO.id
--- Return values/Value type ---
int
--- Description ---
The BGO-id of the BGO.

--- Type ---
Field (ro)
--- Function/Field ---
BGO.isHidden
--- Return values/Value type ---
boolean
--- Description ---
True, if the BGO item is hidden.

--- Type ---
Field
--- Function/Field ---
BGO.x
--- Return values/Value type ---
double
--- Description ---
The x coordinate of the BGO.

--- Type ---
Field
--- Function/Field ---
BGO.y
--- Return values/Value type ---
double
--- Description ---
The y coordinate of the BGO.

--- Type ---
Field
--- Function/Field ---
BGO.width
--- Return values/Value type ---
double
--- Description ---
The width of the BGO.

--- Type ---
Field
--- Function/Field ---
BGO.height
--- Return values/Value type ---
double
--- Description ---
The height of the BGO.

--- Type ---
Field
--- Function/Field ---
BGO.speedX
--- Return values/Value type ---
double
--- Description ---
The x-speed of the BGO.

--- Type ---
Field
--- Function/Field ---
BGO.speedY
--- Return values/Value type ---
double
--- Description ---
The y-speed of the BGO.

--- Type ---
Field
--- Function/Field ---
BGO.layer
--- Return values/Value type ---
Layer
--- Description ---
The layer of the BGO.

--- Type ---
Field
--- Function/Field ---
BGO.layerName
--- Return values/Value type ---
string
--- Description ---
The layer name of the BGO.

------- The Block Class -------

Block
This class provides fields/functions for managing Blocks in the current level.

----- Static Block Functions (Level only) -----

--- Function ---
Block.count()
--- Return values ---
number
--- Description ---
How many blocks are in the level.

--- Function ---
Block.get()
--- Return values ---
table of Block
--- Description ---
Returns all blocks

--- Function ---
Block.get(number or table ids)
--- Return values ---
table of Block
--- Description ---
Returns all blocks with the matching ids. Only the blocks with the same id given by ids will be returned.

--- Function ---
Block.getIntersecting(number x1, number y1, number x2, number y2)
--- Return values ---
table of Block
--- Description ---
Returns all blocks which are intersecting with an area from x1/y1 to x2/y2.

--- Function ---
Block.spawn(number blockId, number x, number y)
--- Return values ---
Block
--- Description ---
Spawns a new block.

--- Function ---
Block(number index)
--- Return values ---
Block
--- Description ---
Returns the Block object at position index in the global Block table. Use this constructor with caution! Use Block.get or Block.getIntersecting instead!! (See above)

----- Instance functions -----

These fields and functions are part of Block Objects and have to be called for that object. Trying to call them from the static Block class will result in an error. Example (feel free to copy it into your lua file to see how it works):

function onTick()
for index,myBlock in ipairs(Block.get()) do
myBlock.speedX = myBlock.speedX + 1
end
end

----- Block Class -----

--- Type ---
function
--- Function/Field ---
Block:mem(int offset, int fieldtype, object value)
--- Return values/Value type ---
nil
--- Description ---
Sets a value of the Block struct at a specific address-offset.

--- Type ---
function
--- Function/Field ---
Block:mem(int offset, int fieldtype)
--- Return values/Value type ---
object
--- Description ---
Returns a value of the Block struct at a specific address-offset.

--- Type ---
function
--- Function/Field ---
Block:collidesWith(Player player)
--- Return values/Value type ---
int
--- Description ---
Returns a number with the side of the collision.
0 = no collision,
1 = Player on top of block,
2 = Player touching right side,
3 = Player touching bottom,
4 = Player touching left side.

--- Type ---
function
--- Function/Field ---
Block:remove(boolean playEffectAndSound)
--- Return values/Value type ---
nil
--- Description ---
Destroys/Removes a block. If playEffectAndSound is true, then the destroy sound and effect you normally only see in the level editor is played. (LunaLua ≥ v0.7.1)

--- Type ---
function
--- Function/Field ---
Block:remove()
--- Return values/Value type ---
nil
--- Description ---
Same as Block:remove(false) (LunaLua ≥ v0.7.1)

--- Type ---
function
--- Function/Field ---
Block:hit(boolean fromUpperSide, Player player, number hittingCount)
--- Return values/Value type ---
nil
Simulates a hit on the block. If fromUpperSide is true, then the block will simulate a hit from the top side. The player argument is needed for blocks like the player-switch block. hittingCount is the number of repeating hits on the block (i.e. when toads hits the block). (LunaLua ≥ v0.7.2)

--- Type ---
function
--- Function/Field ---
Block:hit(boolean fromUpperSide, Player player)
--- Return values/Value type ---
nil
--- Description ---
Simulates a hit on the block. If fromUpperSide is true, then the block will simulate a hit from the top side. The player argument is needed for blocks like the player-switch block. (LunaLua ≥ v0.7.1)

--- Type ---
function
--- Function/Field ---
Block:hit(boolean fromUpperSide)
--- Return values/Value type ---
nil
--- Description ---
Same as Block:hit(fromUpperSide, Player(1)) (LunaLua ≥ v0.7.1)

--- Type ---
function
--- Function/Field ---
Block:hit()
--- Return values/Value type ---
nil
--- Description ---
Same as Block:hit(false, Player(1)) (LunaLua ≥ v0.7.1)

--- Type ---
Field
--- Function/Field ---
Block.x
--- Return values/Value type ---
double
--- Description ---
The x coordinate of the block.

--- Type ---
Field
--- Function/Field ---
Block.y
--- Return values/Value type ---
double
--- Description ---
The y coordinate of the block.

--- Type ---
Field
--- Function/Field ---
Block.speedX
--- Return values/Value type ---
double
--- Description ---
The x-speed of the block.

--- Type ---
Field
--- Function/Field ---
Block.speedY
--- Return values/Value type ---
double
--- Description ---
The y-speed of the block.

--- Type ---
Field
--- Function/Field ---
Block.id
--- Return values/Value type ---
number
--- Description ---
The block-id of the block.

--- Type ---
Field
--- Function/Field ---
Block.contentID
--- Return values/Value type ---
number
--- Description ---
The contents of the block. 0-99 are coin values. 1XXX where XXX is the id of the npc. (i.e. 1099 is the npc with the id 99) (LunaLua ≥ v0.7.2)

--- Type ---
Field
--- Function/Field ---
Block.isHidden
--- Return values/Value type ---
boolean
--- Description ---
Boolean flag if the block is invisible.

--- Type ---
Field
--- Function/Field ---
Block.invisible (Deprecated: Use the above)
--- Return values/Value type ---
boolean
--- Description ---
Boolean flag if the block is invisible.

--- Type ---
Field
--- Function/Field ---
Block.slippery
--- Return values/Value type ---
boolean
--- Description ---
Boolean flag if the block is slippery.

--- Type ---
Field (ro)
--- Function/Field ---
Block.layerName
--- Return values/Value type ---
VBStr
--- Description ---
The layer name of the block.

--- Type ---
Field (ro)
--- Function/Field ---
Block.layerObj
--- Return values/Value type ---
Layer
--- Description ---
The layer object of the block.

----- Offsets -----

This is the memory map for the Block struct. This struct is not fully analysed. Any help is appreciated!
Please note that the data is probably not 100% accurate. We'd have to check if the structure SMBX Block+(memory) is actually represented that way in-game.

--- Name ---
SMBX Block+0x00
--- Memory address ---
0x00
--- Memory type ---
FIELD_WORD
--- Description ---
Makes block slippery

--- Name ---
SMBX Block+0x02
--- Memory address ---
0x02
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown attribute in memory offset 02.

--- Name ---
SMBX Block+0x04
--- Memory address ---
0x04
--- Memory type ---
FIELD_WORD
--- Description ---
How many times the block gets hitted (i.e. when Toad hits the block)

--- Name ---
SMBX Block+0x06
--- Memory address ---
0x06
--- Memory type ---
FIELD_WORD
--- Description ---
Block type 2

--- Name ---
SMBX Block+0x08
--- Memory address ---
0x08
--- Memory type ---
FIELD_WORD
--- Description ---
Content ID related

--- Name ---
SMBX Block+0x0A
--- Memory address ---
0x0A
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown 0A

--- Name ---
SMBX Block+0x0C
--- Memory address ---
0x0C
--- Memory type ---
VB6StrPtr
--- Description ---
Event that triggers when block is hit.

--- Name ---
SMBX Block+0x10
--- Memory address ---
0x10
--- Memory type ---
VB6StrPtr
--- Description ---
Event that triggers when block is destroyed.

--- Name ---
SMBX Block+0x14
--- Memory address ---
0x14
--- Memory type ---
VB6StrPtr
--- Description ---
Event that triggers when there are no more objects in layer.

--- Name ---
SMBX Block+0x18
--- Memory address ---
0x18
--- Memory type ---
VB6StrPtr
--- Description ---
Name of the layer the block belongs to.

--- Name ---
SMBX Block+0x1C
--- Memory address ---
0x1C
--- Memory type ---
FIELD_WORD
--- Description ---
Toggles block visibility. (Hidden layers or destroyed)

--- Name ---
SMBX Block+0x1E
--- Memory address ---
0x1E
--- Memory type ---
FIELD_WORD
--- Description ---
Registers block type.

--- Name ---
SMBX Block+0x20
--- Memory address ---
0x20
--- Memory type ---
FIELD_DFLOAT
--- Description ---
Current x-position

--- Name ---
SMBX Block+0x28
--- Memory address ---
0x28
--- Memory type ---
FIELD_DFLOAT
--- Description ---
Current y-position

--- Name ---
SMBX Block+0x30
--- Memory address ---
0x30
--- Memory type ---
FIELD_DFLOAT
--- Description ---
Height

--- Name ---
SMBX Block+0x38
--- Memory address ---
0x38
--- Memory type ---
FIELD_DFLOAT
--- Description ---
Width

--- Name ---
SMBX Block+0x40
--- Memory address ---
0x40
--- Memory type ---
FIELD_DFLOAT
--- Description ---
Current x-speed

--- Name ---
SMBX Block+0x48
--- Memory address ---
0x48
--- Memory type ---
FIELD_DFLOAT
--- Description ---
Current y-speed

--- Name ---
SMBX Block+0x50
--- Memory address ---
0x50
--- Memory type ---
FIELD_WORD
--- Description ---
Registers ID of block contents.

--- Name ---
SMBX Block+0x52
--- Memory address ---
0x52
--- Memory type ---
FIELD_WORD
--- Description ---
Counter for the first half of the bonk animation. Sum with 0x54 for the y offset of the bonk.

--- Name ---
SMBX Block+0x54
--- Memory address ---
0x54
--- Memory type ---
FIELD_WORD
--- Description ---
Counter for the second half of the bonk animation. Sum with 0x52 for the y offset of the bonk.

--- Name ---
SMBX Block+0x56
--- Memory address ---
0x56
--- Memory type ---
FIELD_WORD
--- Description ---
The y offset of the bonking animation. Should equal -(0x52 + 0x54).

--- Name ---
SMBX Block+0x58
--- Memory address ---
0x58
--- Memory type ---
FIELD_WORD
--- Description ---
-1 on the frame after a block has been bonked, but only when bonked by the player.

--- Name ---
SMBX Block+0x5A
--- Memory address ---
0x5A
--- Memory type ---
FIELD_WORD
--- Description ---
Triggers block invisibility, type 2. (Invisible flag from the editor - will reappear when hit from below)

--- Name ---
SMBX Block+0x5C
--- Memory address ---
0x5C
--- Memory type ---
FIELD_WORD
--- Description ---
Triggers block invisibility, type 3.

--- Name ---
SMBX Block+0x5E
--- Memory address ---
0x5E
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown attribute in memory offset 5E.

--- Name ---
SMBX Block+0x60
--- Memory address ---
0x60
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown attribute in memory offset 60.

--- Name ---
SMBX Block+0x62
--- Memory address ---
0x62
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown attribute in memory offset 62.

--- Name ---
SMBX Block+0x64
--- Memory address ---
0x64
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown attribute in memory offset 64.

--- Name ---
SMBX Block+0x64
--- Memory address ---
0x66
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown attribute in memory offset 66.

------- The Camera Class -------

Camera
This class provides access to the SMBX cameras. NOTE: Only access this class in onCameraUpdate if you want the correct values or overwrite these values!

----- Static Camera Functions (Overworld and level) -----

--- Function ---
Camera.get()
--- Return values ---
table of Camera
--- Description ---
Returns all Cameras

----- Instance functions -----

These fields and functions are part of Camera Objects and have to be called for that object. Trying to call them from the static Camera class will result in an error. Example (feel free to copy it into your lua file to see how it works):

local player1Camera = Camera.get()[1]
function onCameraUpdate()
player1Camera.x = player1Camera.x + 200
end

----- Camera class -----

--- Type ---
Field
--- Function/Field ---
Camera.x
--- Return values/Value type ---
number
--- Description ---
The x position of the camera at the scene.

--- Type ---
Field
--- Function/Field ---
Camera.y
--- Return values/Value type ---
number
--- Description ---
The y position of the camera at the scene.

--- Type ---
Field
--- Function/Field ---
Camera.renderX
--- Return values/Value type ---
number
--- Description ---
The x position of the camera at the screen. (LunaLua ≥ v0.7.3)

--- Type ---
Field
--- Function/Field ---
Camera.renderY
--- Return values/Value type ---
number
--- Description ---
The y position of the camera at the screen. (LunaLua ≥ v0.7.3)

--- Type ---
Field
--- Function/Field ---
Camera.width
--- Return values/Value type ---
number
--- Description ---
The width of the camera.

--- Type ---
Field
--- Function/Field ---
Camera.height
--- Return values/Value type ---
number
--- Description ---
The height of the camera.

----- Camera Memory -----

--- Name ---
Render X Position
--- Memory address ---
CAM+0x00
--- Memory type ---
FIELD_DFLOAT
--- Description ---
The x position of the camera at the screen.

--- Name ---
Render Y Position
--- Memory address ---
CAM+0x08
--- Memory type ---
FIELD_DFLOAT
--- Description ---
The y position of the camera at the screen.

--- Name ---
Width
--- Memory address ---
CAM+0x10
--- Memory type ---
FIELD_DFLOAT
--- Description ---
The width of the camera.

--- Name ---
Height
--- Memory address ---
CAM+0x18
--- Memory type ---
FIELD_DFLOAT
--- Description ---
The height of the camera.

--- Name ---
Is Split Screen?
--- Memory address ---
CAM+0x20
--- Memory type ---
FIELD_BOOL
--- Description ---
Only the second camera will return true when the camera is split.

--- Name ---
Unknown
--- Memory address ---
CAM+0x22
--- Memory type ---
Unknown
--- Description ---
Unknown.

--- Name ---
Unknown
--- Memory address ---
CAM+0x24
--- Memory type ---
Unknown
--- Description ---
Unknown.

--- Name ---
Unknown
--- Memory address ---
CAM+0x26
--- Memory type ---
Unknown
--- Description ---
Unknown.

--- Name ---
Unknown
--- Memory address ---
CAM+0x28
--- Memory type ---
Unknown
--- Description ---
Unknown.

--- Name ---
Unknown
--- Memory address ---
CAM+0x2A
--- Memory type ---
Unknown
--- Description ---
Unknown.

--- Name ---
Player's Y Difference
--- Memory address ---
CAM+0x2C
--- Memory type ---
FIELD_DFLOAT
--- Description ---
The player's Y position difference. This will only work when the cameras are splitted vertically, otherwise it returns 0. The number will cap at 150 or -150.

--- Name ---
Unknown Timer
--- Memory address ---
CAM+0x34
--- Memory type ---
FIELD_DWORD
--- Description ---
Starts at 200 which then decreases to 0. The reason it decreses seems related to the cameras being in different sections?

------- The CaptureBuffer Class -------

CaptureBuffer
A caputure buffer can be used to snapshot a frame to a specific rendering priority. For example, if you capture up to -5, then you will capture all but the SMBX HUD. This capture buffer object can be passed as texture to Graphics.glDraw. (LunaLua ≥ v0.7.3.1)

Example:

local myFullCaptureBuffer = Graphics.CaptureBuffer(800, 600)

function onTick()
myFullCaptureBuffer:captureAt(-5) -- Caputure all but HUD
Graphics.glDraw {
vertexCoords = {
0, 0,
800, 0,
0, 600,
0, 600,
800, 600,
800, 0
},
texture = myFullCaptureBuffer,
textureCoords = {0,0, 1,0, 0,1, 0,1, 1,1, 1,0},
primitive = Graphics.GL_TRIANGLE,
priority = 5.1 -- Overdraw everything
}
end

----- CaptureBuffer class -----

--- Type ---
Constructor
--- Function/Field ---
myCaptureBuffer = Graphics.CaptureBuffer(int width, int height)
--- Return values/Value type ---
CaptureBuffer
--- Description ---
Construct a new CaptureBuffer-Object.

--- Type ---
Constructor
--- Function/Field ---
CaptureBuffer:captureAt(number priority)
--- Return values/Value type ---
nil
--- Description ---
Captures a frame which is rendered up to priority.

------- The Console Class -------

Console
This class provides interaction with a console.

You can get the default console window by starting smbx with the "--console" argument. Further information can be found at LunaLua Command Args. The default instance of this console window is called "console".

----- Console class -----

--- Type ---
function
--- Function/Field ---
Console:print(string text)
--- Return values/Value type ---
nil
--- Description ---
Prints out the text in the console.

--- Type ---
function
--- Function/Field ---
Console:println(string text)
--- Return values/Value type ---
nil
--- Description ---
Prints out the text in the console and breaks the line (\n).

------- The Data Class -------

Data
Note: This class will be deprecated in favor of the SaveData and GameData tables upon release of SMBX2 Beta 4.

This class is a successor of UserData. It now uses strings for both keys and values. You can set your own section-name and save location. You can also make it "saveslot"-local, which means that the data is not shared between different save slots.

----- Data class -----

--- Type ---
Enum
--- Function/Field ---
Data.DATA_LEVEL
--- Return values/Value type ---
---
--- Description ---
Data location: This data will be saved in the level custom folder and can be only accessed by the current level.

--- Type ---
Enum
--- Function/Field ---
Data.DATA_WORLD
--- Return values/Value type ---
---
--- Description ---
Data location: This data will be saved in the episode folder and can be only accessed by the current world or level.

--- Type ---
Enum
--- Function/Field ---
Data.DATA_GLOBAL
--- Return values/Value type ---
---
--- Description ---
Data location: This data will be saved in the {SMBX-Path}/worlds folder and can be accessed from every world or level.

--- Type ---
Constructor
--- Function/Field ---
myData = Data(Data.DATA_##### dataLocation)
--- Return values/Value type ---
Data
--- Description ---
Constructs a new Data class with the save location specified with dataLocation. It will use "default" as section name and use the save slot, if dataLocation is Data.DATA_GLOBAL.

--- Type ---
Constructor
--- Function/Field ---
myData = Data(Data.DATA_##### dataLocation, boolean useSaveSlot)
--- Return values/Value type ---
Data
--- Description ---
Constructs a new Data class with the save location specified with dataLocation. It will use "default" as section name. If useSaveSlot is true, then the save slot will be used.

--- Type ---
Constructor
--- Function/Field ---
myData = Data(Data.DATA_##### dataLocation, string sectionName)
--- Return values/Value type ---
Data
--- Description ---
Constructs a new Data class with the save location specified with dataLocation. It will use sectionName as section name and use the save slot, if dataLocation is Data.DATA_GLOBAL.

--- Type ---
Constructor
--- Function/Field ---
myData = Data(Data.DATA_##### dataLocation, string sectionName, boolean useSaveSlot)
--- Return values/Value type ---
Data
--- Description ---
Constructs a new Data class with the save location specified with dataLocation. It will use sectionName as section name and use the save slot, if useSaveSlot is true.

--- Type ---
function
--- Function/Field ---
Data:set(string key, string value)
--- Return values/Value type ---
nil
--- Description ---
Sets a value in the Data class. Use the tostring() function if you want to save a number.

--- Type ---
function
--- Function/Field ---
Data:get(string key)
--- Return values/Value type ---
string
--- Description ---
Returns the value of the key. If the key is not not set, then an empty string will be returned. Use the tonumber() function to convert a string into a number.

--- Type ---
function
--- Function/Field ---
Data:get()
--- Return values/Value type ---
Table with [key] = value
--- Description ---
Returns a table with a copy of the content. The key is the table-index while the value is the table-value. Use the tonumber() function to convert a string into a number.

--- Type ---
function
--- Function/Field ---
Data:save()
--- Return values/Value type ---
nil
--- Description ---
Saves the data.

--- Type ---
function
--- Function/Field ---
Data:save(string sectionName)
--- Return values/Value type ---
nil
--- Description ---
Saves the data and sets a new section Name.

--- Type ---
Field
--- Function/Field ---
Data.dataType
--- Return values/Value type ---
Data.DATA_#####
--- Description ---
The save location of the data.

--- Type ---
Field
--- Function/Field ---
Data.sectionName
--- Return values/Value type ---
string
--- Description ---
The section name of the data.

--- Type ---
Field
--- Function/Field ---
Data.useSaveSlot
--- Return values/Value type ---
boolean
--- Description ---
If the save slot number should be used when saving.

------- The Event Class -------

Event
This class is used to pass additional data to the event function. This class is mainly used for LunaLua event which are not sync with the main LunaLua event loop. Please note that not every event is cancellable. If doing anyway, it will throw an error.

----- Event Class -----

--- Type ---
Field (ro)
--- Function/Field ---
Event.eventName
--- Return values/Value type ---
string
--- Description ---
The name of the event-type! Not a SMBX Event!

--- Type ---
Field (ro)
--- Function/Field ---
Event.cancellable
--- Return values/Value type ---
boolean
--- Description ---
Returns true, if the event is cancellable.

--- Type ---
Field
--- Function/Field ---
Event.cancelled
--- Return values/Value type ---
boolean
--- Description ---
If set to true, then the event will be cancelled and the hoster of the event will take action to this decision.

------- The Layer Class -------

Layer
This class provides fields/functions for managing Layers in the current level. Accessing Layers only work after the code file is initiated and after onLoad!

--- Static Layer Functions ---

--- Function ---
Layer.get()
--- Return values ---
table of Layer
--- Description ---
Returns all existing layers.

--- Function ---
Layer.get(string layerName)
--- Return values ---
Layer
--- Description ---
Returns the layer object for the layerName. If no layer object with layerName is found then nil is returned.

--- Function ---
Layer(number index)
--- Return values ---
Layer
--- Description ---
Returns the Layer object at position index in the global Layer table. Use this constructor with caution! Use Layer.get instead!! (See above)

----- Instance functions -----

These fields and functions are part of Layer Objects and have to be called for that object. Trying to call them from the static Layer class will result in an error. Example (feel free to copy it into your lua file to see how it works):

function onStart()
local defaultLayer = Layer.get("Default")
defaultLayer:hide(true)
end

----- Layer class -----

--- Type ---
function
--- Function/Field ---
Layer:stop()
--- Return values/Value type ---
nil
--- Description ---
Stops layer's movements.

--- Type ---
function
--- Function/Field ---
Layer:show(boolean noSmoke)
--- Return values/Value type ---
nil
--- Description ---
Shows the layer. If noSmoke is true, then no smoke will be displayed on showing.
(LunaLua ≥v0.7)

--- Type ---
function
--- Function/Field ---
Layer:hide(boolean noSmoke)
--- Return values/Value type ---
nil
--- Description ---
Hides the layer. If noSmoke is true, then no smoke will be displayed on hiding.
(LunaLua ≥v0.7)

--- Type ---
function
--- Function/Field ---
Layer:toggle(boolean noSmoke)
--- Return values/Value type ---
nil
--- Description ---
Toggles (Showing/Hiding) the layer. If noSmoke is true, then no smoke will be displayed on showing/hiding.
(LunaLua ≥v0.7)

--- Type ---
Field (ro)
--- Function/Field ---
Layer.isHidden
--- Return values/Value type ---
boolean
--- Description ---
Returns true, if the layer is hidden.
(LunaLua ≥v0.7)

--- Type ---
Field (ro)
--- Function/Field ---
Layer.layerName
--- Return values/Value type ---
VBStr
--- Description ---
The layer name.

--- Type ---
Field
--- Function/Field ---
Layer.speedX
--- Return values/Value type ---
double
--- Description ---
The x-speed of the layer.

--- Type ---
Field
--- Function/Field ---
Layer.speedY
--- Return values/Value type ---
double
--- Description ---
The y-speed of the layer.

------- The Level Class -------

Level
This class provides fields/functions for managing Levels in the overworld.

----- Static Level Functions (Level Only) -----

--- Function ---
Level.exit()
--- Return values ---
nil
--- Description ---
Exit the level.

--- Function ---
Level.filename()
--- Return values ---
string
--- Description ---
Returns the filename of the level.

--- Function ---
Level.name()
--- Return values ---
string
--- Description ---
Returns the Title/Name of the level.

--- Function ---
Level.winState()
--- Return values ---
int
--- Description ---
Returns the current state of hitting the goal. If currently not winning then this value is 0. SMB3 Roulette: 1. SMB3 Orb: 2. Keyhole: 3. SMB2 Orb: 4. Game End: 5. SMB3 Star: 6. SMW Tape: 7.

--- Function ---
Level.winState(int value)
--- Return values ---
nil
--- Description ---
Sets the current state of hitting the goal. If currently not winning then this value is 0. SMB3 Roulette: 1. SMB3 Orb: 2. Keyhole: 3. SMB2 Orb: 4. Game End: 5. SMB3 Star: 6. SMW Tape: 7.

--- Function ---
Level.loadPlayerHitBoxes(int characterId, int powerUpId, string iniFilename)
--- Return values ---
nil
--- Description ---
Loads the hitbox settings for specific player and it's power-up state from INI file made by Special Calibration tool.

----- Instance functions -----

These fields and functions are part of Level Objects and have to be called for that object. Trying to call them from the static Level class will result in an error. Example (feel free to copy it into your lua file to see how it works):

function onStart()
for index,myLevel in ipairs(Level.get()) do
myLevel.visible = true
end
end

----- Level class -----

--- Type ---
function
--- Function/Field ---
Level:mem(int offset, int fieldtype, object value)
--- Return values/Value type ---
nil
--- Description ---
Sets a value of the Level struct at a specific address-offset.

--- Type ---
function
--- Function/Field ---
Level:mem(int offset, int fieldtype)
--- Return values/Value type ---
object
--- Description ---
Returns a value of the Level struct at a specific address-offset.

--- Type ---
Field
--- Function/Field ---
Level.x
--- Return values/Value type ---
double
--- Description ---
The x position of the level.

--- Type ---
Field
--- Function/Field ---
Level.y
--- Return values/Value type ---
double
--- Description ---
The y position of the level.

--- Type ---
Field
--- Function/Field ---
Level.goToX
--- Return values/Value type ---
double
--- Description ---
The x position to the destination position. (LunaLua ≥ v0.7.2)

--- Type ---
Field
--- Function/Field ---
Level.goToY
--- Return values/Value type ---
double
--- Description ---
The y position to the destination position. (LunaLua ≥ v0.7.2)

--- Type ---
Field
--- Function/Field ---
Level.topExitType
--- Return values/Value type ---
number
--- Description ---
The exit type which triggers the top path. (LunaLua ≥ v0.7.2)

--- Type ---
Field
--- Function/Field ---
Level.leftExitType
--- Return values/Value type ---
number
--- Description ---
The exit type which triggers the left path. (LunaLua ≥ v0.7.2)

--- Type ---
Field
--- Function/Field ---
Level.bottomExitType
--- Return values/Value type ---
number
--- Description ---
The exit type which triggers the bottom path. (LunaLua ≥ v0.7.2)

--- Type ---
Field
--- Function/Field ---
Level.rightExitType
--- Return values/Value type ---
number
--- Description ---
The exit type which triggers the right path. (LunaLua ≥ v0.7.2)

--- Type ---
Field
--- Function/Field ---
Level.levelWarpNumber
--- Return values/Value type ---
number
--- Description ---
The warp id in the level which should be used, when the Player enters the level. (LunaLua ≥ v0.7.2)

--- Type ---
Field
--- Function/Field ---
Level.isPathBackground
--- Return values/Value type ---
boolean
--- Description ---
If the level item has a path background. (LunaLua ≥ v0.7.2)

--- Type ---
Field
--- Function/Field ---
Level.isBigBackground
--- Return values/Value type ---
boolean
--- Description ---
If the level item has a big path background. (LunaLua ≥ v0.7.2)

--- Type ---
Field
--- Function/Field ---
Level.isGameStartPoint
--- Return values/Value type ---
boolean
--- Description ---
If the level item is the game start point. (LunaLua ≥ v0.7.2)

--- Type ---
Field
--- Function/Field ---
Level.isAlwaysVisible
--- Return values/Value type ---
boolean
--- Description ---
If the level is always visible. (LunaLua ≥ v0.7.2)

--- Type ---
Field
--- Function/Field ---
Level.visible
--- Return values/Value type ---
boolean
--- Description ---
Whether the object is visible or not. (LunaLua ≥ v0.7.3.2)

--- Type ---
Field (ro)
--- Function/Field ---
Level.title
--- Return values/Value type ---
string
--- Description ---
The level title.

--- Type ---
Field (ro)
--- Function/Field ---
Level.filename
--- Return values/Value type ---
string
--- Description ---
The level filename.

------- The LuaImageResource Class -------

LuaImageResource
The LuaImageResource refers to a LunaLua specific type, consisting of the data of a loaded Portable Network Graphics (.png) image file. To create image data, files can be loaded via Graphics.loadImage(), Graphics.loadImageResolved() or Graphics.loadAnimatedImage().

As LunaLua ≥ 0.7.3 Beta, This class also provides the following fields for managing images:

--- Field ---
Img.width
--- Value type ---
int
--- Description ---
The image width

--- Field ---
Img.height
--- Value type ---
int
--- Description ---
The image height.

------- The Musicbox Class -------

Musicbox
This class provides fields/functions for managing musicboxes on the overworld.

----- Static Path Functions -----

--- Function ---
Musicbox.count()
--- Return values ---
number
--- Description ---
How many musicboxes are on the overworld.

--- Function ---
Musicbox.get()
--- Return values ---
table of Musicbox
--- Description ---
Returns all musicboxes on the overworld.

--- Function ---
Musicbox.get(number or table ids)
--- Return values ---
table of Musicbox
--- Description ---
Returns all musicboxes with the matching item ids.

--- Function ---
Musicbox.getIntersecting(number x1, number y1, number x2, number y2)
--- Return values ---
table of Musicbox
--- Description ---
Returns all musicboxes which are intersecting with an area from x1/y1 to x2/y2.

----- Instance functions -----

These fields and functions are part of Musicbox Objects and have to be called for that object. Trying to call them from the static Musicbox class will result in an error. Example (feel free to copy it into your lua file to see how it works):

function onStart()
for index,myBox in ipairs(Musicbox.get()) do
myBox.id = 1
end
end

----- Path class -----

--- Type ---
Field
--- Function/Field ---
Musicbox.id
--- Return values/Value type ---
double
--- Description ---
The id of the musicbox.

--- Type ---
Field
--- Function/Field ---
Musicbox.x
--- Return values/Value type ---
double
--- Description ---
The x position of the musicbox.

--- Type ---
Field
--- Function/Field ---
Musicbox.y
--- Return values/Value type ---
double
--- Description ---
The y position of the musicbox.

--- Type ---
Field
--- Function/Field ---
Musicbox.width
--- Return values/Value type ---
double
--- Description ---
The width of the musicbox.

--- Type ---
Field
--- Function/Field ---
Musicbox.height
--- Return values/Value type ---
double
--- Description ---
The height of the musicbox.

--- Type ---
Field
--- Function/Field ---
Musicbox.isValid
--- Return values/Value type ---
boolean
--- Description ---
Whether the object is valid or not.

------- The NPC Class -------

NPC
This class provides fields/functions for managing NPCs in the current level. DO NOT SAVE THIS CLASS/VARIABLE, ONLY USE IT LOCALLY PER FRAME.

--- Function ---
NPC.count()
--- Return values ---
number
--- Description ---
How many NPCs are in the level.

--- Function ---
NPC.get()
--- Return values ---
table of NPC
--- Description ---
Returns all NPCs

--- Function ---
NPC.get(number or table ids, int or table sections)
--- Return values ---
table of NPC
--- Description ---
Returns all NPC with the matching ids and section-numbers (0-20). Use -1 for ids or sections if you want to ignore this filter. Only the NPCs with the same id and sections given by ids and sections will be returned.
v0.7 has a critical bug crashing on this function! Be sure to be updated to 0.7.0.1!

--- Function ---
NPC.getIntersecting(number x1, number y1, number x2, number y2)
--- Return values ---
table of NPC
--- Description ---
Returns all NPCs which are intersecting with an area from x1/y1 to x2/y2.

--- Function ---
NPC.spawn(number npcId, number x, number y, int sectionNumber)
--- Return values ---
NPC
--- Description ---
Spawns a new npc. Note that sectionNumber is from 0-20 (-> Section 1 would be Section 0)

--- Function ---
NPC.spawn(number npcId, number x, number y, int sectionNumber, boolean respawn)
--- Return values ---
NPC
--- Description ---
Spawns a new npc. Note that sectionNumber is from 0-20 (-> Section 1 would be Section 0)

--- Function ---
NPC.spawn(number npcId, number x, number y, int sectionNumber, boolean respawn, boolean centered)
--- Return values ---
NPC
--- Description ---
Spawns a new npc. Note that sectionNumber is from 0-20 (-> Section 1 would be Section 0. If centered is true then x and y are the middle position of the spawning npc.)

--- Function ---
NPC(number index)
--- Return values ---
NPC
--- Description ---
Returns the NPC object at position index in the global NPC table. Use this constructor with caution! Use NPC .get or NPC.getIntersecting instead!! (See above)

----- Instance functions -----

These fields and functions are part of NPC Objects and have to be called for that object. Trying to call them from the static NPC class will result in an error. Example (feel free to copy it into your lua file to see how it works):

function onTick()
for index,myNPC in ipairs(NPC.get()) do
myNPC.speedY = -4
end
end

--- Type ---
Function
--- Function/Field ---
NPC:mem(int offset, int fieldtype, object value)
--- Return values/Value type ---
nil
--- Description ---
Sets a value of the NPC struct at a specific address-offset.

--- Type ---
Function
--- Function/Field ---
NPC:mem(int offset, int fieldtype)
--- Return values/Value type ---
object
--- Description ---
Returns a value of the NPC struct at a specific address-offset.

--- Type ---
Function
--- Function/Field ---
NPC:kill()
--- Return values/Value type ---
nil
--- Description ---
Kills the npc with the standard kill animation.

--- Type ---
Function
--- Function/Field ---
NPC:kill(int killanimation)
--- Return values/Value type ---
nil
--- Description ---
Kills the npc with the kill animation killanimation.

--- Type ---
Function
--- Function/Field ---
NPC:harm()
--- Return values/Value type ---
nil
--- Description ---
Harms the npc as if it were hit by a thrown npc. (LunaLua ≥ v0.7.3)

--- Type ---
Function
--- Function/Field ---
NPC:harm(int harmType)
--- Return values/Value type ---
nil
--- Description ---
Harms the npc as if it took a certain type of damage. See constants for the different harm types. (LunaLua ≥ v0.7.3)

--- Type ---
Function
--- Function/Field ---
NPC:harm(int harmType, int damage)
--- Return values/Value type ---
nil
--- Description ---
Deals the given amount of damage to an NPC with the given harm type. The damage value is ignored by one-hit npcs. (LunaLua ≥ v0.7.3)

--- Type ---
Function
--- Function/Field ---
NPC:toIce()
--- Return values/Value type ---
nil
--- Description ---
Freezes a npc and transform it into ice. (LunaLua ≥ v0.7.2.1)

--- Type ---
Function
--- Function/Field ---
NPC:toCoin()
--- Return values/Value type ---
nil
--- Description ---
Transforms the npc into the coin effect. (Similar to Misc.npcToCoins(), just per NPC) (LunaLua ≥ v0.7.2.1)

--- Type ---
Field
--- Function/Field ---
NPC.x
--- Return values/Value type ---
double
--- Description ---
The x coordinate of the npc.

--- Type ---
Field
--- Function/Field ---
NPC.y
--- Return values/Value type ---
double
--- Description ---
The y coordinate of the npc.

--- Type ---
Field
--- Function/Field ---
NPC.width
--- Return values/Value type ---
int
--- Description ---
The width of the npc.

--- Type ---
Field
--- Function/Field ---
NPC.height
--- Return values/Value type ---
int
--- Description ---
The height of the npc.

--- Type ---
Field
--- Function/Field ---
NPC.speedX
--- Return values/Value type ---
double
--- Description ---
The x-speed of the npc.

--- Type ---
Field
--- Function/Field ---
NPC.speedY
--- Return values/Value type ---
double
--- Description ---
The y-speed of the npc.

--- Type ---
Field
--- Function/Field ---
NPC.id
--- Return values/Value type ---
int
--- Description ---
The npc-id of the npc.

--- Type ---
Field
--- Function/Field ---
NPC.direction
--- Return values/Value type ---
int
--- Description ---
The direction of the npc. NOTE: Setting the direction of a npc, resets the momentum of the npc. You can modify the speedX value if you want to set your own momentum.

--- Type ---
Field
--- Function/Field ---
NPC.msg
--- Return values/Value type ---
VBStr
--- Description ---
The message of the npc.

--- Type ---
Field (ro)
--- Function/Field ---
NPC.attachedLayerName
--- Return values/Value type ---
VBStr
--- Description ---
The attached layer.

--- Type ---
Field (ro)
--- Function/Field ---
NPC.activateEventName
--- Return values/Value type ---
VBStr
--- Description ---
The event name of the activate-event.

--- Type ---
Field (ro)
--- Function/Field ---
NPC.deathEventName
--- Return values/Value type ---
VBStr
--- Description ---
The event name of the death-event.

--- Type ---
Field (ro)
--- Function/Field ---
NPC.noMoreObjInLayer
--- Return values/Value type ---
VBStr
--- Description ---
The event name of the "No more objects in layer"-event.

--- Type ---
Field (ro)
--- Function/Field ---
NPC.talkEventName
--- Return values/Value type ---
VBStr
--- Description ---
The event name of the talk-event.

--- Type ---
Field (ro)
--- Function/Field ---
NPC.layerName
--- Return values/Value type ---
VBStr
--- Description ---
The layer name of the npc.

--- Type ---
Field (ro)
--- Function/Field ---
NPC.layerObj
--- Return values/Value type ---
Layer
--- Description ---
The layer object of the npc.

--- Type ---
Field (ro)
--- Function/Field ---
NPC.attachedLayerObj
--- Return values/Value type ---
Layer
--- Description ---
The attached layer object.

--- Type ---
Field
--- Function/Field ---
NPC.ai1
--- Return values/Value type ---
number
--- Description ---
The 1. AI-field. This field controls the behavouir of NPCs. Read more about it at: SMBX NPC AI (LunaLua ≥ v0.7.2)

--- Type ---
Field
--- Function/Field ---
NPC.ai2
--- Return values/Value type ---
number
--- Description ---
The 2. AI-field. This field controls the behavouir of NPCs. Read more about it at: SMBX NPC AI (LunaLua ≥ v0.7.2)

--- Type ---
Field
--- Function/Field ---
NPC.ai3
--- Return values/Value type ---
number
--- Description ---
The 3. AI-field. This field controls the behavouir of NPCs. Read more about it at: SMBX NPC AI (LunaLua ≥ v0.7.2)

--- Type ---
Field
--- Function/Field ---
NPC.ai4
--- Return values/Value type ---
number
--- Description ---
The 4. AI-field. This field controls the behavouir of NPCs. Read more about it at: SMBX NPC AI (LunaLua ≥ v0.7.2)

--- Type ---
Field
--- Function/Field ---
NPC.ai5
--- Return values/Value type ---
number
--- Description ---
The 5. AI-field. This field controls the behavouir of NPCs. Read more about it at: SMBX NPC AI (LunaLua ≥ v0.7.2)

--- Type ---
Field
--- Function/Field ---
NPC.drawOnlyMask
--- Return values/Value type ---
boolean
--- Description ---
If only the mask of the NPC should be drawn. May not work if the sprite uses PNG. (LunaLua ≥ v0.7.2.1)

--- Type ---
Field
--- Function/Field ---
NPC.invincibleToSword
--- Return values/Value type ---
boolean
--- Description ---
If the NPC is invincible to Link's sword. (LunaLua ≥ v0.7.2.1)

--- Type ---
Field
--- Function/Field ---
NPC.legacyBoss
--- Return values/Value type ---
boolean
--- Description ---
If the NPC is a legacy boss. (LunaLua ≥ v0.7.2.1)

--- Type ---
Field
--- Function/Field ---
NPC.friendly
--- Return values/Value type ---
boolean
--- Description ---
If the NPC is friendly. (LunaLua ≥ v0.7.2.1)

--- Type ---
Field
--- Function/Field ---
NPC.dontMove
--- Return values/Value type ---
boolean
--- Description ---
If the NPC doesn't move. (LunaLua ≥ v0.7.2.1)

--- Type ---
Field
--- Function/Field ---
NPC.collidesBlockBottom
--- Return values/Value type ---
boolean
--- Description ---
If the NPC collides with a block on the bottom side. (LunaLua ≥ v0.7.2.2)

--- Type ---
Field
--- Function/Field ---
NPC.collidesBlockLeft
--- Return values/Value type ---
boolean
--- Description ---
If the NPC collides with a block on the left side. (LunaLua ≥ v0.7.2.2)

--- Type ---
Field
--- Function/Field ---
NPC.collidesBlockUp
--- Return values/Value type ---
boolean
--- Description ---
If the NPC collides with a block on the up side. (LunaLua ≥ v0.7.2.2)

--- Type ---
Field
--- Function/Field ---
NPC.collidesBlockRight
--- Return values/Value type ---
boolean
--- Description ---
If the NPC collides with a block on the right side. (LunaLua ≥ v0.7.2.2)

--- Type ---
Field
--- Function/Field ---
NPC.underwater
--- Return values/Value type ---
boolean
--- Description ---
If the NPC is underwater. (LunaLua ≥ v0.7.2.2)

--- Type ---
Field
--- Function/Field ---
NPC.animationFrame
--- Return values/Value type ---
number
--- Description ---
The current frame of the NPC. (LunaLua ≥ v0.7.2.2)

--- Type ---
Field
--- Function/Field ---
NPC.animationTimer
--- Return values/Value type ---
number
--- Description ---
The animation timer. If the timer reaches a specific value, then the animation frame of the NPC changes. (LunaLua ≥ v0.7.2.2)

----- NPC Memory Offsets (0x158 bytes) -----

This is the memory map for the npc struct. This struct is not fully analysed. Any help is appreciated! Please note that the data may not be fully 100% accurate.

--- Name ---
Attached layer name
--- Memory address ---
NPC+0x00
--- Memory type ---
VB6 String Pointer
--- Description ---
The attached layer name.

--- Name ---
Is in Quicksand?
--- Memory address ---
NPC+0x04
--- Memory type ---
FIELD_WORD
--- Description ---
2 when the NPC is inside quicksand, 1 on the frame the NPC leaves quicksand

--- Name ---
Unknown decrementing timer
--- Memory address ---
NPC+0x06
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown decrementing timer

--- Name ---
Held/Tossed Flag
--- Memory address ---
NPC+0x08
--- Memory type ---
FIELD_BOOL
--- Description ---
Held/thrown by Toad/Peach or knocked forward by Link stab. Resets when touching the ground, but does not reset if Peach or Toad dropped the NPC without throwing it

--- Name ---
Collides below
--- Memory address ---
NPC+0x0A
--- Memory type ---
FIELD_WORD
--- Description ---
Set to 2 when touching a block below and briefly immediately after being thrown by the player

--- Name ---
Collides left
--- Memory address ---
NPC+0x0C
--- Memory type ---
FIELD_WORD
--- Description ---
Set to 2 when touching a block to the left

--- Name ---
Collides above
--- Memory address ---
NPC+0x0E
--- Memory type ---
FIELD_WORD
--- Description ---
Set to 2 when touching a block above

--- Name ---
Collides right
--- Memory address ---
NPC+0x10
--- Memory type ---
FIELD_WORD
--- Description ---
Set to 2 when touching a block to the right

--- Name ---
Pushed vertically
--- Memory address ---
NPC+0x12
--- Memory type ---
FIELD_WORD
--- Description ---
Set to 2 when pushed upwards by a layer or another NPC

--- Name ---
Unknown
--- Memory address ---
NPC+0x14
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown

--- Name ---
Unknown
--- Memory address ---
NPC+0x16
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown

--- Name ---
Quicksand Drag
--- Memory address ---
NPC+0x18
--- Memory type ---
FIELD_FLOAT
--- Description ---
Horizontal drag factor while in quicksand

--- Name ---
Is Underwater?
--- Memory address ---
NPC+0x1C
--- Memory type ---
FIELD_WORD
--- Description ---
underwater state (2 is underwater, 0 is no)

--- Name ---
Unknown
--- Memory address ---
NPC+0x1E
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown

--- Name ---
Unknown
--- Memory address ---
NPC+0x20
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown

--- Name ---
Slope modifier
--- Memory address ---
NPC+0x22
--- Memory type ---
FIELD_WORD
--- Description ---
NPC slope modifier

--- Name ---
Hit Counter (ie for hammers)
--- Memory address ---
NPC+0x24
--- Memory type ---
FIELD_WORD
--- Description ---
Hit counter, for point calculation

--- Name ---
Invincibility to Sword
--- Memory address ---
NPC+0x26
--- Memory type ---
FIELD_WORD
--- Description ---
Invincibility frame countdown, for sword attacks

--- Name ---
Unknown
--- Memory address ---
NPC+0x28
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown

--- Name ---
Unknown
--- Memory address ---
NPC+0x2A
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown

--- Name ---
Activate event layer name
--- Memory address ---
NPC+0x2C
--- Memory type ---
VB6 String Pointer
--- Description ---
Activate event layer name

--- Name ---
Death event layer name
--- Memory address ---
NPC+0x30
--- Memory type ---
VB6 String Pointer
--- Description ---
Death event layer name

--- Name ---
Talk event name?
--- Memory address ---
NPC+0x34
--- Memory type ---
VB6 String Pointer
--- Description ---
Talk event name?

--- Name ---
No More Objs event layer name
--- Memory address ---
NPC+0x38
--- Memory type ---
VB6 String Pointer
--- Description ---
No More Objs event layer name

--- Name ---
Layer name
--- Memory address ---
NPC+0x3C
--- Memory type ---
VB6 String Pointer
--- Description ---
Layer name

--- Name ---
isHidden
--- Memory address ---
NPC+0x40
--- Memory type ---
FIELD_BOOL
--- Description ---
If the NPC is hidden.

--- Name ---
Legacy Boss
--- Memory address ---
NPC+0x42
--- Memory type ---
FIELD_BOOL
--- Description ---
If the NPC is flagged as a boss.

--- Name ---
Activated
--- Memory address ---
NPC+0x44
--- Memory type ---
FIELD_BOOL
--- Description ---
Activated / interacted with player flag

--- Name ---
Friendly
--- Memory address ---
NPC+0x46
--- Memory type ---
FIELD_BOOL
--- Description ---
Friendly

--- Name ---
Don't Move
--- Memory address ---
NPC+0x48
--- Memory type ---
FIELD_BOOL
--- Description ---
Don't Move

--- Name ---
Don't Move
--- Memory address ---
NPC+0x4A
--- Memory type ---
FIELD_BOOL
--- Description ---
Same as 0x48?

--- Name ---
NPC Message text
--- Memory address ---
NPC+0x4C
--- Memory type ---
VB6 String Pointer
--- Description ---
NPC Message text

--- Name ---
Push Force
--- Memory address ---
NPC+0x50
--- Memory type ---
FIELD_FLOAT
--- Description ---
Force exerted on the NPC to push it out of a block

--- Name ---
Unknown
--- Memory address ---
NPC+0x54
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown

--- Name ---
Unknown
--- Memory address ---
NPC+0x56
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown

--- Name ---
Unknown
--- Memory address ---
NPC+0x58
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown

--- Name ---
Unknown
--- Memory address ---
NPC+0x5A
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown

--- Name ---
X-Speed of touched Object
--- Memory address ---
NPC+0x5C
--- Memory type ---
FIELD_FLOAT
--- Description ---
X-Speed of touched NPC or Layer

--- Name ---
Clown Car Player
--- Memory address ---
NPC+0x60
--- Memory type ---
FIELD_WORD
--- Description ---
Index of Player in the clown car touched by the NPC

--- Name ---
Distance from Clown Car
--- Memory address ---
NPC+0x62
--- Memory type ---
FIELD_WORD
--- Description ---
Y-Distance from touched clown car

--- Name ---
Is a generator
--- Memory address ---
NPC+0x64
--- Memory type ---
FIELD_BOOL
--- Description ---
Is a generator?

--- Name ---
Unknown
--- Memory address ---
NPC+0x66
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown

--- Name ---
Generator delay setting
--- Memory address ---
NPC+0x68
--- Memory type ---
FIELD_WORD
--- Description ---
Generator delay setting

--- Name ---
Generator firing rate
--- Memory address ---
NPC+0x6A
--- Memory type ---
FIELD_WORD
--- Description ---
Generator firing rate

--- Name ---
Generator delay countdown
--- Memory address ---
NPC+0x6C
--- Memory type ---
FIELD_FLOAT
--- Description ---
Generator delay countdown

--- Name ---
Direction to generate NPC
--- Memory address ---
NPC+0x70
--- Memory type ---
FIELD_WORD
--- Description ---
Direction to generate NPC or direction in which the NPC was generated. 1,2,3,4 correspond to up,left,down,right respectively.

--- Name ---
Generator type
--- Memory address ---
NPC+0x72
--- Memory type ---
FIELD_WORD
--- Description ---
The generator type (1 = Warp; 2 = Projectile)

--- Name ---
Generator invalidity flag
--- Memory address ---
NPC+0x74
--- Memory type ---
FIELD_BOOL
--- Description ---
Whether or not the generator can fire. Does not account for objects blocking the generator's spawn position

--- Name ---
Unknown
--- Memory address ---
NPC+0x76
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown

--- Name ---
X position
--- Memory address ---
NPC+0x78
--- Memory type ---
FIELD_DFLOAT
--- Description ---
X position

--- Name ---
Y position
--- Memory address ---
NPC+0x80
--- Memory type ---
FIELD_DFLOAT
--- Description ---
Y position

--- Name ---
Height
--- Memory address ---
NPC+0x88
--- Memory type ---
FIELD_DFLOAT
--- Description ---
Height

--- Name ---
Width
--- Memory address ---
NPC+0x90
--- Memory type ---
FIELD_DFLOAT
--- Description ---
Width

--- Name ---
X Speed
--- Memory address ---
NPC+0x98
--- Memory type ---
FIELD_DFLOAT
--- Description ---
X Speed

--- Name ---
Y Speed
--- Memory address ---
NPC+0xA0
--- Memory type ---
FIELD_DFLOAT
--- Description ---
Y Speed

--- Name ---
Spawn X
--- Memory address ---
NPC+0xA8
--- Memory type ---
FIELD_DFLOAT
--- Description ---
Spawn X

--- Name ---
Spawn Y
--- Memory address ---
NPC+0xB0
--- Memory type ---
FIELD_DFLOAT
--- Description ---
Spawn Y

--- Name ---
Spawn Height
--- Memory address ---
NPC+0xB8
--- Memory type ---
FIELD_DFLOAT
--- Description ---
Spawn Height

--- Name ---
Spawn Width
--- Memory address ---
NPC+0xC0
--- Memory type ---
FIELD_DFLOAT
--- Description ---
Spawn Width

--- Name ---
Unused
--- Memory address ---
NPC+0xC8
--- Memory type ---
FIELD_DFLOAT
--- Description ---
Unused

--- Name ---
Unused
--- Memory address ---
NPC+0xD0
--- Memory type ---
FIELD_DFLOAT
--- Description ---
Unused

--- Name ---
Spawn Direction
--- Memory address ---
NPC+0xD8
--- Memory type ---
FIELD_FLOAT
--- Description ---
Direction the NPC is spawned in

--- Name ---
Respawn Id
--- Memory address ---
NPC+0xDC
--- Memory type ---
FIELD_WORD
--- Description ---
Respawn Identity. 0 means doesn't respawn, otherwise same as 0xE2

--- Name ---
Contained NPC
--- Memory address ---
NPC+0xDE
--- Memory type ---
FIELD_WORD
--- Description ---
ID of NPC contained within this NPC

--- Name ---
Target Section
--- Memory address ---
NPC+0xE0
--- Memory type ---
FIELD_WORD
--- Description ---
Target section. Used by SMB2 Subcon door potion. -1 means no target

--- Name ---
Id
--- Memory address ---
NPC+0xE2
--- Memory type ---
FIELD_WORD
--- Description ---
Sprite GFX index/Identity

--- Name ---
Animation frame
--- Memory address ---
NPC+0xE4
--- Memory type ---
FIELD_WORD
--- Description ---
Animation frame

--- Name ---
NPC Array Index
--- Memory address ---
NPC+0xE6
--- Memory type ---
FIELD_WORD
--- Description ---
Index of this NPC in the NPC Array

--- Name ---
Animation timer
--- Memory address ---
NPC+0xE8
--- Memory type ---
FIELD_FLOAT
--- Description ---
Animation timer

--- Name ---
Direction faced
--- Memory address ---
NPC+0xEC
--- Memory type ---
FIELD_FLOAT
--- Description ---
Direction faced (Unknown difference from 0x118)

--- Name ---
NPC AI 1
--- Memory address ---
NPC+0xF0
--- Memory type ---
FIELD_DFLOAT
--- Description ---
Multipurpose NPC AI state/timer 1

--- Name ---
NPC AI 2
--- Memory address ---
NPC+0xF8
--- Memory type ---
FIELD_DFLOAT
--- Description ---
Multipurpose NPC AI state/timer 2

--- Name ---
NPC AI 3
--- Memory address ---
NPC+0x100
--- Memory type ---
FIELD_DFLOAT
--- Description ---
Multipurpose NPC AI state/timer 3

--- Name ---
NPC AI 4
--- Memory address ---
NPC+0x108
--- Memory type ---
FIELD_DFLOAT
--- Description ---
Multipurpose NPC AI state/timer 4

--- Name ---
NPC AI 5
--- Memory address ---
NPC+0x110
--- Memory type ---
FIELD_DFLOAT
--- Description ---
Multipurpose NPC AI state/timer 5

--- Name ---
Direction faced
--- Memory address ---
NPC+0x118
--- Memory type ---
FIELD_FLOAT
--- Description ---
Direction faced

--- Name ---
Player Input Y-Speed
--- Memory address ---
NPC+0x11C
--- Memory type ---
FIELD_FLOAT
--- Description ---
Y-Speed influence through player input (used by airship piece)

--- Name ---
Bounce off block
--- Memory address ---
NPC+0x120
--- Memory type ---
FIELD_BOOL
--- Description ---
Bounced off a block to change direction this frame?

--- Name ---
Kill flag
--- Memory address ---
NPC+0x122
--- Memory type ---
FIELD_BOOL
--- Description ---
Whether or not kill effects should apply

--- Name ---
Respawned, but onscreen
--- Memory address ---
NPC+0x124
--- Memory type ---
FIELD_BOOL
--- Description ---
This is set to false when an NPC resets its respawn position, but will not spawn itself fully because it's still visible by the player. Note: Must be set to true when spawning a new NPC

--- Name ---
Offscreen flag
--- Memory address ---
NPC+0x126
--- Memory type ---
FIELD_BOOL
--- Description ---
Same as 0x128?

--- Name ---
Offscreen flag
--- Memory address ---
NPC+0x128
--- Memory type ---
FIELD_BOOL
--- Description ---
Offscreen flag

--- Name ---
Offscreen countdown timer?
--- Memory address ---
NPC+0x12A
--- Memory type ---
FIELD_WORD
--- Description ---
Offscreen countdown timer. 180 is onscreen. Set to 0 to force despawn. This is set to -1 when an NPC is ready to respawn (but may not be able to if the player is close by)

--- Name ---
Player carrying index
--- Memory address ---
NPC+0x12C
--- Memory type ---
FIELD_WORD
--- Description ---
The index of the player grabbing the NPC. Defaults to 0 when not grabbed, setting to 1 or higher deactivates block collision when grabbed but causes the respective player to drop other objects

--- Name ---
Grab Timer?
--- Memory address ---
NPC+0x12E
--- Memory type ---
FIELD_WORD
--- Description ---
Related to grabbing npcs. Starts at 30 then quickly returns to 0 when released.

--- Name ---
Grabbing Player
--- Memory address ---
NPC+0x130
--- Memory type ---
FIELD_WORD
--- Description ---
Index of Player grabbing the NPC, resets at the top of the release arc

--- Name ---
Thrown by Player
--- Memory address ---
NPC+0x132
--- Memory type ---
FIELD_WORD
--- Description ---
Which Player threw the NPC. Resets when NPC resumes normal behaviour.

--- Name ---
Unknown
--- Memory address ---
NPC+0x134
--- Memory type ---
FIELD_WORD
--- Description ---
Appears to be 5 on the frame the NPC is thrown or spit by Yoshi

--- Name ---
Collides with NPCs
--- Memory address ---
NPC+0x136
--- Memory type ---
FIELD_BOOL
--- Description ---
True when the NPC collides with other NPCs. Doubles as a "grabbed" flag

--- Name ---
Contained Within
--- Memory address ---
NPC+0x138
--- Memory type ---
FIELD_WORD
--- Description ---
Set to the container ID when contained in another NPC (e.g. jar). 1 = Coming out of the top of a block, 2 = Dropped from itembox, 3 = Coming out of the bottom of a block, 4 = Being spawned by generator, 5 = Being eaten by Yoshi

--- Name ---
Unknown
--- Memory address ---
NPC+0x13A
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown

--- Name ---
Generator spawn position
--- Memory address ---
NPC+0x13C
--- Memory type ---
FIELD_DFLOAT
--- Description ---
NPC Spawn position from generator. X or Y coordinate depending on 0x144

--- Name ---
Generator spawn direction
--- Memory address ---
NPC+0x144
--- Memory type ---
FIELD_WORD
--- Description ---
Direction in which the NPC is being spawned: 1,2,3,4 corresponds to up,left,down and right respectively

--- Name ---
Current Section
--- Memory address ---
NPC+0x146
--- Memory type ---
FIELD_WORD
--- Description ---
Current section this NPC is on

--- Name ---
Hit Count
--- Memory address ---
NPC+0x148
--- Memory type ---
FIELD_FLOAT
--- Description ---
Boss Hit count

--- Name ---
Spawned by Camera
--- Memory address ---
NPC+0x14C
--- Memory type ---
FIELD_WORD
--- Description ---
Index of the Camera which spawned the NPC in this frame

--- Name ---
P-Switch Block ID
--- Memory address ---
NPC+0x14E
--- Memory type ---
FIELD_WORD
--- Description ---
ID of the block they were created from due to p-switch

--- Name ---
Block Array Index
--- Memory address ---
NPC+0x150
--- Memory type ---
FIELD_WORD
--- Description ---
Index of NPC in an array involving blocks. Appears to only count for NPCs affected by the npcblocktop flag

--- Name ---
NPC Collision
--- Memory address ---
NPC+0x152
--- Memory type ---
FIELD_BOOL
--- Description ---
Seems to be set to true for a bullet when it destroys another NPC. May apply to all 0x136-related collisions but untested.

--- Name ---
Unknown
--- Memory address ---
NPC+0x154
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown

--- Name ---
Invincibility frames
--- Memory address ---
NPC+0x156
--- Memory type ---
FIELD_WORD
--- Description ---
Invincibility frame countdown for all sources of harm

----- Offsets (Section under construction!) -----

--- Name ---
Unknown
--- Memory address ---
Animation+0x00
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown

--- Name ---
Unknown
--- Memory address ---
Animation+0x02
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown

------- The Path Class -------

Path
This class provides fields/functions for managing path objects on the overworld.

----- Static Path Functions -----

--- Function ---
Path.count()
--- Return values ---
number
--- Description ---
How many path objects are on the overworld.

--- Function ---
Path.get()
--- Return values ---
table of Path
--- Description ---
Returns all path objects on the overworld.

--- Function ---
Path.get(number or table ids)
--- Return values ---
table of Path
--- Description ---
Returns all path objects with the matching item ids.

--- Function ---
Path.getIntersecting(number x1, number y1, number x2, number y2)
--- Return values ---
table of Path
--- Description ---
Returns all path objects which are intersecting with an area from x1/y1 to x2/y2.

----- Instance functions -----

These fields and functions are part of Path Objects and have to be called for that object. Trying to call them from the static Path class will result in an error. Example (feel free to copy it into your lua file to see how it works):

function onStart()
for index,myPath in ipairs(Path.get()) do
myPath.id = 1
end
end

----- Path class -----

--- Type ---
Field
--- Function/Field ---
Path.id
--- Return values/Value type ---
double
--- Description ---
The id of the path object.

--- Type ---
Field
--- Function/Field ---
Path.x
--- Return values/Value type ---
double
--- Description ---
The x position of the path object.

--- Type ---
Field
--- Function/Field ---
Path.y
--- Return values/Value type ---
double
--- Description ---
The y position of the path object.

--- Type ---
Field
--- Function/Field ---
Path.width
--- Return values/Value type ---
double
--- Description ---
The width of the path object.

--- Type ---
Field
--- Function/Field ---
Path.height
--- Return values/Value type ---
double
--- Description ---
The height of the path object.

--- Type ---
Field
--- Function/Field ---
Path.visible
--- Return values/Value type ---
boolean
--- Description ---
Whether the object is visible or not. (LunaLua ≥ v0.7.3.2)

--- Type ---
Field
--- Function/Field ---
Path.isValid
--- Return values/Value type ---
boolean
--- Description ---
Whether the object is valid or not.

------- The Player Class -------

Player
This class provides fields/functions for managing Players in the current level or world map. NOTE: The Player functionality is limited on the world map.

----- Static Player Functions (Overworld and level) -----

--- Function ---
Player.count()
--- Return values ---
number
--- Description ---
How many players are in the level.

--- Function ---
Player.get()
--- Return values ---
table of Player
--- Description ---
Returns all players. You might want to consider using the constants player and player2 instead!

--- Function ---
Player.getIntersecting()
--- Return values ---
table of Player
--- Description ---
Returns all players which are intersecting with an area from x1/y1 to x2/y2.

--- Function ---
Player.getTemplates()
--- Return values ---
table of Player
--- Description ---
Returns all player templates. Player templates are the saved up player states for each character. They are saved, when the player hits a character-switch block. Modifing these templates and then hitting the character-switch blocks may give the result you expect.

--- Function ---
Player()
--- Return values ---
Player
--- Description ---
Returns the first player. You might want to use the constant player instead.

--- Function ---
Player(number index)
--- Return values ---
Player
--- Description ---
Returns the player object at the given index.

----- Static Player Settings Functions -----

--- Function ---
PlayerSettings.get(number character, number powerup)
--- Return values ---
PlayerSettings
--- Description ---
Returns a PlayerSettings object. With this object you can modify the hitbox and offset of the player directly. For character and powerup variable see constants.

----- Player constants -----

--- Constant ---
player
--- Used in ---
Player class
--- Description ---
References the first player

--- Constant ---
player2
--- Used in ---
Player class
--- Description ---
References the second player

----- Instance functions -----

These fields and functions are part of Player Objects and have to be called for that object. Trying to call them from the static Player class will result in an error. Example (feel free to copy it into your lua file to see how it works):

function onStart()
player.powerup = 2
end

----- Player class -----

--- Type ---
function
--- Function/Field ---
Player:mem(int offset, int fieldtype, object value)
--- Return values/Value type ---
nil
--- Description ---
Sets a value of the Player struct at a specific address-offset.

--- Type ---
function
--- Function/Field ---
Player:mem(int offset, int fieldtype)
--- Return values/Value type ---
object
--- Description ---
Returns a value of the Player struct at a specific address-offset.

--- Type ---
function
--- Function/Field ---
Player:kill()
--- Return values/Value type ---
nil
--- Description ---
Kills the player.

--- Type ---
function
--- Function/Field ---
Player:harm()
--- Return values/Value type ---
nil
--- Description ---
Harms the player.

--- Type ---
Field
--- Function/Field ---
Player.x
--- Return values/Value type ---
double
--- Description ---
The x coordinate of the player.

--- Type ---
Field
--- Function/Field ---
Player.y
--- Return values/Value type ---
double
--- Description ---
The y coordinate of the player.

--- Type ---
Field
--- Function/Field ---
Player.speedX
--- Return values/Value type ---
double
--- Description ---
The x-speed of the player.

--- Type ---
Field
--- Function/Field ---
Player.speedY
--- Return values/Value type ---
double
--- Description ---
The y-speed of the player.

--- Type ---
Field (ro)
--- Function/Field ---
Player.screen
--- Return values/Value type ---
RECT
--- Description ---
Returns the distances from the player's coordinates to the screen boundaries of player camera. Note that this means width is 'right' + 'left', and not 'right' - 'left', etc.

--- Type ---
Field (ro)
--- Function/Field ---
Player.section
--- Return values/Value type ---
int
--- Description ---
Returns the current section number of the player.

--- Type ---
Field (ro)
--- Function/Field ---
Player.sectionObj
--- Return values/Value type ---
Section
--- Description ---
Returns the current section object of the player.

--- Type ---
Field
--- Function/Field ---
Player.powerup
--- Return values/Value type ---
int
--- Description ---
The current powerup state the player is in. See constants for the values you can put it.

--- Type ---
Field
--- Function/Field ---
Player.character
--- Return values/Value type ---
int
--- Description ---
The current character of the player is in. See constants for the values you can put it. (LunaLua ≥ v0.7.2)

--- Type ---
Field
--- Function/Field ---
Player.reservePowerup
--- Return values/Value type ---
int
--- Description ---
The npc-id in the powerup box of the player.

--- Type ---
Field
--- Function/Field ---
Player.width
--- Return values/Value type ---
int
--- Description ---
The player width.

--- Type ---
Field
--- Function/Field ---
Player.height
--- Return values/Value type ---
int
--- Description ---
The player height.

--- Type ---
Field (ro)
--- Function/Field ---
Player.holdingNPC
--- Return values/Value type ---
NPC or nil
--- Description ---
The npc which the player is holding. If the player holds nothing then nil is returned.

--- Type ---
Field
--- Function/Field ---
Player.upKeyPressing
--- Return values/Value type ---
boolean
--- Description ---
True, if the player is pressing the up key. Can be overwritten with the Event onInputUpdate, to lock or reverse controls (LunaLua ≥v0.7)

--- Type ---
Field
--- Function/Field ---
Player.downKeyPressing
--- Return values/Value type ---
boolean
--- Description ---
True, if the player is pressing the down key. Can be overwritten with the Event onInputUpdate, to lock or reverse controls (LunaLua ≥v0.7)

--- Type ---
Field
--- Function/Field ---
Player.leftKeyPressing
--- Return values/Value type ---
boolean
--- Description ---
True, if the player is pressing the left key. Can be overwritten with the Event onInputUpdate, to lock or reverse controls (LunaLua ≥v0.7)

--- Type ---
Field
--- Function/Field ---
Player.rightKeyPressing
--- Return values/Value type ---
boolean
--- Description ---
True, if the player is pressing the right key. Can be overwritten with the Event onInputUpdate, to lock or reverse controls (LunaLua ≥v0.7)

--- Type ---
Field
--- Function/Field ---
Player.jumpKeyPressing
--- Return values/Value type ---
boolean
--- Description ---
True, if the player is pressing the jump key. Can be overwritten with the Event onInputUpdate, to lock or reverse controls (LunaLua ≥v0.7)

--- Type ---
Field
--- Function/Field ---
Player.altJumpKeyPressing
--- Return values/Value type ---
boolean
--- Description ---
True, if the player is pressing the alt jump key. Can be overwritten with the Event onInputUpdate, to lock or reverse controls (LunaLua ≥v0.7)

--- Type ---
Field
--- Function/Field ---
Player.runKeyPressing
--- Return values/Value type ---
boolean
--- Description ---
True, if the player is pressing the run key. Can be overwritten with the Event onInputUpdate, to lock or reverse controls (LunaLua ≥v0.7)

--- Type ---
Field
--- Function/Field ---
Player.altRunKeyPressing
--- Return values/Value type ---
boolean
--- Description ---
True, if the player is pressing the alt run key. Can be overwritten with the Event onInputUpdate, to lock or reverse controls (LunaLua ≥v0.7)

--- Type ---
Field
--- Function/Field ---
Player.dropItemKeyPressing
--- Return values/Value type ---
boolean
--- Description ---
True, if the player is pressing the drop item key. Can be overwritten with the Event onInputUpdate, to lock or reverse controls (LunaLua ≥v0.7)

--- Type ---
Field
--- Function/Field ---
Player.pauseKeyPressing
--- Return values/Value type ---
boolean
--- Description ---
True, if the player is pressing the pause key. Can be overwritten with the Event onInputUpdate, to lock or reverse controls (LunaLua ≥v0.7)

--- Type ---
function
--- Function/Field ---
Player:getCurrentPlayerSetting()
--- Return values/Value type ---
PlayerSettings
--- Description ---
Returns a PlayerSettings object of the current character and powerup state of the Player. (LunaLua ≥ v0.7.2)

--- Type ---
function
--- Function/Field ---
Player:getCurrentSpriteIndex()
--- Return values/Value type ---
number, number
--- Description ---
Returns the current indexX and indexY of the sprite on the spritesheet. Can be used with PlayerSettings. (LunaLua ≥ v0.7.2)

--- Type ---
function
--- Function/Field ---
Player:setCurrentSpriteIndex(number indexX, number indexY, boolean forceDirection)
--- Return values/Value type ---
nil
--- Description ---
Sets the current sprite on the spritesheet. If forceDirection is true, then the direction of the player will be set. Caution: This may not work, depending on the players movement!. Can be used with PlayerSettings. (LunaLua ≥ v0.7.2)

--- Type ---
Field (ro)
--- Function/Field ---
Player.isValid
--- Return values/Value type ---
boolean
--- Description ---
Checks if the player is acutally valid.

There are also raw fields. These fields are not maintained and not camel-case affected!
(raw fields found at http://wohlsoft.ru/docs/_PGE/struct_Player.txt)

------- The PlayerSettings Class -------

PlayerSettings
This class provides access to the hitbox and offsets of the player.

----- PlayerSettings class -----

--- Type ---
Field
--- Function/Field ---
PlayerSettings.hitboxWidth
--- Return values/Value type ---
number
--- Description ---
The hitbox width.

--- Type ---
Field
--- Function/Field ---
PlayerSettings.hitboxHeight
--- Return values/Value type ---
number
--- Description ---
The hitbox height.

--- Type ---
Field
--- Function/Field ---
PlayerSettings.hitboxDuckHeight
--- Return values/Value type ---
number
--- Description ---
The hitbox height when ducking.

--- Type ---
Field
--- Function/Field ---
PlayerSettings.grabOffsetX
--- Return values/Value type ---
number
--- Description ---
The graboffset value of x.

--- Type ---
Field
--- Function/Field ---
PlayerSettings.grabOffsetY
--- Return values/Value type ---
number
--- Description ---
The graboffset value of y.

--- Type ---
Field
--- Function/Field ---
PlayerSettings:getSpriteOffsetX(number indexX, number indexY)
--- Return values/Value type ---
number
--- Description ---
Returns the sprite offset value of x.

--- Type ---
Field
--- Function/Field ---
PlayerSettings:setSpriteOffsetX(number indexX, number indexY, number value)
--- Return values/Value type ---
nil
--- Description ---
Sets the sprite offset value of x.

--- Type ---
Field
--- Function/Field ---
PlayerSettings:getSpriteOffsetY(number indexX, number indexY)
--- Return values/Value type ---
number
--- Description ---
Returns the sprite offset value of y.

--- Type ---
Field
--- Function/Field ---
PlayerSettings:setSpriteOffsetY(number indexX, number indexY, number value)
--- Return values/Value type ---
nil
--- Description ---
Sets the sprite offset value of y.

------- The RECT Class -------

RECT
This class (struct) provides fields for a Rectangle.

----- RECT class -----

--- Type ---
Constructor
--- Function/Field ---
myRECT = newRECT()
--- Return values/Value type ---
RECT
--- Description ---
Construct a new RECT-Object

--- Type ---
Field
--- Function/Field ---
RECT.bottom
--- Return values/Value type ---
long
--- Description ---
Bottom-value.

--- Type ---
Field
--- Function/Field ---
RECT.left
--- Return values/Value type ---
long
--- Description ---
Left-value.

--- Type ---
Field
--- Function/Field ---
RECT.right
--- Return values/Value type ---
long
--- Description ---
Right-value.

--- Type ---
Field
--- Function/Field ---
RECT.top
--- Return values/Value type ---
long
--- Description ---
Top-value.

----- Example: -----

local myRect = newRECT()
myRect.top = 0
myRect.left = 0
myRect.bottom = 20
myRect.right = 20
--Do other stuff

------- The RECTd Class -------

RECTd
Same as RECT, but with double-values.

----- RECT class -----

--- Type ---
Constructor
--- Function/Field ---
myRECT = newRECTd()
--- Return values/Value type ---
RECTd
--- Description ---
Construct a new RECTd-Object

--- Type ---
Field
--- Function/Field ---
RECTd.bottom
--- Return values/Value type ---
double
--- Description ---
Bottom-value.

--- Type ---
Field
--- Function/Field ---
RECTd.left
--- Return values/Value type ---
double
--- Description ---
Left-value.

--- Type ---
Field
--- Function/Field ---
RECTd.right
--- Return values/Value type ---
double
--- Description ---
Right-value.

--- Type ---
Field
--- Function/Field ---
RECTd.top
--- Return values/Value type ---
double
--- Description ---
Top-value.

------- The Scenery Class -------

Scenery
This class provides fields/functions for managing scenery objects on the overworld.

----- Static Scenery Functions -----

--- Function ---
Scenery.count()
--- Return values ---
number
--- Description ---
How many scenery objects are on the overworld.

--- Function ---
Scenery.get()
--- Return values ---
table of Scenery
--- Description ---
Returns all scenery objects on the overworld.

--- Function ---
Scenery.get(number or table ids)
--- Return values ---
table of Scenery
--- Description ---
Returns all scenery objects with the matching item ids.

--- Function ---
Scenery.getIntersecting(number x1, number y1, number x2, number y2)
--- Return values ---
table of Scenery
--- Description ---
Returns all scenery objects which are intersecting with an area from x1/y1 to x2/y2.

----- Instance functions -----

These fields and functions are part of Scenery Objects and have to be called for that object. Trying to call them from the static Scenery class will result in an error. Example (feel free to copy it into your lua file to see how it works):

function onStart()
for index,myScene in ipairs(Scenery.get()) do
myScene.id = 1
end
end

----- Scenery class -----

--- Type ---
Field
--- Function/Field ---
Scenery.id
--- Return values/Value type ---
double
--- Description ---
The id of the scenery object.

--- Type ---
Field
--- Function/Field ---
Scenery.x
--- Return values/Value type ---
double
--- Description ---
The x position of the scenery object.

--- Type ---
Field
--- Function/Field ---
Scenery.y
--- Return values/Value type ---
double
--- Description ---
The y position of the scenery object.

--- Type ---
Field
--- Function/Field ---
Scenery.width
--- Return values/Value type ---
double
--- Description ---
The width of the scenery object.

--- Type ---
Field
--- Function/Field ---
Scenery.height
--- Return values/Value type ---
double
--- Description ---
The height of the scenery object.

--- Type ---
Field
--- Function/Field ---
Scenery.isValid
--- Return values/Value type ---
boolean
--- Description ---
Whether the object is valid or not.

------- The Section Class -------

Section
This class provides fields/functions for managing Sections in the current level.

----- Static Section Functions (level only) -----

--- Function ---
Section.get()
--- Return values ---
table of Section
--- Description ---
Returns the array of Sections. The first element of the array represents the first section. (LunaLua ≥ v0.7.2)

--- Function ---
Section.get(number sectionID)
--- Return values ---
Section
--- Description ---
Gets the section object by the section id. Valid number are from 1 (first section) to 21 (last section) (LunaLua ≥ v0.7.2)

--- Function ---
Section(number index)
--- Return values ---
Section
--- Description ---
Returns the Section object by the section id. Valid numbers are from 0 (first section) to 20 (last section)

----- Instance functions -----

These fields and functions are part of Section Objects and have to be called for that object. Trying to call them from the static Section class will result in an error. Example (feel free to copy it into your lua file to see how it works):

function onStart()
for index,mySection in ipairs(Section.get()) do
mySection.backgroundID = index
end
end

----- Section class -----

--- Type ---
Field
--- Function/Field ---
Section.boundary
--- Return values/Value type ---
RECTd
--- Description ---
The section boundary.

--- Type ---
Field
--- Function/Field ---
Section.musicID
--- Return values/Value type ---
number
--- Description ---
The musicID of the section. (LunaLua ≥ v0.7.2)

--- Type ---
Field
--- Function/Field ---
Section.isLevelWarp
--- Return values/Value type ---
boolean
--- Description ---
If the section is a warp level. (LunaLua ≥ v0.7.2)

--- Type ---
Field
--- Function/Field ---
Section.hasOffscreenExit
--- Return values/Value type ---
boolean
--- Description ---
If the section can be left by going out of bounds of the level. (LunaLua ≥ v0.7.2)

--- Type ---
Field
--- Function/Field ---
Section.backgroundID
--- Return values/Value type ---
number
--- Description ---
The background ID of the section. (LunaLua ≥ v0.7.2)

--- Type ---
Field
--- Function/Field ---
Section.noTurnBack
--- Return values/Value type ---
boolean
--- Description ---
If the player cannot go back in the left direction. (LunaLua ≥ v0.7.2)

--- Type ---
Field
--- Function/Field ---
Section.isUnderwater
--- Return values/Value type ---
boolean
--- Description ---
If the section is a underwanter section. (LunaLua ≥ v0.7.2)

------- The Shader Class -------

Shader
Experimental Feature (LunaLua ≥ v0.7.3.2)
This features has been recently added to LunaLua.

Shaders are small GPU programs that can modify vertecies and fragments. In LunaLua you can create Shader-Programs with the Shader-Class. A Shader-Object can then be used in conjunction with Graphics.glDraw.

The shader language used here is GLSL because the new render engine is implemented with OpenGL. Be sure to call Graphics.isOpenGLEnabled first to ensure that OpenGL is available. A quick start with GLSL can be found at "http://calebjohnston.com/storage/glsl" (without quotes).

----- Shader class -----

--- Type ---
Constructor
--- Function/Field ---
myShader = Shader()
--- Return values/Value type ---
Shader
--- Description ---
Creates a new Shader-Object. This Shader-Object is not valid until Shader:compileFromSource or Shader:compileFromFile was called.

--- Type ---
function
--- Function/Field ---
Shader:compileFromSource(string vertexSource, string fragmentSource)
--- Return values/Value type ---
nil
--- Description ---
Compiles the vertex and fragment source code into a shader program.

--- Type ---
function
--- Function/Field ---
Shader:compileFromFile(string vertexSourceFilename, string fragmentSourceFilename)
--- Return values/Value type ---
nil
--- Description ---
Reads the vertex and fragment code from the file and compiles the source code into a shader program.

--- Type ---
function
--- Function/Field ---
Shader:getAttributeInfo()
--- Return values/Value type ---
table
--- Description ---
Returns a table with information of all active attributes. The key of the table is the variable name. The value represents another table with the specific information.

--- Type ---
function
--- Function/Field ---
Shader:getUniformInfo()
--- Return values/Value type ---
table
--- Description ---
Returns a table with information of all active uniforms. The key of the table is the variable name. The value represents another table with the specific information.

--- Type ---
Field
--- Function/Field ---
Shader.isCompiled
--- Return values/Value type ---
boolean
--- Description ---
Returns whether the Shader has been successfully compiled.

----- Attribute/Uniform info -----

These are the values which you can query with Shader:getAttributeInfo and Shader:getUniformInfo

--- Type ---
number
--- Name ---
id
--- Description ---
The attribute/uniform location.

--- Type ---
string
--- Name ---
name
--- Description ---
The name with a possible array suffix. If the attribute/uniform is not an array, then the value is the same.

--- Type ---
string
--- Name ---
rawName
--- Description ---
The name without any qualifier.

--- Type ---
number
--- Name ---
arrayCount
--- Description ---
How many elements the array can contain. This is only needed if the attribute/uniform is an array.

--- Type ---
number
--- Name ---
arrayDepth
--- Description ---
The dimension of the array. If it is not an array, then the value is 0. For an array the value is 1.

--- Type ---
number
--- Name ---
type
--- Description ---
The datatype of the array.

------- The SoundOverride Class -------

SoundOverride
This class represents an sound effects that can be replaced or muted. This is a "virtual" class which is created for every SMBX sound.

You can access this class with

Audio.sounds[*]

* is the id of the sound effect.

----- Example: -----

Audio.sounds[1].sfx = myNewSound

This example would replace sound effect 1 with myNewSound.

To reset it back to default you can do:

Audio.sounds[1].sfx = nil

----- SoundOverride class -----

--- Type ---
Field
--- Function/Field ---
SoundOverride.sfx
--- Return values/Value type ---
Mix_Chunk
--- Description ---
The current sound effect audio.

--- Type ---
Field
--- Function/Field ---
SoundOverride.muted
--- Return values/Value type ---
boolean
--- Description ---
Whether the sound effect is muted.

------- The SpriteOverride Class -------

SpriteOverride
This class represents an image resources bounded to a specific sprite. This is a "virtual" class which is created for every SMBX object (Blocks, BGOs, NPCs, ...).

You can access this class with

Graphics.sprites.####[*]

#### represents the graphics group. The different graphics groups are named after the folders in the graphics folder. In addition you can patch the hardcoded images with the graphics group "hardcoded".
* is the id of the object. With the "hardcoded" graphis group, the id is a string. i.e. "33-2"

----- Example: -----

Graphics.sprites.block[1].img = myNewImageResource

This example would swap the image resource of the block with the id 1 with myNewImageResource.

To reset it back to default you can do:

Graphics.sprites.block[1].img = nil

----- SpriteOverride class -----

--- Type ---
Field
--- Function/Field ---
SpriteOverride.img
--- Return values/Value type ---
LuaResourceImage or SMBXMaskedImage
--- Description ---
The current image resource bounded to the object.

------- The Tile Class -------

Tile
This class provides fields/functions for managing Tiles on the overworld.

----- Static Tile Functions -----

--- Function ---
Tile.count()
--- Return values ---
number
--- Description ---
How many tiles are on the overworld.

--- Function ---
Tile.get()
--- Return values ---
table of Tile
--- Description ---
Returns all tiles on the overworld.

--- Function ---
Tile.get(number or table ids)
--- Return values ---
table of Tile
--- Description ---
Returns all tiles with the matching item ids.

--- Function ---
Tile.getIntersecting(number x1, number y1, number x2, number y2)
--- Return values ---
table of Tile
--- Description ---
Returns all tiles which are intersecting with an area from x1/y1 to x2/y2.

----- Instance functions -----

These fields and functions are part of Tile Objects and have to be called for that object. Trying to call them from the static Tile class will result in an error. Example (feel free to copy it into your lua file to see how it works):

function onTick()
for index,myTile in ipairs(Tile.get()) do
myTile.id = 1
end
end

----- Tile class -----

--- Type ---
Field
--- Function/Field ---
Tile.id
--- Return values/Value type ---
double
--- Description ---
The id of the tile object.

--- Type ---
Field
--- Function/Field ---
Tile.x
--- Return values/Value type ---
double
--- Description ---
The x position of the tile object.

--- Type ---
Field
--- Function/Field ---
Tile.y
--- Return values/Value type ---
double
--- Description ---
The y position of the tile object.

--- Type ---
Field
--- Function/Field ---
Tile.width
--- Return values/Value type ---
double
--- Description ---
The width of the tile object.

--- Type ---
Field
--- Function/Field ---
Tile.height
--- Return values/Value type ---
double
--- Description ---
The height of the tile object.

--- Type ---
Field
--- Function/Field ---
Tile.isValid
--- Return values/Value type ---
boolean
--- Description ---
Whether the object is valid or not.

------- The VBStr Class -------

VBStr
This class wraps a Visual Basic 6 string pointer. Currently it is very limited. This class cannot be constructed by the user.

VBStr class

--- Type ---
field
--- Function/Field ---
VBStr.str
--- Return values/Value type ---
string
--- Description ---
Reads/Writes the string pointer.
NOTE: Writing in the string pointer is not safe. You shouldn't write more than the original length of the string or it might crash.

--- Type ---
field
--- Function/Field ---
VBStr.length
--- Return values/Value type ---
int
--- Description ---
The length of the string.

--- Type ---
function
--- Function/Field ---
VBStr:clear()
--- Return values/Value type ---
nil
--- Description ---
Clears the string.

--- Type ---
meta-function
--- Function/Field ---
tostring(VBStr)
--- Return values/Value type ---
nil
--- Description ---
Same as .str

------- The Warp Class -------

Warp
This class provides fields/functions for managing Warps in the current level. (LunaLua ≥v0.7)

----- Static Warp Functions -----

--- Function ---
Warp.count()
--- Return values ---
number
--- Description ---
How many warps are in the level.

--- Function ---
Warp.get()
--- Return values ---
table of Warp
--- Description ---
Returns all existing warps.

--- Function ---
Warp.getIntersectingEntrance(number x1, number y1, number x2, number y2)
--- Return values ---
table of Animation
--- Description ---
Returns all warps with an entrance intersecting with an area from x1/y1 to x2/y2.

--- Function ---
Warp.getIntersectingExit(number x1, number y1, number x2, number y2)
--- Return values ---
table of Animation
--- Description ---
Returns all warps with an exit intersecting with an area from x1/y1 to x2/y2.

--- Function ---
Warp(number index)
--- Return values ---
Warp
--- Description ---
Returns the Warp object at position index in the global Warp table. Use this constructor with caution! Use Warp.get instead!! (See above)

----- Instance functions -----

These fields and functions are part of Warp Objects and have to be called for that object. Trying to call them from the static Warp class will result in an error. Example (feel free to copy it into your lua file to see how it works):

function onStart()
for index,myWarp in ipairs(Warp.get()) do
myWarp.exitX = player.x
myWarp.exitY = player.y
end
end

----- Warp class -----

--- Type ---
function
--- Function/Field ---
Warp:mem(int offset, int fieldtype, object value)
--- Return values/Value type ---
nil
--- Description ---
Sets a value of the Warp struct at a specific address-offset.

--- Type ---
function
--- Function/Field ---
Warp:mem(int offset, int fieldtype)
--- Return values/Value type ---
object
--- Description ---
Returns a value of the Warp struct at a specific address-offset.

--- Type ---
Field
--- Function/Field ---
Warp.entranceX
--- Return values/Value type ---
double
--- Description ---
The x coordinate of warp entrance.

--- Type ---
Field
--- Function/Field ---
Warp.entranceY
--- Return values/Value type ---
double
--- Description ---
The y coordinate of warp entrance.

--- Type ---
Field
--- Function/Field ---
Warp.exitX
--- Return values/Value type ---
double
--- Description ---
The x coordinate of warp exit.

--- Type ---
Field
--- Function/Field ---
Warp.exitY
--- Return values/Value type ---
double
--- Description ---
The y coordinate of warp exit.

--- Type ---
Field
--- Function/Field ---
Warp.levelFilename
--- Return values/Value type ---
string
--- Description ---
The level-filename of the warp.

----- Warp Memory (0x90 bytes) -----

--- Name ---
Is locked
--- Memory address ---
0x00
--- Memory type ---
FIELD_WORD
--- Description ---
Whether the warp is locked (keyhole)

--- Name ---
Allow carried NPCs
--- Memory address ---
0x02
--- Memory type ---
FIELD_WORD
--- Description ---
Whether carried NPCs can be brought through the warp

--- Name ---
No Yoshi
--- Memory address ---
0x04
--- Memory type ---
FIELD_WORD
--- Description ---
Whether Yoshi is allowed

--- Name ---
Unknown
--- Memory address ---
0x06
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown

--- Name ---
Layer name
--- Memory address ---
0x08
--- Memory type ---
VB6 String Pointer
--- Description ---
Entrance's layer name

--- Name ---
Is hidden
--- Memory address ---
0x0C
--- Memory type ---
FIELD_WORD
--- Description ---
Is hidden flag

--- Name ---
Unknown
--- Memory address ---
0x0E
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown

--- Name ---
Unknown
--- Memory address ---
0x10
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown

--- Name ---
Stars required
--- Memory address ---
0x12
--- Memory type ---
FIELD_WORD
--- Description ---
The number of stars required to use the warp

--- Name ---
Entrance position
--- Memory address ---
0x14
--- Memory type ---
Momentum
--- Description ---
Description not availible.

--- Name ---
Exit position
--- Memory address ---
0x44
--- Memory type ---
Momentum
--- Description ---
Description not availible.

--- Name ---
Warp Type
--- Memory address ---
0x74
--- Memory type ---
FIELD_WORD
--- Description ---
0 = instant, 1 = pipe, 2 = door

--- Name ---
Unknown
--- Memory address ---
0x76
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown

--- Name ---
Level filename
--- Memory address ---
0x78
--- Memory type ---
VB6 String Pointer
--- Description ---
The filename of the level this warp loads

--- Name ---
Warp number
--- Memory address ---
0x7C
--- Memory type ---
FIELD_WORD
--- Description ---
The warp number

--- Name ---
Is level entrance
--- Memory address ---
0x7E
--- Memory type ---
FIELD_WORD
--- Description ---
Whether this warp takes the player to a different level

--- Name ---
Entrance direction
--- Memory address ---
0x80
--- Memory type ---
FIELD_WORD
--- Description ---
1 = up; 2 = left; 3 = down; 4 = right

--- Name ---
Exit direction
--- Memory address ---
0x82
--- Memory type ---
FIELD_WORD
--- Description ---
1 = down; 2 = right; 3 = up; 4 = left

--- Name ---
Is level exit
--- Memory address ---
0x84
--- Memory type ---
FIELD_WORD
--- Description ---
Whether this warp ends the level

--- Name ---
World map X
--- Memory address ---
0x86
--- Memory type ---
FIELD_WORD
--- Description ---
X coordinate on the map the player is moved to

--- Name ---
World map Y
--- Memory address ---
0x88
--- Memory type ---
FIELD_WORD
--- Description ---
Y coordinate on the map the player is moved to

--- Name ---
Unknown
--- Memory address ---
0x8A
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown

--- Name ---
Unknown
--- Memory address ---
0x8C
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown

--- Name ---
Unknown
--- Memory address ---
0x8E
--- Memory type ---
FIELD_WORD
--- Description ---
Unknown

--------- Overworld classes: ---------

------- The VBStr Overworld Class -------

VBStr
This class wraps a Visual Basic 6 string pointer. Currently it is very limited. This class cannot be constructed by the user.

----- VBStr class -----

--- Type ---
field
--- Function/Field ---
VBStr.str
--- Return values/Value type ---
string
--- Description ---
Reads/Writes the string pointer.
NOTE: Writing in the string pointer is not safe. You shouldn't write more than the original length of the string or it might crash.

--- Type ---
field
--- Function/Field ---
VBStr.length
--- Return values/Value type ---
int
--- Description ---
The length of the string.

--- Type ---
function
--- Function/Field ---
VBStr:clear()
--- Return values/Value type ---
nil
--- Description ---
Clears the string.

--- Type ---
meta-function
--- Function/Field ---
tostring(VBStr)
--- Return values/Value type ---
nil
--- Description ---
Same as .str

------- The World Overworld Class -------

World
This class provides fields/functions for managing World. Please note that there is no constructor, only the singleton world object! You can access these methods/fields via world.yourField or world:yourMethod

----- Worldclass -----

--- Type ---
function
--- Function/Field ---
world:mem(int offset, int fieldtype, object value)
--- Return values/Value type ---
nil
--- Description ---
Sets a value of the World struct at a specific address-offset.

--- Type ---
function
--- Function/Field ---
world:mem(int offset, int fieldtype)
--- Return values/Value type ---
object
--- Description ---
Returns a value of the World struct at a specific address-offset.

--- Type ---
Field
--- Function/Field ---
world.playerX
--- Return values/Value type ---
double
--- Description ---
The x coordinate of the player on the world map.

--- Type ---
Field
--- Function/Field ---
world.playerY
--- Return values/Value type ---
double
--- Description ---
The y coordinate of the player on the world map.

--- Type ---
Field
--- Function/Field ---
world.playerWalkingDirection
--- Return values/Value type ---
int
--- Description ---
Gets/Sets the current walking direction.
Following walking direction values:
0 - Idle
1 - Walking Up
2 - Walking Left
3 - Walking Down
4 - Walking Right

--- Type ---
Field
--- Function/Field ---
world.playerWalkingTimer
--- Return values/Value type ---
int
--- Description ---
Gets/Sets the current walking timer. This value will increment from 0 to 32 by 2 each frame. It is an indicator if the player reached the tile. If the value is 32 then the player reached the tile.

--- Type ---
Field
--- Function/Field ---
world.playerWalkingFrame
--- Return values/Value type ---
int
--- Description ---
Gets/Sets the current walking frame.
Following frame values:
0 or 1 - Walking Frames Down
2 or 3 - Walking Frames Right
4 or 5 - Walking Frames Left
6 or 7 - Walking Frames Up

--- Type ---
Field
--- Function/Field ---
world.playerWalkingFrameTimer
--- Return values/Value type ---
int
--- Description ---
Gets/Sets the current walking frame timer. This value will increment from 0 to 8 by 1 each frame. If the value is 8 then the playerWalkingFrame is swapped. For example: If walking down and the value is 0 then the value will be chaged to 1.

--- Type ---
Field (ro)
--- Function/Field ---
world.playerIsCurrentWalking
--- Return values/Value type ---
int
--- Description ---
If the player is currently walking/moving the this field is set to true. Otherwise the field is set to false

--- Type ---
Field (ro)
--- Function/Field ---
world.levelTitle
--- Return values/Value type ---
VBStr or nil
--- Description ---
If the player stands under a level the level title will be returned. Otherwise nil is returned.

--- Type ---
Field (ro)
--- Function/Field ---
world.levelObj
--- Return values/Value type ---
Level or nil
--- Description ---
If the player stands under a level the level object will be returned. Otherwise nil is returned.

--- Type ---
Field (ro)
--- Function/Field ---
world.playerCurrentDirection
--- Return values/Value type ---
int
--- Description ---
Similar to world.playerWalkingDirection but does return the direction values even if the player is not walking.
Following walking direction values:
1 - Looking Up
2 - Looking Left
3 - Looking Down
4 - Looking Right
EDIT: Can't forget the global API functions.
Spoiler: show
source: https://wohlsoft.ru/pgewiki/LunaLua_glo ... _functions
LunaLua global API functions

This is the new softcoded API system for custom written libraries. It provides functions to easily load libraries and provides ways for libraries to hook into events.

----- Global API Functions -----

--- Function ---
loadAPI(string packagename) (Deprecated: Use API.load)
--- Return values ---
table api, boolean newLoaded
--- Description ---
Loads the library packagename.lua. Do load it outside every other function! (Recommended at the top of your scriptfile). newLoaded is false if the library is already loaded.

--- Function ---
loadSharedAPI(string packagename) (Deprecated: Use API.load)
--- Return values ---
table api, boolean newLoaded
--- Description ---
Loads the library packagename.lua and shares it with lunadll.lua and lunaworld.lua. Do load it outside every other function! (Recommended at the top of your scriptfile). newLoaded is false if the library is already loaded.

v0.7.3 and up:

--- Function ---
API.load(string packagename, boolean loadShared)
--- Return values ---
table api, boolean newLoaded
--- Description ---
Loads the library packagename.lua and shares it with lunadll.lua and lunaworld.lua unless loadShared is set to false (set to true by default). Do load it outside every other function! (Recommended at the top of your scriptfile). newLoaded is false if the library is already loaded.

Before v0.4:

--- Function ---
registerEvent(string libraryname, string event, [string eventHandler], [boolean beforeMainCall])
--- Return values ---
nil
--- Description ---
Register events in the event loop. libraryname is the package name of the library (name of the library table). event is the name of the event to be hooked in. If your event-function has a own name then you can set eventHandler (This is optional). If beforeMainCall set to false then this event will be called after the main function call. If set to true or this parameter is not passed then the function is called before the main call.

v0.4 and up:

--- Function ---
registerEvent(table thisTable, string event, [string eventHandler], [boolean beforeMainCall])
--- Return values ---
nil
--- Description ---
Register events in the event loop. thisTable is the package table of the library. event is the name of the event to be hooked in. If your event-function has a own name then you can set eventHandler (This is optional). If beforeMainCall set to false then this event will be called after the main function call. If set to true or this parameter is not passed then the function is called before the main call.

v0.4 and up:

--- Function ---
unregisterEvent(table thisTable, string event, string eventHandler)
--- Return values ---
nil
--- Description ---
Unregisters a event.

v0.7.2.3 and up:

--- Function ---
registerCustomEvent(table thisTable, string event)
--- Return values ---
nil
--- Description ---
Creates a custom event (such as onTick) for the library given as the first argument. Once the function is registered, it can be called from within the library like any other function, and can be defined by the user like any other event.

--- Function ---
isAPILoaded(table libraryObject)
--- Return values ---
boolean
--- Description ---
Checks if a library is loaded by the lunalua API, using the return value of the API.load call to check.

--- Function ---
isAPILoaded(string libraryName)
--- Return values ---
boolean
--- Description ---
Checks if a library is loaded by the lunalua API, using the name of the library to check.
EDIT2: and the Global Memory
Spoiler: show
source: https://wohlsoft.ru/pgewiki/SMBX_Global_Memory
Global Memory

----- General Player Memory ------

--- Name ---
Player Ptr
--- Memory address ---
0x00B25A20
--- Memory type ---
FIELD_DWORD
--- Description ---
The pointer to the Player Array. Not needed directly by lua/autocode

--- Name ---
Player Count
--- Memory address ---
0x00B2595E
--- Memory type ---
FIELD_WORD
--- Description ---
How many Players are in the level.

--- Name ---
Player Editor Ptr
--- Memory address ---
0x00CF74D8
--- Memory type ---
FIELD_DWORD
--- Description ---
The pointer to the Player for testing in the level Editor. Not needed directly by lua/autocode

----- General NPC Memory -----

--- Name ---
NPC Ptr
--- Memory address ---
0x00B259E8
--- Memory type ---
FIELD_DWORD
--- Description ---
The pointer to the NPC Array. Not needed directly by lua/autocode

--- Name ---
NPC Count
--- Memory address ---
0x00B2595A
--- Memory type ---
FIELD_WORD
--- Description ---
The Number of NPCs in the level.

----- General Input Memory -----

--- Name ---
Mouse cursor X
--- Memory address ---
0x00B2D6BC
--- Memory type ---
FIELD_DFLOAT
--- Description ---
The X position of the mouse cursor on the screen.

--- Name ---
Mouse cursor Y
--- Memory address ---
0x00B2D6C4
--- Memory type ---
FIELD_DFLOAT
--- Description ---
The Y position of the mouse cursor on the screen.

--- Name ---
Mouse moving
--- Memory address ---
0x00B2D6D2
--- Memory type ---
FIELD_WORD
--- Description ---
Whether or not the mouse is moving.

--- Name ---
Mouse released
--- Memory address ---
0x00B2D6D0
--- Memory type ---
FIELD_WORD
--- Description ---
Whether or not a mouse button is being released.

--- Name ---
Mouse pressing
--- Memory address ---
0x00B2D6CC
--- Memory type ---
FIELD_WORD
--- Description ---
Whether or not a mouse button is being pressed.

--- Name ---
Key released
--- Memory address ---
0x00B2C884
--- Memory type ---
FIELD_WORD
--- Description ---
Whether or not a keyboard key is being released.

----- General UI Memory -----

--- Name ---
HUD star count
--- Memory address ---
0x00B251E0
--- Memory type ---
FIELD_WORD
--- Description ---
How many stars. WARNING: Changing this value can break save files!

--- Name ---
HUD coins count
--- Memory address ---
0x00B2C5A8
--- Memory type ---
FIELD_WORD
--- Description ---
How many coins.

--- Name ---
HUD lives count
--- Memory address ---
0x00B2C5AC
--- Memory type ---
FIELD_FLOAT
--- Description ---
How many lives.

--- Name ---
HUD points count
--- Memory address ---
0x00B2C8E4
--- Memory type ---
FIELD_DWORD
--- Description ---
How many points.

--- Name ---
Pause menu visible
--- Memory address ---
0x00B250E2
--- Memory type ---
FIELD_WORD
--- Description ---
Is the pause menu or a text box visible?

--- Name ---
Current menu choice
--- Memory address ---
0x00B2C880
--- Memory type ---
FIELD_WORD
--- Description ---
Current menu choice.

----- World Settings Memory -----

--- Name ---
Episode name
--- Memory address ---
0xB2C624
--- Memory type ---
FIELD_STRING
--- Description ---
The name of the current episode.

--- Name ---
Intro level path
--- Memory address ---
0xB25724
--- Memory type ---
FIELD_STRING
--- Description ---
The filename of the intro (hub) level.

--- Name ---
Hub-styled world flag
--- Memory address ---
0xB25728
--- Memory type ---
FIELD_BOOL
--- Description ---
Controls whether the world map is loaded.

--- Name ---
"Restart on death" flag
--- Memory address ---
0xB2572A
--- Memory type ---
FIELD_BOOL
--- Description ---
Controls whether the player restarts the current level after dying.

--- Name ---
Episode Star Count
--- Memory address ---
0xB2C906
--- Memory type ---
FIELD_WORD
--- Description ---
The total number of stars in the episode according to the .wld file.

----- Misc. Memory -----

--- Name ---
Dragon Coin Count
--- Memory address ---
0x05844B7C
--- Memory type ---
FIELD_WORD
--- Description ---
The amount of dragon coins collected.

--- Name ---
Screen HDC
--- Memory address ---
0x00B25028
--- Memory type ---
FIELD_DWORD
--- Description ---
The screen HDC. Not needed by lua/autocode

--- Name ---
Intro Menu Overlay
--- Memory address ---
0x00B2C620
--- Memory type ---
FIELD_WORD
--- Description ---
If set to -1, then the intro menu overlay is displayed.

--- Name ---
Intro Mode
--- Memory address ---
0x00B2C89C
--- Memory type ---
FIELD_DWORD
--- Description ---
If set to -1, then the intro is played.

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 8735
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: I made text-only and easy-to-read LunaLua referance sheets

Postby Enjl » Thu Mar 21, 2019 6:37 am

You can CTRL + S on a web page to save a local version of it. I did it a couple of times when expecting power outages.
Ideas are useless if you can't make them real.
Image

User avatar
Eri7
Banned
Posts: 1772
Joined: Sat Jan 28, 2017 4:48 pm
Flair: Good Foundation allows for strong Execution
Current Project: Producer of the Novaverse
Chat Username: Eri7
Contact:

Re: I made text-only and easy-to-read LunaLua referance sheets

Postby Eri7 » Thu Mar 21, 2019 8:17 am

OH WOW, this will be very useful for me and my friend lunaluastorm 8luestorm, thank you a lot!

PixelPest
Link
Link
Posts: 7116
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Chat Username: PixelPest
Contact:

Re: I made text-only and easy-to-read LunaLua referance sheets

Postby PixelPest » Thu Mar 21, 2019 12:52 pm

I don't think this is useful and sticky-worthy. You've copied a bunch of plain text from the wiki and posted it here in a format that's difficult to read (takes up lots of space, less organized) and called it an easy-to-read reference sheet when it's not really either of those things

User avatar
Scroll
Mouser
Mouser
Posts: 1869
Joined: Fri Apr 20, 2018 9:28 pm
Flair: C'est la vie... profitez-en!
Current Project: The Quest of the Dark Stars
Chat Username: Scroll#7903
Contact:

Re: I made text-only and easy-to-read LunaLua referance sheets

Postby Scroll » Thu Mar 21, 2019 1:19 pm

This looks confusing for me (maybe because I have never used lua lol). And I imagine how long this took to make

lostdarkwolf
Shy Guy
Shy Guy
Posts: 8
Joined: Fri Mar 01, 2019 1:04 am
Chat Username: Jus_Sum_Guy

Re: I made text-only and easy-to-read LunaLua referance sheets

Postby lostdarkwolf » Thu Mar 21, 2019 1:36 pm

it only took about a day or two. I really don't mind if its liked or not. I made it for me and just wanted to share it. I made it because its much more localized than 20 or more saved offline web pages that probably wouldn't link to each other (at least not when I've done it).
I called it easy-to-read because this (labeled and with newlines):
--- Name of Define ---
Defines.gravity
--- Type ---
WORD
--- Default value ---
12
--- Min/Max Size ---
Min. Value: 0
--- Description ---
The maximum falling speed of the player. Note that gravity is a bit of a misnomer.

is much easier to read than this (directly copied and pasted):
Defines.gravity WORD 12 Min. Value: 0 The maximum falling speed of the player. Note that gravity is a bit of a misnomer.

But I do see the mixed response. An ergonomic offline LunaLua reference seems like its needed. I'm going to start working on a CHM file now.

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 8735
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: I made text-only and easy-to-read LunaLua referance sheets

Postby Enjl » Thu Mar 21, 2019 3:04 pm

An excel sheet would've been an easy-to-read alternative.
Ideas are useless if you can't make them real.
Image


Return to “Help and Support”

Who is online

Users browsing this forum: No registered users and 1 guest