Trying to retain HP% when Max HP changes due to states added/removed

PennGuino

Villager
Member
Joined
Aug 31, 2020
Messages
8
Reaction score
0
First Language
English
Primarily Uses
RMMV
I'm pretty new to RPG Maker MV (and this forum), so this may be a dumb question. I don't think it is, however, because I've done hours of research trying to find answers and figure this out, to no avail.
Here's a rundown of my issue.

Actor Alvin has a MHP of 20. State Super is applied to Alvin, which alters Param MHP 150%, resulting in new MHP 30. Alvin then takes 15 damage. Alvin is at 50% MHP. Super is removed by a skill, causing Alvin's MHP to return to normal: 20. However, Alvin's current HP is still 15. I need Alvin's current HP to be the same percentage after Super is removed as when it is applied. So for the above example, I want Alvin to go from 15/30 HP to 10/20 HP, not 15/20 HP.

I also have a State Weaker that, when applied, alters Param MHP 75%, and I need it to work the same way, setting Alvin's current HP to the same percentage as it was before Weaker was removed. For example, when Weaker is applied, Alvin's MHP is 15. Alvin takes no damage. When Weaker is removed, Alvin's MHP is now 20 again, but his current HP is still 15, even though he took no damage.

I've exhausted my admittedly limited understanding of the system and have spent several hours researching this. Maybe I'm just looking in the wrong places or going about the problem incorrectly. I'd really appreciate any insight or help that could be offered.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
Unfortunately there's no real way to solve this using default functionality, because there's no way to explicitly know when a state is added/removed. You have to use plugins. You could approach it one of two ways:

While a somewhat-useful version of this could probably be rigged up using State Remove tags in Yanfly's Buffs & States Core, your best bet is probably to create your own custom plugin to calculate the HP% before a state (or other database item) with a Max HP state is removed, and then set the battler's HP afterwards to keep that same percentage... or to request such a plugin on the JS Plugin Requests board; this is probably a do-able plugin that someone could help you with.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

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.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,569
Latest member
Shtelsky
Top