Sorry if I posted this in the wrong section, I'm not experienced with this website.
Is there a way to have your characters HP/MP automatically restore when they level up?
RGSS3 Script RequestsThe 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.
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.
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
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
You've aliased the method but havent called the alias
So it will be this:
or this:
I've moved this thread to RGSSx Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.
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
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
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~
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~
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...?
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.
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.
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.
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.
Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-way-to-have-your-characters-hp-mp-automatically-restore-when-they-level-up.19340/