ID:268613
 
Currently reading a demo, and have no guess on how to make a statbar overlay.
I just know how to make the object and stuff. No idea on how to make it update. =/
Hell Ramen wrote:
Currently reading a demo, and have no guess on how to make a statbar overlay.
I just know how to make the object and stuff. No idea on how to make it update. =/

There are more than one demo on this, you should look at them. quickly, you can make a proc that is called when ever a stat is changed to update the satbar
In response to Jik
mob
proc/Update()
for(var/obj/HP/O in src.client.screen)
O.num = round((src.varhere/src.Maxofthevarhere)*O.width)
if(O.num >= O.rangemax)
O.icon_state = "29"
if(O.num <= O.rangemin)
O.icon_state = "0"
if(O.num < O.rangemax && O.num > O.rangemin)
var/newnum = O.num - O.rangemin
O.icon_state = "[newnum]"



That proc will update any stat meter on the clients screen.


--Goz
In response to Goz
Where would I call it, though?
Upon log in and any HP reducing things?
In response to Hell Ramen

Well i just whipped up This for you.

--Goz
In response to Goz
@_@
Thanks, but when I attempt to make it an overlay... it fails. :9
I mean as it being on the player.
In response to Hell Ramen
Hell Ramen wrote:
@_@
Thanks, but when I attempt to make it an overlay... it fails. :9
I mean as it being on the player.

Well you can do it that way shown Here but on that thread it also shows the problems with having stat meters as an overlay.

--Goz
In response to Goz
Meh, I'll just do an onscreen HUD.
=/
It'll look more MMORPG like anyways...
Thanks for helping.