Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

2 Pages V   1 2 >  
Reply to this topicStart new topic
> + [ Recover HP/MP/States when Level Up ] +, * A little snippet I made a few days ago~
woratana
post Jun 10 2008, 10:23 PM
Post #1


Looking for scripter to hire? PM me *O*
Group Icon

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




Recover HP/MP/States when Level Up
Version 1.0
by Woratana
Release Date: 10/06/2008


Introduction
Here is a little snippet I scripted after lost one VX game. tongue.gif
I just think that it should be easier (for player) if actors' status are recover when they level up. biggrin.gif

Enjoy~ laugh.gif


Screenshots
-No screenshot-


Script
Place it above main

CODE
CODE
#===============================================================
# ● [VX] ◦ Recover HP/MP/States when Level Up ◦ □
#--------------------------------------------------------------
# ◦ by Woratana [woratana@hotmail.com]
# ◦ Thaiware RPG Maker Community
# ◦ Released on: 10/06/2008
# ◦ Version: 1.0
#--------------------------------------------------------------
# ◦ How to use:
# Put this script above main, you can setup script below
#=================================================================

class Game_Actor < Game_Battler
  
  #==================================
  # * SCRIPT SETUP PART
  #----------------------------------
  RECOVER_HP = true # Recover HP when level up? (true/false)
  RECOVER_MP = true # Recover MP when level up?
  REMOVE_STATES = true # Cure all states when level up?
  #==================================
  
  alias wora_fullhpmp_gamact_lvup level_up
  def level_up
    wora_fullhpmp_gamact_lvup
    @hp = maxhp if RECOVER_HP
    @mp = maxmp if RECOVER_MP
    if REMOVE_STATES
      @states.clone.each {|i| remove_state(i) }
    end
  end
end



Instruction
Place the script above main.
You can setup script in setup part if you don't want to recover all HP/MP/states when level up.


Author's Notes
Free for use in your work if credit is included.


Bug Report?
Please give me these informations:
QUOTE
- What is it says in error window?
- When is it get error? (Right after run game, when you choose something, etc.)
- Do you have any other scripts running in your game that may crash with this script?


__________________________
Check out my NEW blog!!!



MVP (Most Valuable Poster) Award 2008


Go to the top of the page
 
+Quote Post
   
Hanmac
post Jun 10 2008, 11:12 PM
Post #2


Level 8
Group Icon

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




use this:
CODE
@states.clone.each {|i| remove_state(i) if REMOVE_STATES == true or REMOVE_STATES.include?(i) }

so you can use an array of states, witch are removed.
Go to the top of the page
 
+Quote Post
   
woratana
post Jun 10 2008, 11:25 PM
Post #3


Looking for scripter to hire? PM me *O*
Group Icon

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




REMOVE_STATES must be boolean OR array only. tongue.gif

It can't be both. biggrin.gif


__________________________
Check out my NEW blog!!!



MVP (Most Valuable Poster) Award 2008


Go to the top of the page
 
+Quote Post
   
Hanmac
post Jun 10 2008, 11:33 PM
Post #4


Level 8
Group Icon

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




yes, but
CODE
if [1,2,3]
  p "true"
end

puts "true" because [1,2,3] is not false
Go to the top of the page
 
+Quote Post
   
woratana
post Jun 10 2008, 11:41 PM
Post #5


Looking for scripter to hire? PM me *O*
Group Icon

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




Well, I still don't see the point. sad.gif

Because it will always return true. So it will always remove all the states.

CODE
a = [1,2,3]
p 'true' if a or a.include?(2) # true
p 'true' if a or a.include?(5) # true


__________________________
Check out my NEW blog!!!



MVP (Most Valuable Poster) Award 2008


Go to the top of the page
 
+Quote Post
   
Hanmac
post Jun 10 2008, 11:46 PM
Post #6


Level 8
Group Icon

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




you frogot the == true

test:
CODE
a = [1,2,3]
p 'true' if a == true or a.include?(2) # true
p 'true' if a == true or a.include?(5) # false
Go to the top of the page
 
+Quote Post
   
woratana
post Jun 10 2008, 11:56 PM
Post #7


Looking for scripter to hire? PM me *O*
Group Icon

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




Yeah, but that stills not make me understand what do you want to say~
According to your last reply:
QUOTE (Hanmac @ Jun 11 2008, 12:00 AM) *
you frogot the == true

test:
CODE
a = [1,2,3]
p 'true' if a == true or a.include?(2) # true
p 'true' if a == true or a.include?(5) # false


This mean...
QUOTE (woratana @ Jun 10 2008, 11:39 PM) *
REMOVE_STATES must be boolean OR array only. tongue.gif

It can't be both. biggrin.gif


Isn't it?


__________________________
Check out my NEW blog!!!



MVP (Most Valuable Poster) Award 2008


Go to the top of the page
 
+Quote Post
   
Hanmac
post Jun 11 2008, 12:04 AM
Post #8


Level 8
Group Icon

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




