ID:262450
 
Okay, im having a problem with my overlays..Okay here is my overlay code.

mob/var/HealthOverlay
mob/var/MindOverlay
mob/var/ActionOverlay

mob/proc/HPBar()
src.overlays -= src.HealthOverlay
var/obj/Bars/HealthBar/O = new/obj/Bars/HealthBar
var/Length = 30
var/Percent = round((src.health/src.maxhealth) * Length)
O.icon_state = "[(Percent>Length)?(Length-1):Percent]"
if(Percent==30)
O.icon_state = "30"
src.HealthOverlay = O
src.overlays += src.HealthOverlay

mob/proc/ActionBar()
src.overlays -= src.ActionOverlay
var/obj/Bars/ActionBar/O = new/obj/Bars/ActionBar
var/Length = 30
var/Percent = round((src.action/src.maxaction) * Length)
O.icon_state = "[(Percent>Length)?(Length-1):Percent]"
if(Percent==30)
O.icon_state = "30"
src.ActionOverlay = O
src.overlays += src.ActionOverlay

mob/proc/MindBar()
src.overlays -= src.MindOverlay
var/obj/Bars/MindBar/O = new/obj/Bars/MindBar
var/Length = 30
var/Percent = round((src.mind/src.maxmind) * Length)
O.icon_state = "[(Percent>Length)?(Length-1):Percent]"
if(Percent==30)
O.icon_state = "30"
src.MindOverlay = O
src.overlays += src.MindOverlay

mob
Move()
HPBar()
ActionBar()
MindBar()
..()

obj/Bars
HealthBar
icon='hp.dmi';icon_state="30";pixel_y=0;layer=12
ActionBar
icon='ac.dmi';icon_state="30";pixel_y=0;layer=11
MindBar
icon='mi.dmi';icon_state="30";pixel_y=0;layer=10



Here is my login...

mob
Login()
..()
usr.client.screen=null
usr.loc=locate(9,9,1)
HPBar()
HpRegen()
ActionBar()
MindBar()



Please help in game its only showing up with the Health bar and im getting an error when i walk..Here is the error..

runtime error: Undefined operation
proc name: ActionBar (/mob/proc/ActionBar)
source file: Overlay.dm,20
usr: Etneri (/mob/creating_character)
src: Etneri (/mob/creating_character)
call stack:
Etneri (/mob/creating_character): ActionBar()
Etneri (/mob/creating_character): Move(the floor (9,10,1) (/turf/floor), 1)
runtime error: Undefined operation
proc name: MindBar (/mob/proc/MindBar)
source file: Overlay.dm,31
usr: Etneri (/mob/creating_character)
src: Etneri (/mob/creating_character)
call stack:
Etneri (/mob/creating_character): MindBar()
Etneri (/mob/creating_character): Move(the floor (9,10,1) (/turf/floor), 1)
guy, your lucky that i had to make a health bar yesterday...
for now i found this:
    

obj/Bars
HealthBar
icon='hp.dmi';icon_state="30";pixel_y=0;layer=12
ActionBar
icon='ac.dmi';icon_state="30";pixel_y=0;layer=11
MindBar
icon='mi.dmi';icon_state="30";pixel_y=0;layer=10

If there isn't anything else, you didn't say, all bars lay on eachother... well perhaps you fixed that in the icons...
Idea! This operation error happened to me yesterday too.. that probably means that you tried to devidide with 0(one of these vars has to be 0, never devidide with 0...)
Try to make maxMind maxHP and maxHealth not to 0.
In response to CIB
Oh yah i forgot to add a certain health to the max, it fixs the error but still the other 2 bars dont show up, and ive tryed to see if they r overlapping but thats not the case.