[RM2K3] RESTORE HP AND MP WHENEVER CHARACTER LEVELS UP?

Posts

Pages: 1
I want the HP and the MP to restore whenever the hero levels up, please help
The quick solution would be to make a Parallel Process common event that does something like this:


if(Variable Hero1LastLevel == 0)
Variable Hero1LastLevel = Hero1's Level

Variable TempLevel = Hero1's Level
if(Variable TempLevel > Variable Hero1LastLevel)
Full Heal Hero1
Variable Hero1LastLevel = Hero1's Level

(repeat for all heroes)

Wait 0.1s (don't forget this else your game fps will tank)


I can't check the name of the 2k3 commands to do this right now but that's the general idea.
you could probably do this as well for a myriad of other interesting effects like controlling growth yourself (say you want random stats on level up or stats that depend on the weapon), distributing ability points to use on an ability tree etc
Corfaisus
"It's frustrating because - as much as Corf is otherwise an irredeemable person - his 2k/3 mapping is on point." ~ psy_wombats
7874
Assuming you don't want anything flashy, this is all you'll need.


Essentially what this is saying is that if the hero's initial level and current level are the same, do nothing. If they're not, heal the party and set the base variable to the new value. It's only ever going to do anything if something has changed.

Of course if your game has multiple heroes, you'll want to have different copies of this Conditional Branch with its own Variables set to each hero. Also, you'll want to set each full heal to its specific hero if that's another thing you want to do. This is just the simplest way (vanilla/vague coding) to tackle a full heal from a hero leveling up.

Sure, it'll heal you when you first start up a new game, but you'd literally never notice anything happened seeing as your character would already have started at Max HP and MP. Even if your first line of code was to decrease the Hero's HP or MP, this would already have ran its first cycle seeing as RPG Maker 2003's program runs all database code (including Common Events) before it runs map-based code.

author=GreatRedSpirit
Wait 0.1s (don't forget this else your game fps will tank)

Maybe if you're running on a calculator from the 90s. Something this simple shouldn't cause any noticable slowdown regardless of how garbage your rig is. The program will stop letting you run multiple Parallel Processes before lag becomes a problem.
author=Corfaisus
author=GreatRedSpirit
Wait 0.1s (don't forget this else your game fps will tank)
Maybe if you're running on a calculator from the 90s. Something this simple shouldn't cause any noticable slowdown regardless of how garbage your rig is. The program will stop letting you run multiple Parallel Processes before lag becomes a problem.

You should still include the wait 0.1. RPGMaker 2k3 was not coded well and has a super-human ability to find ways to lag in places it shouldn't. Besides, one major advantage to using an old program like rm2k3 is that it can still run on some pretty lousy machines. No sense in ruining that just because you chose to omit a single line of code.
Pages: 1