Changing actor's sprites depending on HP level

redmedved2

Villager
Member
Joined
Nov 2, 2020
Messages
9
Reaction score
1
First Language
Russian
Primarily Uses
RMMV
Hey everyone, need help with events programming.
I have 2 plugins, one can change actor's sprite in battle and another one changes the sprite in menu. Both are controlled with plugin commands, so to change sprite I need either an event or a battle to activate command.
Question is, how do I need to setup this if I want the sprites to change while actor's HP drops below 66 and 33% points, BUT I don't want it to return to the original state until characters are in the field.
So, the concept is, characters can heal wounds in the field, but they can't repair their armor with just a potion. And sprites showing scratches on their armor and how bad it is.

Now technical.
Let's say I have 4 characters, so in every battle event I can create 8 pages (2 on a character). Pages contains triggers when someone's HP drops below certain level and changing their sprite instantly. That would've worked great, if I had just 2 sprite states, but I want to make 3 or even 4 transitions, and the problem is, that in one battle it works great.

But let's say. The character have 10% HP and wins battle. His sprite is maximum damaged. Battle ended, he healed himself, now it's 100% HP, but sprite is still damaged, everything is cool... Until next battle starts. In the second battle when this character's HP drops below 66%, sprite will be changed from maximum damaged to medium damaged again, that is the problem and that's why I need help.
I think, it can be done with switches, so when sprite changing to next "damage level", the system is locking it and it can't be changed to "upper damage level"never again, only lower, but I don't know how to implement all of this.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,420
Reaction score
7,709
First Language
German
Primarily Uses
RMMV
you basically need to check the past status of the armor with conditional branches in the troop events.
So they only change the sprite if the HP drops to that point AND the armor wasn't damaged more at an earlier point. Should probably use variables (actor X armor %) instead of switches if you have more stages than two.
 

redmedved2

Villager
Member
Joined
Nov 2, 2020
Messages
9
Reaction score
1
First Language
Russian
Primarily Uses
RMMV
you basically need to check the past status of the armor with conditional branches in the troop events.
So they only change the sprite if the HP drops to that point AND the armor wasn't damaged more at an earlier point. Should probably use variables (actor X armor %) instead of switches if you have more stages than two.
Just tried it, works perfect, thank you, as always. Actually first time worked with conditional branches, god, there is so many posible options, looks quite hard.
 

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

Latest Threads

Latest Profile Posts

This is relevant so much I can't even!
Frostorm wrote on Featherbrain's profile.
Hey, so what species are your raptors? Any of these?
... so here's my main characters running around inside "Headspace", a place people use as a safe place away from anxious/panic related thinking.
Stream will be live shortly! I will be doing some music tonight! Feel free to drop by!
Made transition effects for going inside or outside using zoom, pixi filter, and a shutter effect

Forum statistics

Threads
105,998
Messages
1,018,218
Members
137,777
Latest member
Bripah
Top