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,288
Reaction score
8,741
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

Phew, sleep all day, awake all night. I don't know what to draw tonight!

Does that count as poetry? ..Is there a super fast way to test my creations in RPG Maker? Has anyone played the new Pokémon games? I'm itching to buy it but I don't think my husband will want me to after he finds out how much I spent on Christmas!
When can we get this?
RPG Maker MZ Saturn.png
Saturn port when?
I'm new to rpgmaker mv, link me some good stuff to learn.
Finally, I have graduated from college and now I can put a lot more work into my game, after having not worked on it for the better part of a year.
post so i can change my profile picture ^^

Forum statistics

Threads
117,070
Messages
1,104,292
Members
153,048
Latest member
kingjui7
Top