Hello.
Is there a way to check with a script (to use in a conditional branch) how many items do I carry, in total? Only items, not armors, neither weapons or key items.
For example: if inventory_size is > 30 then do something.
Thank you.
Does it have to be a script?
Usually that is done with control variable : game data, and you should be able to search for the script equivalent of that event command in the script equivalent list here on the forum if you really need this as a script command - but if you intend to use it in a conditional branch anyway, then load that game data into a variable with the control variable command and check the variable with the conditional branch.
Well, I don't know... I was supposing that it should be done with scripting. Can you please tell me how to load that game data into a variable?
EDIT: oh, I got it. But it doesn't work for me, because I need the total amount of all items you have, not just one. I mean, the way you said I can check how many Potions I have and load it into a variable, but I cannot check how many Potions and Elixirs I have, sum up them, and load it into a variable. I need a way to check all items at once.
You add the control variable command, select which variable you want to store the info into.
Then you select "game data" from the bottom area (defaults to map ID) and after that, click on the dots to the right to open the game data window. the rest should be self-explaining.
One additional comment however: if you're looking for the sum of all items instead of how many of one item is in inventory, then you have no choice but to add the values of all items together manually. And that can't be done differently with a script, because the engine never adds the item numbers for a combined inventory.
If that is what you seek, you better make a common event for those calculations and simply call that whenever you need that number as it will require one control variable command for each item in your database.
What a great idea, to use the common event... That will require a lot of work, but it should do it! Thank you for lighting the things up for me, I really appreciate it.