SmeeDucks

Villager
Member
Joined
Jan 19, 2020
Messages
10
Reaction score
3
First Language
English
Primarily Uses
RMMV
I was looking for a plugin/method that would restore HP (and MP) based on the increase of MHP between levels after level up. This is similar to what happens in Pokemon where if a actor is at 245/250 HP and they level up with a MHP increase of 5, their HP becomes 250/255. If they leveled up again with a MHP increase of 7, then their HP becomes 257/262. All the plugins I have looked at involve a full heal, which is not what I am looking for. There is Hime's Level Up Event's (http://himeworks.com/2015/10/level-up-events) though that seems to skip levels if you level up multiple times in a battle.

As far as I see my best bet is to create an event that runs after every battle, and using variables that track actor levels, when there is a difference in their level, calculate the difference between the new level MHP and the old MHP and add that to the actors current HP.

Thoughts?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
38,028
Reaction score
10,573
First Language
German
Primarily Uses
RMMV
though that seems to skip levels if you level up multiple times
Tsulihime has another script for queuing common events, that is exactly to prevent this overwrite of one common event call with the next one.

you can do this with your common event after each battle, you only need to have different variables for each actor.
just make that common event a parallel process with the switch turned on on turn 0 of the battle and turned off as soon as all calculations are complete.
 
Joined
Feb 29, 2020
Messages
2
Reaction score
0
First Language
German
Primarily Uses
RMMV
Hello Smee,

what do you mean by "MHP"? Is it a variable?

In pseudo code I would say:
Code:
function onLevelUp (newLevel, oldLevel) {
    var currentHp = getCurrentHp(); // e.g. 200
    var fullHp = getFullHp(); // e.g. 250
    var mhp = getMhp(); // Whatever this is, e.g. 5

    setCurrentHp(currentHp += mhp); // So currentHp would be 205
    setFullHp(fullHp += mhp); // So fullHp would be 255
}

How to hook into an event after levelUp and how to get and save current/full HP is up to your project, I guess.

Updating the HP after the battle would be very unusual.

Best regards
Nick
 

Latest Threads

Latest Profile Posts

Shoot.gif
Because The Fury from Metal Gear Solid 3 is one of my favorite bosses of all time, I felt the need to make a somewhat similar boss for my own game. taking cues from both the Fury and another awesome astronaut boss, Captain Vladimir from No More Heroes 2.
RE4make almost had me with their demo until I got to the dog stuck in a bear trap and realized that he was dead and could no longer be saved. Just not the kind of reimagining I'm interested in.
Here's some dudes that I'm drawing for Jimmy's Quest!
autredo.png
Autism Acceptance Month 2023!


Did this randomly in my free time, I guess today is a good day to show it.

Forum statistics

Threads
130,023
Messages
1,207,113
Members
171,288
Latest member
oscerr
Top