Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

5 Pages V  « < 2 3 4 5 >  
Closed TopicStart new topic
> Jens009's Enemy HP Window, Show enemy's HP during battle
jens009
post Aug 20 2009, 10:52 PM
Post #61


L Did you know? Death gods... only eat apples
Group Icon

Group: +Gold Member
Posts: 2,976
Type: Scripter
RM Skill: Skilled




QUOTE (cyrtii @ Aug 20 2009, 10:53 AM) *
@jens009
it gives an error: "undifined method 'x' for #Game_Enemy<blablabla>"

my apologies. I have no rmvx right now since I reformatted my computer.

I forgot that this was a VX script not an XP script.

Replace the line with this instead:
CODE
draw_enemy_hp(enemy, enemy.screen_x + 0, enemy.screen_y + 0, 90)


This is all coming from my memory (which was more than a year ago) so tell me if you still get an error.


__________________________

My RMXP Project:


Farewell RRR. =]
Go to the top of the page
 
+Quote Post
   
cyrtii
post Aug 21 2009, 01:17 AM
Post #62


Level 1
Group Icon

Group: Member
Posts: 10
Type: Artist
RM Skill: Advanced




QUOTE (jens009 @ Aug 21 2009, 08:52 AM) *
QUOTE (cyrtii @ Aug 20 2009, 10:53 AM) *
@jens009
it gives an error: "undifined method 'x' for #Game_Enemy<blablabla>"

my apologies. I have no rmvx right now since I reformatted my computer.

I forgot that this was a VX script not an XP script.

Replace the line with this instead:
CODE
draw_enemy_hp(enemy, enemy.screen_x + 0, enemy.screen_y + 0, 90)


This is all coming from my memory (which was more than a year ago) so tell me if you still get an error.

Thank you it works! I had to edit the digits a little bit, but this one is good:
CODE
draw_enemy_hp(enemy, enemy.screen_x - 60, enemy.screen_y - 30, 90)

(its shows the bar beneath the monster)

Thank you very much for your support!


__________________________
Go to the top of the page
 
+Quote Post
   
asherty
post Oct 10 2009, 05:41 AM
Post #63


Level 2
Group Icon

Group: Member
Posts: 18
Type: None
RM Skill: Intermediate




Where am I suppsoe to paste this I am a noob scripter so I probubly wouldn't be asking this if I wasn't
Go to the top of the page
 
+Quote Post
   
Xzygon
post Oct 10 2009, 08:54 PM
Post #64


Pineapple Inc's President and Creator of Duality Online
Group Icon

Group: Revolutionary
Posts: 554
Type: Writer
RM Skill: Skilled




Plug and Play usually means Materials. You should be asking in the Script Support section, stop NECROPOSTING! If you don't know what that is, you should've read the forum rules. If you say "I didn't read the forum rules" that's your fault. And anyways, it says INSIDE the scripts when you make your game WHERE to put your scripts! Put the script under the Materials section, read the forum rules, and please type correctly. It's kind of hard to read what you're trying to type when you type without a punctuation mark anywhere.


__________________________
Check out my game, Duality Online!
Duality Online






Blah
A saying that I DID NOT STEAL FROM KUNG FU PANDA!
Today is a Gift.
That's why they call it the Present.
You never know what's inside,
Because the Present is always changing.
~Made it up with my cuz 7 Years Ago, without the help of anybody else~


Don't read!
00110000001100010011000000110000001100010011000000110000001100000011000000
11000100110001001100000011000000110000001100000011000100110000001100010011000100
1
10000001100010011000000110000001100000011000000110001001100010011000000110000001
1
00000011000000110001001100000011000000110001001100000011000100110001001100000011
0
00000110000001100000011000100110000001100000011000000110000001100000011000000110
0
01001100010011000000110000001100010011000000110001001100000011000100110001001100
0
10011000000110000001100000011000000110000001100010011000100110000001100010011000
0
00110000001100010011000000110001001100010011000000110000001100000011000100110001
0
01100000011000000110001001100000011000000110000001100000011000000110000001100010
0
11000100110000001100000011000100110001001100000011000000110001001100010011000000
1
10000001100000011000000110001001100000011000100110001001100000011000100110000001
1
00000011000100110000001100010011000100110000001100010011000100110000001100000011
0
00000110000001100010011000000110000001100000011000000110000001100000011000100110
0
01001100000011000000110001001100010011000000110000001100010011000100110000001100
0
10011000100110001001100010011000000110001001100010011000100110000001100000011000
1
00110000001100000011000000110001001100000011000000110000001100000011000000110000
0
01100010011000100110000001100000011000100110000001100000011000000110001001100010
0
11000000110001001100010011000100110001001100000011000100110001001100010011000000
1
10001001100000011000100110000001100010011000100110000001100000011000000110001001
1
00000011000000110001001100010011000000110001001100010011000000110000001100000011
0
00100110001001100000011000000110001001100000011000100110000001100000011000100110
0
00001100000011000000110000001100000011000000110001001100010011000000110000001100
0
10011000000110000001100000011000100110001001100000011000000110001001100000011000
1
00110000001100010011000100110000001100000011000000110001001100010011000000110001
0
01100010011000100110000001100000011000100110000001100000011000100110001001100010
0
11000100110000001100000011000100110000001100010011000100110001001100000011000000
1
10000001100000011000000110001001100010011000100110000001100010011000000110000001
1
00000011000100110001001100000011000100110000001100000011000100110000001100010011
0
00100110000001100010011000100110001001100000011000000110001001100010011000000110
0
00001100010011000100110001001100000011000000110001001100000011000000110000001100
0
00011000000110000001100010011000100110001001100000011000100110000001100000011000
0
00110001001100010011000000110001001100000011000000110000001100000011000100110001
0
01100000011000100110000001100000011000100110000001100010011000100110001001100000
0
11000000110001001100010011000000110000001100010011000000110000001100000011000000
1
10000001100000011000100110001001100000011000000110000001100010011000000110000001
1
00010011000100110000001100010011000000110000001100010011000000110001001100010011
0
00000110001001100010011000100110000001100000011000100110001001100000011000000110
0
00001100000011000100110000001100010011000100110001001100000011000000110001001100
0
00011000000110001001100010011000100110001001100000011000000110001001100000011000
0
00110001001100000011000000110000001100000011000000110000001100010011000100110000
0
01100000011000000110001001100010011000000110001001100010011000000110001001100010
0
11000100110001001100000011000100110001001100000011000000110001001100000011000000
1
10000001100010011000100110000001100000011000100110000001100010011000000110000001
1
00010011000000110001001100010011000100110000





I support
Supporting


Go to the top of the page
 
+Quote Post
   
Locke
post Oct 17 2009, 10:28 AM
Post #65


Level 10
Group Icon

Group: Revolutionary
Posts: 151
Type: Mapper
RM Skill: Intermediate




Nice script may as well copy the script and paste the script in the script editor happy.gif


__________________________
We are one (Really i,m not joking)



I've seen many things when mankind rule the land


Which Final Fantasy Character Are You?
Go to the top of the page
 
+Quote Post
   
new
post Oct 19 2009, 06:38 PM
Post #66


Level 4
Group Icon

Group: Member
Posts: 58
Type: None
RM Skill: Undisclosed




is it possible to just show the window when you press "Y" which is S in my keyboard? there's graphic collision with YERD_scene battle redux.. this script is too useful. is it possible that the enemy HP values wont be shown until you use scan skill on YERD_bestiary ? like it will be displayed as ??? until you scanned the enemy.
Go to the top of the page
 
+Quote Post
   
ZeroManArmy
post Oct 29 2009, 06:35 PM
Post #67


Level 5
Group Icon

Group: Member
Posts: 68
Type: Artist
RM Skill: Undisclosed




Can some one just post it so all i have to do is plug and play it? I cant figure it out. It wont turn on at all. I hate being a noob


__________________________
Go to the top of the page
 
+Quote Post
   
matrox89
post Nov 20 2009, 10:14 AM
Post #68


Level 1
Group Icon

Group: Member
Posts: 6
Type: Event Designer
RM Skill: Skilled




finally! ive been looking for this evry where! thx thx thx biggrin.gif
Go to the top of the page
 
+Quote Post
   
mmwsfz
post Apr 20 2010, 05:54 AM
Post #69


Level 1
Group Icon

Group: Member
Posts: 10
Type: Developer
RM Skill: Intermediate




Hey Jens, I love this script very much. But is it possible that we can change the colour of the bar and hide these words: HP and The number?
Go to the top of the page
 
