Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fyre < Status Menu
#1
Fyre < Status Menu
by FyreXKnight
Jul 1 2008

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


Info:

Alright, let me first start off by saying that this is my very first script and quite honestly it's not really mine. I just edited the existing classes and added the Gradient bars (by SephirothSpawn). If you think it sucks or if you think it's great, give me ideas on how to improve it.


Instructions:

For the full-sized picture of the character, the name of the picture should be the character's name + "(Status)". So if your character's name is Aluxes, then the picture's name should be "Aluxes(Status)". The resolution is 232 x 434.

For the extra information, the name of the picture should be the character's name + "(Extra)". So if your character's name is Aluxes, then the picture's name should be "Aluxes(Extra)". The resolution is 244 x 209. On a side note, as mentioned below, I'm not too good a scripter, as this is my first one. So until I can figure out something else, all of the extra info has to be in graphic form.


Enhancements:

0=]===> Rearranged everything so that's it's more organized.
0=]===> Added the gradient bars so that the status screen doesn't look so bland.
0=]===> Added the actor full-sized pics (mostly meant for the pics from Naramura, but they can be your own custom ones).
0=]===> Added the actor extra section so you can put anything extra you want for the character such as text (which as of now has to be in a graphical form) or a picture representing their element or anything else you would like it to be, it just has to be in graphical form (at least until I learn a little more about scripting).


Bugs:

0=]===> As far as I know, the only bug is with the slant bars. Once the character is at level 99, it glitches and gives you a script error. Everything is fine otherwise.


Custom Status Script
Just insert this right above Main and name it Fyre < Status.
Code:
module FYRECUSTOMSTATUS
# Highest value that the character's stats can reach.
ST_MAX = 999
# The extra title for the actors.
ST_EXTRA = "Biography:"
end


#==============================================================================
# ** Window_BaseStatus
#------------------------------------------------------------------------------
#  I'm just adding a few methods to Window_Base and changing some values.
#==============================================================================

class Window_BaseStatus < Window
  
   def initialize(x, y, width, height)
    super()
    @windowskin_name = $game_system.windowskin_name
    self.windowskin = RPG::Cache.windowskin(@windowskin_name)
    self.x = x
    self.y = y
    self.width = width
    self.height = height
    self.z = 100
  end
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  def dispose
    # Dispose if window contents bit map is set
    if self.contents != nil
      self.contents.dispose
    end
    super
  end
  #--------------------------------------------------------------------------
  # * Get Text Color
  #     n : text color number (0-7)
  #--------------------------------------------------------------------------
  def text_color(n)
    case n
    when 0
      return Color.new(255, 255, 255, 255)
    when 1
      return Color.new(128, 128, 255, 255)
    when 2
      return Color.new(255, 128, 128, 255)
    when 3
      return Color.new(128, 255, 128, 255)
    when 4
      return Color.new(128, 255, 255, 255)
    when 5
      return Color.new(255, 128, 255, 255)
    when 6
      return Color.new(255, 255, 128, 255)
    when 7
      return Color.new(192, 192, 192, 255)
    else
      normal_color
    end
  end
  #--------------------------------------------------------------------------
  # * Get Normal Text Color
  #--------------------------------------------------------------------------
  def normal_color
    return Color.new(255, 255, 255, 255)
  end
  #--------------------------------------------------------------------------
  # * Get Disabled Text Color
  #--------------------------------------------------------------------------
  def disabled_color
    return Color.new(255, 255, 255, 128)
  end
  #--------------------------------------------------------------------------
  # * Get System Text Color
  #--------------------------------------------------------------------------
  def system_color
    return Color.new(192, 224, 255, 255)
  end
  #--------------------------------------------------------------------------
  # * Get Crisis Text Color
  #--------------------------------------------------------------------------
  def crisis_color
    return Color.new(255, 255, 64, 255)
  end
  #--------------------------------------------------------------------------
  # * Get Knockout Text Color
  #--------------------------------------------------------------------------
  def knockout_color
    return Color.new(255, 64, 0)
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    # Reset if windowskin was changed
    if $game_system.windowskin_name != @windowskin_name
      @windowskin_name = $game_system.windowskin_name
      self.windowskin = RPG::Cache.windowskin(@windowskin_name)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Graphic
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #--------------------------------------------------------------------------
  def draw_actor_graphic(actor, x, y)
    bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
    cw = bitmap.width / 4
    ch = bitmap.height / 4
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  end
  #--------------------------------------------------------------------------
  # * Draw Name
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #--------------------------------------------------------------------------
  def draw_actor_name(actor, x, y)
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y, 120, 32, actor.name)
  end
  #--------------------------------------------------------------------------
  # * Draw Class
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #--------------------------------------------------------------------------
  def draw_actor_class(actor, x, y)
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y, 236, 32, actor.class_name)
  end
  #--------------------------------------------------------------------------
  # * Draw Level
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #--------------------------------------------------------------------------
  def draw_actor_level(actor, x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, 32, "Lv.")
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 10, y, 24, 32, actor.level.to_s, 2)
  end
  
  ###########################################################################
###
  #Draws the actors full picture in the status window.
  ###########################################################################
###
  
  def draw_actor_full(actor, x, y)
    actorfull = RPG::Cache.picture(actor.name + "(Status)")
    cw = actorfull.width
    ch = actorfull.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x - cw / 2, y - ch, actorfull, src_rect)
  end
  
  ###########################################################################
###
  #Draws the picture for the extra information for each actor.
  ###########################################################################
###
  
  def draw_actor_extra(actor, x, y)
    actorextra = RPG::Cache.picture(actor.name + "(Extra)")
    text = FYRECUSTOMSTATUS::ST_EXTRA
    cw = actorextra.width
    ch = actorextra.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x - cw / 2, y - ch, actorextra, src_rect)
    self.contents.draw_text(x / 3, y - 219, 120, 32, text, 2)
  end
  
  
  #--------------------------------------------------------------------------
  # * Make State Text String for Drawing
  #     actor       : actor
  #     width       : draw spot width
  #     need_normal : Whether or not [normal] is needed (true / false)
  #--------------------------------------------------------------------------
  def make_battler_state_text(battler, width, need_normal)
    # Get width of brackets
    brackets_width = self.contents.text_size("[]").width
    # Make text string for state names
    text = ""
    for i in battler.states
      if $data_states[i].rating >= 1
        if text == ""
          text = $data_states[i].name
        else
          new_text = text + "/" + $data_states[i].name
          text_width = self.contents.text_size(new_text).width
          if text_width > width - brackets_width
            break
          end
          text = new_text
        end
      end
    end
    # If text string for state names is empty, make it [normal]
    if text == ""
      if need_normal
        text = "[Normal]"
      end
    else
      # Attach brackets
      text = "[" + text + "]"
    end
    # Return completed text string
    return text
  end
  #--------------------------------------------------------------------------
  # * Draw State
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #--------------------------------------------------------------------------
  def draw_actor_state(actor, x, y, width = 120)
    text = make_battler_state_text(actor, width, true)
    self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color
    self.contents.draw_text(x, y, width, 32, text)
  end

  #--------------------------------------------------------------------------
  # * Draw HP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #--------------------------------------------------------------------------
  def draw_actor_hp(actor, x, y, width = 144)
    # Draw "HP" text string
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
    # Calculate if there is draw space for MaxHP
    if width - 32 >= 108
      hp_x = x + width - 108
      flag = true
    elsif width - 32 >= 48
      hp_x = x + width - 48
      flag = false
    end
    # Draw HP
    self.contents.font.color = actor.hp == 0 ? knockout_color :
      actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
    self.contents.draw_text(hp_x, y, 32, 32, actor.hp.to_s, 2)
    # Draw MaxHP
    if flag
      self.contents.font.color = normal_color
      self.contents.draw_text(hp_x + 32, y, 12, 32, "/", 1)
      self.contents.draw_text(hp_x + 46, y, 48, 32, actor.maxhp.to_s)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw SP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #--------------------------------------------------------------------------
  def draw_actor_sp(actor, x, y, width = 144)
    # Draw "SP" text string
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
    # Calculate if there is draw space for MaxHP
    if width - 32 >= 108
      sp_x = x + width - 108
      flag = true
    elsif width - 32 >= 48
      sp_x = x + width - 48
      flag = false
    end
    # Draw SP
    self.contents.font.color = actor.sp == 0 ? knockout_color :
      actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
    self.contents.draw_text(sp_x, y, 32, 32, actor.sp.to_s, 2)
    # Draw MaxSP
    if flag
      self.contents.font.color = normal_color
      self.contents.draw_text(sp_x + 32, y, 12, 32, "/", 1)
      self.contents.draw_text(sp_x + 46, y, 48, 32, actor.maxsp.to_s)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Parameter
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     type  : parameter type (0-6)
  #--------------------------------------------------------------------------
  def draw_actor_parameter(actor, x, y, type)
    case type
    when 0
      parameter_name = $data_system.words.atk
      parameter_value = actor.atk
    when 1
      parameter_name = $data_system.words.pdef
      parameter_value = actor.pdef
    when 2
      parameter_name = $data_system.words.mdef
      parameter_value = actor.mdef
    when 3
      parameter_name = $data_system.words.str
      parameter_value = actor.str
    when 4
      parameter_name = $data_system.words.dex
      parameter_value = actor.dex
    when 5
      parameter_name = $data_system.words.agi
      parameter_value = actor.agi
    when 6
      parameter_name = $data_system.words.int
      parameter_value = actor.int
    end
    self.contents.font.color = system_color
    self.contents.draw_text(x, y + 2, 120, 32, parameter_name)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 105, y, 36, 32, parameter_value.to_s, 2)
  end
  
  #--------------------------------------------------------------------------
  # * Draw Item Name
  #     item : item
  #     x    : draw spot x-coordinate
  #     y    : draw spot y-coordinate
  #--------------------------------------------------------------------------
  def draw_item_name(item, x, y)
    if item == nil
      return
    end
    bitmap = RPG::Cache.icon(item.icon_name)
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 28, y, 212, 32, item.name)
  end

  ###########################################################################
###
  # * Draw Slant Bar(by SephirothSpawn)
  ###########################################################################
###
  def draw_slant_bar(x, y, min, max, width = 152, height = 6,
      bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))
    # Draw Border
    for i in 0..height
      self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
    end
    # Draw Background
    for i in 1..(height - 1)
      r = 100 * (height - i) / height + 0 * i / height
      g = 100 * (height - i) / height + 0 * i / height
      b = 100 * (height - i) / height + 0 * i / height
      a = 255 * (height - i) / height + 255 * i / height
      self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
    end
    # Draws Bar
    for i in 1..( (min / max.to_f) * width - 1)
      for j in 1..(height - 1)
        r = bar_color.red * (width - i) / width + end_color.red * i / width
        g = bar_color.green * (width - i) / width + end_color.green * i / width
        b = bar_color.blue * (width - i) / width + end_color.blue * i / width
        a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
        self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
      end
    end
  end
end
#==============================================================================
# ** Window_Status
#------------------------------------------------------------------------------
#  This window displays full status specs on the status screen.
#==============================================================================

class Window_Status < Window_BaseStatus
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor : actor
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 0, 640, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.name = "Century Gothic"
    self.contents.font.size = 18
    draw_actor_full(@actor, 490, 450)
    draw_actor_name(@actor, 4, 0)
    draw_actor_class(@actor, 4 + 144, 0)
    draw_actor_level(@actor, 80, 0)
    draw_actor_state(@actor, 300, 0)
    draw_slant_bar(x + 43, y + 58, @actor.hp, @actor.maxhp, 65, 6, bar_color = Color.new(200, 200, 255, 255), end_color = Color.new(24, 68, 196, 255))
    draw_slant_bar(x + 43, y + 88, @actor.sp, @actor.maxsp, 65, 6, bar_color = Color.new(245, 216, 223, 255), end_color = Color.new(188, 2, 218, 255))
    draw_slant_bar(x + 205, y + 58, @actor.exp_s.to_i, @actor.next_exp_s.to_i, 130, 6, bar_color = Color.new(130, 255, 130, 255), end_color = Color.new(70, 255, 70, 255))
    draw_actor_hp(@actor, 4, 42, 144)
    draw_actor_sp(@actor, 4, 72, 144)
    draw_slant_bar(x + 95, y + 136, @actor.atk, FYRECUSTOMSTATUS::ST_MAX, 80, 6, bar_color = Color.new(255, 50, 50, 255), end_color = Color.new(196, 24, 68, 255))
    draw_actor_parameter(@actor, 4, 120, 0)
    draw_slant_bar(x + 95, y + 156, @actor.pdef, FYRECUSTOMSTATUS::ST_MAX, 80, 6, bar_color = Color.new(50, 255, 50, 255), end_color = Color.new(196, 24, 68, 255))
    draw_actor_parameter(@actor, 4, 140, 1)
    draw_slant_bar(x + 95, y + 176, @actor.mdef, FYRECUSTOMSTATUS::ST_MAX, 80, 6, bar_color = Color.new(50, 50, 255, 255), end_color = Color.new(196, 24, 68, 255))
    draw_actor_parameter(@actor, 4, 160, 2)
    draw_slant_bar(x + 281, y + 136, @actor.str, FYRECUSTOMSTATUS::ST_MAX, 80, 6, bar_color = Color.new(255, 50, 50, 255), end_color = Color.new(196, 24, 68, 255))
    draw_actor_parameter(@actor, 190, 120, 3)
    draw_slant_bar(x + 281, y + 156, @actor.dex, FYRECUSTOMSTATUS::ST_MAX, 80, 6, bar_color = Color.new(255, 128, 0, 255), end_color = Color.new(196, 24, 68, 255))
    draw_actor_parameter(@actor, 190, 140, 4)
    draw_slant_bar(x + 281, y + 176, @actor.agi, FYRECUSTOMSTATUS::ST_MAX, 80, 6, bar_color = Color.new(50, 255, 50, 255), end_color = Color.new(196, 24, 68, 255))
    draw_actor_parameter(@actor, 190, 160, 5)
    draw_slant_bar(x + 281, y + 196, @actor.int, FYRECUSTOMSTATUS::ST_MAX, 80, 6, bar_color = Color.new(50, 50, 255, 255), end_color = Color.new(196, 24, 68, 255))
    draw_actor_parameter(@actor, 190, 180, 6)
    draw_actor_extra(@actor, 130, 450)
    self.contents.font.color = system_color
    self.contents.draw_text(165, 42, 80, 32, "Exp.")
    self.contents.font.color = normal_color
    self.contents.draw_text(165, 42, 84, 32, @actor.exp_s, 2)
    self.contents.draw_text(165 + 35, 42, 84, 32, "/", 2)
    self.contents.draw_text(165 + 82, 42, 84, 32, @actor.next_exp_s, 2)
    self.contents.font.color = system_color
    self.contents.draw_text(270, 260, 96, 32, "Equipment")
    draw_item_name($data_weapons[@actor.weapon_id], 270, 298)
    draw_item_name($data_armors[@actor.armor1_id], 270, 326)
    draw_item_name($data_armors[@actor.armor2_id], 270, 354)
    draw_item_name($data_armors[@actor.armor3_id], 270, 382)
    draw_item_name($data_armors[@actor.armor4_id], 270, 410)
  end
  def dummy
    self.contents.font.color = system_color
    self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
    self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
    self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
    self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
    self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
    draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
    draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
    draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
    draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
    draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
  end
end

#==============================================================================
# ** Scene_Status
#------------------------------------------------------------------------------
#  This class performs status screen processing.
#==============================================================================

class Scene_Status
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor_index : actor index
  #--------------------------------------------------------------------------
  def initialize(actor_index = 0, equip_index = 0)
    @actor_index = actor_index
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Get actor
    @actor = $game_party.actors[@actor_index]
    # Make status window
    @status_window = Window_Status.new(@actor)
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to menu screen
      $scene = Scene_Menu.new(3)
      return
    end
    # If R button was pressed
    if Input.trigger?(Input::RIGHT)
      # Play cursor SE
      $game_system.se_play($data_system.cursor_se)
      # To next actor
      @actor_index += 1
      @actor_index %= $game_party.actors.size
      # Switch to different status screen
      $scene = Scene_Status.new(@actor_index)
      return
    end
    # If L button was pressed
    if Input.trigger?(Input::LEFT)
      # Play cursor SE
      $game_system.se_play($data_system.cursor_se)
      # To previous actor
      @actor_index += $game_party.actors.size - 1
      @actor_index %= $game_party.actors.size
      # Switch to different status screen
      $scene = Scene_Status.new(@actor_index)
      return
    end
  end
end


Credits/Thanks:

I don't need credit or want it really. This script isn't for me to bask in.

Thanks to: SephirothSpawn for his gradient bars; Anyone who uses this script.
}


Possibly Related Threads…
Thread Author Replies Views Last Post
  Compact Status Window Cockroach 0 2,972 01-24-2013, 01:00 PM
Last Post: Cockroach
  Run Common Events in Menu GubiD 0 2,152 08-12-2007, 01:00 PM
Last Post: GubiD
  TDS status window Sephirothtds 0 1,948 03-05-2007, 01:00 PM
Last Post: Sephirothtds
  GameOver Menu sasuke89 0 2,094 09-18-2006, 01:00 PM
Last Post: sasuke89
  GameOver Menu Script sasuke89 0 2,097 06-08-2006, 01:00 PM
Last Post: sasuke89
  Victory counter in menu garfunkle 0 2,165 01-05-2006, 01:00 PM
Last Post: garfunkle
  Ten items in equip menu! Jimmie 0 2,250 08-13-2005, 01:00 PM
Last Post: Jimmie
  Bag item menu rune76 0 1,883 08-12-2005, 01:00 PM
Last Post: rune76



Users browsing this thread: