JackyBranthe

Villager
Member
Joined
Apr 30, 2021
Messages
5
Reaction score
4
First Language
English
Primarily Uses
RMMV
I'm trying to make an event NPC sparring enemy. In this case, a common town guard that the player can ask to spar with and test out their skills on.

Is there a way to retain HP/MP before and after fighting this NPC?
Like if the player fights with their character at 250/300 HP, no matter how much damage you receive win or lose, you always go back to being at 250/300 HP after the fight.
 

gsuk

Veteran
Veteran
Joined
Jun 24, 2013
Messages
158
Reaction score
12
First Language
English
Primarily Uses
RMVXA
Define 2 variables: one for HP and one for MP. set the HP variable to game data: Actor's HP, and the MP variable to Actor's MP. Save these numbers at the beginning of the sparring event (you can do this in the event itself, or in a common event triggered when the spar event starts).

Once the fight event is over, you can Change HP (player) -9999, then + the HP variable. Same for MP. This effectively reduces HP and MP to zero, then adds the value you saved in the two variables before the sparring event begins.

Your character's HP and MP should return to the values before the sparring started.

EDIT: I use VX Ace, so I don't know the exact settings names for MV, but the principle should be the same.
 

JackyBranthe

Villager
Member
Joined
Apr 30, 2021
Messages
5
Reaction score
4
First Language
English
Primarily Uses
RMMV
Define 2 variables: one for HP and one for MP. set the HP variable to game data: Actor's HP, and the MP variable to Actor's MP. Save these numbers at the beginning of the sparring event (you can do this in the event itself, or in a common event triggered when the spar event starts).

Once the fight event is over, you can Change HP (player) -9999, then + the HP variable. Same for MP. This effectively reduces HP and MP to zero, then adds the value you saved in the two variables before the sparring event begins.

Your character's HP and MP should return to the values before the sparring started.

EDIT: I use VX Ace, so I don't know the exact settings names for MV, but the principle should be the same.
I'll give it a try. Thanks!
 

Latest Threads

Latest Profile Posts

Been away for awhile, but here's some new free music. This one is kind of weird or experimental and not sure how I'd classify it. But, hopefully someone will find it useful!

I'm working with Excel today, and I just hate VBA so much. It's like the designers said "How can we make a programming language that works as obtusely and inefficiently as possible?"
Beep-Beep-Motha-facka.gif

Just finished and uploaded the delivery truck base/sprite sheet. I've been steadily replacing the default assets with early modern alternatives. The air-ship for a biplane, horse-drawn wagon for a delivery truck, and next a sailboat for a steam-powered passenger liner (think of the SS Olympic and RMS Titanic).
I caught a shiny magikarp on pokemonGO today AND finally saw Detective Pikachu and it was so cute and I'm still so hype AHHHHH!!!
one of the coolest things I've learned from the forums is the ability to give yourself a hitbox. I have a move you can do on the fields. shoulder tackle. thanks to the forums, that tackle triggers self A switches on some events. NPC's and the environment now react to the tackle. awesome.

Forum statistics

Threads
121,947
Messages
1,145,377
Members
160,220
Latest member
Trex1930
Top