+Quote Post
   
SlyCooperFan1
post May 1 2010, 10:59 AM
Post #70


Level 1
Group Icon

Group: Member
Posts: 6
Type: Writer
RM Skill: Beginner




I don't get what I'm doing wrong. I put the v1.2 script in as well as the Neo Gauge Patch, both under Materials, both in two different scripts. I edited nothing for either one. But in battles, the bars aren't showing up.

Also, in Battle Tests, I get the error message:
QUOTE
Script 'Neo Gauge Patch' line 39: NoMethodError occurred.

undefined method 'draw_neo_gauge' for
#<Window_EnemyHP:0x2ae4e18>
Go to the top of the page
 
+Quote Post
   
jens009
post May 1 2010, 04:44 PM
Post #71


L Did you know? Death gods... only eat apples
Group Icon

Group: +Gold Member
Posts: 2,976
Type: Scripter
RM Skill: Skilled




QUOTE
Hey Jens, I love this script very much. But is it possible that we can change the colour of the bar and hide these words: HP and The number?

Of course. To change the color of the bars, change gc1 and gc2 to another color scheme.
CODE
  def draw_enemy_hp_gauge(enemy, x, y, width = 120)
    gw = width * enemy.hp / enemy.maxhp
    gc1 = hp_gauge_color1
    gc2 = hp_gauge_color2
    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

To remove the HP string and number, just delete these lines:
CODE
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 30, WLH, Vocab::hp_a)
    last_font_size = self.contents.font.size
    xr = x + width
    if width < 120
      self.contents.draw_text(xr - 44, y, 44, WLH, enemy.hp, 2)
    else
      self.contents.draw_text(xr - 99, y, 44, WLH, enemy.hp, 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, enemy.maxhp, 2)
    end


QUOTE (SlyCooperFan1 @ May 1 2010, 11:59 AM) *
I don't get what I'm doing wrong. I put the v1.2 script in as well as the Neo Gauge Patch, both under Materials, both in two different scripts. I edited nothing for either one. But in battles, the bars aren't showing up.

Also, in Battle Tests, I get the error message:
QUOTE
Script 'Neo Gauge Patch' line 39: NoMethodError occurred.

undefined method 'draw_neo_gauge' for
#<Window_EnemyHP:0x2ae4e18>


You need to have woratana's neo gauge script. Otherwise, you can't have the patch included.


__________________________

My RMXP Project:


Farewell RRR. =]
Go to the top of the page
 
+Quote Post
   
ZeroManArmy
post May 1 2010, 07:24 PM
Post #72


Level 5
Group Icon

Group: Member
Posts: 68
Type: Artist
RM Skill: Undisclosed




Is it possible to get this to to work with Syvkal's Menu Bars? Also is there another way to make the word H to HP

CODE
#======================================================
==========
==============
# ** Syvkal's Menu Bars
#------------------------------------------------------------------------------
# by Syvkal
# Version 4.1
# 05-20-08
#==============================================================================
#
# - INTRODUCTION -
#
# This system implements a series of Plug 'N' Play Menu Bars
# The Bars were inspired CogWheel, but all coding was done by me
# ( Except Wortana's 'gradient_fill_rect' Bug Fix )
#
#------------------------------------------------------------------------------
#
# - USAGE -
#
# This system will work as soon as you put it in the Script Editor
# You can edit the script from the Configuration System
# However, it has also been made so you can easily make your own bars
#
# ---------------------------------------------------
#
# To draw a bar use:
# draw_custom_gauge
#
# Followed by:
# (value, max, x, y, color1, color2, width, height, slanted, up)
#
# value : bar calculation value
# max : bar max value
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# color1 : bar gradient color 1 EITHER Color.new(r,g,b,a)
# color2 : bar gradient color 2 OR Numeric Text color
# width : Width
# height : Height
# slanted : draw slanted bar
# vertical : draw bar vertically
#
# ---------------------------------------------------
#
# To draw a ring use:
# draw_custom_ring
#
# Followed by:
# (value, max, x, y, color1, color2, radius, height, amount, start, reverse)

# value : bar calculation value
# max : bar max value
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# color1 : bar gradient color 1
# color2 : bar gradient color 2
# radius : distance from center point
# height : Height
# amount : size of ring - default 360�
# start : start position - max 360�
# reverse : draw ring in reverse
#
#------------------------------------------------------------------------------
#
# - SCRIPTERS USAGE -
#
# I have added a few extra features to allow scripters to easily use the bars
# Seeing as the bars can be drawn Normal, Vertical or in a Ring I've added a
# feature to allow you to turn off the bars when drawing an actors HP, MP etc.
# When drawing an actors HP etc. simply add 'true' on the end. Like this:
# draw_actor_hp(actor, x, y, width, true)
#
# I've also separated the different bars so they're easier to draw
#
# draw_actor_hp_gauge(actor, x, y, width) Will draw a normal bar
# draw_actor_hp_gauge(actor, x, y, width, true) Will draw a vertical bar
# draw_actor_hp_ring(actor, x, y, radius, height, amount, start)
# Will draw a ring
#
#------------------------------------------------------------------------------
#
# - SCRIPT CALLS -
#
# There are no script calls necessary to enable this script
# However, you can change any of the constants in game if you wish
# This can be done by the Script Call Funtion in an event
#
# For example:
# COG::HPMPSLANT = true
#
# Will make the HP and MP bars Slant
# And setting it to false will turn them back to normal
#
#==============================================================================
module BAR
#===================================================#
# ** C O N F I G U R A T I O N S Y S T E M ** #
#===================================================#

# Parameter Max Value
P_MAX = 500
# The system uses a 'rate' feature. It is set when drawing a bar
# The 'rate' is how much the bar is filled as a decimal (max : 1)
# This is used to enable color change as the bar decreased in amount
$rate = 0 # Don't touch this
# The system uses a series of CONSTANTS that can be edited here
# They control the basic gauge colors and the manner the gauge is filled:

# Gauge Border Colors
COLOR1 = Color.new(0, 0, 0, 192) # Outer Border
COLOR2 = Color.new(255, 255, 192, 192) # Inner Border
# Gauge Empty filler
COLOR3 = Color.new(0, 0, 0, 12) # Half of Inner Shading
COLOR4 = Color.new(64, 0, 0, 92) # Half of Inner Shading
# Gauge Settings
EMPTY = false # EMPTY gauge (false - Side : true - Vertical)
FILLER = false # FILLER gauge (false - Side : true - Vertical)
# Border Settings - Applies only to standard bars
CORNER = false # Remove corners?

# The Parameter colors can be text colors taken from the windowskin or
# colors like above. You don't need set your own 'rate' functions
# it does it for you
# Parameter Gauge Color1
ATKCOLOR1 = 2
DEFCOLOR1 = 17
SPICOLOR1 = 30
AGICOLOR1 = 12
# Parameter Gauge Color2
ATKCOLOR2 = 20
DEFCOLOR2 = 21
SPICOLOR2 = 31
AGICOLOR2 = 4

# The system has been made to use a series of SWITCHES that can be edited here
# They control whether certain Bars are Normal or Slanted:

HPMPSLANT = false # Slanted HP and MP Bars?
EXPSLANT = false # Slanted Exp Bars?
PARSLANT = false # Slanted Parameter Bars?
DVVLBSLANT = true # Slanted Limit Break Bars?

#===================================================#
# ** C O M P L E X C O N F I G U R A T I O N ** #
#===================================================#

# The system allows you to edit the main gauge colous from here
# Functions had to be used instead of Constants so the $rate feature still works
# Edit only if you know what you're doing:

def self::hpcolor1 # HP Guage Color1
return Color.new(80 - 24 * $rate, 80 * $rate, 14 * $rate, 192)
end
def self::hpcolor2 # HP Guage Color2
return Color.new(240 - 72 * $rate, 240 * $rate, 62 * $rate, 192)
end
def self::mpcolor1 # MP Guage Color1
return Color.new(14 * $rate, 80 - 24 * $rate, 80 * $rate, 192)
end
def self::mpcolor2 # MP Guage Color2
return Color.new(62 * $rate, 240 - 72 * $rate, 240 * $rate, 192)
end
def self::expcolor1 # EXP Guage Color1
Color.new(80 * $rate, 80 - 80 * $rate ** 2, 80 - 80 * $rate, 192)
end
def self::expcolor2 # EXP Guage Color2
Color.new(240 * $rate, 240 - 240 * $rate ** 2, 240 - 240 * $rate, 192)
end
#===================================================#
# ** E N D C O N F I G U R A T I O N ** #
#===================================================#
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# Added EXP and Next Level EXP for numeric for calculations
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Get EXP - numeric for calculations
#--------------------------------------------------------------------------
def now_exp
return @exp - @exp_list[@level]
end
#--------------------------------------------------------------------------
# * Get Next Level EXP - numeric for calculations
#--------------------------------------------------------------------------
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# Added the 'Draw' functions for each gauge
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# * Includes The BAR Module
#--------------------------------------------------------------------------
include BAR
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias draw_actor_parameter_original draw_actor_parameter
#--------------------------------------------------------------------------
# * Draw HP gauge
# vertical : draw bar vertically
#--------------------------------------------------------------------------
def draw_actor_hp_gauge(actor, x, y, width = 120, vertical = false)
$rate = actor.hp.to_f / actor.maxhp
gw = width * actor.hp / actor.maxhp
w = vertical ? 6 : width; h = vertical ? width : 6
HPMPSLANT ? self.contents.cogwheel_fill_slant(x, y + WLH - 8, gw, w, h, BAR::hpcolor1, BAR::hpcolor2, vertical) :
self.contents.cogwheel_fill_rect(x, y + WLH - 8, gw, w, h, BAR::hpcolor1, BAR::hpcolor2, vertical)
end
#--------------------------------------------------------------------------
# * Draw MP gauge
# vertical : draw bar vertically
#--------------------------------------------------------------------------
def draw_actor_mp_gauge(actor, x, y, width = 120, vertical = false)
$rate = actor.mp.to_f / [actor.maxmp, 1].max
gw = width * actor.mp / [actor.maxmp, 1].max
w = vertical ? 6 : width; h = vertical ? width : 6
HPMPSLANT ? self.contents.cogwheel_fill_slant(x, y + WLH - 8, gw, w, h, BAR::mpcolor1, BAR::mpcolor2, vertical) :
self.contents.cogwheel_fill_rect(x, y + WLH - 8, gw, w, h, BAR::mpcolor1, BAR::mpcolor2, vertical)
end
#--------------------------------------------------------------------------
# * Draw Exp gauge
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : Width
# vertical : draw bar vertically
#--------------------------------------------------------------------------
def draw_actor_exp_gauge(actor, x, y, width = 170, vertical = false)
$rate = actor.now_exp.to_f / [actor.next_exp, 1].max
gw = width * actor.now_exp / [actor.next_exp, 1].max
w = vertical ? 6 : width; h = vertical ? width : 6
EXPSLANT ? self.contents.cogwheel_fill_slant(x, y + WLH - 8, gw, w, h, BAR::expcolor1, BAR::expcolor2, vertical) :
self.contents.cogwheel_fill_rect(x, y + WLH - 8, gw, w, h, BAR::expcolor1, BAR::expcolor2, vertical)
end
#--------------------------------------------------------------------------
# * Draw Parameters
# hide_bar : draw Parameters without gauge
#--------------------------------------------------------------------------
def draw_actor_parameter(actor, x, y, type, hide_bar = false)
hide_bar ? nil : draw_actor_parameter_gauge(actor, x, y, type)
draw_actor_parameter_original(actor, x, y, type)
end
#--------------------------------------------------------------------------
# * Draw Parameters gauge
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# type : Type of parameters (0-3)
# width : Width
# vertical : draw bar vertically
#--------------------------------------------------------------------------
def draw_actor_parameter_gauge(actor, x, y, type, width = 160, vertical = false)
case type
when 0
e1 = actor.atk
gc1 = ATKCOLOR1.is_a?(Integer) ? text_color(ATKCOLOR1) : ATKCOLOR1
gc2 = ATKCOLOR2.is_a?(Integer) ? text_color(ATKCOLOR2) : ATKCOLOR2
when 1
e1 = actor.def
gc1 = DEFCOLOR1.is_a?(Integer) ? text_color(DEFCOLOR1) : DEFCOLOR1
gc2 = DEFCOLOR2.is_a?(Integer) ? text_color(DEFCOLOR2) : DEFCOLOR2
when 2
e1 = actor.spi
gc1 = SPICOLOR1.is_a?(Integer) ? text_color(SPICOLOR1) : SPICOLOR1
gc2 = SPICOLOR2.is_a?(Integer) ? text_color(SPICOLOR2) : SPICOLOR2
when 3
e1 = actor.agi
gc1 = AGICOLOR1.is_a?(Integer) ? text_color(AGICOLOR1) : AGICOLOR1
gc2 = AGICOLOR2.is_a?(Integer) ? text_color(AGICOLOR2) : AGICOLOR2
end
e2 = P_MAX
rate = [e1.to_f / e2.to_f, 1].min
gw = width * [e1.to_f / e2.to_f, 1].min
r = gc2.red * rate
g = (gc2.green - 72) * rate
b = gc2.blue * rate
a = gc2.alpha
w = vertical ? 6 : width; h = vertical ? width : 6
PARSLANT ? self.contents.cogwheel_fill_slant(x, y + WLH - 8, gw, w, h, gc1, Color.new(r, g, b, a), vertical) :
self.contents.cogwheel_fill_rect(x, y + WLH - 8, gw, w, h, gc1, Color.new(r, g, b, a), vertical)
end
#--------------------------------------------------------------------------
# * Draw Custom gauge
# value : bar calculation value
# max : bar max value
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# color1 : bar gradient color 1
# color2 : bar gradient color 2
# width : Width
# height : Height
# slanted : draw slanted bar
# vertical : draw bar vertically
#--------------------------------------------------------------------------
def draw_custom_gauge(value, max, x, y, color1, color2, width=120, height=6, slanted = false, vertical = false)
rate = [value.to_f / max.to_f, 1].min
gw = width * [value.to_f / max.to_f, 1].min
gc1 = color1.is_a?(Integer) ? text_color(color1) : color1
gc2 = color2.is_a?(Integer) ? text_color(color2) : color2
r = gc2.red * rate
g = (gc2.green - 72) * rate
b = gc2.blue * rate
a = gc2.alpha
w = vertical ? 6 : width; h = vertical ? width : 6
slanted ? self.contents.cogwheel_fill_slant(x, y + WLH - 8, gw, w, h, gc1, Color.new(r, g, b, a), vertical) :
self.contents.cogwheel_fill_rect(x, y + WLH - 8, gw, w, h, gc1, Color.new(r, g, b, a), vertical)
end
#--------------------------------------------------------------------------
# * Draw Limit Break gauge
# vertical : draw bar vertically
#--------------------------------------------------------------------------
def draw_actor_lb(actor, x, y, width = 120, vertical = false)
return unless actor.lb_gauge_visible?
st1 = lb_gauge_normal_start_color; st2 = lb_gauge_max_start_color
ed1 = lb_gauge_normal_end_color; ed2 = lb_gauge_max_end_color
rate = actor.limitbreak.to_f / [LB_MAX, 1].max
gw = width * actor.limitbreak / LB_MAX
gc1 = (gw == width ? st2 : Color.new(st1.red,st1.green-(10*rate),st1.blue-(10*rate), 192))
gc2 = (gw == width ? ed2 : Color.new(ed1.red,ed1.green-(10*rate),ed1.blue-(10*rate), 192))
w = vertical ? 6 : width; h = vertical ? width : 6
DVVLBSLANT ? self.contents.cogwheel_fill_slant(x, y + WLH - 8, gw, w, h, gc1, gc2, vertical) :
self.contents.cogwheel_fill_rect(x, y + WLH - 8, gw, w, h, gc1, gc2, vertical)
end
#--------------------------------------------------------------------------
# * Draw HP gauge ring
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# radius : distance from center point
# height : Height
# amount : size of ring - default 360�
# start : start position - max 360�
# reverse : draw ring in reverse
#--------------------------------------------------------------------------
def draw_actor_hp_ring(actor, x, y, radius, height, amount = 360, start = 0, reverse = false)
$rate = actor.hp.to_f / actor.maxhp
gw = amount * actor.hp / actor.maxhp
self.contents.cogwheel_fill_ring(x, y, gw, radius, height, BAR::hpcolor1, BAR::hpcolor2, amount, start, reverse)
end
#--------------------------------------------------------------------------
# * Draw MP gauge ring
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# radius : distance from center point
# height : Height
# amount : size of ring - default 360�
# start : start position - max 360�
# reverse : draw ring in reverse
#--------------------------------------------------------------------------
def draw_actor_mp_ring(actor, x, y, radius, height, amount = 360, start = 0, reverse = false)
$rate = actor.mp.to_f / [actor.maxmp, 1].max
gw = amount * actor.mp / [actor.maxmp, 1].max
self.contents.cogwheel_fill_ring(x, y, gw, radius, height, BAR::mpcolor1, BAR::mpcolor2, amount, start, reverse)
end
#--------------------------------------------------------------------------
# * Draw Exp gauge ring
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# radius : distance from center point
# height : Height
# amount : size of ring - default 360�
# start : start position - max 360�
# reverse : draw ring in reverse
#--------------------------------------------------------------------------
def draw_actor_exp_ring(actor, x, y, radius, height, amount = 360, start = 0, reverse = false)
$rate = actor.now_exp.to_f / [actor.next_exp, 1].max
gw = amount * actor.now_exp / [actor.next_exp, 1].max
self.contents.cogwheel_fill_ring(x, y, gw, radius, height, BAR::expcolor1, BAR::expcolor2, amount, start, reverse)
end
#--------------------------------------------------------------------------
# * Draw Custom gauge ring
# value : bar calculation value
# max : bar max value
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# color1 : bar gradient color 1
# color2 : bar gradient color 2
# radius : distance from center point
# height : Height
# amount : size of ring - default 360�
# start : start position - max 360�
# reverse : draw ring in reverse
#--------------------------------------------------------------------------
def draw_custom_ring(value, max, x, y, color1, color2, radius, height, amount = 360, start = 0, reverse = false)
rate = [value.to_f / max.to_f, 1].min
gw = amount * [value.to_f / max.to_f, 1].min
gc1 = color1.is_a?(Integer) ? text_color(color1) : color1
gc2 = color2.is_a?(Integer) ? text_color(color2) : color2
r = gc2.red * rate
g = (gc2.green - 72) * rate
b = gc2.blue * rate
a = gc2.alpha
self.contents.cogwheel_fill_ring(x, y, gw, radius, height, gc1, Color.new(r, g, b, a), amount, start, reverse)
end
#--------------------------------------------------------------------------
# * Draw HP
# hide_bar : draw Parameters without gauge
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 120, hide_bar = false)
hide_bar ? nil : draw_actor_hp_gauge(actor, x, y, width)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, WLH, Vocab::hp_a)
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.hp, 2)
else
self.contents.draw_text(xr - 99, y, 44, WLH, actor.hp, 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.maxhp, 2)
end
end
#--------------------------------------------------------------------------
# * Draw MP
# hide_bar : draw Parameters without gauge
#--------------------------------------------------------------------------
def draw_actor_mp(actor, x, y, width = 120, hide_bar = false)
hide_bar ? nil : draw_actor_mp_gauge(actor, x, y, width)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, WLH, Vocab::mp_a)
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
#--------------------------------------------------------------------------
# * Draw Exp
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : Width
# hide_bar : draw Parameters without gauge
#--------------------------------------------------------------------------
def draw_actor_exp(actor, x, y, width = 170, hide_bar = false)
hide_bar ? nil : draw_actor_exp_gauge(actor, x, y, width)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 45, WLH, "Exp")
self.contents.font.color = normal_color
xr = x + width
if width < 170
self.contents.draw_text(xr - 60, y, 60, WLH, actor.next_rest_exp_s, 2)
else
self.contents.draw_text(xr - 131, y, 60, WLH, actor.exp_s, 2)
self.contents.draw_text(xr - 71, y, 11, WLH, "/", 2)
self.contents.draw_text(xr - 60, y, 60, WLH, actor.next_exp_s, 2)
end
end
end
#==============================================================================
# ** Window_SkillStatus
#------------------------------------------------------------------------------
# Edited so te Bars don't cut off
#==============================================================================
class Window_SkillStatus < Window_Base
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
draw_actor_level(@actor, 140, 0)
draw_actor_hp(@actor, 238, 0)
draw_actor_mp(@actor, 390, 0)
end
end
#==============================================================================
# ** Bitmap
#------------------------------------------------------------------------------
# Added gauge Calculations
#==============================================================================
class Bitmap
#--------------------------------------------------------------------------
# * Includes The BAR Module
#--------------------------------------------------------------------------
include BAR
#--------------------------------------------------------------------------
# * Wortana's 'gradient_fill_rect' Bug Fix
#--------------------------------------------------------------------------
alias gradient_original gradient_fill_rect unless method_defined?('gradient_original')
def gradient_fill_rect(*args)
args.pop if !args.last if args.size == 4 || 7 and !args.last
gradient_original(*args)
end
#--------------------------------------------------------------------------
# * CogWheel Style Fill of Rect
#--------------------------------------------------------------------------
def cogwheel_fill_rect(x, y, gw, width, height, gc1, gc2, up = false)
rect_border(x-2, y-2, width+4, height+4, COLOR1, CORNER)
rect_border(x-1, y-1, width+2, height+2, COLOR2, CORNER)
gradient_fill_rect(x, y, width, height, COLOR3, COLOR4, EMPTY)
gradient_fill_rect(x, y, up ? width : gw, up ? gw : height, gc1, gc2, FILLER)
end
#--------------------------------------------------------------------------
# * CogWheel Style Fill of Slanted Rect
#--------------------------------------------------------------------------
def cogwheel_fill_slant(x, y, gw, width, height, gc1, gc2, up = false)
bgx = up ? 2 : 4; bdx = up ? 1 : 2
bgy = up ? 4 : 2; bdy = up ? 2 : 1
bgw = up ? 4 : 8; bdw = up ? 2 : 4
bgh = up ? 8 : 4; bdh = up ? 4 : 2
slant_border(x-bgx, y-bgy, width+bgw, height+bgh, COLOR1, up)
slant_border(x-bdx, y-bdy, width+bdw, height+bdh, COLOR2, up)
gradient_fill_slant(x, y, width, height, COLOR3, COLOR4, EMPTY, up)
gradient_fill_slant(x, y,up ? width : gw,up ? gw : height, gc1, gc2, FILLER, up)
end
#--------------------------------------------------------------------------
# * CogWheel Style Fill of Ring
#--------------------------------------------------------------------------
def cogwheel_fill_ring(x, y, gw, radius, height, gc1, gc2, amount = 360, start = 0, reverse = false)
fill_ring(x-2, y-2, radius, height+4, COLOR1, amount, start, reverse)
fill_ring(x-1, y-1, radius, height+2, COLOR2, amount, start, reverse)
if amount >= 220
gradient_fill_ring(x, y, radius, height, COLOR3, COLOR4, [amount/2, 180].min, start, reverse)
gradient_fill_ring(x, y, radius, height, COLOR4, COLOR3, [amount/2, 180].min, start+(amount/2), reverse)
else
gradient_fill_ring(x, y, radius, height, COLOR3, COLOR4, [amount, 360].min, start, reverse)
end
if gw >= 220
gw1 = amount/2; gw2 = gw / 2
gradient_fill_ring(x, y, radius, height, gc1, gc2, gw1, start, reverse)
gradient_fill_ring(x, y, radius, height, gc2, gc1, gw2, start +(amount/2), reverse)
else
gradient_fill_ring(x, y, radius, height, gc1, gc2, gw, start, reverse)
end
end
#--------------------------------------------------------------------------
# * Fill of Border
#--------------------------------------------------------------------------
def rect_border(x, y, width, height, gc1, edge = false)
fill_rect(x + (edge ? 1 : 0), y, width - (edge ? 2 : 0), 2, gc1)
fill_rect(x + (edge ? 1 : 0), y+(height-2), width - (edge ? 2 : 0), 2, gc1)
fill_rect(x, y+1, 2, height-2, gc1)
fill_rect(x +(width-2), y+1, 2, height-2, gc1)
end
#--------------------------------------------------------------------------
# * Gradient Fill of Slanted Rect
#--------------------------------------------------------------------------
def gradient_fill_slant(x, y, width, height, gc1, gc2, vertical = false, up = false)
if up
for i in 1..width
if vertical
gradient_fill_rect(x + width - i, y+i+1, 1, (height-2)-width, gc1, gc2, vertical)
else
color = get_gradient_pixel(gc1, gc2, width, i)
fill_rect(x + width - i, y+i+1, 1, (height-2)-width, color)
end
end
else
for i in 1..height
if vertical
color = get_gradient_pixel(gc1, gc2, height, i)
fill_rect(x+i+1, y + height - i, (width-2)-height, 1, color)
else
gradient_fill_rect(x+i+1, y + height - i, (width-2)-height, 1, gc1, gc2)
end
end
end
end
#--------------------------------------------------------------------------
# * Fill of Slanted Rect
#--------------------------------------------------------------------------
def fill_slant(x, y, width, height, gc1, up = false)
oh = up ? width : height
for i in 1..oh
if up
fill_rect(x + width -i, y+i, 1, height-width, gc1)
else
fill_rect(x+i, y + height -i, width-height, 1, gc1)
end
end
end
#--------------------------------------------------------------------------
# * Fill of Slanted Border
#--------------------------------------------------------------------------
def slant_border(x, y, width, height, gc1, up = false)
oh = up ? width : height
for i in 1..oh-2
if up
fill_rect(x + width-1 -i, y+((height-1)-width)+i, 1, 2, gc1)
fill_rect(x + width-1 -i, y+1+i, 1, 2, gc1)
fill_rect(x + width-1, y+1, 1, height-width, gc1)
fill_rect(x, y+width, 1, height-width, gc1)
else
fill_rect(x+((width-1)-height)+i, y + height-1 -i, 2, 1, gc1)
fill_rect(x+1+i, y + height-1 -i, 2, 1, gc1)
fill_rect(x+1, y + height -1, width-height, 1, gc1)
fill_rect(x+height, y, width-height, 1, gc1)
end
end
end
#--------------------------------------------------------------------------
# * Fill of Ring
#--------------------------------------------------------------------------
def fill_ring(ox, oy, radius, height, gc1, amount = 360, start = 0, reverse = false)
d = 2.0 * Math:tongue.gifI / 360
for i in 1..[amount, 360].min
s = i + start
if reverse
x = ox + ( radius * Math.sin( d * s ) ).to_i
y = oy - ( radius * Math.cos( d * s ) ).to_i
else
x = ox - ( radius * Math.cos( d * s ) ).to_i
y = oy + ( radius * Math.sin( d * s ) ).to_i
end
fill_rect(x, y, height, height, gc1)
end
end
#--------------------------------------------------------------------------
# * Gradient Fill of Ring
#--------------------------------------------------------------------------
def gradient_fill_ring(ox, oy, radius, height, gc1, gc2, amount = 360, start = 0, reverse = false)
d = 2.0 * Math:tongue.gifI / 360
for i in 1..amount
s = i + start
if reverse
x = ox + ( radius * Math.sin( d * s ) ).to_i
y = oy - ( radius * Math.cos( d * s ) ).to_i
else
x = ox - ( radius * Math.cos( d * s ) ).to_i
y = oy + ( radius * Math.sin( d * s ) ).to_i
end
color = get_gradient_pixel(gc1, gc2, amount, i)
fill_rect(x, y, height, height, color)
end
end
#--------------------------------------------------------------------------
# * Get Pixel Color for Gradient Fill
#--------------------------------------------------------------------------
def get_gradient_pixel(gc1, gc2, amount, i)
red = gc1.red * (amount - i) / amount + gc2.red * i / amount
green = gc1.green * (amount - i) / amount + gc2.green * i / amount
blue = gc1.blue * (amount - i) / amount + gc2.blue * i / amount
alpha = gc1.alpha * (amount - i) / amount + gc2.alpha * i / amount
return Color.new(red, green, blue, alpha)
end
end



This post has been edited by ZeroManArmy: May 1 2010, 07:46 PM


__________________________
Go to the top of the page
 
+Quote Post
   
SlyCooperFan1
post May 2 2010, 01:45 PM
Post #73


Level 1
Group Icon

Group: Member
Posts: 6
Type: Writer
RM Skill: Beginner




QUOTE (jens009 @ May 1 2010, 08:44 PM) *
QUOTE (SlyCooperFan1 @ May 1 2010, 11:59 AM) *
I don't get what I'm doing wrong. I put the v1.2 script in as well as the Neo Gauge Patch, both under Materials, both in two different scripts. I edited nothing for either one. But in battles, the bars aren't showing up.

Also, in Battle Tests, I get the error message:
QUOTE
Script 'Neo Gauge Patch' line 39: NoMethodError occurred.

undefined method 'draw_neo_gauge' for
#<Window_EnemyHP:0x2ae4e18>


You need to have woratana's neo gauge script. Otherwise, you can't have the patch included.
Oh...where is the script? I searched here but couldn't find it.
Go to the top of the page
 
+Quote Post
   
jens009
post May 2 2010, 02:45 PM
Post #74


L Did you know? Death gods... only eat apples
Group Icon

Group: +Gold Member
Posts: 2,976
Type: Scripter
RM Skill: Skilled




QUOTE (ZeroManArmy @ May 1 2010, 08:24 PM) *
Is it possible to get this to to work with Syvkal's Menu Bars? Also is there another way to make the word H to HP

CODE
#======================================================
==========
==============
# ** Syvkal's Menu Bars
#------------------------------------------------------------------------------
# by Syvkal
# Version 4.1
# 05-20-08
#==============================================================================
#
# - INTRODUCTION -
#
# This system implements a series of Plug 'N' Play Menu Bars
# The Bars were inspired CogWheel, but all coding was done by me
# ( Except Wortana's 'gradient_fill_rect' Bug Fix )
#
#------------------------------------------------------------------------------
#
# - USAGE -
#
# This system will work as soon as you put it in the Script Editor
# You can edit the script from the Configuration System
# However, it has also been made so you can easily make your own bars
#
# ---------------------------------------------------
#
# To draw a bar use:
# draw_custom_gauge
#
# Followed by:
# (value, max, x, y, color1, color2, width, height, slanted, up)
#
# value : bar calculation value
# max : bar max value
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# color1 : bar gradient color 1 EITHER Color.new(r,g,b,a)
# color2 : bar gradient color 2 OR Numeric Text color
# width : Width
# height : Height
# slanted : draw slanted bar
# vertical : draw bar vertically
#
# ---------------------------------------------------
#
# To draw a ring use:
# draw_custom_ring
#
# Followed by:
# (value, max, x, y, color1, color2, radius, height, amount, start, reverse)

# value : bar calculation value
# max : bar max value
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# color1 : bar gradient color 1
# color2 : bar gradient color 2
# radius : distance from center point
# height : Height
# amount : size of ring - default 360�
# start : start position - max 360�
# reverse : draw ring in reverse
#
#------------------------------------------------------------------------------
#
# - SCRIPTERS USAGE -
#
# I have added a few extra features to allow scripters to easily use the bars
# Seeing as the bars can be drawn Normal, Vertical or in a Ring I've added a
# feature to allow you to turn off the bars when drawing an actors HP, MP etc.
# When drawing an actors HP etc. simply add 'true' on the end. Like this:
# draw_actor_hp(actor, x, y, width, true)
#
# I've also separated the different bars so they're easier to draw
#
# draw_actor_hp_gauge(actor, x, y, width) Will draw a normal bar
# draw_actor_hp_gauge(actor, x, y, width, true) Will draw a vertical bar
# draw_actor_hp_ring(actor, x, y, radius, height, amount, start)
# Will draw a ring
#
#------------------------------------------------------------------------------
#
# - SCRIPT CALLS -
#
# There are no script calls necessary to enable this script
# However, you can change any of the constants in game if you wish
# This can be done by the Script Call Funtion in an event
#
# For example:
# COG::HPMPSLANT = true
#
# Will make the HP and MP bars Slant
# And setting it to false will turn them back to normal
#
#==============================================================================
module BAR
#===================================================#
# ** C O N F I G U R A T I O N S Y S T E M ** #
#===================================================#

# Parameter Max Value
P_MAX = 500
# The system uses a 'rate' feature. It is set when drawing a bar
# The 'rate' is how much the bar is filled as a decimal (max : 1)
# This is used to enable color change as the bar decreased in amount
$rate = 0 # Don't touch this
# The system uses a series of CONSTANTS that can be edited here
# They control the basic gauge colors and the manner the gauge is filled:

# Gauge Border Colors
COLOR1 = Color.new(0, 0, 0, 192) # Outer Border
COLOR2 = Color.new(255, 255, 192, 192) # Inner Border
# Gauge Empty filler
COLOR3 = Color.new(0, 0, 0, 12) # Half of Inner Shading
COLOR4 = Color.new(64, 0, 0, 92) # Half of Inner Shading
# Gauge Settings
EMPTY = false # EMPTY gauge (false - Side : true - Vertical)
FILLER = false # FILLER gauge (false - Side : true - Vertical)
# Border Settings - Applies only to standard bars
CORNER = false # Remove corners?

# The Parameter colors can be text colors taken from the windowskin or
# colors like above. You don't need set your own 'rate' functions
# it does it for you
# Parameter Gauge Color1
ATKCOLOR1 = 2
DEFCOLOR1 = 17
SPICOLOR1 = 30
AGICOLOR1 = 12
# Parameter Gauge Color2
ATKCOLOR2 = 20
DEFCOLOR2 = 21
SPICOLOR2 = 31
AGICOLOR2 = 4

# The system has been made to use a series of SWITCHES that can be edited here
# They control whether certain Bars are Normal or Slanted:

HPMPSLANT = false # Slanted HP and MP Bars?
EXPSLANT = false # Slanted Exp Bars?
PARSLANT = false # Slanted Parameter Bars?
DVVLBSLANT = true # Slanted Limit Break Bars?

#===================================================#
# ** C O M P L E X C O N F I G U R A T I O N ** #
#===================================================#

# The system allows you to edit the main gauge colous from here
# Functions had to be used instead of Constants so the $rate feature still works
# Edit only if you know what you're doing:

def self::hpcolor1 # HP Guage Color1
return Color.new(80 - 24 * $rate, 80 * $rate, 14 * $rate, 192)
end
def self::hpcolor2 # HP Guage Color2
return Color.new(240 - 72 * $rate, 240 * $rate, 62 * $rate, 192)
end
def self::mpcolor1 # MP Guage Color1
return Color.new(14 * $rate, 80 - 24 * $rate, 80 * $rate, 192)
end
def self::mpcolor2 # MP Guage Color2
return Color.new(62 * $rate, 240 - 72 * $rate, 240 * $rate, 192)
end
def self::expcolor1 # EXP Guage Color1
Color.new(80 * $rate, 80 - 80 * $rate ** 2, 80 - 80 * $rate, 192)
end
def self::expcolor2 # EXP Guage Color2
Color.new(240 * $rate, 240 - 240 * $rate ** 2, 240 - 240 * $rate, 192)
end
#===================================================#
# ** E N D C O N F I G U R A T I O N ** #
#===================================================#
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# Added EXP and Next Level EXP for numeric for calculations
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Get EXP - numeric for calculations
#--------------------------------------------------------------------------
def now_exp
return @exp - @exp_list[@level]
end
#--------------------------------------------------------------------------
# * Get Next Level EXP - numeric for calculations
#--------------------------------------------------------------------------
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# Added the 'Draw' functions for each gauge
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# * Includes The BAR Module
#--------------------------------------------------------------------------
include BAR
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias draw_actor_parameter_original draw_actor_parameter
#--------------------------------------------------------------------------
# * Draw HP gauge
# vertical : draw bar vertically
#--------------------------------------------------------------------------
def draw_actor_hp_gauge(actor, x, y, width = 120, vertical = false)
$rate = actor.hp.to_f / actor.maxhp
gw = width * actor.hp / actor.maxhp
w = vertical ? 6 : width; h = vertical ? width : 6
HPMPSLANT ? self.contents.cogwheel_fill_slant(x, y + WLH - 8, gw, w, h, BAR::hpcolor1, BAR::hpcolor2, vertical) :
self.contents.cogwheel_fill_rect(x, y + WLH - 8, gw, w, h, BAR::hpcolor1, BAR::hpcolor2, vertical)
end
#--------------------------------------------------------------------------
# * Draw MP gauge
# vertical : draw bar vertically
#--------------------------------------------------------------------------
def draw_actor_mp_gauge(actor, x, y, width = 120, vertical = false)
$rate = actor.mp.to_f / [actor.maxmp, 1].max
gw = width * actor.mp / [actor.maxmp, 1].max
w = vertical ? 6 : width; h = vertical ? width : 6
HPMPSLANT ? self.contents.cogwheel_fill_slant(x, y + WLH - 8, gw, w, h, BAR::mpcolor1, BAR::mpcolor2, vertical) :
self.contents.cogwheel_fill_rect(x, y + WLH - 8, gw, w, h, BAR::mpcolor1, BAR::mpcolor2, vertical)
end
#--------------------------------------------------------------------------
# * Draw Exp gauge
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : Width
# vertical : draw bar vertically
#--------------------------------------------------------------------------
def draw_actor_exp_gauge(actor, x, y, width = 170, vertical = false)
$rate = actor.now_exp.to_f / [actor.next_exp, 1].max
gw = width * actor.now_exp / [actor.next_exp, 1].max
w = vertical ? 6 : width; h = vertical ? width : 6
EXPSLANT ? self.contents.cogwheel_fill_slant(x, y + WLH - 8, gw, w, h, BAR::expcolor1, BAR::expcolor2, vertical) :
self.contents.cogwheel_fill_rect(x, y + WLH - 8, gw, w, h, BAR::expcolor1, BAR::expcolor2, vertical)
end
#--------------------------------------------------------------------------
# * Draw Parameters
# hide_bar : draw Parameters without gauge
#--------------------------------------------------------------------------
def draw_actor_parameter(actor, x, y, type, hide_bar = false)
hide_bar ? nil : draw_actor_parameter_gauge(actor, x, y, type)
draw_actor_parameter_original(actor, x, y, type)
end
#--------------------------------------------------------------------------
# * Draw Parameters gauge
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# type : Type of parameters (0-3)
# width : Width
# vertical : draw bar vertically
#--------------------------------------------------------------------------
def draw_actor_parameter_gauge(actor, x, y, type, width = 160, vertical = false)
case type
when 0
e1 = actor.atk
gc1 = ATKCOLOR1.is_a?(Integer) ? text_color(ATKCOLOR1) : ATKCOLOR1
gc2 = ATKCOLOR2.is_a?(Integer) ? text_color(ATKCOLOR2) : ATKCOLOR2
when 1
e1 = actor.def
gc1 = DEFCOLOR1.is_a?(Integer) ? text_color(DEFCOLOR1) : DEFCOLOR1
gc2 = DEFCOLOR2.is_a?(Integer) ? text_color(DEFCOLOR2) : DEFCOLOR2
when 2
e1 = actor.spi
gc1 = SPICOLOR1.is_a?(Integer) ? text_color(SPICOLOR1) : SPICOLOR1
gc2 = SPICOLOR2.is_a?(Integer) ? text_color(SPICOLOR2) : SPICOLOR2
when 3
e1 = actor.agi
gc1 = AGICOLOR1.is_a?(Integer) ? text_color(AGICOLOR1) : AGICOLOR1
gc2 = AGICOLOR2.is_a?(Integer) ? text_color(AGICOLOR2) : AGICOLOR2
end
e2 = P_MAX
rate = [e1.to_f / e2.to_f, 1].min
gw = width * [e1.to_f / e2.to_f, 1].min
r = gc2.red * rate
g = (gc2.green - 72) * rate
b = gc2.blue * rate
a = gc2.alpha
w = vertical ? 6 : width; h = vertical ? width : 6
PARSLANT ? self.contents.cogwheel_fill_slant(x, y + WLH - 8, gw, w, h, gc1, Color.new(r, g, b, a), vertical) :
self.contents.cogwheel_fill_rect(x, y + WLH - 8, gw, w, h, gc1, Color.new(r, g, b, a), vertical)
end
#--------------------------------------------------------------------------
# * Draw Custom gauge
# value : bar calculation value
# max : bar max value
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# color1 : bar gradient color 1
# color2 : bar gradient color 2
# width : Width
# height : Height
# slanted : draw slanted bar
# vertical : draw bar vertically
#--------------------------------------------------------------------------
def draw_custom_gauge(value, max, x, y, color1, color2, width=120, height=6, slanted = false, vertical = false)
rate = [value.to_f / max.to_f, 1].min
gw = width * [value.to_f / max.to_f, 1].min
gc1 = color1.is_a?(Integer) ? text_color(color1) : color1
gc2 = color2.is_a?(Integer) ? text_color(color2) : color2
r = gc2.red * rate
g = (gc2.green - 72) * rate
b = gc2.blue * rate
a = gc2.alpha
w = vertical ? 6 : width; h = vertical ? width : 6
slanted ? self.contents.cogwheel_fill_slant(x, y + WLH - 8, gw, w, h, gc1, Color.new(r, g, b, a), vertical) :
self.contents.cogwheel_fill_rect(x, y + WLH - 8, gw, w, h, gc1, Color.new(r, g, b, a), vertical)
end
#--------------------------------------------------------------------------
# * Draw Limit Break gauge
# vertical : draw bar vertically
#--------------------------------------------------------------------------
def draw_actor_lb(actor, x, y, width = 120, vertical = false)
return unless actor.lb_gauge_visible?
st1 = lb_gauge_normal_start_color; st2 = lb_gauge_max_start_color
ed1 = lb_gauge_normal_end_color; ed2 = lb_gauge_max_end_color
rate = actor.limitbreak.to_f / [LB_MAX, 1].max
gw = width * actor.limitbreak / LB_MAX
gc1 = (gw == width ? st2 : Color.new(st1.red,st1.green-(10*rate),st1.blue-(10*rate), 192))
gc2 = (gw == width ? ed2 : Color.new(ed1.red,ed1.green-(10*rate),ed1.blue-(10*rate), 192))
w = vertical ? 6 : width; h = vertical ? width : 6
DVVLBSLANT ? self.contents.cogwheel_fill_slant(x, y + WLH - 8, gw, w, h, gc1, gc2, vertical) :
self.contents.cogwheel_fill_rect(x, y + WLH - 8, gw, w, h, gc1, gc2, vertical)
end
#--------------------------------------------------------------------------
# * Draw HP gauge ring
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# radius : distance from center point
# height : Height
# amount : size of ring - default 360�
# start : start position - max 360�
# reverse : draw ring in reverse
#--------------------------------------------------------------------------
def draw_actor_hp_ring(actor, x, y, radius, height, amount = 360, start = 0, reverse = false)
$rate = actor.hp.to_f / actor.maxhp
gw = amount * actor.hp / actor.maxhp
self.contents.cogwheel_fill_ring(x, y, gw, radius, height, BAR::hpcolor1, BAR::hpcolor2, amount, start, reverse)
end
#--------------------------------------------------------------------------
# * Draw MP gauge ring
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# radius : distance from center point
# height : Height
# amount : size of ring - default 360�
# start : start position - max 360�
# reverse : draw ring in reverse
#--------------------------------------------------------------------------
def draw_actor_mp_ring(actor, x, y, radius, height, amount = 360, start = 0, reverse = false)
$rate = actor.mp.to_f / [actor.maxmp, 1].max
gw = amount * actor.mp / [actor.maxmp, 1].max
self.contents.cogwheel_fill_ring(x, y, gw, radius, height, BAR::mpcolor1, BAR::mpcolor2, amount, start, reverse)
end
#--------------------------------------------------------------------------
# * Draw Exp gauge ring
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# radius : distance from center point
# height : Height
# amount : size of ring - default 360�
# start : start position - max 360�
# reverse : draw ring in reverse
#--------------------------------------------------------------------------
def draw_actor_exp_ring(actor, x, y, radius, height, amount = 360, start = 0, reverse = false)
$rate = actor.now_exp.to_f / [actor.next_exp, 1].max
gw = amount * actor.now_exp / [actor.next_exp, 1].max
self.contents.cogwheel_fill_ring(x, y, gw, radius, height, BAR::expcolor1, BAR::expcolor2, amount, start, reverse)
end
#--------------------------------------------------------------------------
# * Draw Custom gauge ring
# value : bar calculation value
# max : bar max value
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# color1 : bar gradient color 1
# color2 : bar gradient color 2
# radius : distance from center point
# height : Height
# amount : size of ring - default 360�
# start : start position - max 360�
# reverse : draw ring in reverse
#--------------------------------------------------------------------------
def draw_custom_ring(value, max, x, y, color1, color2, radius, height, amount = 360, start = 0, reverse = false)
rate = [value.to_f / max.to_f, 1].min
gw = amount * [value.to_f / max.to_f, 1].min
gc1 = color1.is_a?(Integer) ? text_color(color1) : color1
gc2 = color2.is_a?(Integer) ? text_color(color2) : color2
r = gc2.red * rate
g = (gc2.green - 72) * rate
b = gc2.blue * rate
a = gc2.alpha
self.contents.cogwheel_fill_ring(x, y, gw, radius, height, gc1, Color.new(r, g, b, a), amount, start, reverse)
end
#--------------------------------------------------------------------------
# * Draw HP
# hide_bar : draw Parameters without gauge
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 120, hide_bar = false)
hide_bar ? nil : draw_actor_hp_gauge(actor, x, y, width)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, WLH, Vocab::hp_a)
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.hp, 2)
else
self.contents.draw_text(xr - 99, y, 44, WLH, actor.hp, 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.maxhp, 2)
end
end
#--------------------------------------------------------------------------
# * Draw MP
# hide_bar : draw Parameters without gauge
#--------------------------------------------------------------------------
def draw_actor_mp(actor, x, y, width = 120, hide_bar = false)
hide_bar ? nil : draw_actor_mp_gauge(actor, x, y, width)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, WLH, Vocab::mp_a)
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
#--------------------------------------------------------------------------
# * Draw Exp
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : Width
# hide_bar : draw Parameters without gauge
#--------------------------------------------------------------------------
def draw_actor_exp(actor, x, y, width = 170, hide_bar = false)
hide_bar ? nil : draw_actor_exp_gauge(actor, x, y, width)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 45, WLH, "Exp")
self.contents.font.color = normal_color
xr = x + width
if width < 170
self.contents.draw_text(xr - 60, y, 60, WLH, actor.next_rest_exp_s, 2)
else
self.contents.draw_text(xr - 131, y, 60, WLH, actor.exp_s, 2)
self.contents.draw_text(xr - 71, y, 11, WLH, "/", 2)
self.contents.draw_text(xr - 60, y, 60, WLH, actor.next_exp_s, 2)
end
end
end
#==============================================================================
# ** Window_SkillStatus
#------------------------------------------------------------------------------
# Edited so te Bars don't cut off
#==============================================================================
class Window_SkillStatus < Window_Base
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
draw_actor_level(@actor, 140, 0)
draw_actor_hp(@actor, 238, 0)
draw_actor_mp(@actor, 390, 0)
end
end
#==============================================================================
# ** Bitmap
#------------------------------------------------------------------------------
# Added gauge Calculations
#==============================================================================
class Bitmap
#--------------------------------------------------------------------------
# * Includes The BAR Module
#--------------------------------------------------------------------------
include BAR
#--------------------------------------------------------------------------
# * Wortana's 'gradient_fill_rect' Bug Fix
#--------------------------------------------------------------------------
alias gradient_original gradient_fill_rect unless method_defined?('gradient_original')
def gradient_fill_rect(*args)
args.pop if !args.last if args.size == 4 || 7 and !args.last
gradient_original(*args)
end
#--------------------------------------------------------------------------
# * CogWheel Style Fill of Rect
#--------------------------------------------------------------------------
def cogwheel_fill_rect(x, y, gw, width, height, gc1, gc2, up = false)
rect_border(x-2, y-2, width+4, height+4, COLOR1, CORNER)
rect_border(x-1, y-1, width+2, height+2, COLOR2, CORNER)
gradient_fill_rect(x, y, width, height, COLOR3, COLOR4, EMPTY)
gradient_fill_rect(x, y, up ? width : gw, up ? gw : height, gc1, gc2, FILLER)
end
#--------------------------------------------------------------------------
# * CogWheel Style Fill of Slanted Rect
#--------------------------------------------------------------------------
def cogwheel_fill_slant(x, y, gw, width, height, gc1, gc2, up = false)
bgx = up ? 2 : 4; bdx = up ? 1 : 2
bgy = up ? 4 : 2; bdy = up ? 2 : 1
bgw = up ? 4 : 8; bdw = up ? 2 : 4
bgh = up ? 8 : 4; bdh = up ? 4 : 2
slant_border(x-bgx, y-bgy, width+bgw, height+bgh, COLOR1, up)
slant_border(x-bdx, y-bdy, width+bdw, height+bdh, COLOR2, up)
gradient_fill_slant(x, y, width, height, COLOR3, COLOR4, EMPTY, up)
gradient_fill_slant(x, y,up ? width : gw,up ? gw : height, gc1, gc2, FILLER, up)
end
#--------------------------------------------------------------------------
# * CogWheel Style Fill of Ring
#--------------------------------------------------------------------------
def cogwheel_fill_ring(x, y, gw, radius, height, gc1, gc2, amount = 360, start = 0, reverse = false)
fill_ring(x-2, y-2, radius, height+4, COLOR1, amount, start, reverse)
fill_ring(x-1, y-1, radius, height+2, COLOR2, amount, start, reverse)
if amount >= 220
gradient_fill_ring(x, y, radius, height, COLOR3, COLOR4, [amount/2, 180].min, start, reverse)
gradient_fill_ring(x, y, radius, height, COLOR4, COLOR3, [amount/2, 180].min, start+(amount/2), reverse)
else
gradient_fill_ring(x, y, radius, height, COLOR3, COLOR4, [amount, 360].min, start, reverse)
end
if gw >= 220
gw1 = amount/2; gw2 = gw / 2
gradient_fill_ring(x, y, radius, height, gc1, gc2, gw1, start, reverse)
gradient_fill_ring(x, y, radius, height, gc2, gc1, gw2, start +(amount/2), reverse)
else
gradient_fill_ring(x, y, radius, height, gc1, gc2, gw, start, reverse)
end
end
#--------------------------------------------------------------------------
# * Fill of Border
#--------------------------------------------------------------------------
def rect_border(x, y, width, height, gc1, edge = false)
fill_rect(x + (edge ? 1 : 0), y, width - (edge ? 2 : 0), 2, gc1)
fill_rect(x + (edge ? 1 : 0), y+(height-2), width - (edge ? 2 : 0), 2, gc1)
fill_rect(x, y+1, 2, height-2, gc1)
fill_rect(x +(width-2), y+1, 2, height-2, gc1)
end
#--------------------------------------------------------------------------
# * Gradient Fill of Slanted Rect
#--------------------------------------------------------------------------
def gradient_fill_slant(x, y, width, height, gc1, gc2, vertical = false, up = false)
if up
for i in 1..width
if vertical
gradient_fill_rect(x + width - i, y+i+1, 1, (height-2)-width, gc1, gc2, vertical)
else
color = get_gradient_pixel(gc1, gc2, width, i)
fill_rect(x + width - i, y+i+1, 1, (height-2)-width, color)
end
end
else
for i in 1..height
if vertical
color = get_gradient_pixel(gc1, gc2, height, i)
fill_rect(x+i+1, y + height - i, (width-2)-height, 1, color)
else
gradient_fill_rect(x+i+1, y + height - i, (width-2)-height, 1, gc1, gc2)
end
end
end
end
#--------------------------------------------------------------------------
# * Fill of Slanted Rect
#--------------------------------------------------------------------------
def fill_slant(x, y, width, height, gc1, up = false)
oh = up ? width : height
for i in 1..oh
if up
fill_rect(x + width -i, y+i, 1, height-width, gc1)
else
fill_rect(x+i, y + height -i, width-height, 1, gc1)
end
end
end
#--------------------------------------------------------------------------
# * Fill of Slanted Border
#--------------------------------------------------------------------------
def slant_border(x, y, width, height, gc1, up = false)
oh = up ? width : height
for i in 1..oh-2
if up
fill_rect(x + width-1 -i, y+((height-1)-width)+i, 1, 2, gc1)
fill_rect(x + width-1 -i, y+1+i, 1, 2, gc1)
fill_rect(x + width-1, y+1, 1, height-width, gc1)
fill_rect(x, y+width, 1, height-width, gc1)
else
fill_rect(x+((width-1)-height)+i, y + height-1 -i, 2, 1, gc1)
fill_rect(x+1+i, y + height-1 -i, 2, 1, gc1)
fill_rect(x+1, y + height -1, width-height, 1, gc1)
fill_rect(x+height, y, width-height, 1, gc1)
end
end
end
#--------------------------------------------------------------------------
# * Fill of Ring
#--------------------------------------------------------------------------
def fill_ring(ox, oy, radius, height, gc1, amount = 360, start = 0, reverse = false)
d = 2.0 * Math:tongue.gifI / 360
for i in 1..[amount, 360].min
s = i + start
if reverse
x = ox + ( radius * Math.sin( d * s ) ).to_i
y = oy - ( radius * Math.cos( d * s ) ).to_i
else
x = ox - ( radius * Math.cos( d * s ) ).to_i
y = oy + ( radius * Math.sin( d * s ) ).to_i
end
fill_rect(x, y, height, height, gc1)
end
end
#--------------------------------------------------------------------------
# * Gradient Fill of Ring
#--------------------------------------------------------------------------
def gradient_fill_ring(ox, oy, radius, height, gc1, gc2, amount = 360, start = 0, reverse = false)
d = 2.0 * Math:tongue.gifI / 360
for i in 1..amount
s = i + start
if reverse
x = ox + ( radius * Math.sin( d * s ) ).to_i
y = oy - ( radius * Math.cos( d * s ) ).to_i
else
x = ox - ( radius * Math.cos( d * s ) ).to_i
y = oy + ( radius * Math.sin( d * s ) ).to_i
end
color = get_gradient_pixel(gc1, gc2, amount, i)
fill_rect(x, y, height, height, color)
end
end
#--------------------------------------------------------------------------
# * Get Pixel Color for Gradient Fill
#--------------------------------------------------------------------------
def get_gradient_pixel(gc1, gc2, amount, i)
red = gc1.red * (amount - i) / amount + gc2.red * i / amount
green = gc1.green * (amount - i) / amount + gc2.green * i / amount
blue = gc1.blue * (amount - i) / amount + gc2.blue * i / amount
alpha = gc1.alpha * (amount - i) / amount + gc2.alpha * i / amount
return Color.new(red, green, blue, alpha)
end
end


Yeap. If I remember correctly, Syvkal's scripts have different types of bars you can use. All you have to edit is the gauge section:
CODE
  def draw_enemy_hp_gauge(enemy, x, y, width = 120)
    gw = width * enemy.hp / enemy.maxhp
    gc1 = hp_gauge_color1
    gc2 = hp_gauge_color2
    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

The calculations are already done, you just have to implement Syvkal's bars here.


QUOTE (SlyCooperFan1 @ May 2 2010, 02:45 PM) *
Oh...where is the script? I searched here but couldn't find it.

I just looked at the RGSS2 Scripting List. Here you go:
http://www.rpgrevolution.com/forums/index....showtopic=12014

Paste the script above my enemy HP window.


__________________________

My RMXP Project:


Farewell RRR. =]
Go to the top of the page
 
+Quote Post
   
ZeroManArmy
post May 4 2010, 02:11 PM
Post #75


Level 5
Group Icon

Group: Member
Posts: 68
Type: Artist
RM Skill: Undisclosed




How do I add the bars in? Im newbie script person.


__________________________
Go to the top of the page
 
+Quote Post
   
SlyCooperFan1
post May 5 2010, 07:35 PM
Post #76


Level 1
Group Icon

Group: Member
Posts: 6
Type: Writer
RM Skill: Beginner




