Numbers Rollout

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,282
Reaction score
106
First Language
Irish
Primarily Uses
N/A
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?
 

Resonance

Veteran
Veteran
Joined
Oct 25, 2015
Messages
43
Reaction score
6
First Language
English
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.
 

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,282
Reaction score
106
First Language
Irish
Primarily Uses
N/A
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.
 

Kino

EIS Game Dev
Veteran
Joined
Nov 27, 2015
Messages
515
Reaction score
676
First Language
English
Primarily Uses
RMMV
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.
 

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,282
Reaction score
106
First Language
Irish
Primarily Uses
N/A
I will try this right now, thank you.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

colorize an old sketch
Welp... with numerous plugins and a bit of Javascript help, I've simulated an AP system in battle. Proud of myself honestly.
Why most of games like to give a horrible control to an aircraft vehicle? can I get a simplified control that does not require me to roll first just to change my direction?
Homie, this so amazing! Old but Gold :)
I cannot get the Benny Hill Theme out of my head

Forum statistics

Threads
93,427
Messages
912,247
Members
122,936
Latest member
Trackline
Top