Page 1 of 2
SMBX Custom Inventory System (1.0)
Posted: Tue Apr 28, 2020 11:53 am
by Lusho
Custom Inventory
Welcome folks to another library! this is the custom inventory, again this started in the form of reviving the old one that XerX made, although it ended being completely different, its SMB3 style, but works pretty similar to the New Super Mario Bros one.
How can i install this and how does this work?
Its pretty simple, you add the code file and folder inside your episode folder and add to your level/folder luna.lua and map.lua files:
Code: Select all
local inventory = require("customInventory")
Also this comes with two functions to add stuff into your inventory, because otherwise, well, this would be useless.
Code: Select all
-- The item order is: Mushroom, FireFlower, Leaf, Tanooki, Hammer, IceFlower, Starman, PWing. Going from 0 to 7
-- This function adds Items to the inventory, select which item you want to add and the amount --
inventory.addPowerUp(itemID, amount)
-- This one sets the amount of Items that you have, select which item do you want to set and the number --
inventory.setPowerUp(itemID, number)
Its also pretty simple to use, while in the world map use the altRun key to open and close the inventory, you navigate through the menu using left and right, and use the jump button to select an item, in the world map a select player menu might open when you want to add a powerup.

Re: SMBX Custom Inventory System (1.0)
Posted: Tue Apr 28, 2020 11:56 am
by Eri7
Wow this is awesome, I'm also impressed you managed to add the P-wing.
Re: SMBX Custom Inventory System (1.0)
Posted: Tue Apr 28, 2020 12:08 pm
by Lusho
Oh geez i found an error in the code let me update it quickly.
Re: SMBX Custom Inventory System (1.0)
Posted: Tue Apr 28, 2020 3:39 pm
by DrMekar
This is really cool, though what is the diffrence between this Codes?
Code: Select all
-- The item order is: Mushroom, FireFlower, Leaf, Tanooki, Hammer, IceFlower, Starman, PWing. Going from 0 to 7
-- This function adds Items to the inventory, select which item you want to add and the amount --
inventory.addPowerUp(itemID, amount)
-- This one sets the amount of Items that you have, select which item do you want to set and the number --
inventory.setPowerUp(itemID, number)
From my understanding, both add items to the players Inventory.
Re: SMBX Custom Inventory System (1.0)
Posted: Tue Apr 28, 2020 3:42 pm
by Emral
DrMekar wrote: ↑Tue Apr 28, 2020 3:39 pm
This is really cool, though what is the diffrence between this Codes?
From my understanding, both add items to the players Inventory.
Add:
itemCount = itemCount + n
Set:
itemCount = n
Re: SMBX Custom Inventory System (1.0)
Posted: Wed Feb 24, 2021 3:37 am
by Wowsie
When getting starman, Mario dosen't became invincible in the start of the level, please fix this
Added in 43 minutes 59 seconds:
oops, this also need to be loaded in luna.lua episode script
Re: SMBX Custom Inventory System (1.0)
Posted: Wed Feb 24, 2021 3:20 pm
by ShadowLabrys101
How can implement this code so that you can make Toad Houses that give you items for your inventory?
Re: SMBX Custom Inventory System (1.0)
Posted: Fri Jul 09, 2021 1:45 am
by Murphmario
How hard would it be to get this to work with MrDoubleA's SMWmap?
Re: SMBX Custom Inventory System (1.0)
Posted: Fri Jul 09, 2021 3:34 am
by Marioman2007
Murphmario wrote: ↑Fri Jul 09, 2021 1:45 am
How hard would it be to get this to work with MrDoubleA's SMWmap?
MrDoubleA told me to not to use this code, because Lusho is going to update it.
Re: SMBX Custom Inventory System (1.0)
Posted: Tue Jul 13, 2021 9:46 pm
by Lusho
Yeah, I have been planning to do this for a while, in fact I did a bit of it, but I haven't advanced enough on it, and i'm not sure on how long it will take until I actually get to finish it
Re: SMBX Custom Inventory System (1.0)
Posted: Thu Sep 16, 2021 8:33 pm
by JordanTRS
ShadowLabrys101 wrote: ↑Wed Feb 24, 2021 3:20 pm
How can implement this code so that you can make Toad Houses that give you items for your inventory?
I second this. It would be really useful to have this, as my own episode requires it too. Only problem is I want mine to be random, but only have a select few powerups you can get from each toad house (for example, world 1 will only have mushrooms, fire flowers, and leafs while world 6 has hammer suits and some others)
Re: SMBX Custom Inventory System (1.0)
Posted: Fri Sep 17, 2021 12:47 am
by Marioman2007
JordanTRS wrote: ↑Thu Sep 16, 2021 8:33 pm
ShadowLabrys101 wrote: ↑Wed Feb 24, 2021 3:20 pm
How can implement this code so that you can make Toad Houses that give you items for your inventory?
I second this. It would be really useful to have this, as my own episode requires it too. Only problem is I want mine to be random, but only have a select few powerups you can get from each toad house (for example, world 1 will only have mushrooms, fire flowers, and leafs while world 6 has hammer suits and some others)
Code: Select all
function onEvent(eventName)
if eventName == "yourEventNameHere"
inventory.addPowerUp(itemID, amount)
end
end
Re: SMBX Custom Inventory System (1.0)
Posted: Tue Sep 21, 2021 8:57 pm
by ChunkyChimp
I see there is the PWING as an inventory item option. How do you actually get this?
Re: SMBX Custom Inventory System (1.0)
Posted: Fri Nov 19, 2021 10:31 pm
by MrCool422
how come i've got an error

i've got the lua code right
Re: SMBX Custom Inventory System (1.0)
Posted: Sat Nov 20, 2021 7:54 am
by Marioman2007
MrCool422 wrote: ↑Fri Nov 19, 2021 10:31 pm
how come i've got an error

i've got the lua code right
Can you share the code??
Re: SMBX Custom Inventory System (1.0)
Posted: Thu Nov 25, 2021 4:58 pm
by MrCool422
marioman2007 wrote: ↑Sat Nov 20, 2021 7:54 am
MrCool422 wrote: ↑Fri Nov 19, 2021 10:31 pm
how come i've got an error

i've got the lua code right
Can you share the code??
I've just put in this: local inventory = require("customInventory")
What i did wrong?
Re: SMBX Custom Inventory System (1.0)
Posted: Mon Apr 25, 2022 1:36 pm
by RadMetalMarioSMIX
Can this Inventory support custom power-ups?
Re: SMBX Custom Inventory System (1.0)
Posted: Wed Apr 27, 2022 10:51 am
by Danat Nukem
RadMetalMarioSMIX wrote: ↑Mon Apr 25, 2022 1:36 pm
Can this Inventory support custom power-ups?
Thats pretty good question, i wanna know about this too.
Re: SMBX Custom Inventory System (1.0)
Posted: Wed Apr 27, 2022 10:56 am
by Mal8rk
RadMetalMarioSMIX wrote: ↑Mon Apr 25, 2022 1:36 pm
Can this Inventory support custom power-ups?
It could theoretically support custom power-ups, but you will have to add a new icon for the power-up you want to add, and then make it so that the code registers the power-up
This is what I think will work
Re: SMBX Custom Inventory System (1.0)
Posted: Thu Apr 28, 2022 1:26 am
by LawrenceindaSky
I am super new still to Lua related stuff on SMBX2, how would I call the script? I've tried to 'Edit raw user data' and tried putting adding the item but I am certain I need something like "if interacted = do this" but I am unsure how it all works out.
Thank you so much in advance!