Numbers Rollout

I would like to ask if there's a simple way to rollout the numbers in the battle status when you take damage? Rollout meaning I want the numbers to slowly change instead of them going directly to the value my hp / mp currently is. So if I have 10 hp and I got hit by 6, the HP number slowly drops from 10 - 9 - 8 - 7 - 6 - 5 - 4?
Create another variable to keep track of "displayed hp".


In your functions that draw the text/bars, make it compare the "real hp" vs "displayed hp". When there's a discrepancy between the two, increment "displayed hp" towards the "real hp", then draw the new "displayed hp".


Now it'll just constantly draw new "displayed hp" values until it reaches the "real hp" value.
It sounds like a possible idea, but wouldn't the oldHp variable something you can access inside the current drawn values? This means you have to get it inside drawActorHP itself. So it would just return the current HP rather than getting an old hp.
One other option I think which is kind of like Earthbound, since they had hp that goes down slowly( this is if you don't want the actor to die immediately upon taking lots of damage).


You would essentially want to not really change drawActorHp.


Instead, when a character takes damage, you record that damage and subtract that damage from the actor hp over a certain amount of frames, until the recorded damage is 0.


The other option mentioned above I think still requires that you check when the actor takes damage, and you store their hp before the hit takes place that would subtract from their health pool.


I just checked and it seems BattleManager.invokeAction is where actions are invoked in battle; it takes a subject and a target parameter, so this might be a good place to make modifications or capture the hp information that you need.
I will try this right now, thank you.

Original thread: https://forums.rpgmakerweb.com/threads/numbers-rollout.66367/