So again I have another problem with RAIDERS, if anyone could help me that would be great. I basically want an inventory function, which has three arrays: InventoryItems, InventoryNumbers, and InventoryImages. When you open the inventory it sorts these out into menu options with @richard’s mini-menu extension. You can throw away or eat some items in the game so I’m wondering, is there a way to check when one of the numbers is at zero, then delete that value from each array? I’ve gotten it to work with all the arrays except InventoryImages.
Here’s the project:
@eugeneredwing8 you can’t remove items from a minimenu that is already visible. you can, however, close the menu and reopen it with different menu items.
i would recommend defining a function for opening your inventory menu if you haven’t already. then when an items amount reaches 0, close the menu and call the function again to immediately reopen it
Yeah I’ve tried that and it works but it messes up the image, let’s say I have this in my inventory:
Leafimage LEAF x3
Vinimage VINE x2
Meatimage MEAT x1
Pebbleimage PEBBLE x4
Sapimage SAP x3
then I eat one meat
it now looks like this:
Leafimage LEAF x3
Vineimage VINE x2
Meatimage PEBBLE x4
Pebbleimage SAP x3
And it’s kind of weird when you have four pebbles that look like meat in your inventory.
What you need to do is search the item array with a
For (index) from 0 to ( (length of array (item array) ) - 1)
loop. That way, when you find an item with 0 things you can also remove the image in the same spot… or just have an array of the menu items? Idk I didn’t really look at your code lol
@richard if you look at the project, it won’t have any deletion at 0 technique in it, so here is a better version that does include it:
It doesn’t want to remove the image in the correct way.