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
> Regenration State
Applepie181
post Jan 4 2011, 01:35 PM
Post #1



Group Icon

Group: Member
Posts: 4
Type: Writer
RM Skill: Beginner




I am completely new to the RPG Revolution forums and I didn't plan on ask for help with things until my first project is done but I really want one of my characters in my game to have a regeneration spell. I looking for a state that slowly recovers a small amount of health each turn but I have no idea how to work it since you can only setup slip damage or parameter changes.

Does anybody know how to work a regeneration state or there's absolutely no way without coding? Thanks guys biggrin.gif
Go to the top of the page
 
+Quote Post
   
brewmeister
post Jan 27 2011, 08:15 PM
Post #2


Paste above Main
Group Icon

Group: Revolutionary
Posts: 408
Type: Scripter
RM Skill: Skilled




I'm certain there is a way, albeit rather cumbersome, to do this with events. However, since it's already built in for Armor, it's pretty easy to just have it check for the Regen state as well....

CODE
class Game_Actor
  alias regen_auto_hp_recover auto_hp_recover
  def auto_hp_recover
    if state?(17)  # Regenerate.  Change 17 to your Regen state ID
      if self.hp == maxhp
        remove_state(17)  # Regenerate.  Change 17 to your Regen state ID
      end
      return true
    end
    regen_auto_hp_recover
  end
end


This adds 1 HP per step on the map, and 5% of MAXHP per turn during battle. (Same as the Auto HP Recover for Armor)
This script will also remove the Regen state once the character is fully healed.


__________________________
Go to the top of the page
 
+Quote Post
   
LaDestitute
post Jan 27 2011, 09:31 PM
Post #3


Level 18
Group Icon

Group: Revolutionary
Posts: 350
Type: Event Designer
RM Skill: Advanced




Might be a good idea if you make regen and poison cancel each other out.

Edit: Try this if you want, it's up to you.

CODE
class Game_Actor
  alias regen_auto_hp_recover auto_hp_recover
  def auto_hp_recover
    if state?(17)  # Regenerate.  Change 17 to your Regen state ID
      if self.hp == maxhp
        remove_state(17)  # Regenerate.  Change 17 to your Regen state ID
      end
    if state?(3) # Venom. Change 3 to your venom/poison state ID (Poison will cancel out Regen, and vice versa)
      remove_state(17)  # Regenerate.  Change 17 to your Regen state ID
    end
    if state?(17) # Regenerate. Change 17 to your Regen state ID
      remove_state(3)  # Venom.  Change 17 to your Venom/Poison state ID
    end
      return true
    end
    regen_auto_hp_recover
  end
end


__________________________
Current Project: Pozzo (arcade game, tentative title)

The following statement is true: The previous statement is false.

Cool links and shit
YouTube Subscribe Spread
Illumination effect tutorial
Writing good dialog tutorial
Color theory tutorial
Breeze Revolution
Tindy's General Mapping Guidelines
Proper story structure tutorial
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: 19th May 2013 - 10:59 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker