Yanfly Buff and State Core + Item Durability: Updating Counter in Menu

Seacliff

RPG Maker Mastermind
Veteran
Joined
Nov 8, 2012
Messages
2,982
Reaction score
1,129
First Language
Yes
Primarily Uses
RM2k
Hello.

I am using Yanfly's Item Durability Plugin for the use of Weapons, but for the sake of the player's convenience I used Yanfly Buff and States Core to create a state and manipulate it's counter to display the current number of uses a Weapon has left.

Works like this:
<Custom Action End Effect>
var dur = user.equips()[0].durability;
if(dur >= 0)
{
user.setStateCounter(12, dur);
} else {
user.setStateCounter(12, "∞");
}
</Custom Action End Effect>

This will show the remaining uses of a weapon, unless the weapon is unbreakable in which case it just shows the infinity sign. Works just fine in combat. I also have the same code for a <Custom Battle Effect> to update the information when entering battle.

The problem I'm having is that because this is the only way for the state to update, any changes to weapons outside of combat will not reflect on the menu screen. So if the last battle ended with the remaining durability at 8, and the character decides to change to a weapon with a durability of 12, it will still display as 8 in the menu.

Unfortunately, Buff and States Core only provide conditions for updates that can happen in battle. If someone knows how to update the state when needed in the menu, like when the scene is updated when the character changes, that would defiantly help the game seem less clunky.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,093
Members
137,587
Latest member
Usagiis
Top