RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[RESOLVED] XP Battle Bars

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 82
Issue resolved by user dodoop, of the Brazilian Maker community.

Hello, fellow coders... one thing that I can't really work with in RGSS are health/skill bars... luckily there are enough scripts out there for me to not have to code one, but I have hit a consistency issue. The best bar I found is by a coder named Carol13. It's very different from Sephirot's bar, and I think it's different for the better. However, his script only works for enemies.

Is anybody interested in converting this script to a player HP/SP script? I'd like the HP bar in the same hue as the enemy's, and the SP bar in shades of blue.

I'm not in a hurry or anything, but please do drop a note if you interested and take your time to do it. :)

THE CODE:

Code: [Select]
#==============================================================================
# Enemy HP Display by Carol13 (66rpg.com)
#==============================================================================
class Window_Help < Window_Base
  def set_enemy(actor)
    self.contents.clear
    draw_actor_name(actor, 4, 0)
    draw_actor_state(actor, 140, 0)
    carol3_draw_hp_bar(actor, 284, 0)
    @text = nil
    self.visible = true
  end
  def carol3_draw_hp_bar(actor, x, y, width = 128)
    self.contents.font.color = system_color
    w = width * actor.hp / [actor.maxhp,1].max
    if actor.maxhp != 0
      rate = actor.hp.to_f / actor.maxhp
    else
      rate = 0
    end
    color1 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 150)
    self.contents.fill_rect(x+1, y+15, width+2,1, Color.new(0, 0, 0, 255))
    self.contents.fill_rect(x+1, y+16, width+2,1, Color.new(255, 255, 192, 192))
    self.contents.fill_rect(x+1, y+17, w,6,color1)
    self.contents.fill_rect(x+1, y+23, width+2,1, Color.new(255, 255, 192, 192))
    self.contents.fill_rect(x+1, y+24, width+2,1, Color.new(0, 0, 0, 255))
    self.contents.fill_rect(x, y+16, 1,8, Color.new(255, 255, 192, 192))
    self.contents.fill_rect(x-1, y+15, 1,10, Color.new(0, 0, 0, 255))
    self.contents.fill_rect(x+129, y+16, 1,8, Color.new(255, 255, 192, 192))
    self.contents.fill_rect(x+130, y+15, 1,10, Color.new(0, 0, 0, 255))
    self.contents.draw_text(x-53,y,128,32,$data_system.words.hp,1)
    if actor.hp>actor.maxhp/3
      self.contents.font.color = Color.new(255, 255, 255, 250)
    end
    if actor.hp>=actor.maxhp/6 and actor.maxhp/3>actor.hp
      self.contents.font.color = Color.new(200, 200, 0, 255)
    end
    if actor.maxhp/6>actor.hp
      self.contents.font.color = Color.new(200, 0, 0, 255)
    end
    self.contents.draw_text(x+47,y,128,32,actor.hp.to_s,1)
  end
end
« Last Edit: October 22, 2009, 12:53:50 AM by MarkDarkness »

**
Rep:
Level 82
No takers?