accessories.lua - the cosmos of cosmetics!

Share and discuss custom LunaLua code and content packs for SMBX2.
Master of Disaster
Bit
Bit
Posts: 62
Joined: Sun Nov 28, 2021 9:29 am
Flair: Average Koopa Fan
Pronouns: he/him

accessories.lua - the cosmos of cosmetics!

Postby Master of Disaster » Thu Feb 20, 2025 1:37 pm

Hello everyone, did you ever feel the need for cosmetics in your episodes (no? Oh well...)
Then this might fit your need, introducing

Accessories.lua v1.0
Image

A library that lets you add stuff onto the player's sprites, without having to rely on costumes!
One benefit of that is that you can stack accessories, and have it a little bit easier to set them up!

While setting up accessories isn't trivial, it's at least somewhat streamlined.
Most of your work adding an accessory will be making offset.txt files (which specify X- and Y-offsets and frames depending on the player's current frame).
At least some basic lunalua konwledge is expected however, so be warned.

Here you can see the accessories in motion:
Spoiler: show
Image

Of note:
There are 3 example accessories which you're free to use, however they are made to fit SMW-Mario specifically. If you use different/multiple characters, you have to change/add offset.txt files for the different characters/powerup states (small and big should suffice).
There's some documentation in the credits file, the example accessories might help too.

If you want to be as cool as Mario, make sure to leave proper credit!

You can get your dinosaur-hat here:
https://www.dropbox.com/scl/fo/zxr7594p ... tt07t&dl=0

mariobrigade2018
Volcano Lotus
Volcano Lotus
Posts: 586
Joined: Wed May 24, 2023 7:00 pm
Flair: OK in coding who dreams of making a Mario game
Pronouns: he/him

Re: accessories.lua - the cosmos of cosmetics!

Postby mariobrigade2018 » Thu Feb 20, 2025 3:08 pm

TF you mean “no?” There was an entire conversation about what would you give players for episode that didn’t use lives, and cosmetic was a contender. So many possibilities have been opened up because of this.

I do have a question: does this support custom powerups?

Master of Disaster
Bit
Bit
Posts: 62
Joined: Sun Nov 28, 2021 9:29 am
Flair: Average Koopa Fan
Pronouns: he/him

Re: accessories.lua - the cosmos of cosmetics!

Postby Master of Disaster » Thu Feb 20, 2025 4:19 pm

the no part was more or less just a stupid joke, but yeah, this should work perfectly fine with custom powerups!
For some powerups it might look weird but if you really want to use it with the big mushroom you could always just add another offset file to be used when the player has that powerup.

mariobrigade2018
Volcano Lotus
Volcano Lotus
Posts: 586
Joined: Wed May 24, 2023 7:00 pm
Flair: OK in coding who dreams of making a Mario game
Pronouns: he/him

Re: accessories.lua - the cosmos of cosmetics!

Postby mariobrigade2018 » Thu Feb 20, 2025 5:06 pm

Master of Disaster wrote:
Thu Feb 20, 2025 4:19 pm
the no part was more or less just a stupid joke, but yeah, this should work perfectly fine with custom powerups!
For some powerups it might look weird but if you really want to use it with the big mushroom you could always just add another offset file to be used when the player has that powerup.
Oh DW, I knew the no part was a joke lol.

But what I did want to know more about is how to override the default offset file.

Master of Disaster
Bit
Bit
Posts: 62
Joined: Sun Nov 28, 2021 9:29 am
Flair: Average Koopa Fan
Pronouns: he/him

Re: accessories.lua - the cosmos of cosmetics!

Postby Master of Disaster » Thu Feb 20, 2025 6:32 pm

mariobrigade2018 wrote:
Thu Feb 20, 2025 5:06 pm
Oh DW, I knew the no part was a joke lol.

But what I did want to know more about is how to override the default offset file.
Override as in "have an additional one"? There is no default offset file, so you have to make one for your accessory. I'd just recommend copying an example file and go from there. Either way if you want to add another offset file, you'd add that when registering the accessory (similar to offsetDataSmall = ...), and then in your drawFunc you could add a case, like the default one does for small Mario.

Pixelated_Perfection
Swooper
Swooper
Posts: 52
Joined: Fri Feb 25, 2022 1:23 pm
Pronouns: Any/All

Re: accessories.lua - the cosmos of cosmetics!

Postby Pixelated_Perfection » Thu Feb 20, 2025 8:29 pm

this seems like it would work wonderfully in an episode with a sort of RPG equipment system to it


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari