Rpg Style Lifebars

msmalik681

OpenBOR Developer
Staff member
here is a tutorial how to use rpg style lifebars i will try to make this as simple as possible by uploading the needed files to use the trick rather then post the full code any questions dont hesitae to ask !

Step1: Add the following line to your enemys header: takedamagescript data/scripts/damage.c

(make sure you copy damage.c to your scripts folder)

Step2: Make a HP entity with the name "HP" with 11 frames starting from 0 then up in multiples of 10 to 100.

(you can use attached HP entity as template remember to identify in models.txt)

Step3: Set Enemys Mp in header as the height from enemys offset to display hp bar each character would want it at a differed height depending on their size.

its that simple enjoy  ;)

Edit:Big thanks to utunnels for the take damage script !


image hosting tinypic

Download Files: http://www.mediafire.com/download/c5n66tp955qbd58/Hp_Bar_Files.zip
 
Very nice indeed! But I'm confused by what you mean with MP height... there's no such thing in the manual for entity headers. Or, do you mean that the MP stat is the height? IE, MP 100 = the HP bar is 100 pixels up from the offset?
 
NickyP said:
Very nice indeed! But I'm confused by what you mean with MP height... there's no such thing in the manual for entity headers. Or, do you mean that the MP stat is the height? IE, MP 100 = the HP bar is 100 pixels up from the offset?

that is correct ! as far as i know enemys dont have any use for mp so this works out just fine !
 
worked fine thanks
i merged it with the code to popup damage values

https://www.dropbox.com/s/9bpwkpd28mso2bk/fantasticfour%20-%200038.png

https://www.dropbox.com/s/ts871kvnuq7zo43/fantasticfour%20-%200048.png

now i just need to find a good height for each enemy bar
 
I have a question. How about having enemies not showing their damaged lifebars, but numbers (even showing no negative numbers but positive numbers when damaged)?
 
now i just need to find a good height for each enemy bar

Mugen have the variables for mid.pos and head.pos, maybe you can set a localvariable for each char and use it (or just put the direct value, since I don't think a var is needed)

Or maybe

animheight {alt}

~This command sets entity's height just for this animation. It overrides 'height' (see Header Data above) if it's declared.
~Defaults to 0 or 'height' if it's not declared.
 
4yZb86J.png


Works like a charm! Thanks Malik! Now I can make Dynasty Warriors style games!
 
NickyP said:
4yZb86J.png


Works like a charm! Thanks Malik! Now I can make Dynasty Warriors style games!

What NickyP using scripts ?? Lol just joking glad I could help.

I think you should change the hp bars to suite your mod better!
 
its almost was i want but i had to change the bar to the one i use on the fantastic four game,
but their size are different than the original one

how to change to corret the bar size for this custom bar i use on my game
attached my custom bar here

[attachment deleted by admin]
 
rafhot said:
its almost was i want but i had to change the bar to the one i use on the fantastic four game,
but their size are different than the original one

how to change to corret the bar size for this custom bar i use on my game
attached my custom bar here

The bar is more smooth 'cause when you lost health the bar deacrease in time pixel by pixel.
however the main func.:
drawbox(x-scr_posx+4, z-y-scr_posy-1, width, height, z, color, 0);
change to
drawbox(x-scr_posx+3, z-y-scr_posy-1, width, height, z, color, 0);
because there are 3 pixels at the left of your bar before the inside HP bar, then change:
height = 4+1, maxwidth = 40+1;
to
height = 3+1, maxwidth = 56+1;
that is your inside bar resolution

rafhot said:
its almost was i want
ps. why almost?
 
thanks! almost like i want here

now for the 30% hp change the bar color to red instead of that could be possible to change to something like this:

when enemy recieve the hit the amount of damage enemy got are set to red and then subtracted to the yellow bar?

like in street fighter alfa
https://www.youtube.com/watch?v=psKF_s8jFAI
 
thanks everything is smooth and beautiful as i dream in my project :P

i noticed that sometimes a red bar when kill the enemy appears a little off, but it not appears off everytime, just in some cases


[attachment deleted by admin]
 
still happening :(
i think is something related to

dmg_width = (maxwidth*(damage+1))/maxhealth;
or
drawbox(x-scr_posx+xshift+width-1, z-y-scr_posy-1, dmg_width, height, z, color_red, 0);

 
Back
Top Bottom