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,604
Reaction score
5,067
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

Lately when I listen to 1970s songs, I always think that the "real world" is still at mid 70s. What we experience now is a futuristic dream. With this point of view, even 80s and 90s looks super futuristic. :D

The GIF of this seemed too cool to bury in replies. :LZSwink:
You may have slept with my aunt... but, given the circumstances, cheers.

- Professor Ian Duncan, 2013
Ami
--- Swimming ---

F.Knight: This Shrine always Flood. We don't have a choice,we have to Swimming in this place
F.Healer: That Insane!
F.Mage: We can use…Boat,rather than Swimming
F.Knight: You guys…Can't Swim?
F.Healer & F.Mage: (Shocked) Eehh??

Forum statistics

Threads
105,525
Messages
1,014,391
Members
137,209
Latest member
RowanWolf
Top