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,973
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

Doing clean-up on tall-ified sprites, filling in pixel by pixel where the stretching warped the image, feels incredibly tedious but also highly rewarding when one zooms out and the sprite looks even better than before.
I found this app on the playstore and I'm loving it, it's very good for organizing project ideas
hmm one of those days where there's a lot to work on with my game... annnnnd I have no idea what I wanna do. most of it tho, involves drawing lol. either enemies or NPCs.
I'm going back to the default RTP, in the interest of getting it done. FSM is lovely but slow to work with and has tall doors. And switching to tall sprites would mean a lot of franking, and also the horses will be small.

Forum statistics

Threads
118,577
Messages
1,117,078
Members
155,633
Latest member
raylux92
Top