How to use batch potions instead of using it one by one when outside battle, let's say in menu? I am using RPG MV. Thank you.
How to use batch potions instead of using it one by one?
RPG Maker MV SupportIn order to allow the player to use multiple items at a time, there needs to be a modification to the item scene that changes the code where you can only use them one by one. I'm not aware of any current plugins that do this.
Oh never mind I was able to solve it via simple common events. Here, I am posting this guide because I think this might help someone in need someday because I know the feeling of being lost.
First, we just need to make the item unconsumable. Unconsumable? but why? Because it will be consumed right away before Common Event kicks in from item effects. If you will not do this, the item will be reduced by 1 every time the item processes the event so the quantity is already in an error.
Next, setup a variable let's say Variable 001 that auto monitors the live quantity of that item via Control Variables -> Game Data. (make sure this is Parallel Triggered)
Third, make a common event, let's just name it [Common Event 001] for example, that will process if player choses "All" or "1 item only" (or you can add number input too if you want, but for the sake of example I will just use 2 scenarios). This is achievable by a simple Show Choices:
A. when player chooses "1 item only", process whatever the use of that potion for example if it adds +10 Atk then say:
>[Change Parameter: Harold(for example), Attack + 10].
>Then do not forget to subtract 1 count for that item [Change Items: Potion -1].
> Lastly, place Control Variables -> Game Data same as what you did at Variable 001 to refresh the quantity value just to be safe. (idk if this is needed but for me I like to make sure it is updated after changes)
B. when player chooses "All", process the one you setup earlier that monitors live quantity of that item. Use a script like this or whatever you prefer:
>$gameParty.leader().addParam(2, 10* $gameVariables.value(1) ) // I used leader since I only have 1 member but you can use actors instead if you like.
> This provides the party leader a permanent +10 ATK bonus per quantity
> Then do not forget to subtract exact count for that item [Change Items: Potion - {Variable 001} ].
> Lastly, place Control Variables -> Game Data same as what you did at Variable 001 again to refresh the quantity value just to be safe. (idk if this is needed but for me I like to make sure it is updated after changes)
Fourth, place the common event [Common Event 001] on the potion Effects tab.
(The power of common events because I do not have any programming backgrounds.)
First, we just need to make the item unconsumable. Unconsumable? but why? Because it will be consumed right away before Common Event kicks in from item effects. If you will not do this, the item will be reduced by 1 every time the item processes the event so the quantity is already in an error.
Next, setup a variable let's say Variable 001 that auto monitors the live quantity of that item via Control Variables -> Game Data. (make sure this is Parallel Triggered)
Third, make a common event, let's just name it [Common Event 001] for example, that will process if player choses "All" or "1 item only" (or you can add number input too if you want, but for the sake of example I will just use 2 scenarios). This is achievable by a simple Show Choices:
A. when player chooses "1 item only", process whatever the use of that potion for example if it adds +10 Atk then say:
>[Change Parameter: Harold(for example), Attack + 10].
>Then do not forget to subtract 1 count for that item [Change Items: Potion -1].
> Lastly, place Control Variables -> Game Data same as what you did at Variable 001 to refresh the quantity value just to be safe. (idk if this is needed but for me I like to make sure it is updated after changes)
B. when player chooses "All", process the one you setup earlier that monitors live quantity of that item. Use a script like this or whatever you prefer:
>$gameParty.leader().addParam(2, 10* $gameVariables.value(1) ) // I used leader since I only have 1 member but you can use actors instead if you like.
> This provides the party leader a permanent +10 ATK bonus per quantity
> Then do not forget to subtract exact count for that item [Change Items: Potion - {Variable 001} ].
> Lastly, place Control Variables -> Game Data same as what you did at Variable 001 again to refresh the quantity value just to be safe. (idk if this is needed but for me I like to make sure it is updated after changes)
Fourth, place the common event [Common Event 001] on the potion Effects tab.
(The power of common events because I do not have any programming backgrounds.)
@jeromemanzon
just a few comments to your solution:
1) keep in mind that while the results look similar, this is not the same as you originally asked. There are a few item effects that cannot be done the exactly same way by event commands.
2) do not use any parallel process here - place the control variable to load the item count at the beginning of your effect common event instead. Parallel Processes can lag your game a lot, especially if you have not yet learned how to use wait with parallels.
3) for future reference, don't write leading zeros for any ID. It's common event 1, not common event 001.
there is no difference to the editor, but if you ever start to use script commands then the leading 00 can mess up your numbers, so don't start with that bad practice.
just a few comments to your solution:
1) keep in mind that while the results look similar, this is not the same as you originally asked. There are a few item effects that cannot be done the exactly same way by event commands.
2) do not use any parallel process here - place the control variable to load the item count at the beginning of your effect common event instead. Parallel Processes can lag your game a lot, especially if you have not yet learned how to use wait with parallels.
3) for future reference, don't write leading zeros for any ID. It's common event 1, not common event 001.
there is no difference to the editor, but if you ever start to use script commands then the leading 00 can mess up your numbers, so don't start with that bad practice.
thanks I'll take that as constructive criticism
Original thread: https://forums.rpgmakerweb.com/threads/how-to-use-batch-potions-instead-of-using-it-one-by-one.159858/