Parameter Bar Script
#1
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.


credit to me(Clock) and firewords for his hp and sp bar scripts
in this scripts I edited his script so we have a parameter bar in Status Screen.
I add a max scripts too in this scripts,
it's also show "Max" text when your player parameter reach 999(max) points.


Now the script

Add this in game_battler1 under @states_turn = {} or under line 35
Code:
@pdef_plus = 0
    @mdef_plus = 0
    @atk_plus = 0

Then add this everywhere under def initialize ... end or under line 55
Code:
#----------------------------------------------------------------
  # Add new functions for the actor parameter
  #----------------------------------------------------------------
  def maxstr
    n = [[base_maxstr + @str_plus, 1].max, 999].min
    for i in @states
      n *= $data_states[i].maxstr_rate / 100.0
    end
    n = [[Integer(n), 1].max, 999].min
    return n
  end
  
  def maxpdef
    n = [[base_maxpdef + @pdef_plus, 1].max, 999].min
    for i in @states
      n *= $data_states[i].maxpdef_rate / 100.0
    end
    n = [[Integer(n), 1].max, 999].min
    return n
  end

  def maxmdef
    n = [[base_maxmdef + @mdef_plus, 1].max, 999].min
    for i in @states
      n *= $data_states[i].maxmdef_rate / 100.0
    end
    n = [[Integer(n), 1].max, 999].min
    return n
  end
  
  def maxatk
    n = [[base_maxatk + @atk_plus, 1].max, 999].min
    for i in @states
      n *= $data_states[i].maxatk_rate / 100.0
    end
    n = [[Integer(n), 1].max, 999].min
    return n
  end
  
  def maxdex
    n = [[base_maxdex + @dex_plus, 1].max, 999].min
    for i in @states
      n *= $data_states[i].maxdex_rate / 100.0
    end
    n = [[Integer(n), 1].max, 999].min
    return n
  end
  
  def maxagi
    n = [[base_maxagi + @agi_plus, 1].max, 999].min
    for i in @states
      n *= $data_states[i].maxagi_rate / 100.0
    end
    n = [[Integer(n), 1].max, 999].min
    return n
  end
  
    def maxint
    n = [[base_maxint + @int_plus, 1].max, 999].min
    for i in @states
      n *= $data_states[i].maxint_rate / 100.0
    end
    n = [[Integer(n), 1].max, 999].min
    return n
  end

in game_actor def setup(actor_id), add this
Code:
@pdef_plus = 0
    @mdef_plus = 0
    @atk_plus = 0

then add this everywhere under def setup(actor_id) ... end (under line 81).
Code:
#----------------------------------------------------------------
  # Giving max point for the parameter bars
  #----------------------------------------------------------------
  def base_maxstr
    return 999
  end
  
  def base_maxpdef
    return 999
  end
  
  def base_maxmdef
    return 999
  end
  
  def base_maxatk
    return 999
  end
  
  def base_maxdex
    return 999
  end
  
  def base_maxagi
    return 999
  end
  
  def base_maxint
    return 999
  end

and add this in window_base everywhere under def dispose ... end (under line 34).
Code:
#--------------------------------------------------------------------------
# Showing the Hp and Sp Bars Script by Firewords,
# but in this script we will not show the hp and sp bars.
# I change it so it will just show the actor parameter bars.
# Just edit by yourself if you want to add the Hp and Sp bars.
#--------------------------------------------------------------------------
def draw_actor_str_bar(actor, x, y, width = 56 * 2, height =7)
  self.contents.fill_rect(x-1, y-2, width +2, height +2, Color.new(0, 0, 0, 0))#(0, 0, 0, 255))
  bitmap=RPG::Cache.picture("Redbar")
  cw=bitmap.width
  ch=bitmap.height
  src_rect=Rect.new(0,0,cw,ch)
  # %
  dest_rect=Rect.new(x,y-1,width * actor.str / actor.maxstr,height)
  if actor.str != 0
       self.contents.stretch_blt(dest_rect,bitmap,src_rect)
  end  
end

def draw_actor_atk_bar(actor, x, y, width = 56 * 2, height =7)
  self.contents.fill_rect(x-1, y-2, width +2, height +2, Color.new(0, 0, 0, 0))#(0, 0, 0, 255))
  bitmap=RPG::Cache.picture("Redbar")
  cw=bitmap.width
  ch=bitmap.height
  src_rect=Rect.new(0,0,cw,ch)
  # %
  dest_rect=Rect.new(x,y-1,width * actor.atk / actor.maxatk,height)
  if actor.str != 0
       self.contents.stretch_blt(dest_rect,bitmap,src_rect)
  end  
end

def draw_actor_mdef_bar(actor, x, y, width = 56 * 2, height =7)
  self.contents.fill_rect(x-1, y-2, width +2, height +2, Color.new(0, 0, 0, 0))#(0, 0, 0, 255))
  bitmap=RPG::Cache.picture("Redbar")
  cw=bitmap.width
  ch=bitmap.height
  src_rect=Rect.new(0,0,cw,ch)
  # %
  dest_rect=Rect.new(x,y-1,width * actor.mdef / actor.maxmdef,height)
  if actor.str != 0
       self.contents.stretch_blt(dest_rect,bitmap,src_rect)
  end  
end

def draw_actor_pdef_bar(actor, x, y, width = 56 * 2, height =7)
  self.contents.fill_rect(x-1, y-2, width +2, height +2, Color.new(0, 0, 0, 0))#(0, 0, 0, 255))
  bitmap=RPG::Cache.picture("Redbar")
  cw=bitmap.width
  ch=bitmap.height
  src_rect=Rect.new(0,0,cw,ch)
  # %
  dest_rect=Rect.new(x,y-1,width * actor.pdef / actor.maxpdef,height)
  if actor.pdef != 0
       self.contents.stretch_blt(dest_rect,bitmap,src_rect)
  end  
end

def draw_actor_dex_bar(actor, x, y, width = 56 * 2, height =7)
  self.contents.fill_rect(x-1, y-2, width +2, height +2, Color.new(0, 0, 0, 0))#(0, 0, 0, 255))
  bitmap=RPG::Cache.picture("Redbar")
  cw=bitmap.width
  ch=bitmap.height
  src_rect=Rect.new(0,0,cw,ch)
  # %
  dest_rect=Rect.new(x,y-1,width * actor.dex / actor.maxdex,height)
  if actor.dex != 0
       self.contents.stretch_blt(dest_rect,bitmap,src_rect)
  end  
end

def draw_actor_agi_bar(actor, x, y, width = 56 * 2, height =7)
  self.contents.fill_rect(x-1, y-2, width +2, height +2, Color.new(0, 0, 0, 0))#(0, 0, 0, 255))
  bitmap=RPG::Cache.picture("Redbar")
  cw=bitmap.width
  ch=bitmap.height
  src_rect=Rect.new(0,0,cw,ch)
  # %
  dest_rect=Rect.new(x,y-1,width * actor.agi / actor.maxagi,height)
  if actor.str != 0
       self.contents.stretch_blt(dest_rect,bitmap,src_rect)
  end  
end

def draw_actor_int_bar(actor, x, y, width = 56 * 2, height =7)
  self.contents.fill_rect(x-1, y-2, width +2, height +2, Color.new(0, 0, 0, 0))#(0, 0, 0, 255))
  bitmap=RPG::Cache.picture("Redbar")
  cw=bitmap.width
  ch=bitmap.height
  src_rect=Rect.new(0,0,cw,ch)
  # %
  dest_rect=Rect.new(x,y-1,width * actor.int / actor.maxint,height)
  if actor.str != 0
       self.contents.stretch_blt(dest_rect,bitmap,src_rect)
  end  
end
#--------------------------------------------------------------------------
# Showing "Max" pic/text
# Script by Clock
#--------------------------------------------------------------------------
def draw_max( x, y)
  bitmap = RPG::Cache.picture("Max")
  self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 35, 18))
end

then, add this in window_status under draw_actor_parameter(@actor, 96, 400, 6)
Code:
#--------------------------------------------------------------------------
# Showing the parameter bar and max pic/text
# Script by Clock
#--------------------------------------------------------------------------
  draw_actor_atk_bar(@actor, 96, 192+30)
  draw_actor_pdef_bar(@actor, 96, 224+30)
  draw_actor_mdef_bar(@actor, 96, 256+30)
  draw_actor_str_bar(@actor, 96, 304+30)
  draw_actor_dex_bar(@actor, 96, 336+30)
  draw_actor_agi_bar(@actor, 96, 368+30)
  draw_actor_int_bar(@actor, 96, 400+30)
  if @actor.atk == 999
    draw_max(220,192+22)
  end      
  if @actor.pdef == 999
    draw_max(220,224+22)
  end
  if @actor.mdef == 999
    draw_max(220,256+22)
  end
  if @actor.str == 999
    draw_max(220,304+22)
  end
  if @actor.dex == 999
    draw_max(220,336+22)
  end
  if @actor.agi == 999
    draw_max(220,368+22)
  end
  if @actor.int == 999
    draw_max(220,400+22)
  end

lastly put this image on your pictures.
(Download Images 'redbar.png' & 'max.png' Unavailable)

and now look in your status screen
}


Possibly Related Threads…
Thread Author Replies Views Last Post
  Change character script jaigai 0 3,187 11-19-2006, 01:00 PM
Last Post: jaigai
  Just a modification of Abyssos' facs script lumina... 0 2,958 11-01-2006, 01:00 PM
Last Post: lumina...
  Credit Script 1.1 acoole 0 2,838 10-24-2006, 01:00 PM
Last Post: acoole
  Script Dev Kit Nick 0 3,227 10-15-2006, 01:00 PM
Last Post: Nick
  Opening Image script sasuke89 0 2,360 07-24-2006, 01:00 PM
Last Post: sasuke89
  Change Color of The diferent Status Script MASTERLOKI 0 2,629 07-18-2006, 01:00 PM
Last Post: MASTERLOKI
  Event Name and ID Search Script Hadriel 0 2,415 06-21-2006, 01:00 PM
Last Post: Hadriel
  Currency Script Split 0 2,653 05-18-2006, 01:00 PM
Last Post: Split
  Book Script and Utility Bruth 0 2,603 05-07-2006, 01:00 PM
Last Post: Bruth
  Individuality Script DrakoShade 0 2,568 03-12-2006, 01:00 PM
Last Post: DrakoShade



Users browsing this thread: 1 Guest(s)