Help - Search - Members - Calendar
Full Version: Actor Recover
RPG RPG Revolution Forums > Game Engines > RPG Maker VX Ace Discussion
katasu
when an actor levels up I want him to recover his hp and mp. So do I need a script or is there a way to do it with VXAce
amerk
You might be able to do it with a complicated event system using Common Events and maybe even variables, but it's probably simpler to use a script.
katasu
QUOTE (amerk @ May 30 2012, 04:09 PM) *
You might be able to do it with a complicated event system using Common Events and maybe even variables, but it's probably simpler to use a script.

Yeah Common events would do the trick but that'd take time and be complicated I was wondering if there was a script for it or if I could just hit a button and make it do it lol I guess I need that script.
Tsukihime
Wouldn't bothering eventing something like this. You'd probably end doing weird hacks like storing the actor's level in a variable, and whenever the variable changes you flip a switch to recover all, and then turn off that switch and wait again.

When you could just write it in a single line.

CODE
class Game_Actor < Game_Battler
  
  alias :level_up_recover_all :level_up
  def level_up
    level_up_recover_all
    recover_all
  end
end
katasu
Where do I put that? Thanks for helpin.

Please don't quote entire posts, only use the quote function when referencing specific statements - Verbal Warn - Night_Runner
Night_Runner
In your game's Editor, in the Menu Bar select Tools >> Script Editor.
In the Script Editor, along the left hand side scroll to the bottom, right click on the blue rectangle under 'Materials', and select 'Insert'.
Paste Tsukihime's code in the blank window on the right, and label the script in the 'Name:' box in the bottom left of the Script Editor.
Click 'OK' to apply the changes
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.