Basically what the title says. I'm wondering if there's a way to track the total number of items, not just the amount of a single item. If the total is over a certain number or higher, chests won't open. If possible, I'd prefer it to be tracked with a variable or in a conditional branch, but any way possible will be fine.
Example: The player has 3 potions, 10 max potions and 1 elixir. The game will register the total as 14, since that is the amount of all the items added up.
Thanks in advance!
(This is for MV if this somehow gets placed in the wrong category)
nothing automatic.
the simplest version would probably be a common event that uses two vaariables to add the total number of items together, with one control variable command for each item in the list.
A scripted loop would also be a possibility, but that would really add everything including hidden items that are often used for triggers without the player seeing them in the inventory.
You would also have to event a shop (if your game uses shops) not use the shop processing. May i suggest a mechanic to go with what you want to do? Bartering with items. You can trade multipules of an item to get a slightly better item for free. You wouldn't be able to do something like 100 potions for the legendary-sword-of-bad-assery. But you could trade three potions for two refined potions. Or four spears-of-fae-might for one legendary-sword-of-bad-assery
It would be annoying for the player if they had to throw away items or sell a bunch of items and not buy anything every time they were about to go into a dungeon
I'm on my work pc so don't have MV at the moment, but isn't the $gamePlayer._items just an array, where the index is the item number and the value is the count? Is there an array method that adds up all the elements in the array?
Also, when you say 'items' do you mean 'items' and 'weapons' and 'armors', and does that include what's equipped?