SmeeDucks

Villager
Member
Joined
Jan 19, 2020
Messages
10
Reaction score
2
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
34,763
Reaction score
8,975
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 Posts

Latest Profile Posts

Another thumb update. The nail is beginning to break away, along with the aforementioned hard and blackened dead skin. The final join has regained some of its flexibility, tho it's a bit stiff after being held still for so long. The very tip of my thumb has a strange dry and somewhat tingly feeling to it when I touch it to something, but at least it isn't numb. I am so ready for this to be over. :o
Can I get away with calling a "shortsword" a dagger and not a sword?
So here's the full cycles, I'm not so familiar with actually animating and giving motion so any observation on that matter would be really helpful! :kaoswt:
EfGHbLh.gif

Just now I realized I didn't scale it up so its smol...
I wanna make a YouTube video about reviewing a game, but I don't know what RPG Maker game I should play...
Guarii wrote on TSR's profile.
I want to create a OneShot style inventory. Without having the weapons and armor sections. Just the items. How can I do this?
images

Forum statistics

Threads
118,705
Messages
1,118,056
Members
155,834
Latest member
Amaginus
Top