LunaDLL Autocode Reference
Jump to navigation
Jump to search
WARNING: Autocode is OUTDATED!!! Autocode is Outdated, NEVER use it!!
For SMBX2: See the document page for LunaLua. For TheXTech: Please wait for LUA script system support. |
Basic Filters
Details | |||||||
---|---|---|---|---|---|---|---|
Command | Target | Param | Param | Param | Active time | String | Description |
FilterToSmall | x | x | x | x | Length | x | Player loses all powerups. |
FilterToBig | x | x | x | x | Length | x | Player loses all powerups higher than bigness. |
FilterToFire | x | x | x | x | Length | x | Player loses all powerups higher than fireballs. |
FilterMount | x | x | x | x | Length | x | Whatever the player is riding disappears. |
FilterReservePowerup | x | x | x | x | Length | x | The player's reserve powerup disappears. |
FilterPlayer | x | Filter ID | To ID | x | Length | x | If the player's character type is "Filter ID", they change to the character set in "To ID". |
General Effect Commands
Details | |||||||
---|---|---|---|---|---|---|---|
Command | Target | Param | Param | Param | Active time | String | Description |
HeartSystem | Display X | Display Y | Max hearts | x | Length | x | Activates a heart tracking system for players that use hearts. Allows for more than 3 hearts and displays the current heart count at X / Y on screen. |
InfiniteFlying | x | x | x | x | Length | x | Player's flight timer never decreases below 50 so long as this event is active. |
ForceFacing | NPC ID | Section | x | x | Length | x | All NPCs of NPC ID in Section always face the player. |
Screen commands
Details | |||||||
---|---|---|---|---|---|---|---|
Command | Target | Param | Param | Param | Active time | String | Description |
PushScreenBoundary | Section | UDLR | x | x | Length | Speed | Moves section borders. |
ScreenEdgeBuffer | NPC ID | UDLR | Buffer Space | x | Length | x | Keeps NPCs from leaving the screen. |
SnapSectionBounds | Section | X | Y | x | Length | x |
Text commands
Details | |||||||
---|---|---|---|---|---|---|---|
Command | Target | Param | Param | Param | Active time | String | Description |
ClearInputString | x | x | x | x | Length | x | Interrupts words and cheats the player is typing. |
ShowText | x | X pos | Y pos | Font type | Length | String | Shows String on the screen, at coordinates X pos and Y pos, with specified font type. |
ShowNPCLifeLeft | NPC ID | X pos | Y pos | Section | Length | Base health | Displays how much life the first match for "NPC ID" in "Section" has. Displays on the screen at coordinates X pos and Y pos. Supply the correct base health for the NPC so it can calculate the correct remaining life. |
ShowLevelName | x | X pos | Y pos | Font type | Length | x | Display level name at the (X pos, Y pos) with specific Font Type. |
ShowLevelFile | x | X pos | Y pos | Font type | Length | x | Display level filename at the (X pos, Y pos) with specific Font Type. |
$VarName,ShowVar | x | X pos | Y pos | Font type | Length | Base Text | Shows value of the variable on the screen, at coordinates X pos and Y pos with specified font type. |
Triggers
Details | |||||||
---|---|---|---|---|---|---|---|
Command | Target | Param | Param | Param | Active time | String | Description |
Timer | Target | Effect | Display? | Reset? | Length | x | Starts a timer that performs Effect on Target. Set "Display?" to 1 to display the timer in the top right. Set "Reset" to 1 and the timer will start over once it completes. If "Effect" is 1000 or higher, the timer will behave like the Trigger command. It will trigger the corresponding custom event by placing it in the section specified by Target. |
Trigger | Section | Event | x | x | x | x | Activates an event by moving "Event" to "New section". The trigger itself expires afterwards. |
TriggerRandom | Possible event 1 | Possible event 2 | Possible event 3 | Possible event 4 | Length | x | Triggers one of the 4 events at random. |
TriggerRandomRange | Start | End | x | x | Length | x | Triggers one of the events between two other events. |
TriggerSMBXEvent | x | x | x | x | x | Event Name | Triggers SMBX event with Event Name. |
CancelSMBXEvent | x | x | x | x | Length | Event Name | Cancel triggered SMBX event with a delay. Allows breaking the loop of SMBX events that trigger each other. |
TriggerZone | Event to trigger | Top edge | Bottom edge edge | Left edge | Right edge | Options | Triggers EVENT when the player enters the rectangle created by the 4 bounds. |
RunCheat | x | x | x | x | Delay | Cheat String | Set a cheat code to execute it now. |
IfNPC | NPC ID | Condition | To section | Event | Length | x | If "Condition" is true for NPC specified by "NPC ID", then custom event "Event" is triggered in "To section". IfNPC command expires itself after triggering. |
IfVar | x | Comparison type | Value | Event | Length | Variable Name | Check permanent Variable and activate Event if Comparison is true |
IfCompatMode | x | Comparison type | Mode number | Event | Length | x | Triggers an event according to the currently using compatibility mode of TheXTech: 0 is modern mode, 1 is the compatibility with SMBX2 fixes, and 2 is the full SMBX 1.3 compatibility mode. |
IfSpeedRunMode | x | Comparison type | Mode number | Event | Length | x | Triggers an event according to the currently using speed-run mode of TheXTech: 0 is disabled speed-run, 1 is a speedrun with modern mode, 2 is a speedrun with X2 compatibility mode, and 3 is a speedrun with SMBX 1.3 compatibility mode. |
OnInput | x | Button | First frame? | Event to trigger | Length | x | Activates EVENT when BUTTON is pressed. If TAPPED is set, it only activates the first frame that the player pressed the button and won't again until they let go and press again. |
OnCustomCheat | x | x | Only once? | Event to trigger | Length | Cheat String | When the player types CHEAT STRING, activate EVENT. |
OnEvent | x | x | Boolean for once | Event | Length | Event Name | Run the LunaScript event when SMBX event got been triggered. |
OnPlayerMem | Offset | Value | Comparison type | Event to trigger | Length | Type (b, w, dw, f, df) | Scans player memory and checks OFFSET. Does COMPARISON to the VALUE at that OFFSET, and if the comparison is true, it activates EVENT. DATA SIZE is what type of data it should look for at that offset. |
OnGlobalMem | Address | Value | Comparison type | Event to trigger | Length | Type (b, w, dw, f, df) | Scans SMBX global memory at ADDRESS. Does COMPARISON to the VALUE at that ADDRESS, and if the compaison is true, it activates EVENT. DATA SIZE is what type of data it should look for at that offset. |
BlockTrigger | Who can trigger | Block type | Collision type | Event to trigger | Length | Options | When player touches any block of type BLOCK ID, activates EVENT. URDL determines what type of interaction the player must have with the block. |
ScreenBorderTrigger | Left Event | Top Event | Bottom Event | Down Event | Length | Depth |
Layer commands
Details | |||||||
---|---|---|---|---|---|---|---|
Command | Target | Param | Param | Param | Active time | String | Description |
LayerXSpeed | Layer # | Stop after? | x | x | Length | New speed | Sets the X (left and right) speed of LAYER NUMBER to SPEED. Note that layer number is 0-based instead of 1-based. |
LayerYSpeed | Layer # | Stop after? | x | x | Length | New speed | Sets the Y (up and down) speed of LAYER NUMBER to SPEED. |
AccelerateLayerX | Layer # | Max speed | x | x | Length | Accel amt | Increases the X speed of a layer, up to MAX SPEED. Adds by SPEED every frame. |
AccelerateLayerY | Layer # | Max speed | x | x | Length | Accel amt | Increases the Y speed of a layer, up to MAX SPEED. Adds by SPEED every frame. |
DeccelerateLayerX | Layer # | Deccelerate to | x | x | Length | Accel amt | Puts a friction or air resistance-like decceleration on a layer. The layer's speed will decrease by SPEED every frame, to a minimum of DECCEL TO. |
DeccelerateLayerY | Layer # | Deccelerate to | x | x | Length | Accel amt | Puts a friction or air resistance-like decceleration on a layer. The layer's speed will decrease by SPEED every frame, to a minimum of DECCEL TO. |
Block commands
Details | |||||||
---|---|---|---|---|---|---|---|
Command | Target | Param | Param | Param | Active time | String | Description |
SetAllBlocksID | Type | Set to | x | x | Length | x | |
SwapAllBlocks | Type (in) | Type (out) | x | x | Length | x | |
ShowAllBlocks | Type | x | x | x | Length | x | |
HideAllBlocks | Type | x | x | x | Length | x |
Set commands
Details | |||||||
---|---|---|---|---|---|---|---|
Command | Target | Param | Param | Param | Active time | String | Description |
CyclePlayerLeft | x | x | x | x | Length | x | Cycles player character 'left'. |
CyclePlayerRight | x | x | x | x | Length | x | Cycles player character 'right'. |
DeleteEventsFrom | Section | x | x | x | Length | x | Delete all commands marked with the given Section. |
Kill | 0 (Player) | x | x | x | Length | Option | Kills the player. |
MemAssign | Address | Value | OPERATION | x | Length | Data type | Sets the internal memory of SMBX. |
NPCMemSet | NPC ID | Offset | Value | OPERATION | Length | Data type | Sets the memory of all NPCs in the level of the given type. |
PlayerMemSet | x | Offset | Value | OPERATION | Length | Data type | Sets the memory of Player 1. |
SetHearts | x | Hearts | x | x | Length | x | Sets the amount of hearts the player currently has to HEARTS. |
SetHits | NPC ID | Section | Damage | x | Length | x | Set all NPCs that have the given NPCID to have taken HITS amount of hits. |
SetVar | x | OPERATION | Value | x | Length | Variable Name | Manipulates permanent user variables |
$TargetVar,CopyVar | x | OPERATION | x | x | Length | Source variable Name | Copies one permanent user variable to another with or without operations. |
Audio commands
Details | |||||||
---|---|---|---|---|---|---|---|
Command | Target | Param | Param | Param | Active time | String | Description |
SFX | x | Sound ID | x | x | Delay | Filename (.wav for original LunaDLL) | Plays SOUND EFFECT after DELAY. Set DELAY of 1 for instant playback. Can play a custom sound effect from the level folder if you specify FILENAME. |
SetMusic | Section | Music ID | x | x | Active Time | Filename | Change Music in a section. |
PlayMusic | x | Section | x | x | Delay | x | Plays the music from SECTION after DELAY. Set DELAY to 1 to play it right now. |
Advanced/Misc commands
Details | |||||||
---|---|---|---|---|---|---|---|
Command | Target | Param | Param | Param | Active time | String | Description |
DebugPrint | x | x | x | x | Length | x | Write some info about how lunadll is running onto the screen. |
LunaControl | Type | Action | x | x | Length | x | Performs Action on Type |
ModParam | Parameter # | Value | OPERATION | Section | Length | Identifier | |
ChangeTime | x | Value | OPERATION | x | Length | Identifier | |
DebugWindow | x | x | x | x | x | Message | |
CollisionScan | x | x | x | x | Length | x | |
$VarName,LoadPlayerVar | x | Offset | OPERATION | x | Length | Data type | |
$VarName,LoadNPCVar | Type | Offset | OPERATION | Section | Length | Data type | |
$VarName,LoadGlobalVar | Address | OPERATION | x | x | Length | Data type |
Sprite commands
Details | |||||||
---|---|---|---|---|---|---|---|
Command | Target | Param | Param | Param | Active time | String | Description |
LoadImage | Image ID | Transparent Colour (Hex) | x | x | x | Filename.bmp | |
PlaceSprite | Type | Image ID | X | Y | Length | x | |
OnPlayerCollide | x | Small Hitbox? | x | Comp | Length | x | |
OnPlayerDistance | Distance | Far / Close | x | Comp | Length | x | |
WaitForPlayer | Offset | Value | Comparsion Type | Comp | Length | Data Type | |
PlayerHoldingSprite | Type | x | x | Comp | Length | x |
TheXTech only commands
There are commands of Autocode language that exclusive to TheXTech engine and they aren't available in any versions of LunaDLL, LunaLua, and SMBX2.
Details | |||||||
---|---|---|---|---|---|---|---|
Command | Target | Param | Param | Param | Active time | String | Description |
Version 1.3.6 | |||||||
OnEvent | x | x | Boolean for once | Event | Length | Event Name | Run the LunaScript event when SMBX event got been triggered. |
CancelSMBXEvent | x | x | x | x | Length | Event Name | Cancel triggered SMBX event with a delay. Allows breaking the loop of SMBX events that trigger each other. |
PlaySFX | x | Sound ID | Loops | Volume | Delay | Filename | Same as SFX but allows to define number of loops (0-based count, -1 means infinite loop) and initial volume (from 1 to 128). |
StopSFX | x | x | x | x | Delay | Filename | Stops the currently playing custom sound using filename as a key. |
RunCheat | x | x | x | x | Delay | Cheat String | Set a cheat code to execute it now. |
IfCompatMode | x | Comparison type | Mode number | Event | Length | x | Triggers an event according to the currently using compatibility mode of TheXTech: 0 is modern mode, 1 is the compatibility with SMBX2 fixes, and 2 is the full SMBX 1.3 compatibility mode. |
IfSpeedRunMode | x | Comparison type | Mode number | Event | Length | x | Triggers an event according to the currently using speed-run mode of TheXTech: 0 is disabled speed-run, 1 is a speedrun with modern mode, 2 is a speedrun with X2 compatibility mode, and 3 is a speedrun with SMBX 1.3 compatibility mode. |
Version 1.3.6.1 | |||||||
ShowLevelName | x | X pos | Y pos | Font type | Length | x | Display level name at the (X pos, Y pos) with specific Font Type. |
ShowLevelFile | x | X pos | Y pos | Font type | Length | x | Display level filename at the (X pos, Y pos) with specific Font Type. |
Version 1.3.6.5 | |||||||
$TargetVar,CopyVar | x | OPERATION | x | x | Length | Source variable Name | Copies one permanent user variable to another with or without operations. |