Help - Search - Members - Calendar
Full Version: KaiMonkey's MP types Version 5.0
RPG RPG Revolution Forums > Scripting > Script Tutorials > RGSS2
kaimonkey
KaiMonkey's MP types 5.0
by KaiMonkey

Introduction
This template will help you to make a better presentation for your script. This is purely optional but will help to create a standard which in return will help user to quickly find the required info on your script.

Features
- Change the name of each classes MP
- Change the colour to make MP represent
anything from stamina to ammo!
- Can be diffenrent for every class
- Have in increase or decrease on attack or block
- Make only the right potions and items regain the right MP (no more gunners getting ammo from potions and mages from clips!)

Screenshots

version 2



How to Use

Post above main, duh....
e
Well at the top there is seven configuration lines
MP_Types = ["RAGE","N/A","HOLY","MP","","DARK","EG","EG"]
MP_Colour = [[18,0],[18,10],[6,14],[22,23],[22,23],[15,19],[18,10],[18,10]]
Dont_Have = [2,5]
MP_TO_DECREASE_Attacking = [0,0,5,2,0,0,0,0]
MP_TO_DECREASE_Blocking= [15,0,0,0,0,0,0,0]
MP_TO_INCREASE_Attacking = [5,0,0,0,0,0,0,0]
MP_TO_INCREASE_Blocking= [0,0,5,0,0,0,0,0]
It looks complex, but don't worry, its very simple

First MP_Types repristents the types of Mp for each class, in the order they come in the database. So the first thing in the databases uses RAGE, the second is N/A (see dont_have), but 3rd has holy, 4th uses MP 5th uses nothing (again see dont_have). The 6th uses DARK!, and the last two use EG again. Make sence? Good.

Now MP_Colour (English spelling, sorry laugh.gif ) this is quite complex, but it just shows the two colours in the bar, the first one fading into the second one. If you want a certain colour Look at the part of you window skin that looks abit like
Now, The top one (white) is 0, the one next to that is 1, 2 ,3 ,4 ,5 and once a new row starts you just read across like reading a page of a book! Easy? Well once you worked out the colors you want, you put them in, in the same place as they are in MP_Types. So EG is 18,10, which is Red fading into lighter red, MP, is 22,23 which is the normal blues, and DARK is 15,19, which is black and grey!
Here are some simple colour samples to use if you don't want to work it out. These wont work with all WindowSkins! wink.gif

Blue [22,23]
Red [18,10]
Black [15,19]
Green [3,11]
White/grey [0,8]
Pink/purple [30,31]

Also make sure they all have commars after them exept the last one! wink.gif Any problems post those three lines here and I'll sort it out!
Version 2 help
the new line Dont_Have = [2,5] is simply the list of classes' ids that their MP is never shown. When you wright their MP_Type, but "N/A" , "None" or just "" and for MP_Colour, put anything it doesn't matter. In this case classes 2 and 5 don't show anything, exept their MP_Type!

Version 3 help
The new line MP_TO_DECREASE_Attacking = [5,0,5,0,0,0,0,0]
this is a list of all classes, and how much to decrese the "MP" (or ammo or energy) by when they attack, to say they don't lost any, just put 0. On this class 1 and 3 lose 5 every attack and no other classes lose any thing! this can be used to represent ammo and such.

Version 4 help
Then theres MP_TO_DECREASE_Blocking= [15,0,0,0,0,0,0,0]
this is a list of all classes (in order they are in in the database) and how much there "MP" (or ammo, or enegy) is decreased when the user blocks. So the first class, loses 15 when they block, this can be used to represent rage.

MP_TO_INCREASE_Blocking works just like Decreaing, expept makes it higher, so
MP_TO_INCREASE_Blocking= [0,0,5,0,0,0,0,0]
means that the 3rd class gains 5 "mp" when ever they guard.
MP_TO_INCREASE_Attacking = [5,0,0,0,0,0,0,0]
this works just works like the MP_TO_DECREASE_Attacking , expets adds, so the first class gains 5 "mp" whenever they attack, this can also be used as rage.

Version 5 help (wow)

New feature is setting up the potions.This is easy, just look at the part where it says

$Potions_effect ={
# item id => [list of classes]
# so 5 => [1,3] means class 1 and 3 can use item 5
4 => [4],
21 => [1,7,8],
22 => [3],
23 => [6]
}
As it states, you can set up potions that only heals MP for monks and preasts, and stop charactures with no MP drinking potions!
Script
CODE
MP_Types = ["RAGE","N/A","HOLY","MP","","DARK","EG","EG"]
MP_Colour = [[18,0],[18,10],[6,14],[22,23],[22,23],[15,19],[18,10],[18,10]]
Dont_Have = [2,5]
MP_TO_DECREASE_Attacking = [0,0,5,2,0,0,0,0]
MP_TO_DECREASE_Blocking= [15,0,0,0,0,0,0,0]
MP_TO_INCREASE_Attacking = [5,0,0,0,0,0,0,0]
MP_TO_INCREASE_Blocking= [0,0,5,0,0,0,0,0]
#####Potion config#############
$Potions_effect ={
#  item id => [list of classes]
# so 5 => [1,3] means class 1 and 3 can use item 5
4 => [4],
21 => [1,7,8],
22 => [3],
23 => [6]
}
class Window_Base < Window
  #--------------------------------------------------------------------------
  # * Draw MP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : Width
  #--------------------------------------------------------------------------
  def draw_actor_mp(actor, x, y, width = 120)
    have_or_not = 0
    work = 0
    while have_or_not == 0
      if actor.class.id == Dont_Have[work]  
        have_or_not = 1
        break
      else
        work += 1
        if work == Dont_Have.size
          break
        end
      end
    end
    
    if have_or_not == 1
      final_word = MP_Types[actor.class.id - 1]
      self.contents.draw_text(x, y, 30, WLH, final_word)  
    else
      draw_actor_mp_gauge(actor, x, y, width)
      self.contents.font.color = system_color
      final_word = MP_Types[actor.class.id - 1]
      self.contents.draw_text(x, y, 30, WLH, final_word)
      self.contents.font.color = mp_color(actor)
      last_font_size = self.contents.font.size
      xr = x + width
      if width < 120
        self.contents.draw_text(xr - 44, y, 44, WLH, actor.mp, 2)
      else
        self.contents.draw_text(xr - 99, y, 44, WLH, actor.mp, 2)
        self.contents.font.color = normal_color
        self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2)
        self.contents.draw_text(xr - 44, y, 44, WLH, actor.maxmp, 2)
      end
    end
  end
  #~ #--------------------------------------------------------------------------
  #~ # * Draw MP Gauge
  #~ #     actor : actor
  #~ #     x     : draw spot x-coordinate
  #~ #     y     : draw spot y-coordinate
  #~ #     width : Width
  #~ #--------------------------------------------------------------------------
  def draw_actor_mp_gauge(actor, x, y, width = 120)
    gw = width * actor.mp / [actor.maxmp, 1].max
    gc1 = mp_gauge_color1(actor)
    gc2 = mp_gauge_color2(actor)
    self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
    self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  end
  #--------------------------------------------------------------------------
  # * Get MP Gauge Color 1
  #--------------------------------------------------------------------------
  def mp_gauge_color1(actor)
    return text_color(MP_Colour[actor.class.id - 1][0])
  end
  #--------------------------------------------------------------------------
  # * Get MP Gauge Color 2
  #--------------------------------------------------------------------------
  def mp_gauge_color2(actor)
    return text_color(MP_Colour[actor.class.id - 1][1])
  end
  end
  #######################
  # CREDIT TO KAIMONKEY #
  #######################

class Scene_Battle < Scene_Base
     def update_item_selection
    @item_window.active = true
    @item_window.update
    @help_window.update
    if Input.trigger?(Input::B)
      Sound.play_cancel
      end_item_selection
    elsif Input.trigger?(Input::C)
      @item = @item_window.item
      if @item != nil
        $game_party.last_item_id = @item.id
      end
      if $Potions_effect[@item.id] != nil
        if $game_party.item_can_use?(@item)&& $Potions_effect[@item.id].include?(@active_battler.class.id)
          Sound.play_decision
          determine_item
        else
          Sound.play_buzzer
        end
      else
        if $game_party.item_can_use?(@item)
          Sound.play_decision
          determine_item
        else
          Sound.play_buzzer
        end
      end
    end
  end  
    
    def execute_action_attack
      if MP_TO_DECREASE_Attacking[@active_battler.id - 1] != nil
         if @active_battler.mp >= MP_TO_DECREASE_Attacking[@active_battler.class.id - 1]
            text = sprintf(Vocab::DoAttack, @active_battler.name)
            @message_window.add_instant_text(text)
            targets = @active_battler.action.make_targets
            display_attack_animation(targets)
            wait(20)
            for target in targets
              target.attack_effect(@active_battler)
              display_action_effects(target)
            end
            @active_battler.mp -= MP_TO_DECREASE_Attacking[@active_battler.class.id - 1]
          else
            text1= " hasn't enough "
            text = @active_battler.name + text1 + MP_Types[@active_battler.class.id - 1] + " to attack!"
            @message_window.add_instant_text(text)
            wait(200)
          end
      if MP_TO_INCREASE_Attacking[@active_battler.class.id - 1] != nil
  #~        p @active_battler.name
  #~        p @active_battler.mp
  #~       p MP_TO_INCREASE_Attacking[@active_battler.class.id - 1]
            text = sprintf(Vocab::DoAttack, @active_battler.name)
            @message_window.add_instant_text(text)
            targets = @active_battler.action.make_targets
            display_attack_animation(targets)
            wait(20)
            for target in targets
              target.attack_effect(@active_battler)
              display_action_effects(target)
            end
            @active_battler.mp += MP_TO_INCREASE_Attacking[@active_battler.class.id - 1]
  #~        p @active_battler.mp
  #~        p MP_TO_INCREASE_Attacking[@active_battler.id - 1]
        end
      else
       text = sprintf(Vocab::DoAttack, @active_battler.name)
        @message_window.add_instant_text(text)
        targets = @active_battler.action.make_targets
        display_attack_animation(targets)
        wait(20)
        for target in targets
          target.attack_effect(@active_battler)
          display_action_effects(target)
        end
      end
    end
    
  #~  
    def execute_action_guard
      if MP_TO_INCREASE_Blocking[@active_battler.class.id - 1] != nil
         if MP_TO_INCREASE_Blocking[@active_battler.class.id - 1] != 0
            @active_battler.mp += MP_TO_INCREASE_Blocking[@active_battler.class.id - 1]
            text = sprintf(Vocab::DoGuard, @active_battler.name)
            @message_window.add_instant_text(text)
             wait(45)
            text = "So " + @active_battler.name + "'s " + MP_Types[@active_battler.class.id - 1] + " increased!"
            @message_window.add_instant_text(text)
            wait(45)
        elsif MP_TO_INCREASE_Blocking[@active_battler.id - 1] != 0
            @active_battler.mp -= MP_TO_DECREASE_Blocking[@active_battler.class.id - 1]
            text = sprintf(Vocab::DoGuard, @active_battler.name)
            @message_window.add_instant_text(text)
            wait(45)
            text = "So " + @active_battler.name + "'s " + MP_Types[@active_battler.class.id - 1] + " was Lost!"
            @message_window.add_instant_text(text)
            wait(45)
         end
    else
      text = sprintf(Vocab::DoGuard, @active_battler.name)
      @message_window.add_instant_text(text)
      wait(45)
    end
  end
    
end


#~ #=============================================================================
#~ # ** Scene_Item
#~ #------------------------------------------------------------------------------
#~ #  This class performs the item screen processing.
#~ #==============================================================================

class Scene_Item < Scene_Base
  def determine_target
    used = false
    if @item.for_all?
      for target in $game_party.members
        target.item_effect(target, @item)
        used = true unless target.skipped
      end
    else
      $game_party.last_target_index = @target_window.index
      target = $game_party.members[@target_window.index]
      class_needed = $Potions_effect[@item.id]
     if class_needed.include?(target.class.id)
         target.item_effect(target, @item)
          used = true unless target.skipped
       end
    end
    if used
      use_item_nontarget
    else
      Sound.play_buzzer
    end
  end
end



FAQ

Q: Who should i credit?
A: KaiMonkey

Q: I'm finding it hard to configure, can you do it for me?
A: Of coause (spelt wrong <_< )

