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.

pictoral HP/SP indicators? Do-able?

Mea

Member

Basically, what I want to do is have some way to indicate HP or SP without using the traditional gradient bar.

For the record, these screen shots were made while running Trickster's CTB Battle System. The blue bar at the bottom is the time indicator.

http://www.stkp.com/rpgmxp/interface/normal.png[/img]

http://www.stkp.com/rpgmxp/interface/mockup.png[/img]
(minus the watermark of course)

In general terms, each indicator, HP or SP, is made of two images - a "full" image and an "empty" image as background - and some form of masking on the "full" image, sort of what's done with some grad bar scripts as they are now, I think. (warning: This is being spoken by a scripting illiterate)

For example, the HP indicator is made up of:
http://www.stkp.com/rpgmxp/interface/vial_red.png[/img] and http://www.stkp.com/rpgmxp/interface/vial_empty.png[/img]

When the character is at full HP/SP, the topmost image that indicates "full" is fully visible. As the character receives damage, the "full" image is masked off to indicate the percentage of HP/SP left. Thus is a character had 100 HP and took 25 damage, the top 25% of the "full" image would be masked off, revealing the "empty" image underneath. The character's current HP/SP appear beneath their respective indicators. I considered putting both the current and the max, but honestly I don't think there's room, but I could be wrong.

The final script should "hopefully" have someplace near the top to define the source (preferably using the "gradient" directory as the target directory), height, and width of the graphics. It'll allow for more versatility in the long run. The ability to set the X & Y placement would be nice too, but not required - there are ways to fake it with the graphic itself to some degree.

Theoretically, this should be simple, but then again, what do I know. :blushanim02:

The three vial graphics I whipped together for testing purposes are here:
http://www.stkp.com/rpgmxp/interface/vial_blue.png
http://www.stkp.com/rpgmxp/interface/vial_red.png
http://www.stkp.com/rpgmxp/interface/vial_empty.png

NOTE: I imagine this would modification would be for the Battle display only. Honestly, I'm not sure how it would work in the regular menu system, if it'd be too unwieldy or what.

Anyway, thanks in advance anyone who takes up the challenge.
 

Mea

Member

Good news! It runs now.

Bad news! It looks like this:
http://www.stkp.com/rpgmxp/displaybug.jpg[/img]

I think the layers are off somehow. Taking damage has no effect on how the indicators look.
 
I sure the problem is with these methods (not tested yet). Just add the reddy "100*"
Code:
  #--------------------------------------------------------------------------
  # * Draw HP
  #--------------------------------------------------------------------------
  def draw_actor_hp(actor, x, y, width = 144)
    # Draw Vial
    draw_vial(EMPTY_HP_VIAL, HP_VIAL, [COLOR=Red]100 *[/COLOR] actor.hp / actor.maxhp, x, y)
    # Draw Hp Text
    self.contents.draw_text(x, y + 40, width, 32, actor.hp.to_s)
  end
  #--------------------------------------------------------------------------
  # * Draw SP
  #--------------------------------------------------------------------------
  def draw_actor_sp(actor, x, y, width = 144)
    # If Actor Maxsp is greater than 0
    if actor.maxsp > 0
      # Draw Vial
      draw_vial(EMPTY_SP_VIAL, SP_VIAL, [COLOR=Red]100 *[/COLOR] actor.sp / actor.maxsp, x, y)
      # Draw Sp Text
      self.contents.draw_text(x, y + 40, width, 32, actor.sp.to_s)
    end
  end
I'll take a deeper look later...
 

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