Help - Search - Members - Calendar
Full Version: ASCIIgod rename MP Vocab each class Lv:3
RPG RPG Revolution Forums > Scripting > Script Tutorials > RGSS2
ASCIIgod
ASCIIgod rename MP







INTRODUCTION

okay so i was amaze on how kaimonkey's MP script. the way of having different MP per class... however, i was expecting that it is still the same mp just renamed vocab mp and vocab mp_a... so why not make it quite simplier without the different potion usage...

how to use
so how to use it? you can refer to my other scripts but to say it here, i uses hash most for the modules... so quite easy to use...

credit goes to me and some to kaimonkey for the idea...

here comes the script
Scripts
Copy this into a new place on your scripts... preferable below all...

script

CODE
#ASCIIgod rename MP Vocab each class Lv:3
#
# a simpler MP rename script without the same function as the one in the net
#
# Lv:1 = Initial coding. Name Functions
# Lv:2 = choose from 2 characters or name
# Lv:3 = recoulor gauges depending on what you chooses
################################################################################

module ASCIIGOD
  module RENAME_MP
    
    #Format::Class_id => "name"
    NAME_MP_CLASS =
    {
      1 => "Mana",
      2 => "Tech",
      3 => "Mana",
      4 => "Mana",
      5 => "Tech",
      6 => "Mana",
      7 => "Mana",
      8 => "Mana",
      9 => "Chi",
      10 => "Tech",
      11 => "Mana",
      12 => "Power",
      13 => "Power",
      14 => "Rune",
      15 => "Bond",
      16 => "Sleight",
      17 => "Sleight",
      18 => "Sleight",
      19 => "Mana",
      20 => "Mana",
    }
    
    #Usage::1 = full name, 0 = abbreviation
    TYPE_NAME = 0
    
    #Format::Class_id => "abbreviation"
    NAME_MP_CLASS_A =
    {
      1 => "Mp",
      2 => "Tp",
      3 => "Mp",
      4 => "Mp",
      5 => "Tp",
      6 => "Mp",
      7 => "Mp",
      8 => "Mp",
      9 => "Cp",
      10 => "Tp",
      11 => "Mp",
      12 => "Pp",
      13 => "Pp",
      14 => "Rp",
      15 => "Bp",
      16 => "Sp",
      17 => "Sp",
      18 => "Sp",
      19 => "Mp",
      20 => "Mp",
    }
    
    GAUGE_COULOR_1 =
    {
      1 => 22,
      2 => 24,
      3 => 26,
      4 => 28,
      5 => 30,
      6 => 32,
      7 => 34,
      8 => 36,
      9 => 38,
      10 => 40,
      11 => 42,
      12 => 44,
      13 => 46,
      14 => 48,
      15 => 50,
      16 => 22,
      17 => 22,
      18 => 22,
      19 => 22,
      20 => 22,
    }
    
    GAUGE_COULOR_2 =
    {
      1 => 23,
      2 => 23,
      3 => 23,
      4 => 23,
      5 => 23,
      6 => 23,
      7 => 23,
      8 => 23,
      9 => 23,
      10 => 23,
      11 => 23,
      12 => 23,
      13 => 23,
      14 => 23,
      15 => 23,
      16 => 23,
      17 => 23,
      18 => 23,
      19 => 23,
      20 => 23,
    }
    
  end
end

class Window_Base
  
  def draw_actor_mp(actor, x, y, width = 120)
    draw_actor_mp_gauge(actor, x, y, width)
    self.contents.font.color = system_color
    case ASCIIGOD::RENAME_MP::TYPE_NAME
    when 0
      text = ASCIIGOD::RENAME_MP::NAME_MP_CLASS_A[actor.class.id]
    when 1
      text = ASCIIGOD::RENAME_MP::NAME_MP_CLASS[actor.class.id]
    else
      text = ASCIIGOD::RENAME_MP::NAME_MP_CLASS[actor.class.id]
    end
    
    self.contents.draw_text(x, y, 30, WLH, text)
    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
  
  def draw_actor_mp_gauge(actor, x, y, width = 120)
    gw = width * actor.mp / [actor.maxmp, 1].max
    gc1 = text_color(ASCIIGOD::RENAME_MP::GAUGE_COULOR_1[actor.class.id])
    gc2 = text_color(ASCIIGOD::RENAME_MP::GAUGE_COULOR_2[actor.class.id])
    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
end

Kread-EX
You know, it would be easier to make your script use the default value and only replace it if an entry exists, rather than forcing the user to fill a name for all the classes.
Resource Dragon
I'm confused. What's it do? huh.gif

EDIT: wait, it gives different classes different abilities? Like a wizard can have magic, a warrior can have skills?
Kread-EX
Nah, it just renames the MP according to the class. The mechanics don't change.
Resource Dragon
Oh, so it changes the MP name, and not the in-battle skill tab?

If it did both, that would be neat. Almost like Final Fantasy.
ASCIIgod
as i said the basis is kaimonkey's mp script but i omitted the feature of using different potions since what kaimonkey's script does is like this, rename the vocab mp and vocab mp_a and why i did not make the way you expected kread is that some class uses the same material for casting spells like for example, a wizard gather mana particle around his surrounding converting it to elemental particles but a necromancer gather mana just to convert into negative life force(zombie lifeforce if you put it that way)
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.