Okay, I'm seriously lost. The patch is in the first post on this thread, there's two different scripts in the thread you linked to me two posts above this one...I'm sorry for being so noobish at this stuff, but where the heck do these things go? xD Your script is working perfectly, though, it's really awesome. biggrin.gif
Go to the top of the page
 
+Quote Post
   
new
post Jun 17 2010, 11:19 PM
Post #77


Level 4
Group Icon

Group: Member
Posts: 58
Type: None
RM Skill: Undisclosed




is it possible that the Enemy HP would only be shown on target select? and its centered at the top in a window?
Go to the top of the page
 
+Quote Post
   
Akroona_Shadow_o...
post Jul 27 2010, 03:39 PM
Post #78



Group Icon

Group: Member
Posts: 3
Type: None
RM Skill: Beginner




I was wondering if there is a way to remove the message for how much the characters deal to enemies, and to remove the numbers denoting the enemies life, but to keep the bars visible. That request may be ridiculous, but I grew up on Pokemon! happy.gif


__________________________
I am Akroona! Fear me as the shadow of Death itself!
Go to the top of the page
 
+Quote Post
   
Haku
post Dec 7 2010, 07:50 AM
Post #79


Level 11
Group Icon

Group: Revolutionary
Posts: 187
Type: Scripter
RM Skill: Advanced




Hello, how do I put the hp bars below each other and move in the bottom right?
Go to the top of the page
 
+Quote Post
   
anythingmasterz
post Feb 20 2011, 11:32 AM
Post #80



Group Icon

Group: Member
Posts: 2
Type: None
RM Skill: Undisclosed




Where does the neo health bar extra go in? after all the text from the window_enemyHP or just right before?

This post has been edited by anythingmasterz: Feb 20 2011, 11:37 AM
Go to the top of the page
 
+Quote Post
   

5 Pages V  « < 2 3 4 5 >
Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 22nd May 2013 - 08:51 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker