apple's Changes (.lua):
Spoiler: show
This is my general-changing library that does a lot of stuff I prefer for my projects. Reduced powerup timers, a quick-death system, spinjump patchs, dropping the reserve when hurt, faster powered forcedStates, etc:




Download: https://drive.google.com/file/d/1XKyCeQ ... sp=sharing
Load in your luna.lua with something like local ch = require("appleChanges"). Here's all the settings:




Download: https://drive.google.com/file/d/1XKyCeQ ... sp=sharing
Load in your luna.lua with something like local ch = require("appleChanges"). Here's all the settings:
Spoiler: show
*ch.quickDeathArgs - Table with arguments for the quick reload. Lines up with this: https://docs.codehaus.moe/#/reference/level-levels
Scroll down till you see Level.load and change parts of this table according to your needs, or leave it alone for default use.
There's also an extra slot on the end, "framesToWait," which is how many frames pass before reloading.
*ch.runRestartRoutine(level, episode, warp, framesToWait) - Function used to start the reloading routine. You can pass other
things for level, episode, warp, and framesToWait, but if you don't, ch.quickDeathArgs is used instead (This is what
the library does). Will NOT work if there is already a restart routine going.
*ch.preventReload - Used by the library to prevent two reload routines running at once. Setting this to false allows a routine to happen,
setting it to true prevents it. I want to highlight, as I was told by Emral, that allowing multiple of the restart routines to run
is REALLY BAD, so don't let that happen if you abuse this field!
*ch.disableSpinshooting - When true, you don't shoot fireballs during a spinjump
*ch.changePeachQuirks - Sorry for the bad name, but this changes a couple things for Peach:
*what ch.disableSpinfloating did
*makes the normal jump NOT enable the floating
*i guess that's it lol
*ch.canDropReserve(p) - Checks if the passed player (p) should drop their reserve item when they get hurt.
*ch.paths - Table with three fields: lr, cr, and mri. The first is the path to lovelyReserves, the second is to customReserve, and the third is to modernReserveItems
*ch.dropReserveWhenHurt - Set this to false to PREVENT dropping your reserve when hurt (this also controls if you lose it when you die).
*ch.dropReserveHurtDelay - How many frames pass before your reserve is dropped AFTER being hurt.
*ch.dropReserveWhenOnTheseMounts - Mapped table with mounts that allow you to drop the reserve when hurt.
*ch.customReservesLost - If you're using customReserve, this determines how many you lose when you die.
*ch.peachCharacters - Mapped table with characters that use Peach's mem offsets (the floating ones specifically)
*ch.linkCharacters - Mapped table with characters that use Link's mem offsets (specifically the slashing / projectile cooldown ones).
*ch.bannedProjectileMounts - Mapped table with mounts that don't allow you to shoot projectiles (and SHOULDN'T mess with the projectile timer).
*ch.newFireballTimer - If the fireball/projectile mem-offset is greater than this, the offset is set to this
*ch.newTanookiTimer - The above, but for the statue cooldown timer
*ch.slowStates - Mapped table with powered forcedStates that are made faster. Each indexed state is a table with these fields:
*powerup, which is what powerup the player is set to when in this state
*iframes, which is how many invincibility frames they are given
*ch.newTimerCutoff - When the player's forcedTimer hits this number, the above are cutoff
*ch.cheepNPCs - Mapped table with Cheep-Cheep-like NPCs that should have their death cancelled when stepped on in water
*ch.brickBlocks - Blocks that the purple yoshi should tear thru
*ch.o - Value used to increase the size of getIntersecting-type ranges
Scroll down till you see Level.load and change parts of this table according to your needs, or leave it alone for default use.
There's also an extra slot on the end, "framesToWait," which is how many frames pass before reloading.
*ch.runRestartRoutine(level, episode, warp, framesToWait) - Function used to start the reloading routine. You can pass other
things for level, episode, warp, and framesToWait, but if you don't, ch.quickDeathArgs is used instead (This is what
the library does). Will NOT work if there is already a restart routine going.
*ch.preventReload - Used by the library to prevent two reload routines running at once. Setting this to false allows a routine to happen,
setting it to true prevents it. I want to highlight, as I was told by Emral, that allowing multiple of the restart routines to run
is REALLY BAD, so don't let that happen if you abuse this field!
*ch.disableSpinshooting - When true, you don't shoot fireballs during a spinjump
*ch.changePeachQuirks - Sorry for the bad name, but this changes a couple things for Peach:
*what ch.disableSpinfloating did
*makes the normal jump NOT enable the floating
*i guess that's it lol
*ch.canDropReserve(p) - Checks if the passed player (p) should drop their reserve item when they get hurt.
*ch.paths - Table with three fields: lr, cr, and mri. The first is the path to lovelyReserves, the second is to customReserve, and the third is to modernReserveItems
*ch.dropReserveWhenHurt - Set this to false to PREVENT dropping your reserve when hurt (this also controls if you lose it when you die).
*ch.dropReserveHurtDelay - How many frames pass before your reserve is dropped AFTER being hurt.
*ch.dropReserveWhenOnTheseMounts - Mapped table with mounts that allow you to drop the reserve when hurt.
*ch.customReservesLost - If you're using customReserve, this determines how many you lose when you die.
*ch.peachCharacters - Mapped table with characters that use Peach's mem offsets (the floating ones specifically)
*ch.linkCharacters - Mapped table with characters that use Link's mem offsets (specifically the slashing / projectile cooldown ones).
*ch.bannedProjectileMounts - Mapped table with mounts that don't allow you to shoot projectiles (and SHOULDN'T mess with the projectile timer).
*ch.newFireballTimer - If the fireball/projectile mem-offset is greater than this, the offset is set to this
*ch.newTanookiTimer - The above, but for the statue cooldown timer
*ch.slowStates - Mapped table with powered forcedStates that are made faster. Each indexed state is a table with these fields:
*powerup, which is what powerup the player is set to when in this state
*iframes, which is how many invincibility frames they are given
*ch.newTimerCutoff - When the player's forcedTimer hits this number, the above are cutoff
*ch.cheepNPCs - Mapped table with Cheep-Cheep-like NPCs that should have their death cancelled when stepped on in water
*ch.brickBlocks - Blocks that the purple yoshi should tear thru
*ch.o - Value used to increase the size of getIntersecting-type ranges
Spoiler: show
This was code FireSeraphim had in SMZ (another cool episode, check it out: https://www.smwcentral.net/?p=viewthrea ... 7#p1624457) that he says he got from either MDA or MegaDood. I then asked permission to use this code and then expanded it into this. It makes the typical "autoscroll crushing" from other Marios work.
Download: https://drive.google.com/file/d/1Je-orO ... sp=sharing
Load in your luna.lua with something like local bc = require("boundaryCrush"). Here's all the settings:
Download: https://drive.google.com/file/d/1Je-orO ... sp=sharing
Load in your luna.lua with something like local bc = require("boundaryCrush"). Here's all the settings:
Spoiler: show
*bc.enabled - Set to false to disable this library
*bc.isPlayerDead(p) - Checks if the passed player (p) has died
*bc.horizontalCrush(p) - Checks if the passed player (p) is being crushed horizontally
*bc.isPlayerDead(p) - Checks if the passed player (p) has died
*bc.horizontalCrush(p) - Checks if the passed player (p) is being crushed horizontally
Spoiler: show
I made this for fun in a scrapped project and then released it. It allows box users to store their held item in said box by pressing up and altRun:

Download: https://drive.google.com/file/d/11AXbbR ... sp=sharing
Load in your luna.lua with something like local hh = require("handyHoarder"). Here's all the settings:

Download: https://drive.google.com/file/d/11AXbbR ... sp=sharing
Load in your luna.lua with something like local hh = require("handyHoarder"). Here's all the settings:
Spoiler: show
*hh.allowedCharacters - Which characters can store items. Used this over Graphics.getHUDType so you COULD remove box users if you want
*hh.containerNPCs - A mapped table with NPC IDs that are containers, so that if you hold one of these and store it,
the contained item will be saved for when you spawn the container again
*hh.bannedNPCs - A mapped table with banned NPCs that don't really work well with this system
*hh.transformNPCs - When you map an NPC ID to this table, you will assign it to a different NPC ID. If you are holding an NPC of the first ID,
it'll put the second ID into your reserve when you store the NPC
*hh.saveSettingsNPCs - Mapped table with NPC IDs that have their settings saved to the player that stored them.
That way, if the NPC's settings are essential, they can be applied again when they're used. Will NOT work
with the vanilla reserve. You must either be using lovelyReserves and/or modernReserveItems.
*hh.storeSounds - Table with two fields: yoshi and normal. First is a SFX ID that gets used when Yoshi saves an item, second is when you store an item yourself
*hh.enabled - Can you store your held item?
*hh.canNormalStore - Can you store an item normally?
*hh.canYoshiStore - Can Yoshi store your item?s
*hh.onStoreItem(eventToken, npc, p) - Custom event called right before default item-storing shenanigans. eventToken.cancelAll can be set to true to prevent everything,
npc is the npc that's attempting to be stored, and p is the player attempting the storing
*hh.onAdjustItem(eventTokens, npc, p, item) - Custom event called right before the stored-item-ID is adjusted regularly. eventTokens.cancelAdjustment can be set to true to prevent default adjusting,
eventTokens.cancelNPCkill can be set to true to prevent the held-NPC from dying (as well as the reserve-ing of that NPC), npc is the held-NPC in question, p is the player attempting the storing,
and item (which's .id field is what your reserve will be set to) can be maunually set to something else if eventTokens.cancelAdjustment is set to true
*hh.onPostStoreItem(p, item) - Custom event called after the item has successfully been stored. p is the player that stored their item, and item.id is what the reserve was set to
*hh.containerNPCs - A mapped table with NPC IDs that are containers, so that if you hold one of these and store it,
the contained item will be saved for when you spawn the container again
*hh.bannedNPCs - A mapped table with banned NPCs that don't really work well with this system
*hh.transformNPCs - When you map an NPC ID to this table, you will assign it to a different NPC ID. If you are holding an NPC of the first ID,
it'll put the second ID into your reserve when you store the NPC
*hh.saveSettingsNPCs - Mapped table with NPC IDs that have their settings saved to the player that stored them.
That way, if the NPC's settings are essential, they can be applied again when they're used. Will NOT work
with the vanilla reserve. You must either be using lovelyReserves and/or modernReserveItems.
*hh.storeSounds - Table with two fields: yoshi and normal. First is a SFX ID that gets used when Yoshi saves an item, second is when you store an item yourself
*hh.enabled - Can you store your held item?
*hh.canNormalStore - Can you store an item normally?
*hh.canYoshiStore - Can Yoshi store your item?s
*hh.onStoreItem(eventToken, npc, p) - Custom event called right before default item-storing shenanigans. eventToken.cancelAll can be set to true to prevent everything,
npc is the npc that's attempting to be stored, and p is the player attempting the storing
*hh.onAdjustItem(eventTokens, npc, p, item) - Custom event called right before the stored-item-ID is adjusted regularly. eventTokens.cancelAdjustment can be set to true to prevent default adjusting,
eventTokens.cancelNPCkill can be set to true to prevent the held-NPC from dying (as well as the reserve-ing of that NPC), npc is the held-NPC in question, p is the player attempting the storing,
and item (which's .id field is what your reserve will be set to) can be maunually set to something else if eventTokens.cancelAdjustment is set to true
*hh.onPostStoreItem(p, item) - Custom event called after the item has successfully been stored. p is the player that stored their item, and item.id is what the reserve was set to
Spoiler: show
This allows you to make certain levels unplayable once you beat them.
Download: https://drive.google.com/file/d/1fsZ7wi ... sp=sharing
Load in your luna.lua AND map.lua with something like local otl = require("oneTimeLevels"). To make a specific level unplayable once you beat it, put otl.addLevel(Level.filename()) in said level's luna.lua. Here's the settings:
Download: https://drive.google.com/file/d/1fsZ7wi ... sp=sharing
Load in your luna.lua AND map.lua with something like local otl = require("oneTimeLevels"). To make a specific level unplayable once you beat it, put otl.addLevel(Level.filename()) in said level's luna.lua. Here's the settings:
Spoiler: show
*SaveData.oneTimeLevels - Table that is indexed per-level, where that level is a one time level. Each indexed part is another
level that has one field, 'hasBeaten,' which is used to check if that level has been beaten and should not be enterable
again on the world map.
*otl.addLevel(filename) - Function used to add a one time level if it hasn't been added already. You should be able to
just put 'Level.filename()' for 'filename,' unless you want to specify a level
*otl.standingOnValidLevel(filedTable) - Function that does a general check to see if, on the map, you're standing on a valid level and can
check whatever needed table (that's what 'filedTable' is for)
level that has one field, 'hasBeaten,' which is used to check if that level has been beaten and should not be enterable
again on the world map.
*otl.addLevel(filename) - Function used to add a one time level if it hasn't been added already. You should be able to
just put 'Level.filename()' for 'filename,' unless you want to specify a level
*otl.standingOnValidLevel(filedTable) - Function that does a general check to see if, on the map, you're standing on a valid level and can
check whatever needed table (that's what 'filedTable' is for)
Spoiler: show
This library allows you to take away ALL of the player's powerup related things, and then give them back when you want. Here, I do it when the player enters certain sections:

Download: https://drive.google.com/file/d/1vb96Mo ... sp=sharing
Load in your luna.lua with something like local pd = require("poweredDown"). Here are all the settings:

Download: https://drive.google.com/file/d/1vb96Mo ... sp=sharing
Load in your luna.lua with something like local pd = require("poweredDown"). Here are all the settings:
Spoiler: show
*SaveData.poweredDownplayerData - Where player data is stored for each player index. The table settings are:
reserve, for the player's reserve-powerup
powerup, for the player's powerup
mount, for the player's mount
color, for the player's mount-color
*pd.setPlayerData(i) - Sets SaveData.poweredDownplayerData with the passed player index, along with "resetting" that player
*pd.setWithPlayerData(i) - Sets the player's data using SaveData.poweredDownplayerData
reserve, for the player's reserve-powerup
powerup, for the player's powerup
mount, for the player's mount
color, for the player's mount-color
*pd.setPlayerData(i) - Sets SaveData.poweredDownplayerData with the passed player index, along with "resetting" that player
*pd.setWithPlayerData(i) - Sets the player's data using SaveData.poweredDownplayerData
Spoiler: show
Me and a few other people helped ArUFuhReal on Discord with code that removes the leaf flight. I held on to that for my own use and, of course, library-ified it.
Download: https://drive.google.com/file/d/1oMf0Dg ... sp=sharing
Load in your luna.lua with something like local rf = require("removedFlight"). Here's the settings:
Download: https://drive.google.com/file/d/1oMf0Dg ... sp=sharing
Load in your luna.lua with something like local rf = require("removedFlight"). Here's the settings:
Spoiler: show
*rf.enabled - Set to false to disable the library
Spoiler: show
I extracted this from my simplifiedHUD (haha self plug: viewtopic.php?t=29156) for Galeboy/HAK0TA538's episode, and this was the code he suggested I release that inspired this pack. It draws four counters on the map: a global starcoin counter, and a per-level starcoin counter, and the same two, but for stars:

Download: https://drive.google.com/file/d/1Dgb5eT ... sp=sharing
Load in your luna.lua AND map.lua with something like local sc = require("starItemCounters"). The counters will only show up if the level you're on has starcoins AND you've entered that level in some way. Here's the settings:

Download: https://drive.google.com/file/d/1Dgb5eT ... sp=sharing
Load in your luna.lua AND map.lua with something like local sc = require("starItemCounters"). The counters will only show up if the level you're on has starcoins AND you've entered that level in some way. Here's the settings:
Spoiler: show
*SaveData.starItemCounters_starData - Where the per-level star data is saved. Has two fields: collected and total
*sc.standingOnValidLevel(levelName, t) - Checks if the level of the given name (levelName) is a valid level.
t is a table which is level file index checked in the code
*sc.getLevelFullyCollected(levelFile) - Copied from the main starcoin AI file and adjusted for the COLLECTED_WEAK starcoin state.
Checks for all fully collected/saved starcoins in the given level (using levelFile)
*sc.worldX - The x position of the redrawn stuff on the world map
*sc.worldY - The y position of the redrawn stuff on the world map
*sc.spaceBetweenCounterParts - The space between each of the counter parts (icon, cross, value, etc)
*sc.p2Offset - How much the counters move if Player 2 is on the map
*sc.priority - The priority ALL stuff is redrawn at
*sc.starCounterOffset - How much the per-level star counter is offset from the y stuff
*sc.starcoinCounterOffset - Same as the above, but for the per-level starcoin counter
*sc.starcoinOffset - Same as the two above, but for the global starcoin counter
*sc.starNPCs - Mapped table with star NPC IDs
*sc.standingOnValidLevel(levelName, t) - Checks if the level of the given name (levelName) is a valid level.
t is a table which is level file index checked in the code
*sc.getLevelFullyCollected(levelFile) - Copied from the main starcoin AI file and adjusted for the COLLECTED_WEAK starcoin state.
Checks for all fully collected/saved starcoins in the given level (using levelFile)
*sc.worldX - The x position of the redrawn stuff on the world map
*sc.worldY - The y position of the redrawn stuff on the world map
*sc.spaceBetweenCounterParts - The space between each of the counter parts (icon, cross, value, etc)
*sc.p2Offset - How much the counters move if Player 2 is on the map
*sc.priority - The priority ALL stuff is redrawn at
*sc.starCounterOffset - How much the per-level star counter is offset from the y stuff
*sc.starcoinCounterOffset - Same as the above, but for the per-level starcoin counter
*sc.starcoinOffset - Same as the two above, but for the global starcoin counter
*sc.starNPCs - Mapped table with star NPC IDs
Spoiler: show
I made this one after seeing a discussion regarding the "invisible while powering from leaf to fire" issue. This provides fixes for ALL leaf to fire situations, like this one here:

Download: https://drive.google.com/file/d/1mtrsOx ... sp=sharing
Load in your luna.lua with something like local pff = require("tailToFireFixes"). Here's the settings:

Download: https://drive.google.com/file/d/1mtrsOx ... sp=sharing
Load in your luna.lua with something like local pff = require("tailToFireFixes"). Here's the settings:
Spoiler: show
*pff.powering - The powering forced states that allow the frame fixes (Fire and Ice by default)
*pff.holdingJumpKey(p) - Checks if the passed player (p) is holding some kind of jump button
*pff.frameFixes - Table with all the possible frame fixes (Has some examples by default)
*pff.tailPowers - Table with the current tail powers (Leaf and Tanooki)
*pff.holdingJumpKey(p) - Checks if the passed player (p) is holding some kind of jump button
*pff.frameFixes - Table with all the possible frame fixes (Has some examples by default)
*pff.tailPowers - Table with the current tail powers (Leaf and Tanooki)
Spoiler: show
My current episode has the player as Small Mario for the majority of it, and so I wanted to find a way to get powerups to spawn normally out of blocks without turning into mushrooms. So I wrote this lol. Works pretty well, I hope:

Download: https://drive.google.com/file/d/1rcIEX9 ... sp=sharing
Load in your luna.lua with something like local witb = require("whatsInTheBox"). Here's the settings:

Download: https://drive.google.com/file/d/1rcIEX9 ... sp=sharing
Load in your luna.lua with something like local witb = require("whatsInTheBox"). Here's the settings:
Spoiler: show
*witb.enabled - Set to false to disable the...disabling lol
*witb.inBlockState - Mapped table with "NPC coming out of a block" states.
They relate to the 0x138 offset
*witb.powerups - Mapped table with powerup IDs that should have their progression disabled
*witb.inBlockState - Mapped table with "NPC coming out of a block" states.
They relate to the 0x138 offset
*witb.powerups - Mapped table with powerup IDs that should have their progression disabled
Spoiler: show
In the process of remaking a bunch of playables that lacked all the necessary powerup sprites, I went to lua as a fix instead of trying to "fake" the forms. With this library, you can register certain forced states and/or powerups for a character that put them into a different state/powerup. It's got an intended use, and a cool use:


Download: https://drive.google.com/file/d/1rOCVlQ ... sp=sharing
Load in your luna.lua with something like local wtp = require("whatsThatPowerup"). In the library file is an example on how to use it. Here's the settings:


Download: https://drive.google.com/file/d/1rOCVlQ ... sp=sharing
Load in your luna.lua with something like local wtp = require("whatsThatPowerup"). In the library file is an example on how to use it. Here's the settings:
Spoiler: show
*wtp.enabled - Set to false to disable the library
*wtp.bannedPowers - A table with another possible table per-character. It has 4 fields:
banStates and changeStates (if you are in the first, you are put into the second),
and banPowers and changePowers (same as above, but with powerups).
These are all tables btw.
*wtp.bannedPowers - A table with another possible table per-character. It has 4 fields:
banStates and changeStates (if you are in the first, you are put into the second),
and banPowers and changePowers (same as above, but with powerups).
These are all tables btw.
Spoiler: show
*v1.0.0.0:
- First released version
*v1.0.0.1:
- Used otl.standingOnValidLevel(filedTable) from oneTimeLevels.lua in starcoinCounters.lua
*v1.0.1.0:
- Added "drop reserve when hurt" functionality to apple's Changes
- Fixed a unintentional crushing issue with boundaryCrush's vertical checks
*v1.0.2.0:
- Added faster powered forcedStates to apple's Changes
- Added whatsInTheBox.lua
*v1.0.2.1:
- apple's Changes now supports lovelyReserves
*v1.0.2.2:
- Fixed a bug with the starman and apple's Changes' drop-when-hurt stuff
*v1.0.2.3:
- handyHoarder now supports lovelyReserves
*v1.0.2.4:
- apple's Changes now removes your reserve when you die. Can be disabled in the same way the "drop reserve when hurt" can
*v1.0.2.5:
- apple's Changes got a small documentation update
*v1.0.2.6:
- starcoinCounters got a sizable update
*v1.0.2.7:
- starcoinCounters got changed to starItemCounters, and now handles stars!
*v1.0.2.8:
- starItemCounters got a small update
- Might as well group this in here, but applesChanges got a small update just now
*v1.0.2.9:
- applesChanges got a small update
*v1.0.3.0:
- applesChanges got a small update
- handyHoarder got a big update
*v1.0.3.1:
- Another solid handyHoarder update
*v1.0.3.2:
-applesChanges got the most miniscule update
*v1.0.3.3:
- applesChanges received a bug fix/new field to use
*v1.0.3.4:
- applesChanges received a minor update
*v1.0.3.5:
- applesChanges received a bug fix
*v1.0.3.6:
- applesChanges was updated so it worked with the latest lovelyReserves version
*v1.0.3.7:
- applesChanges was updated to include some purple-yoshi changes
*v1.0.3.8:
- applesChanges and handyHoarder got customReserve support added
*v1.0.3.9:
- applesChanges got a pretty good fix/QOL update
- First released version
*v1.0.0.1:
- Used otl.standingOnValidLevel(filedTable) from oneTimeLevels.lua in starcoinCounters.lua
*v1.0.1.0:
- Added "drop reserve when hurt" functionality to apple's Changes
- Fixed a unintentional crushing issue with boundaryCrush's vertical checks
*v1.0.2.0:
- Added faster powered forcedStates to apple's Changes
- Added whatsInTheBox.lua
*v1.0.2.1:
- apple's Changes now supports lovelyReserves
*v1.0.2.2:
- Fixed a bug with the starman and apple's Changes' drop-when-hurt stuff
*v1.0.2.3:
- handyHoarder now supports lovelyReserves
*v1.0.2.4:
- apple's Changes now removes your reserve when you die. Can be disabled in the same way the "drop reserve when hurt" can
*v1.0.2.5:
- apple's Changes got a small documentation update
*v1.0.2.6:
- starcoinCounters got a sizable update
*v1.0.2.7:
- starcoinCounters got changed to starItemCounters, and now handles stars!
*v1.0.2.8:
- starItemCounters got a small update
- Might as well group this in here, but applesChanges got a small update just now
*v1.0.2.9:
- applesChanges got a small update
*v1.0.3.0:
- applesChanges got a small update
- handyHoarder got a big update
*v1.0.3.1:
- Another solid handyHoarder update
*v1.0.3.2:
-applesChanges got the most miniscule update
*v1.0.3.3:
- applesChanges received a bug fix/new field to use
*v1.0.3.4:
- applesChanges received a minor update
*v1.0.3.5:
- applesChanges received a bug fix
*v1.0.3.6:
- applesChanges was updated so it worked with the latest lovelyReserves version
*v1.0.3.7:
- applesChanges was updated to include some purple-yoshi changes
*v1.0.3.8:
- applesChanges and handyHoarder got customReserve support added
*v1.0.3.9:
- applesChanges got a pretty good fix/QOL update
I want to thank all the individuals who either directly contributed to these libraries or indirectly did by helping me learn things about X2's lua.
Please remember to credit me if you used any of these, and have a great day!