Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Cookie Cutter MZ - Bank System

A project template for RPG Maker MZ. Copy and paste it into your own project to utilize a custom evented bank! · By Caz

Is There A Way to Deposit More Than One of an Item Per Slot?

A topic by Storm of Sunbeams created Mar 06, 2025 Views: 67 Replies: 3
Viewing posts 1 to 2

Hi there! As the question asks, is there a way to deposit more than one item per slot? Say I want to deposit 99 potions in one slot instead of just one potion, is there a way to make that possible? Since it uses actual script to define the variables, I'm at a loss. I'd love to have an answer, because I use these templates as learning material as much as anything. I can figure out how to manage about everything else I need (I think), but I'm at a loss when it comes to this. Thank you in advance either way!

Developer

Yep, that's totally possible! 

- You'll need to include an extra section of dialogue after selecting an item, where the player is asked a quantity for their deposit. Make a new variable for each slot for the quantity of each item, and use the Input Number to store the player's desired quantity to the relevant variable. 

- Make a Conditional Branch that checks if the player is carrying the same amount or more of the number they put in. If they don't, return all the slot variables to zero. But if they do, you can keep the Input variable as it is. Make sure to remove the quantity of items from the player's inventory.

- When it comes to withdrawing the items, make sure to return the quantity in the variable to the player's inventory. Be mindful if your game has an item limit (the default is 99) that the player doesn't receive too many and some of the withdrawal gets wasted. You can get around that by creating another variable that checks how many items the player has, and compare it against the bank slot quantity.

- There is a script call to work out how many items the player is carrying if that helps too. You should be able to use $gameParty.numItems(1) to find the quantity of item ID 1 the player is carrying. You can also use variables inside that script call, so try $gameParty.numItems($dataItems[$gameVariables.value(1)]) to find the quantity of items under the item ID stored in variable 1.

I hope that makes sense! :D 

(1 edit)

Thank you for the help! I have it mostly figured out I think. I am getting stuck on something, and thus can't really figure out anything beyond that point: I can get items to go into the storage fine, but I can't get them out. They are 'eaten' essentially--when I try to remove items, it empties the storage slot but doesn't give back any items. I don't know if Input Number isn't going to the variable properly for data storage or what the issue might be. I've worked on it all day to no avail, so I thought I'd come back here with that update. The variable on Input Number for the items in and items out should be the same, correct? Or should there be a separate variable for items in and one for items out? I don't think that's where it's stuck, but it's an idea. I think it's getting stuck on this bit here from what the debug menu said: (variable 454 is Deposited Item Quantity, so the Input Number; 416 is Selected Slot ID)

$gamePart.gainItem($dataItems[$gamevariables.value(416)], [$gameVariables.value(454)]); 

Once I get past that point, I might end up with more questions, but right now that's where I'm stuck. Everything else to that point is working perfectly fine.

Editing to add: thank you for all your help, and I'll still keep all this info as a learning experience, but I found a plugin that does what I need in a way that better suits my game, so no worries on getting back to me with answers! 

Developer

Glad you found a solution that works better for you!

For anyone else having this issue: 

You can press F9 while playtesting your game to see the values of switches and variables, so you can check if the value of the deposit variable is what it's supposed to be. 

The variable for the amount of items being deposited into the bank needs to be stored somewhere that it's not going to be changed until it's withdrawn, so it should be put into its own "Slot 1 Quantity" variable until it needs to be read later when the item is taken back out.

Hope that helps, and I hope it helps you learn more about RPG Maker too! :D