Is there a way to have your characters HP/MP automatically restore when they level up?

Status
Not open for further replies.

Nosidag

Veteran
Veteran
Joined
Sep 29, 2013
Messages
30
Reaction score
3
First Language
English
Primarily Uses
Sorry if I posted this in the wrong section, I'm not experienced with this website.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
The resource forums are for artwork discussions, questions like yours go into support.

Someone will move this (I can't, because I'm not a mod in this area).

To your question:

yes, it's possible - but it either requires a complex common event on parallel process to check for level-ups, or a simple script addition that calls a simple common event on level-up.

Which option is best depends on if you use other scripts, and if you're comfortable with scripting in your game.
 

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
Slip this into a new script spot.

class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # * Level Up Recover All #-------------------------------------------------------------------------- alias level_up_recover_all level_up def level_up recover_all #<-----------Added this small function call level_up_recover_all endendIf you don't want to heal states then replace recover_all with

Code:
@hp = mhp@mp = mmp
 
Last edited by a moderator:

Xypher

Veteran
Veteran
Joined
Apr 1, 2012
Messages
148
Reaction score
26
Primarily Uses
Slip this into a new script spot.

class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # * Level Up Recover All #-------------------------------------------------------------------------- alias level_up_recover_all level_up def level_up recover_all #<-----------Added this small function call endendIf you don't want to heal states then replace recover_all with

@hp = mhp@mp = mmp
You've aliased the method but havent called the alias
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
So it will be this:

Code:
class Game_Actor < Game_Battler  #--------------------------------------------------------------------------  # * Level Up Recover All  #--------------------------------------------------------------------------  alias level_up_recover_all level_up  def level_up    level_up_recover_all    recover_all  #<-----------Added this small function call  endend
or this:
Code:
class Game_Actor < Game_Battler  #--------------------------------------------------------------------------  # * Level Up Recover All  #--------------------------------------------------------------------------  alias level_up_recover_all level_up  def level_up    level_up_recover_all    @hp = mhp    @mp = mhp  endend
I've moved this thread to RGSSx Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.
 

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
Oh snap, thanks Xypher. That was a derp on my part. xD

It's 4:30 am and i've been performance-optimizing my huge lists of battle-related scripts in my project. I need to take a break from scripts q_q.

Edited it~
 
Last edited by a moderator:

Nosidag

Veteran
Veteran
Joined
Sep 29, 2013
Messages
30
Reaction score
3
First Language
English
Primarily Uses
It worked. Thanks you guys are awesome. I wish I understood, how these scripts worked. Is there a tutorial on here that breaks it down? Like the terms(ex.alias)

and positioning, etc...?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
Is there a tutorial on here that breaks it down? Like the terms(ex.alias) and positioning, etc...?
Unfortunately, it isn't that easy.

What is called "scripting" in the RM-Community is basically full programming of the engine, and you can't learn a programming engine with a few tutorials.

You can start looking on the internet for tutorials to learn Ruby, which is the programming language that was the basis for RM's RGSS.

If you know how to write a Ruby-Program, you basically have mastered Scripting in RM - the differences are vey minor, only learning a few specific commands and classes that are used in RGSS.
 

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
Yeah what Andar said. If you can learn basic programming knowledge (more specifically for Ruby language) like variables (integer/float/string), boolean operators, functions, loops, conditional statements, classes and modules, and so on, then scripting for RPG Maker would be the next step. (Learning how the engine works and what functions/variables it uses, how it's organized by class/modules, etc.)

I myself never studied Ruby language, but I did learn in college basic C++, FORTRAN, VisualBasic, QBASIC, and Java, which is good enough since all programming languages are universally the exact same thing. (except maybe Assembly)  It only took me a day to analyze RGSS and Ruby's syntaxes and such.

By the way, an alias basically adds additional code to the end of an existing function call (def level_up) instead of having to rewrite the same function to include the new code.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
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

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,570
Latest member
fgfhdfg
Top