Sticky Keys from SMW ROM hacks are here!!!
Originally, in SMW, Sticky Keys are actually a sprite used with the Sticky Hands ASM
https://www.smwcentral.net/?p=section&a ... s&id=33627
https://www.smwcentral.net/?p=section&a ... s&id=21745
But now, with the help of people like Emral, Quine, Hoeloe and ESPECIALLY Mr.Nameless who actually provided base code to make you never let go items, this mechanic is now in SMBX!
Library code:
https://pastebin.com/6g1w6yCD
Gif of the library in action:
HOW TO USE:
To load the library, you need to put this in your luna.lua file.
Variables you can touch:
Code: Select all
SK.stickymovementstate -- if this is set to false, the script will be automatically holding the run button for you. If this is set to true, no run button will be held. True by default.
Fun Fact: Apparently, walking with stickykeys issn't possible in SMW afaik, but with a memory method in SMBX, this was possible to make happen!
How to register NPCS that can be stuck to Mario's hands:
A lookup table called SK.holdingtable is used to register NPCS that can be glued to Mario's hands.
Registering an NPC is simple: In the library, both NPC-45 and NPC-31 are sticky by default. To add an NPC, you have to type this code in:
Code: Select all
SK.holdingtable[30] = true -- registers NPC-30 as a sticky item Mario can hold
This is my first library ever made for SMBX2 and I hope you enjoy using it!
IMPORTANT NOTES:
Klonoa won't work with this code. He can throw the items regardless if Stickykeys is active.