Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Actor Recover
katasu
post May 30 2012, 03:01 PM
Post #1


Level 9
Group Icon

Group: Revolutionary
Posts: 147
Type: Writer
RM Skill: Intermediate




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


__________________________

Go to the top of the page
 
+Quote Post
   
amerk
post May 30 2012, 03:09 PM
Post #2


Level 56
Group Icon

Group: Global Mod
Posts: 1,784
Type: None
RM Skill: Undisclosed
Rev Points: 15




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.


__________________________
Go to the top of the page
 
+Quote Post
   
katasu
post May 30 2012, 03:31 PM
Post #3


Level 9
Group Icon

Group: Revolutionary
Posts: 147
Type: Writer
RM Skill: Intermediate




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.


__________________________

Go to the top of the page
 
+Quote Post
   
Tsukihime
post May 30 2012, 03:51 PM
Post #4


Level 25
Group Icon

Group: Revolutionary
Posts: 561
Type: None
RM Skill: Undisclosed
Rev Points: 25




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


This post has been edited by Tsukihime: May 30 2012, 03:53 PM


__________________________
My Scripts
Go to the top of the page
 
+Quote Post
   
katasu
post May 30 2012, 07:13 PM
Post #5


Level 9
Group Icon

Group: Revolutionary
Posts: 147
Type: Writer
RM Skill: Intermediate




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

This post has been edited by Night_Runner: May 31 2012, 04:52 AM


__________________________

Go to the top of the page
 
+Quote Post
   
Night_Runner
post May 31 2012, 04:56 AM
Post #6


Level 50
Group Icon

Group: +Gold Member
Posts: 1,525
Type: Scripter
RM Skill: Undisclosed




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


__________________________
K.I.S.S.
Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.

Most important guide ever: Newbie's Guide to Switches
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 23rd May 2013 - 07:14 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker