Numbers Rollout

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,281
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,281
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
556
Reaction score
794
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,281
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 Profile Posts

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

Forum statistics

Threads
105,868
Messages
1,017,072
Members
137,578
Latest member
JamesLightning
Top