RadMetalMarioSMIX wrote: ↑Sun May 25, 2025 1:38 am
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?
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!
The code for the event would look something like this:
Code: Select all
local inventory = require("simpleInventory")
function onInventoryItemAdded(eventObj, slot, quantity)
local idx = inventory.getSlot(slot)
SaveData.inventory[idx].quantity = 99
end