How to recover HP and MP when you level up?

Status
Not open for further replies.

Btobin98

Villager
Member
Joined
May 30, 2012
Messages
25
Reaction score
1
First Language
English
Primarily Uses
The name says it all. Is this done through the script editor? or the Database? I'm almost positive this can be achieved through one of those but I have been unable to find it.
 

SOC

Be your own hero
Veteran
Joined
Mar 22, 2012
Messages
570
Reaction score
490
First Language
English
Primarily Uses
RMMV
You'll have to do it in the scripts.
 

Yato

(aka Racheal)
Veteran
Joined
Mar 17, 2012
Messages
825
Reaction score
346
Primarily Uses
More specifically,



Code:
class Game_Actor < Game_Battler
  alias heal_on_level_up level_up
  #--------------------------------------------------------------------------
  # * Level Up
  #--------------------------------------------------------------------------
  def level_up
	heal_on_level_up
	recover_all
  end
end
The above will also remove states. If you don't want to remove states, use this instead:



Code:
class Game_Actor < Game_Battler
  alias heal_on_level_up level_up
  #--------------------------------------------------------------------------
  # * Level Up
  #--------------------------------------------------------------------------
  def level_up
	heal_on_level_up
	@hp = mhp
	@mp = mmp
  end
end
 
Last edited by a moderator:

Btobin98

Villager
Member
Joined
May 30, 2012
Messages
25
Reaction score
1
First Language
English
Primarily Uses
More specifically,



Code:
class Game_Actor < Game_Battler
  alias heal_on_level_up level_up
  #--------------------------------------------------------------------------
  # * Level Up
  #--------------------------------------------------------------------------
  def level_up
	heal_on_level_up
	recover_all
  end
end
Thanks this is just what I was looking for! Could you also tell me where in the Game Actor < Game Battler script to place this please? :huh:
 
Last edited by a moderator:

Yato

(aka Racheal)
Veteran
Joined
Mar 17, 2012
Messages
825
Reaction score
346
Primarily Uses
You can just insert that scriptlet anywhere in the materials section.
 

Celianna

Tileset artist
Veteran
Joined
Mar 1, 2012
Messages
10,557
Reaction score
5,591
First Language
Dutch
Primarily Uses
RMMV
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

My pumpkin! Anyone like Fallout?

It's not terrible, but could be better. This thing took me over an hour to carve. :kaophew:

Dad's watching a WWII documentary while I work on some cool assets for my games. I just love RPG Maker!
Also Happy Halloween! Dad's friend won't be coming unfortunately, but Dad will still be taking me to Boxi Park to have some fun tonight! I'll be posting a video on my YouTube channel of the show, and I'll be sure to post a link here.
"Nightmares exist outside of logic and there's little fun to be had in explanations. They're antithetical to the poetry of fear. In a horror story the victim keeps asking why, but there can be no explanation and there shouldn't be one..." - Stephen King
I feel people seek explanation and demand it sometimes in games, but in the horror genre, well, maybe you shouldn't have one. Silent Hill 1 comes to mind...
Managed to implement QSprite.

Always double check your plugin order.


Finally! I've been puzzling over why it wasn't working for two days now. Turns out all of my calculations were correct, I just forgot to give some events hitboxes. :kaoswt: Now my randomly generated maps check for collision errors, and move stuff around in real time if they finds any. :LZSexcite:

Forum statistics

Threads
104,682
Messages
1,008,069
Members
136,171
Latest member
emcautley1
Top