test it:
REMOVE_STATES = false it make nothing
REMOVE_STATES = true it makes all
REMOVE_STATES = [] it make nothing
REMOVE_STATES = [1,2,3] it removes state 1,2 and 3

CODE
    if REMOVE_STATES # if false ignore this and array are true
      @states.clone.each {|i|
        if REMOVE_STATES == true or REMOVE_STATES.include?(i) #if true ignore include?, otherwise check include
          remove_state(i)
        end
        }
    end


or very short:
CODE
@states.clone.each {|i| remove_state(i) if REMOVE_STATES == true or REMOVE_STATES.include?(i) } if REMOVE_STATES


This post has been edited by Hanmac: Jun 11 2008, 12:05 AM
Go to the top of the page
 
+Quote Post
   
woratana
post Jun 11 2008, 12:40 AM
Post #9


Looking for scripter to hire? PM me *O*
Group Icon

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




Well, that's actually a good idea. smile.gif Nice job!

Though, false will return NoMethodError biggrin.gif
because boolean doesn't has method 'include?'


__________________________
Check out my NEW blog!!!



MVP (Most Valuable Poster) Award 2008


Go to the top of the page
 
+Quote Post
   
Hanmac
post Jun 11 2008, 12:45 AM
Post #10


Level 8
Group Icon

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




have you test it?

because false cant go into the each because "if REMOVE_STATES" at the end.
or have you forgot this?
Go to the top of the page
 
+Quote Post
   
woratana
post Jun 11 2008, 12:56 AM
Post #11


Looking for scripter to hire? PM me *O*
Group Icon

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




Yeah, I totally forgot about that. biggrin.gif


__________________________
Check out my NEW blog!!!



MVP (Most Valuable Poster) Award 2008


Go to the top of the page
 
+Quote Post
   
Beecheese
post Jun 24 2008, 05:07 PM
Post #12


Level 2
Group Icon

Group: Member
Posts: 21
Type: Developer
RM Skill: Skilled




This might be a little old, but I wanted to show my support for this script. Very small but very practical, I agree with you, actors should recover fully after leveling up.
Go to the top of the page
 
+Quote Post
   
woratana
post Jun 25 2008, 06:26 AM
Post #13


Looking for scripter to hire? PM me *O*
Group Icon

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




Thanks smile.gif
I'm glad you like it~^^

The post like yours kept me scripting. biggrin.gif


__________________________
Check out my NEW blog!!!



MVP (Most Valuable Poster) Award 2008


Go to the top of the page
 
+Quote Post
   
Omegas7
post Sep 8 2008, 01:31 PM
Post #14


Awesome. Epic. Fantastic. Did someone call me?
Group Icon

Group: Revolutionary
Posts: 977
Type: Scripter
RM Skill: Advanced




Hey! Thank you dude thumbsup.gif.


__________________________
Go to the top of the page
 
+Quote Post
   
mudducky
post Sep 8 2008, 03:07 PM
Post #15


Level 19
Group Icon

Group: Revolutionary
Posts: 392
Type: None
RM Skill: Beginner




You do come up with the most useful idea's for scripts. Many thanks for making this, Woratana. thanks.gif
Go to the top of the page
 
+Quote Post
   
repic
post Sep 10 2008, 12:23 PM
Post #16



Group Icon

Group: Member
Posts: 1
Type: None
RM Skill: Undisclosed




ok, im a total noob at this and i got lost at the begining...how exsactly do i do this?
Go to the top of the page
 
+Quote Post
   
woratana
post Sep 11 2008, 07:33 AM
Post #17


Looking for scripter to hire? PM me *O*
Group Icon

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




Put it in script editor ^^


__________________________
Check out my NEW blog!!!



MVP (Most Valuable Poster) Award 2008


Go to the top of the page
 
+Quote Post
   
Mickadell
post Jan 18 2009, 04:35 AM
Post #18


Level 5
Group Icon

Group: Member
Posts: 71
Type: Event Designer
RM Skill: Masterful




Comment
Rate: Excellent

Thank you,
So much. I really needed this or my game would be to rigged. So thanks again
This really helped.
Attached File(s)
Attached File  Excellent.png ( 2.31K ) Number of downloads: 3
 
Go to the top of the page
 
+Quote Post
   
Mickadell
post Jan 18 2009, 04:41 AM
Post #19


Level 5
Group Icon

Group: Member
Posts: 71
Type: Event Designer
RM Skill: Masterful




Problem
When I used it one of my Characters healed but the other didn't
I have 2 Characters and I am using your 2 player script.
Go to the top of the page
 
+Quote Post
   
woratana
post Jan 18 2009, 07:07 PM
Post #20


Looking for scripter to hire? PM me *O*
Group Icon

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




It doesn't heal the party, it heal only the one who level up. ^^


__________________________
Check out my NEW blog!!!



MVP (Most Valuable Poster) Award 2008


Go to the top of the page
 
+Quote Post
   

2 Pages V   1 2 >
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: 24th May 2013 - 12:33 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker