The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX => VX Scripts Database => Topic started by: cozziekuns on May 04, 2010, 03:31:27 AM

Title: Cozziekuns' Status Screen
Post by: cozziekuns on May 04, 2010, 03:31:27 AM
Cozziekuns' Status Screen
Version: 1.2
Author: cozziekuns
Date: May 3, 2010

Version History



Planned Future Versions


Description


A touched up version of the dull scene status. By the way, the watermarks that I used are Yggdra Union ones. They're probably definitely copyrighted, so if you're gonna make a commercial game or whatever, I don't recommend using them. They're crappy quality because I didn't spend much time photoshopping them.

You can find the Yggdra Union pictures attached to this post. I just used them because I had nothing better to use.

Features


Screenshots

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi39.tinypic.com%2F23m6fxh.png&hash=f870f66220ef1543f06504348a7e6c5afb539e76)

Instructions

See header. Make sure that you have MA's Paragraph Formatter (http://rmrk.net/index.php?topic=25129.0), included in the demo.

Script


Code: [Select]
#===============================================================================
#
# Cozziekuns' Status Screen
# Last Date Updated: 11/28/2010
#
# A status screen. A nice looking one at that.
#
#===============================================================================
# Updates
# -----------------------------------------------------------------------------
# o 18/07/11 - Updated Script.
# o 11/28/10 - Started Script.
#===============================================================================
# What's to come?
# -----------------------------------------------------------------------------
# o I dunno. You tell me!
#===============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ? Materials but above ? Main. Remember to save. You can
# edit the modules as you wish.
#
# The background images should be of size 544 * 416. When importing a background
# image, import it to the folder Graphics/Pictures. The name of the actor should
# be on the name of the file, followed by _bg.
#
# Example: Raven_bg
#===============================================================================

module COZZIEKUNS
 
  BACKGROUND_OPACITY = 100
 
  HP_ICON = 99
  MP_ICON = 100
  EXP_ICON = 98
  LEVEL_ICON = 62
  ATTACK_ICON = 26
  DEFENSE_ICON = 52
  SPIRIT_ICON = 20
  AGILITY_ICON = 49
 
  CLASS_ICONS ={
            0 => 0,
            1 => 16,
            2 => 32,
            3 => 21,
            4 => 8,
      }
   BIOGRAPHIES ={
      # Actor => Biography
            0 => "I like pie.",
            1 => "Our average hero who hails from a family that lives in poverty.",
            2 => "Our hero's best friend, but sometimes worst rival. Can be irrational at times.",
            3 => "Our 3rd hero, a magician with a nice personality, and has powerful skills to boot.",
            4 => "Our 4th hero, a thief shrouded in mystery. Not much is known about Sora, except she's damn pro.",
      }
end

#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  This is a superclass of all windows in the game.
#==============================================================================

class Window_Base < Window
  #--------------------------------------------------------------------------
  # * Get Exp Gauge Colour 1
  #--------------------------------------------------------------------------
  def exp_gauge_colour1
    return text_color(7)
  end
  #--------------------------------------------------------------------------
  # * Get Exp Gauge Colour 2
  #--------------------------------------------------------------------------
  def exp_gauge_colour2
    return text_color(8)
  end
end
#==============================================================================
# ** Window_Status
#------------------------------------------------------------------------------
#  This window displays full status specs on the status screen.
#==============================================================================

class Window_Status < Window_Base
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_back(@actor, 0, 0)
    unless Input.press?(Input::A)
      @hp_icon = COZZIEKUNS::HP_ICON
      @mp_icon = COZZIEKUNS::MP_ICON
      @exp_icon = COZZIEKUNS::EXP_ICON
      @level_icon = COZZIEKUNS::LEVEL_ICON
      @atk_icon = COZZIEKUNS::ATTACK_ICON
      @def_icon = COZZIEKUNS::DEFENSE_ICON
      @spi_icon = COZZIEKUNS::SPIRIT_ICON
      @agi_icon = COZZIEKUNS::AGILITY_ICON
      draw_actor_name(@actor, 4, 0)
      draw_actor_class(@actor, 160, 0)
      draw_icon(62, 128, 32)
      draw_icon(98, 128, WLH * 3 + 32)
      draw_icon(99, 128, WLH + 32)
      draw_icon(100, 128, WLH * 2 + 32)
      draw_icon(26, 320, 33)
      draw_icon(52, 320, 33 + WLH + 1)
      draw_icon(20, 320, 33 + WLH * 2 + 2)
      draw_icon(49, 320, 33 + WLH * 3 + 3)
      if COZZIEKUNS::CLASS_ICONS.include?(@actor.id)
        @icon_number = COZZIEKUNS::CLASS_ICONS[@actor.id]
      else
        @icon_number = COZZIEKUNS::CLASS_ICONS[0]
      end
      draw_icon(@icon_number, 128, 0)
      draw_actor_face(@actor, 8, 32)
      draw_basic_info(160, 32)
      draw_parameters(352, 32)
      draw_actor_tnl(@actor, 160, WLH * 3 + 32)
      draw_equipments(288, 154)
      self.contents.font.color = system_color
      self.contents.draw_text(320, 0, 80, WLH, "Status:", 0)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Basic Information
  #     x : Draw spot X coordinate
  #     y : Draw spot Y coordinate
  #--------------------------------------------------------------------------
  def draw_basic_info(x, y)
    draw_actor_level(@actor, x, y + WLH * 0)
    draw_actor_state(@actor, 400, 0)
    draw_actor_hp(@actor, x, y + WLH * 1)
    draw_actor_mp(@actor, x, y + WLH * 2)
  end
  #--------------------------------------------------------------------------
  # * Draw Actor Back
  #     actor : the actor you want
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #--------------------------------------------------------------------------
  def draw_actor_back(actor, x, y)
    @background_opacity = COZZIEKUNS::BACKGROUND_OPACITY
    bitmap = Cache.picture(actor.name + "_bg")
    rect = Rect.new(0, 0, 544,416)
    self.contents.blt(x, y, bitmap, rect, @background_opacity)
    bitmap.dispose
  end
  #--------------------------------------------------------------------------
  # * Draw Equipment
  #     x : Draw spot X coordinate
  #     y : Draw spot Y coordinate
  #--------------------------------------------------------------------------
  def draw_equipments(x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 120, WLH, Vocab::equip + "s:")
    for i in 0..4
      draw_item_name(@actor.equips[i], x + 16, y + 11 + WLH * (i + 1))
    end
  end
  #--------------------------------------------------------------------------
  # * Draw TNL (To next level)
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : Width
  #--------------------------------------------------------------------------
  def draw_actor_tnl(actor, x, y, width = 120)
    draw_actor_tnl_gauge(actor, x, y, width)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 30, WLH, "E")
    self.contents.font.color = hp_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.exp_s, 2)
    else
      self.contents.draw_text(xr - 99, y, 44, WLH, actor.exp_s, 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.next_exp_s, 2)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw TNL gauge
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : Width
  #--------------------------------------------------------------------------
  def draw_actor_tnl_gauge(actor, x, y, width = 120)
    gw = width * actor.exp_s / actor.next_exp_s
    gc1 = exp_gauge_colour1
    gc2 = exp_gauge_colour2
    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
  #--------------------------------------------------------------------------
  # * Update
  #--------------------------------------------------------------------------
  def update
    super
    refresh
  end
end

#==============================================================================
# ** Window_Biography
#------------------------------------------------------------------------------
#  Basically what Yanfly did. Kudos to you, Yanfly.
#==============================================================================

class Window_Biography < Window_Base
  #--------------------------------------------------------------------------
  # * Initalize
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 154, 288, 416)
    @actor = actor
    self.opacity = 0
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    unless Input.press?(Input::A)
      self.contents.font.color = system_color
      self.contents.draw_text(4, 0, 284, WLH, "Biography:", 0)
      self.contents.font.color = normal_color
      self.contents.font.size = 20
      if COZZIEKUNS::BIOGRAPHIES.include?(@actor.id)
        text = COZZIEKUNS::BIOGRAPHIES[@actor.id]
      else
        text = COZZIEKUNS::BIOGRAPHIES[0]
      end
      self.contents.draw_paragraph(4, 32, 252, WLH * 4, text)
    end
  end
  #--------------------------------------------------------------------------
  # * Update
  #--------------------------------------------------------------------------
  def update
    super
    refresh
  end
end

#==============================================================================
# ** Window_Status_Help
#------------------------------------------------------------------------------
#  Helps you out, I guess...
#==============================================================================

class Window_StatusHelp < Window_Base
  #--------------------------------------------------------------------------
  # * Initalize
  #--------------------------------------------------------------------------
  def initialize(x, y)
    super(x, y, 544, 60)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
   self.contents.draw_text(4, 0, 544, WLH, "Press Q and W to switch characters. Press X to exit.")
  end
end

#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles actors. It's used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler 
  #--------------------------------------------------------------------------
  # * Get Experience String
  #--------------------------------------------------------------------------
  def exp_s
    return @exp_list[@level+1] > 0 ? @exp : 1
  end
  #--------------------------------------------------------------------------
  # * Get String for Next Level Experience
  #--------------------------------------------------------------------------
  def next_exp_s
    return @exp_list[@level+1] > 0 ? @exp_list[@level+1] : 1
  end
  #--------------------------------------------------------------------------
  # * Get String for Experience to Next Level
  #--------------------------------------------------------------------------
  def next_rest_exp_s
    return @exp_list[@level+1] > 0 ? (@exp_list[@level+1] - @exp) : 1
  end
end
 
#==============================================================================
# ** Scene_Status
#------------------------------------------------------------------------------
#  This class performs the status screen processing.
#==============================================================================

class Scene_Status < Scene_Base
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  alias coz_ssw_ss_start start
  def start
    coz_ssw_ss_start
    @bio_window = Window_Biography.new(@actor)
    @statushelp_window = Window_StatusHelp.new(0, 356)
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  alias coz_ssw_ss_terminate terminate
  def terminate
    coz_ssw_ss_terminate
    @bio_window.dispose
    @statushelp_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Update Processing
  #--------------------------------------------------------------------------
  alias coz_ssw_ss_update update
  def update
    coz_ssw_ss_update
    @bio_window.update
    @statushelp_window.update
  end
end

Credit



Thanks


Support


Just post down here.

Known Compatibility Issues

Guess it won't work with other status screens. But otherwise, none as of yet.
Title: Re: Cozziekuns' Status Screen
Post by: modern algebra on May 04, 2010, 05:07:39 AM
I like it! :)
Title: Re: Cozziekuns' Status Screen
Post by: Opozorilo on November 28, 2010, 02:35:34 PM
I like it too, it's great :D
though I'm having a problem with it
When I change the Biography It just doesn't work
Instead of using the whole biography space, it just cuts in the first line...
so ..is there a way to fix this? D:
Title: Re: Cozziekuns' Status Screen
Post by: cozziekuns on November 28, 2010, 05:15:27 PM
Well, since I didn't have any paragraph formatting, you'll have to put a "|" (Not an I, but a |) every time you want a line break.

EDIT: Ignore this, I added in paragraph formatting.
Title: Re: Cozziekuns' Status Screen
Post by: Wiimeiser on January 28, 2011, 11:39:36 PM
Have you tried Yanfly Main Menu Melody? I think it uses a completely different refresh system.
Title: Re: Cozziekuns' Status Screen
Post by: mittenrc on July 18, 2011, 04:11:25 AM
This is exactly what I was looking for ^^ (sorry for necroposting)

I have a suggest though, I'd love it if the status window could be hidable, only showing the watermark without any transparency? Triggered by pressing some button for example? I'm afraid that I'm requesting something stupidly easy here, but at least it seems like a challenge to me :P

I have an awesome consept artist agreed to do graphs for our game, so I'd love to put them in to good use :)

Once more big thanks to Cozziekun *hugs*
Title: Re: Cozziekuns' Status Screen
Post by: cozziekuns on July 18, 2011, 04:19:26 PM
Thanks for the suggestion! Updated.
Title: Re: Cozziekuns' Status Screen
Post by: mittenrc on July 19, 2011, 03:03:13 PM
OoooooOOoo!! That's exactly what I wanted ^^

Thank you million times Cozziekuns!!!!! *hundreds hugs*

... I can use your script in our game, right..?
Title: Re: Cozziekuns' Status Screen
Post by: cozziekuns on July 19, 2011, 03:40:29 PM
Sure, go shoot.
Title: Re: Cozziekuns' Status Screen
Post by: Chronological on September 16, 2011, 05:49:18 PM
And what if you want the player to choose the actor's name?  How could this script be changed to "variable_bg" so that there isn't a watermark error.  Or.. can the status screen BG just be turned off or made a generic color?  Thanks.
Title: Re: Cozziekuns' Status Screen
Post by: pacdiggity on September 16, 2011, 09:09:44 PM
I don't have VX at the moment, but I think the way you would fix the name problem is by going to line 147 and changing
Code: [Select]
    bitmap = Cache.picture(actor.name + "_bg")
to
Code: [Select]
    bitmap = Cache.picture(actor.actor.name + "_bg")
As for your other idea, you could just create blank images for each actor, but an actual fix would be changing lines 145-151 from this:
Code: [Select]
  def draw_actor_back(actor, x, y)
    @background_opacity = COZZIEKUNS::BACKGROUND_OPACITY
    bitmap = Cache.picture(actor.name + "_bg")
    rect = Rect.new(0, 0, 544,416)
    self.contents.blt(x, y, bitmap, rect, @background_opacity)
    bitmap.dispose
  end
to this:
Code: [Select]
  def draw_actor_back(*args)
    return
  end
Title: Re: Cozziekuns' Status Screen
Post by: Vexil1989 on January 12, 2012, 12:39:26 AM
Well I did what pacman said to do to skip adding a background image, but i'm having a different issue now. It's not Pacman's code thats causing the issue, I get the same problem when I do add a image. When I try to access one of the Character's status menus I get this:

"Script 'Cozziekuns' Status Screen' line 241: NoMethodError occurred. Undefined method 'draw_paragraph' for #<Bitmap:0x391cda8>"
Title: Re: Cozziekuns' Status Screen
Post by: pacdiggity on January 12, 2012, 12:42:35 AM
See header. Make sure that you have MA's Paragraph Formatter (http://rmrk.net/index.php?topic=25129.0), included in the demo.

Do you have that?
Title: Re: Cozziekuns' Status Screen
Post by: Vexil1989 on January 12, 2012, 03:45:54 AM
Well it actually disappeared after I deleted that particular line. So I guess its solved, deleting it doesn't seem to be causing any issues from what I can see.
Title: Re: Cozziekuns' Status Screen
Post by: ShinGamix on June 02, 2014, 06:42:32 PM
I just wanted to repost the pic because it was showing up for me on this awesome script.
(https://rmrk.net/proxy.php?request=http%3A%2F%2Foi39.tinypic.com%2F23m6fxh.jpg&hash=d6403910d7b5f4e5046191e0a3401fdc6962e8a7)