Re: simpleInventory.lua [v1.0] - Yet another Bowser's Fury-inspired inventory!
Posted: Thu May 22, 2025 10:50 pm
How would I remove Power-Ups I don't want in the inventory system? Like the Ice Flower for Example?
Forums for SMBX
https://www.smbxgame.com/forums/
I'm pretty sure you should just be able to put this code in a luna.lua file:RadMetalMarioSMIX wrote: ↑Thu May 22, 2025 10:50 pmHow would I remove Power-Ups I don't want in the inventory system? Like the Ice Flower for Example?
Code: Select all
local inventory = require("simpleInventory.lua")
inventory.removeSlot("iceflower")
Well yeah, I would guess it doesn't get rid of it completely. but the Ice Flower isn't in the episode so I didn't want it's slot glaring at the player. Thank you very much! Also is there a way to make it so you have an unlimited amount of the power-ups in each slot?Lurrae wrote: ↑Fri May 23, 2025 12:24 amI'm pretty sure you should just be able to put this code in a luna.lua file:RadMetalMarioSMIX wrote: ↑Thu May 22, 2025 10:50 pmHow would I remove Power-Ups I don't want in the inventory system? Like the Ice Flower for Example?Obviously it only removes the inventory slot for the Ice Flower, it doesn't actually delete the Ice Flower from the game as a whole, but this should work for your use case hopefully!Code: Select all
local inventory = require("simpleInventory.lua") inventory.removeSlot("iceflower")
Yep- you can use the "creativemode" cheat! It gives you an infinite supply of all powerups until you type the cheat again, which reverts your inventory back to the state it was in before typing the cheat (so if you had 5 Super Mushrooms before enabling creativemode, those 5 Super Mushrooms will come back when you type creativemode again)RadMetalMarioSMIX wrote: ↑Sat May 24, 2025 3:45 amAlso is there a way to make it so you have an unlimited amount of the power-ups in each slot?
Well, I'm working on a Metroid Episode and I need it to only give infinite power-ups for the ones the player collects throughout the whole episode. Is there a way I can do that?Lurrae wrote: ↑Sun May 25, 2025 1:34 amYep- you can use the "creativemode" cheat! It gives you an infinite supply of all powerups until you type the cheat again, which reverts your inventory back to the state it was in before typing the cheat (so if you had 5 Super Mushrooms before enabling creativemode, those 5 Super Mushrooms will come back when you type creativemode again)RadMetalMarioSMIX wrote: ↑Sat May 24, 2025 3:45 amAlso is there a way to make it so you have an unlimited amount of the power-ups in each slot?
Oh, I see! There’s not currently a good way to do that, but there is an event that triggers when an item is collected. You could set the number of items in the slot to 99 when that happens as a temporary workaround? I’ll look into adding something more official in the next update!RadMetalMarioSMIX wrote: ↑Sun May 25, 2025 1:38 amWell, I'm working on a Metroid Episode and I need it to only give infinite power-ups for the ones the player collects throughout the whole episode. Is there a way I can do that?
Code: Select all
local inventory = require("simpleInventory")
function onInventoryItemAdded(eventObj, slot, quantity)
local idx = inventory.getSlot(slot)
SaveData.inventory[idx].quantity = 99
end