Credit and Thanks
- KaiMonkey
- BigEd, for annoying me so much I starting scripting.....
TimmahX
Oooh, this is quite a good idea! Nice job! thumbsup.gif
Aureku
Great idea and great script KaiMonkey, will credit you if I use it ^^
kaimonkey
Thankyou tongue.gif any suggestions? Problems?
breadlord
No suggestions, no questions, this script is perfect!!

P.S Yay I'm quoted biggrin.gif

kaimonkey
QUOTE (breadlord @ Apr 6 2009, 08:42 AM) *
No suggestions, no questions, this script is perfect!!

P.S Yay I'm quoted biggrin.gif


Um... Well thats boring... I might do the same for HP, incase..... nah that wont work.... Im bored *checks script requests*
jens009
Nice script. =].
Out of curiosity, what happens if the number of classes does not correspond to the number of entries in the list of MP_Types and MP_Colour?
Do you get an error then?
kaimonkey
QUOTE (jens009 @ Apr 7 2009, 04:37 AM) *
Nice script. =].
Out of curiosity, what happens if the number of classes does not correspond to the number of entries in the list of MP_Types and MP_Colour?
Do you get an error then?


You would as it all works with a arrays, it would return nill, and you can't find the nill'th in another array, so big fat ERROR!
kaimonkey
Version 2 is UP! PS 100th post!
miget man12
What an ingenious idea! please post it!! This will be probably the easiest ammunition script out there! Wonderful job, KaiMonkey!
Can't wait for you to post it!

~Miget man12
kaimonkey
Then wait no longer!

CODE
MP_Types = ["EG","N/A","HOLY","MP","MP","DARK","EG","EG"]
MP_Colour = [[18,10],[18,10],[6,14],[22,23],[22,23],[15,19],[18,10],[18,10]]
Dont_Have = [2,5]
MP_TO_DECREASE = [5,0,5,0,0,0,0,0]


class Window_Base < Window
#--------------------------------------------------------------------------
# * Draw MP
#     actor : actor
#     x     : draw spot x-coordinate
#     y     : draw spot y-coordinate
#     width : Width
#--------------------------------------------------------------------------
def draw_actor_mp(actor, x, y, width = 120)
  have_or_not = 0
  work = 0
  while have_or_not == 0
    if actor.class.id == Dont_Have[work]  
      have_or_not = 1
      break
    else
      work += 1
      if work == Dont_Have.size
        break
      end
    end
  end
  if have_or_not == 1
    final_word = MP_Types[actor.class.id - 1]
    self.contents.draw_text(x, y, 30, WLH, final_word)  
  else
    draw_actor_mp_gauge(actor, x, y, width)
    self.contents.font.color = system_color
    final_word = MP_Types[actor.class.id - 1]
    self.contents.draw_text(x, y, 30, WLH, final_word)
    self.contents.font.color = mp_color(actor)
    last_font_size = self.contents.font.size
    xr = x + width
    if width < 120
      self.contents.draw_text(xr - 44, y, 44, WLH, actor.mp, 2)
    else
      self.contents.draw_text(xr - 99, y, 44, WLH, actor.mp, 2)
      self.contents.font.color = normal_color
      self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2)
      self.contents.draw_text(xr - 44, y, 44, WLH, actor.maxmp, 2)
    end
  end
end
#~ #--------------------------------------------------------------------------
#~ # * Draw MP Gauge
#~ #     actor : actor
#~ #     x     : draw spot x-coordinate
#~ #     y     : draw spot y-coordinate
#~ #     width : Width
#~ #--------------------------------------------------------------------------
def draw_actor_mp_gauge(actor, x, y, width = 120)
  gw = width * actor.mp / [actor.maxmp, 1].max
  gc1 = mp_gauge_color1(actor)
  gc2 = mp_gauge_color2(actor)
  self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
  self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
end
#--------------------------------------------------------------------------
# * Get MP Gauge Color 1
#--------------------------------------------------------------------------
def mp_gauge_color1(actor)
  return text_color(MP_Colour[actor.class.id - 1][0])
end
#--------------------------------------------------------------------------
# * Get MP Gauge Color 2
#--------------------------------------------------------------------------
def mp_gauge_color2(actor)
  return text_color(MP_Colour[actor.class.id - 1][1])
end
end
#######################
# CREDIT TO KAIMONKEY #
#######################
class Scene_Battle
  def execute_action_attack
#~     p @active_battler.name
#~     p @active_battler.mp
#~     p MP_TO_DECREASE[@active_battler.id - 1]
#~      if @active_battler.mp = MP_TO_DECREASE[@active_battler.id -1]
        text = sprintf(Vocab::DoAttack, @active_battler.name)
        @message_window.add_instant_text(text)
        targets = @active_battler.action.make_targets
        display_attack_animation(targets)
        wait(20)
        for target in targets
          target.attack_effect(@active_battler)
          display_action_effects(target)
        end
      @active_battler.mp -= MP_TO_DECREASE[@active_battler.id - 1]
#~  
#~      else
#~         text1= "Not enough "
#~         text = text1 + MP_Types[@active_battler.id - 1]
#~         @message_window.add_instant_text(text)
#~         end
#~     p  "after" + @active_battler.name
#~     p @active_battler.mp
#~     p MP_TO_DECREASE[@active_battler.id - 1]
  end
end


MP_TO_DECREASE = [5,0,5,0,0,0,0,0] this is a list of all classes, and how much to decrese the "MP" (or ammo or health) by when they attack, to say they don't lost any, just put 0. On this class 1 and 3 lose 5 every attack and no other classes lose any thing! Thankyou!
jens009
QUOTE (kaimonkey @ Apr 12 2009, 03:05 PM) *
Well what scrips do people want, if no one gives a monkeys peanuts about the new version, do people only care about how stupid mastermind 29 year olds do three billion page scripts in there sleep but couldn't care less about when a small child, who pours there heart into learing somthing. Well what do you want, do you want me to just go away until Im so amazing that I cam make the best scripts in my sleep, does no one care atall about anyone who tring to learn somthing new, and only cares about those people who can script in there sleep, well someone just post here and tell to go away if im so bad at coding, if no ones going to bother even posting 1 one! I dont know, "thx" three letters too much for a days work, or maybe the fact that it took me a whole day when Kylock or Pim or whoever could do it in seconds. Well I don't care! Or maybe the reason no-one posts is because my scripts don't have 100's or errors in that people tell me about! MAYBE,JUST MAYBY, MY SCRIPTS DO WHAT THEY ARE TRYING TO DO AND DON'T HAVE A HUDRED BUGS!

Kai, there's no need to be outraged like that.

It is true that you are just learning scripting. However, I do think your scripts are wonderful. They are simple and easy to use. Short and sweet. =]. I'm kind of amazed that you learned scripting so quick! I remember a few months back you were asking for support. Now look at you, you're on your own making custom scripts. Excellent job. =D

Now, I'm sure nobody wants you out of here. Every scripter we have in RRR should be treasured. So in a way, you're a treasure too. If your scripts don't get enough attention, so what? Your script did what it was supposed to do. It didn't have any bugs or issues like those complicated scripts. Like I said, I enjoy your short and simple scripts.

You don't have to be amazing. No, not at all. People might not be appreciative right now, but trust me. This will come in handy for someone out there. They might find this script really useful.

Take me for example. I enjoy learning new tricks with RGSS. I didn't know you could use the colors on the system graphic to create your own gradient. That code snippet will be useful for me in the future. Heck, you just saved me a lot of time trying to figure out how to integrate different types of MP bars to different classes. This knowledge will be useful for me one way or another.

So don't be discouraged. Every script is useful. Besides, your script does what it's suppose to do.
kaimonkey
I was walking down a road and an apple hit my head, BUMP!
Octople Threat
Hey, Kaimonkey, I am having a problem when I am trying to use this script in conjunction with Yanfly's Interface Fix script, do you think you could fix it?

Here's the script...

CODE
#===============================================================================
#
# Yanfly Engine RD - Interface Fix
# Last Date Updated: 2009.04.23
# Level: Easy
#
# Redone the drawing fixes from the prototype version for the current Yanfly
# Engine. This one includes all the stuff you've seen before in the other fix
# but this time, HP and MP bars that are below their base HP and base MP will
# show another shade to indicate how much of them were shaved off. This also
# makes a better check for what to draw and reduce the overall bitmap overload
# from the interface itself.
#
# Status effects with an icon ID of zero will now be omitted. This is the
# default clear icon and shouldn't have anything in its place anyway. States
# with this empty icon will no longer clog up the limited area which states
# can be shown.
#
#===============================================================================
# Updates:
# ----------------------------------------------------------------------------
# o 2009.04.23 - Improved display for 0 MaxMP.
# o 2009.04.17 - Started script.
#===============================================================================
# Instructions
#===============================================================================
#
# Nothing to instruct, really. Just input this script somewhere and let it run
# its stuff. Adjust the values down below for quicker access to text colours.
#
#===============================================================================
#
# Compatibility
# - Overwrites: Window_Base, *_color, draw_actor_state
# - Overwrites: Window_Base, draw_actor_hp_gauge, draw_actor_mp_gauge
#
#===============================================================================

$imported = {} if $imported == nil
$imported["InterfaceFix"] = true

module YE
  module FIX
    module TEXT
    
      # This affects various colours used by the ingame system.
      NORMAL   = 0        # This is the normal text colour.
      SYSTEM   = 16       # This is the system text colour.
      CRISIS   = 17       # This is the critical HP colour.
      LOW_MP   = 17       # This is the low MP colour.
      KNOCKOUT = 18       # This is the knocked out colour.
      BACK_HP  = 19       # This is the gauge background colour for HP.
      BACK_MP  = 19       # This is the gauge background colour for HP.
      EXHAUST  = 7        # This is the exhaust colour.
      HPGAUGE1 = 20       # This is the first HP gauge colour.
      HPGAUGE2 = 21       # This is the second HP gauge colour.
      MPGAUGE1 = 23       # This is the first MP gauge colour.
      MPGAUGE2 = 24       # This is the second MP gauge colour.
      POWER_UP = 24       # This is the equips boost a stat colour.
      POWER_DN = 25       # This is the equips nerf a stat colour.
      
    end #module TEXT
    module DRAW
    
      # This affects when crisis level HP and low MP colours appear.
      HP_UNDER     = 25       # If Current HP is under this percent.
      MP_UNDER     = 25       # If Current MP is under this percent.
      
      GAUGE_HEIGHT = 6        # This adjusts the gauge height.
    
    end #module DRAW
  end # module FIX
end # module YE

#===============================================================================
# Editting anything past this point may potentially result in causing computer
# damage, incontinence, explosion of user's head, coma, death, and/or halitosis.
# Therefore, edit at your own risk.
#===============================================================================

#==============================================================================
# Window_Base
#==============================================================================

class Window_Base < Window

  #--------------------------------------------------------------------------
  # text colour overwrites
  #--------------------------------------------------------------------------
  def normal_color; return text_color(YE::FIX::TEXT::NORMAL); end
  def system_color; return text_color(YE::FIX::TEXT::SYSTEM); end
  def crisis_color; return text_color(YE::FIX::TEXT::CRISIS); end
  def low_mp_color; return text_color(YE::FIX::TEXT::LOW_MP); end
  def knockout_color; return text_color(YE::FIX::TEXT::KNOCKOUT); end
  def gauge_back_color; return text_color(YE::FIX::TEXT::BACK_HP); end
  def gauge_back_color_mp; return text_color(YE::FIX::TEXT::BACK_MP); end
  def exhaust_color; return text_color(YE::FIX::TEXT::EXHAUST); end
  def hp_gauge1_color; return text_color(YE::FIX::TEXT::HPGAUGE1); end
  def hp_gauge2_color; return text_color(YE::FIX::TEXT::HPGAUGE2); end
  def mp_gauge1_color; return text_color(YE::FIX::TEXT::MPGAUGE1); end
  def mp_gauge3_color; return text_color(YE::FIX::TEXT::MPGAUGE2); end
  def power_up_color; return text_color(YE::FIX::TEXT::POWER_UP); end
  def power_down_color; return text_color(YE::FIX::TEXT::POWER_DN); end
    
  #--------------------------------------------------------------------------
  # hp_colour and mp_colour
  #--------------------------------------------------------------------------
  def hp_color(actor)
    return knockout_color if actor.hp == 0
    per = YE::FIX::DRAW::HP_UNDER
    return crisis_color if actor.hp < (actor.maxhp * per / 100)
    return normal_color
  end
  def mp_color(actor)
    per = YE::FIX::DRAW::MP_UNDER
    return low_mp_color if actor.mp < (actor.maxmp * per / 100)
    return normal_color
  end
  
  #--------------------------------------------------------------------------
  # Draw HP Gauge
  #--------------------------------------------------------------------------
  def draw_actor_hp_gauge(actor, x, y, width = 120, height = nil)
    actor.hp = actor.maxhp if actor.hp > actor.maxhp
    gc0 = gauge_back_color
    gc1 = hp_gauge_color1
    gc2 = hp_gauge_color2
    if height == nil
      gh = YE::FIX::DRAW::GAUGE_HEIGHT
    else
      gh = height
    end
    gy = y + WLH - 8 - (gh - 6)
    if actor.maxhp < actor.base_maxhp and actor.base_maxhp > 0
      gb = width * actor.maxhp / actor.base_maxhp
      self.contents.fill_rect(x, gy, width, gh, exhaust_color)
    else
      gb = width
    end
    self.contents.fill_rect(x, gy, gb, gh, gc0)
    if actor.maxhp <= 0
      if actor.base_maxhp <= 0
        gw = width
      else
        gw = 0
      end
    else
      gw = gb * actor.hp / actor.maxhp
      self.contents.gradient_fill_rect(x, gy, gw, gh, gc1, gc2)
    end
  end
  
  #--------------------------------------------------------------------------
  # Draw MP Gauge
  #--------------------------------------------------------------------------
  def draw_actor_mp_gauge(actor, x, y, width = 120, height = nil)
    actor.mp = actor.maxmp if actor.mp > actor.maxmp
    gc0 = gauge_back_color_mp
    gc1 = mp_gauge_color1
    gc2 = mp_gauge_color2
    if height == nil
      gh = YE::FIX::DRAW::GAUGE_HEIGHT
    else
      gh = height
    end
    gy = y + WLH - 8 - (gh - 6)
    if actor.maxmp < actor.base_maxmp and actor.base_maxmp > 0
      gb = width * actor.maxmp / actor.base_maxmp
      self.contents.fill_rect(x, gy, width, gh, exhaust_color)
    else
      gb = width
    end
    self.contents.fill_rect(x, gy, gb, gh, gc0)
    if actor.maxmp <= 0
      if actor.base_maxmp <= 0
        gw = width
      else
        gw = 0
      end
    else
      gw = gb * actor.mp / actor.maxmp
    end
    self.contents.gradient_fill_rect(x, gy, gw, gh, gc1, gc2)
  end
  
  #--------------------------------------------------------------------------
  # Draw State
  #--------------------------------------------------------------------------
  def draw_actor_state(actor, x, y, width = 96)
    count = 0
    for state in actor.states
      unless state.icon_index == 0
        draw_icon(state.icon_index, x + 24 * count, y)
        count += 1
        break if (24 * count > width - 24)
      end
    end
  end
  
end #end Window_Base

#===============================================================================
#
# END OF FILE
#
#===============================================================================
kaimonkey
Um... they over ride each other, they are plain opersits, I'll see what I can do but theres a 99/100 chance that I won't be able to do it!
Octople Threat
Well, I kind of figure that it would be difficult to do, but I figured it couldn't hurt to ask. If you can't do it, no worries, at least you tried. Good luck, though! thumbsup.gif
Okamisolaris
-Snip-
kaimonkey
Just tell me what you are trying to do, are you just trying to configue it it, if so, post the classes colours and names of their MP, (and if they have it or if it decreases)
Okamisolaris
-Snip-
Okamisolaris
-Snip-
kaimonkey
Im sorry, but the second one is the only one I can do, but I'm neally done....
Okamisolaris
-Snip-
kaimonkey
well what classes do you want MP's for, what class ID's are they, what colour and and what name ,and what special effects (increasing or dereasing, when guarding or attacking)
Okamisolaris
-Snip-
Okamisolaris
-Snip-
kaimonkey
Well that can all be done with the script as is, exept the heal item, I'll try that, and then post the configuration you want
Okamisolaris
-Snip-
ParadiseLost
Could I use this same script for HP as well? just switch the names?
Okamisolaris
-Snip-
Okamisolaris
-Snip-
Surichi
I have a suggestion that would be kinda cool. A single character could have multiple MP types. Let's say Ralph has Dark, Light, and Neutral type MPs and each of his skills use one or the other MP, and maybe a combination of all or two MPs. So what do you think?
kaimonkey
As I have prevosly said, I cannot add more than one, as if you look, you see all I change is the coloure and the wording on the bar, and added a few features, Unforuantly, I would not be in tgis scrpit, soz
Octople Threat
You could just use Omegazion's SP system in conjunction with this. Kind of meld them together... Here's a link to it, http://www.rpgrevolution.com/forums/index....mp;#entry208977, and I can really see some possibilities in combining them.
Surichi
QUOTE (kaimonkey @ Jun 18 2009, 11:18 AM) *
As I have prevosly said, I cannot add more than one, as if you look, you see all I change is the coloure and the wording on the bar, and added a few features, Unforuantly, I would not be in tgis scrpit, soz

Oh yeah, sorry. My bad.
kaimonkey
No prob, but if you have any other ideas I'll be happy to hear them, the worst I can do is say no!
kaimonkey
Version 5 is up! biggrin.gif laugh.gif biggrin.gif
Okamisolaris
-Snip-
Demos Kerrigan
Sorry for the necroposting but I wanted to say that your script is deadly awesome. Good work for someone who started scripting few months ago ^^.
kaimonkey
That counts as necroposting!?!, last post was only 3 days ago!

Any way thanks, any suggestions are welcome, wanted and pleaded for! smile.gif
Okamisolaris
-Snip-
Okamisolaris
-Snip-
silvershadic
Sorry for this necropost. Is it possible to get a YEM patch?
crudonia
THIS WHAT I NEEDED THANK YOU!!
kaimonkey
QUOTE (silvershadic @ May 15 2011, 02:19 AM) *
Sorry for this necropost. Is it possible to get a YEM patch?


It's a month late, so you probably won't need it, but as it's already been necroposted twice I see no harm in asking.

What do you mean by a YEM patch (I havn't been active on these forums for a while), and do you still need it?
SaturnJohn
QUOTE (kaimonkey @ Jun 26 2011, 01:53 AM) *
QUOTE (silvershadic @ May 15 2011, 02:19 AM) *
Sorry for this necropost. Is it possible to get a YEM patch?


It's a month late, so you probably won't need it, but as it's already been necroposted twice I see no harm in asking.

What do you mean by a YEM patch (I havn't been active on these forums for a while), and do you still need it?

i believe he wants it to be compatible with yanfly engine melody. it isn't the most compatible script, because i believe it rewrites the entire battle system. therefore, a huge rewrite is needed, i think. ignore.

at any rate, you have made a good script! keep it up!
Jonnie19
IF you would be willing to make it compatible it would be highly useful. It doesn't work in Battles. You go back to the original MP names biggrin.gif
Thanks
Kread-EX
You should PM silvershadic for that, because he asked me to do it for him. I don't have the fix anymore but he should have it.
kaimonkey
I'm still amazed that after almost 2 years of me not touching it something I made is still used.
silvershadic
QUOTE (kaimonkey @ Jun 26 2011, 01:53 AM) *
QUOTE (silvershadic @ May 15 2011, 02:19 AM) *
Sorry for this necropost. Is it possible to get a YEM patch?


It's a month late, so you probably won't need it, but as it's already been necroposted twice I see no harm in asking.

What do you mean by a YEM patch (I havn't been active on these forums for a while), and do you still need it?

Kread helped me out with the patch. The option to lose/gain mp on attack/guard doesn't work ((Though I figured out how I could get around this))
apoclaydon
sorry for necro posting

QUOTE (Octople Threat @ Jun 18 2009, 05:00 PM) *
You could just use Omegazion's SP system in conjunction with this. Kind of meld them together... Here's a link to it, http://www.rpgrevolution.com/forums/index....mp;#entry208977, and I can really see some possibilities in combining them.


thank you for the idea it works
one quick question tho can abbreviations be added or not
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.