Inventory limit and Storage

I have Yep Item Core, that have one option to create inventory limits, or specifically, item limits. Normally items have a limit of 99, but i reduced it depending of the item to make a better balance in the game. For that i want to introduce an storage system, to save your items when you have no space in your inventory.

The thing i don´t like at all, and it can be a bit unfair is that a player could get an item, but the item capacity is full, resulting in losing the item because he/she took it but the game would not allow to exceed that limitation.

My question is: The is a way to make the item go to the storage automatically when the player pick one that would exceed the limitation? Or at least the game not allowing you to get it for the same reason?
I think theoretically you would need to check for the item count and if its like x > y (y is your cap number) you could always have a Ressource Check to make variables for some items. Once it reaches a certain point you issue a +1 into storage instead

Let's say we have an item Stack-Limit of 15, we check if that variable is lower than 15. If it's higher than that we WON'T increase the Variable in our Inventory and we will send a +1 of that item into your storage. How to code that one is out of my reach right now but I have a certain idea how to implement it.
You'd have to overwrite the gainItem function to check the amount of the item in the party's inventory + the item amount gained. If over the maximum, change the inventory amount to the maximum, then call the add item command from the storage plugin of your choosing and add the remainder to the storage.
You'd have to overwrite the gainItem function to check the amount of the item in the party's inventory + the item amount gained. If over the maximum, change the inventory amount to the maximum, then call the add item command from the storage plugin of your choosing and add the remainder to the storage.
I have the storage plugin, and it seems that one adapt to the item limit, because don´t leave take more items from the storage if i have the max amount, so there is no problem.

How i overwrite the gainItem function? I mean, where is the function?
How i overwrite the gainItem function? I mean, where is the function?
It's in rpg_objects.js, but YEP Item Core also overwrites it so you need to overwrite that version. I suspect you don't know what you're doing though so I wouldn't recommend it.
It's in rpg_objects.js, but YEP Item Core also overwrites it so you need to overwrite that version. I suspect you don't know what you're doing though so I wouldn't recommend it.
I could make a copy in case i screw up something. I don´t know what i would have to do in the Yep item core code.
I could make a copy in case i screw up something. I don´t know what i would have to do in the Yep item core code.
I told you in general terms what needed to be done. If I have to tell you the exact lines of code to write and where to put them it would be faster to do it myself. If you want to do it, you should take some time to learn Javascript so you understand what you're looking at.

This is not an easy task for a beginner because you are combining the functions of two plugins, and also have to understand the original gainItem function because Yanfly just aliases it in his code.
I told you in general terms what needed to be done. If I have to tell you the exact lines of code to write and where to put them it would be faster to do it myself. If you want to do it, you should take some time to learn Javascript so you understand what you're looking at.

This is not an easy task for a beginner because you are combining the functions of two plugins, and also have to understand the original gainItem function because Yanfly just aliases it in his code.
That is the thing, i don´t know almost nothing about programming. RPG Maker is very easy to use, but doing more advanced things like i want requires knowledge about the code. Like i said in other moment, i´m just preparing this project because i have another almost finished. And when i finished the other, begin with this one.

Original thread: https://forums.rpgmakerweb.com/threads/inventory-limit-and-storage.161567/