ID:141198
 
Code:
mob
icon='Base Icon.dmi'
icon_state="Tan"
var
health=100
max_health=100
energy=200
max_energy=200
exp=0
max_exp=500
proc
updateExp()
var/percent=round(src.exp/src.max_exp*100,10)
if(percent>100) percent=100
if(percent<0) percent=0
for(var/obj/hudMeters/o in src.client.screen)
o.icon_state=num2text(percent)
spawn(10)
src.updateExp()
updateHealth()
var/percent=round(src.health/src.max_health*100,10)
if(percent>100) percent=100
if(percent<0) percent=0
for(var/obj/hudMeters/p in src.client.screen)
p.icon_state=num2text(percent)
spawn(10)
src.updateHealth()
updateEnergy()
var/percent=round(src.energy/src.max_energy*100,10)
if(percent>100) percent=100
if(percent<0) percent=0
for(var/obj/hudMeters/q in src.client.screen)
q.icon_state=num2text(percent)
spawn(10)
src.updateEnergy()


Problem description: The Energy meter and the Health meter work great when together but when the exp. meter is added with 0 as a starting instead of max, both the energy and the health meter reflect their updates on the experience meter. im running low on ideas on how to make the exp. meter an individual meter that reflects on its own stats

I haven't even read your whole code and I haven't even completed read through your description but just so you know, you can't divide by 0.
In response to Haywire
actually you can. you just cant divide into 0. 0/100 = 0 but 100/0 = n/a so i dont think the exp. var. being at 0 has to do with the fact that all of the meters reflect off of the exp.
All of them have;
for(var/obj/hudMeters/p


Sooo they're all changing the same thing. Gotta be more precise. Like /obj/hudMeters/Health or something.
In response to Mysame
thank you so much, it works perfectly now. i forgot i had to group them before putting them in. i really appreciate your help. thank you again