Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Rewrite to make "Slanted Bar"

Hi,

Well, this is definately something I have no idea on how to do. so I am going to jump ahead and ask for someone to help me with the coding here.

I want to get the CT Bar (which serves as the ATB bar) to be a slanted one; Sephiroth Spawn style. But, I have no idea what coding to add to the script to make that happen. So, if you could either just tell me what to add so it redraws the bar in battle as a slanted one, or whatever, I would really appreciate it!

Here are the links to the scripts i am working with, if they help any!

I am using Paradogs battle system:
Link to thread: CLICK
Link to paradog download: CLICK

And Seph's slanted bars, which i'd like to know, to get them to work correctly you have to use the script found in DVV's lmit break script:
Link to thread: CLICK

If there are any questions, or something i left out, ask away or let me know!

Thanks in advance,
-Zank
 
hanmac;251188 said:

Yeah, those the bars I am using (they had to be rewritten, which is why I pointed to DVV's limit break script. He rewrote them to work with his script; which can be found in the limit break demo). But I need the scripting so that it overrights the CT bar in Paradog's battle system with a slanted bar. Thats what i can't figure out (just to get it to replace the HP and SP bars I had to make a side script to redraw and over write the old HP and SP bars. Curtiousy of DVV).

And phooey. I could have sworn that the last time i read the 'bump' rules it said 48 hours, not 72. My bad. Things change around here whenever i turn my back, i swear! (just getting back into this part of the forum, so thanks for the heads up)

Anyways, to further elaberate on what i said; since i don't think it made much since, this had to be put after seph's bar script to make it work (i had to add an extra part to make the limit break bar different in battle than it was in the menu... i just can't figure out how to add the CT bar in this equation and make it slanted...)

Code:
#================================================= =============================
# ** Window_BattleStatus
#------------------------------------------------------------------------------
# This window displays the status of all party members on the battle screen.
#================================================= =============================

class Window_BattleStatus < Window_Base

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

#================================================= =========================
# * Draw HP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#================================================= =========================
alias :draw_actor_hp_hpsp :draw_actor_hp
def draw_actor_hp(actor, x, y, width = 144) 
draw_slant_bar(x, y + 12, actor.hp, actor.maxhp, width, 6, 
bar_color = Color.new(150, 0, 0, 255), 
end_color = Color.new(255, 255, 60, 255))
draw_actor_hp_hpsp(actor, x, y, width)
end
#================================================= =========================
# * Draw SP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#================================================= =========================
alias :draw_actor_sp_hpsp :draw_actor_sp
def draw_actor_sp(actor, x, y, width = 144)
draw_slant_bar(x, y + 12, actor.sp, actor.maxsp, width, 6,
bar_color = Color.new(0, 0, 155, 255), 
end_color = Color.new(255, 255, 255, 255))
draw_actor_sp_hpsp(actor, x, y, width)
end

  #=========================================================================
  # * Draw Actor Limit Break Bar
  #     actor : Actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #=========================================================================
  def draw_actor_lb(actor, x, y, width = 144)
    rate = actor.limitbreak.to_f / LB_MAX
    plus_x = -2
    rate_x = 0
    plus_y = 12
    plus_width = 0
    rate_width = 100
    height = 6
    lb = (width + plus_width) * actor.limitbreak * rate_width / 100 / LB_MAX
    # Drawing of gauge
    if actor.limitbreak == LB_MAX
      # Draw Silver Blue Bar
      draw_slant_bar(x + plus_x + width * rate_x / 100, y + plus_y, lb, width,
        width, height, od_color1 = Color.new(0,80,200,192), 
        od_color2 = Color.new(255,255,255,192))
    else
      # Draw Green Bar
      draw_slant_bar(x + plus_x + width * rate_x / 100, y + plus_y, lb, width,
        width, height, od_color1 = Color.new(31, 128, 0, 128), 
        od_color2 = Color.new(255, 255, 191))
    end
    self.contents.font.color = system_color
    self.contents.font.size = 16
    self.contents.draw_text(x - 25, y, 48, 32, "SCS")
  end
end
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top