Battle HUD Request (Preferred Compatible with Yanfly Battle Engine)

TacoButters

Villager
Member
Joined
Apr 12, 2014
Messages
24
Reaction score
1
First Language
English
Primarily Uses
RMMV
Hello there, My name's TacoButters and I'm making a game. But I wanted a unique HP and MP gauge in my game instead of the typical horizontal bar. Here's a drawing on how I would like it and some specific details. I'm a big fan of Kingdom Hearts so this Custom HP Gauge is inspired from it's original design for an HP Bar.

Custom HP Bar request.png

You don't need to render the bar in the script, you could make it so I just need images, for when it's filled, empty, etc.

Thank you for even reading this request.

Also, if it was compatible with Yanfly Battle Engine, it would be more amazing!

 

Here's the link to the Battle Engine:

https://yanflychannel.wordpress.com/rmvxa/battle-scripts/ace-battle-engine/

Thank you!
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Provide a link to the battle engine


In response to your status update, it's a no-no to post an update asking people to look at your forum post - they will see it when they see it. Also, you only posted this 3 hours ago, and only waited 15 minutes before posting that update. Give people a chance - not everyone is on at the very moment you post. If you read the forum rules (link in lower right corner of every page - and that also contains a link to the status feed rules), you will see that you should wait up to 3 days before bumping your thread. A "please look at my thread" status update is like a bump. You've got a long way to go before it's time to get impatient ;)


Do you have art for all of this? I'm not sure how anyone would go programming that (the circle being filled in as HP is changed)
 

TacoButters

Villager
Member
Joined
Apr 12, 2014
Messages
24
Reaction score
1
First Language
English
Primarily Uses
RMMV
Thanks, Sixth. Maybe now, it might be easier for a scripter to do it.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
Well, I quickly threw something together using the script I mentioned above.

You will need a modified version of that script, here it is:

=begin=============================================================================== Circular Gauges by efeberk Date : 21.03.2015 01:47 Version: RGSS3=============================================================================== This script draws circular progress bars. This script can be used by a maker who knows about scripting. I have used Bresenham's line algorithm for this script. You can google it. How to use: First of all, you need to create bitmap of the circular bar:mad:circular_bitmap = BerksCircularBar.new([path of bar image], [start value], [max value], [start angle])after that, you can draw this bitmap to contents : contents.blt(x, y, @circular_bitmap, @circular_bitmap.rect)contact skype if you have trouble or something like that : oceanjack35--------------------------------------------------------------------------------=endmodule BERK # Folder where all circular gauge pictures are stored. GaugeFolder = "Graphics/Pictures/" endclass BerksCircularBar < Bitmap # Added decrease direction and mask fill size arguments! - Sixth # Added base folder path to reduce the lenght of the filename argument. def initialize(filename, v, m, s, d=1, fill=[2,2]) super(BERK::GaugeFolder+filename) @fill = fill radial_reactive(v, m, s, d) end # Added decrease direction argument! - Sixth def radial_reactive(value, max_value, start_aci, d) value = max_value if value > max_value if value < max_value && value >= 0 v = value.to_f * 100.0 / max_value.to_f aci = start_aci tane = 108 * (100 - v) / 100 for i in 0..(tane.to_i - 1) nx = self.width / 2 + ((self.width / 2 + 1) * Math.cos(aci * Math::pI / 180.0)).to_i ny = self.height / 2 - 1 - ((self.height / 2 + 1) * Math.sin(aci * Math::pI / 180.0)).to_i draw_line(self.width / 2, self.height / 2, nx, ny) aci -= d*3.33 end end end # Added mask fill sizes to avoid visual bugs! - Sixth def draw_point(x, y) self.fill_rect(x, y, @fill[0], @fill[1], Color.new(255, 0, 0, 0)) end # Bresenham's line algorithm def draw_line(x1, y1, x2, y2) steep = (y2 - y1).abs > (x2 - x1).abs if steep x1, y1 = y1, x1 x2, y2 = y2, x2 end if x1 > x2 x1, x2 = x2, x1 y1, y2 = y2, y1 end deltax = x2 - x1 deltay = (y2 - y1).abs error = deltax / 2 ystep = y1 < y2 ? 1 : -1 y = y1 for x in x1..x2 pixel = steep ? [y,x] : [x,y] draw_point(pixel[0], pixel[1]) error -= deltay if error < 0 y += ystep error += deltax end end endend
Put this above the HUD script.

And here is the HUD script:

module BattleHUDCircle #----------------------------------------------------------------------------- # Settings: #----------------------------------------------------------------------------- # :img => "file name", # Image used for fill rate. # # :back => "file name", # Image used for gauge background. # # :pos => [x,y], # Offsets for fine tuning the position of the gauge. # # :start => angle, # The starting angle. The gauge will be at this position on full HP. # 0 = left, 90 = up, 180 = right, 270 = down. # # :dir => value, # The decrease direction of the fill rate. 1 = right, -1 = left. # # :fill => [width,height], # The filling size of the mask. Increase this if you see weird points upon # an emptying gauge. # Generally, the bigger your image, the bigger these values must be! #----------------------------------------------------------------------------- Circle = { :img => "circular_hp1", :back => "back1", :pos => [-1,-1], :start => 90, :dir => -1, :fill => [3,3], } end class Window_BattleStatus < Window_Selectable def draw_item(index) return if index.nil? clear_item(index) actor = battle_members[index] rect = item_rect(index) return if actor.nil? draw_actor_face(actor, rect.x+2, rect.y+2, actor.alive?) draw_actor_name(actor, rect.x, rect.y, rect.width-8) draw_actor_action(actor, rect.x, rect.y) draw_actor_icons(actor, rect.x, line_height*1, rect.width) gx = YEA::BATTLE::BATTLESTATUS_HPGAUGE_Y_PLUS contents.font.size = YEA::BATTLE::BATTLESTATUS_TEXT_FONT_SIZE inf = BattleHUDCircle::Circle c_hp = BerksCircularBar.new(inf[:img], actor.hp, actor.mhp, inf[:start], inf[:dir], inf[:fill]) c_back = Cache.picture(inf[:back]) contents.blt(rect.x+inf[:pos][0], rect.y+inf[:pos][1], c_back, c_back.rect) contents.blt(rect.x+inf[:pos][0], rect.y+inf[:pos][1], c_hp, c_hp.rect) #draw_actor_hp(actor, rect.x+2, line_height*2+gx, rect.width-4) if draw_tp?(actor) && draw_mp?(actor) dw = rect.width/2-2 dw += 1 if $imported["YEA-CoreEngine"] && YEA::CORE::GAUGE_OUTLINE draw_actor_tp(actor, rect.x+2, line_height*3, dw) dw = rect.width - rect.width/2 - 2 draw_actor_mp(actor, rect.x+rect.width/2, line_height*3, dw) elsif draw_tp?(actor) && !draw_mp?(actor) draw_actor_tp(actor, rect.x+2, line_height*3, rect.width-4) else draw_actor_mp(actor, rect.x+2, line_height*3, rect.width-4) end endend
You did not write anything about the rest of the layout, so I just placed in the circular HP gauge and removed the default one.

The HP is not displayed with numbers now, only the gauge is showing the rate of HP.

I did not want to change anything else, because I don't know how you would want it to look like, and I have no time to make a setting for everything now.

The HUD code is written with YEA - Battle Engine, so it won't work without it!

You must place this HUD snippet below YEA - Battle Engine!

If you want anything changed, let me know. I can't guarantee that I will answer quickly, but I will sooner or later.
 

TacoButters

Villager
Member
Joined
Apr 12, 2014
Messages
24
Reaction score
1
First Language
English
Primarily Uses
RMMV
Thank you so much! I'm gonna try this out and I'll tell you if I want something changed. But I am so grateful for what you've done!
 

TacoButters

Villager
Member
Joined
Apr 12, 2014
Messages
24
Reaction score
1
First Language
English
Primarily Uses
RMMV
Well, everything's great and all but there's a problem, I don't mind the actor's name being blocked but I can't see the state icons. But it's alright, you don't need to do anything if you don't want to, the script is already amazing and I'm glad you took time to make it, now I can continue my game! Thank you so much :)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,574
Latest member
nikisknight
Top