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
> HP/MP De/Regeneration, for different party members, on map/battle/event
Moonchaos
post May 16 2011, 12:58 PM
Post #1


Level 1
Group Icon

Group: Member
Posts: 7
Type: Event Designer
RM Skill: Beginner




Hi Community, after a lot of search i found out there is no easy to understand regeneration script.
So i took my time building this script.

Script description:

If you call the script "drainGroupMP" or "restoreGroupHP" inside a event the script activates.
You can use it for battle is you want to gain a ammount of Hp/Mp regenerated or degenerated, but you need
to add the condition for the script to activate. (like if you defend or attack with a special weapon/skill)
But this you need to add to the script yourself.

My script is more used for map de/regeneration and special about it for only some of your partymember if you want.

Example: (just like the script is unchanged now)
All partymembers will regenerate 3% hp and + 1 hp (minimum) everytime the script is active
but only partymember 2-4 will lose - 1 mp everytime the script is active

Of course you can change that if you need, the ammounts of hp/mp and the actors wich will be targeted.
The script will deactivate if the charakter is in incap/dead state. (If state id is 1, otherwise change script)

Set it up to the map with a step count:

Thats probably the most wanted function for the script.
# I use the german patched game maker vx so dont worry about the commands, you can change all the variable names.

This time it is every 10 steps activated

Screenshots:



Thats it already, change it just like you need it.

Installation:

Just copy the script and add it under "Material" in the Scripteditor (F11)
# the script only activate after you call it on page 3 RGSS "Script"

Script:
CODE
#-------------------------------------------------
#Mp degeneration
#-------------------------------------------------
def drainGroupMP    # rename if you want
  1.upto($game_party.members.length - 1) do    # from Party ID 1 (2. Member) downwards
    |i|
    @actor = $game_party.members[i]
    if @actor != nil
      if @actor.state?(1) # if charakter is Status id (1) (Incapacitate/Dead) the hp is disabled
      else      
      @actor.mp -= 1    # -1 Mp
      end  
    end
  end
end
#-------------------------------------------------
#Hp regeneration
#-------------------------------------------------
def restoreGroupHP    # rename if you want
  0.upto($game_party.members.length - 1) do    # from Party ID 0 (Hero) downwards
    |i|
    @actor = $game_party.members[i]
  if @actor != nil  
    if @actor.state?(1)    # if charakter is Status id (1) (Incapacitate/Dead) the hp is disabled
    else
    @actor.hp += (@actor.maxhp * 3 / 100) + 1    # +3% hp + 1 hp
# If the regenerated hp are under 0,44 he would return 0 but with +1 he will add min. 1 hp
      end  
    end
  end
end


Credits:

If you want to thank me it is ok, but you dont need to.
Go to the top of the page
 
+Quote Post
   
Fonstw
post Aug 9 2011, 03:18 AM
Post #2


Level 3
Group Icon

Group: Member
Posts: 36
Type: Writer
RM Skill: Intermediate




Hey!

I was looking for a script in wich you can a state regenerate/deregenerate HP and/or MP, could you make somethinbg like that too?


Example: You make a note in the state like
CODE
regenarate hp = [3]
to gain 3 HP each turn/step, and for example
CODE
deregenerate mp = [1]
would make the actor lose 1 MP each turn??


__________________________
Haven't you ever noticed that "four" is the only number with the same amount of letters as it's definition in the entire English language?
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: 21st May 2013 - 10:39 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker