ID:149631
 
i have this
stat("Health:",src.health_meter) //output the health meter
stat("Magic:",src.magic_meter) //output the magic meter
i want to put it into nadrews hud sys i just want to know how you would re do that into to a on screen object so you can place it like this or something
healthbar
icon_state = "hpbar"
New(client/C)
screen_loc = "3,12"
C.screen+=src
I haven't seen Nadrew's HUD system, but basically you're not too far off track with the code you posted. A HUD health meter might look something like this:
obj/HUD
var/client/owner

New(client/C,sl)
screen_loc=sl
C.screen+=src
owner=C

Del()
if(owner) owner.screen-=src
..()

proc/SetOwner(client/C)
if(owner) owner.screen-=src
owner=C
C.screen+=src

meter
icon='meter.dmi'

proc/Set(value,maxvalue)
icon_state="[round(value/maxvalue*30,1)]"

mob
var/obj/HUD/meter/healthmeter
var/obj/HUD/meter/magicmeter

Login()
..()
healthmeter=new(client,"EAST,1")
magicmeter=new(client,"EAST,2")
UpdateMeters()

// this timed loop isn't the best way to do it, but it works
// a better way is to always call the update proc when a stat changes
proc/UpdateMeters()
set background=1
while(1)
if(!client) return // don't bother with this proc
healthmeter.Set(health,maxhealth)
magicmeter.Set(magic,maxmagic)
sleep(5)

Lummox JR