ID:1878500
 
(See the best response by Lummox JR.)
Code:
var/const
AURA_LAYER = FLOAT_LAYER-1
BODY_LAYER = FLOAT_LAYER-2
obj/overlay
aura
icon = 'auras.dmi'
layer = AURA_LAYER
body
icon = 'playerMob.dmi'
layer = BODY_LAYER
mob/verb
Ten()
overlays += /obj/overlay/aura



Problem description:
Okay. So I've been look on the byond reference site on how to properly do an overlay. I've tested it out and nothing happens when I press the verbs. The way I did it is in the code. Im trying to do it so when I press the activate Ten verb when Im testing the game. An aura layer comes over my guy.Much like in DBZ or HxH if you have watched those. So what am I doing wrong here?

You mixed up the way layers interact. You want the forefront to be on a higher layer.
In response to Lugia319
 var/const
BODY_LAYER = FLOAT_LAYER-1
AURA_LAYER = FLOAT_LAYER-2
obj/overlay
body
icon = 'playerMob.dmi'
layer = BODY_LAYER
body
icon = 'auras.dmi'
layer = AURA_LAYER
mob/verb
Ten()
overlays += /obj/overlay/body


So I redid it like this. But I cant get the effect I want it to have when I click the Ten verb. Nothing pops up
Are you sure? That code says you're adding the body overlay to (what I presume) is the body.

That said, we do have a system of UNDERLAYS which could be what you might be looking for.
In response to Lugia319
Yea I looked around for underlays but I didnt exactly get how Im suppose to edit this formula to fit mines:
turf/verb/AddUnderlay(I as icon)
underlays += I
turf/verb/RemoveUnderlay(I as icon)
underlays -= I
Ideally you would read the documentation on what overlays and underlays are. The documentation provides one way to define a function (a verb actually) to add/remove overlays/underlays.

Personally I'm surprised that those are turf verbs...
Yea that's where my confusion arose from. But Ill try to figure out how it works by experimenting (and getting frustrated) with the code until everything is working.
Best response
You can add/remove a type path to underlays just like you can to overlays. The two lists work exactly the same way, except that floats in underlays are always behind the main atom, and floats in overlays are always in front.
In response to Lummox JR
Thanks for the help. Ive figured out what to do. and I found this code gets exactly what I wanted to be done.

mob/player/verb/obj/Ten()
icon = 'playerMob.dmi'
overlays = newlist(/image { icon = 'aura.dmi'; pixel_y = -2 })
icon_state = "tenred1"
Player // player mob defined.
parent_type = /mob
//icon = '' enter icon name.

Effects // root/category.
parent_type = /obj //parent type would be object.
layer = MOB_LAYER + 3 //change layer value if need be.

body
icon = 'auras.dmi'

Player/verb // for player mob only.
Ten()
overlays += /Effects/body
..()

Player/New()
var/Player/P
P.verbs += /Player/verb
..()

world/mob=/Player


or you can make it less complicated for your self and do this ^
In response to Hebrons
That's actually more complicated code than what he has, and not entirely correct either.

Thanks for the help. Ive figured out what to do. and I found this code gets exactly what I wanted to be done.

I think you want to add to your list overlays list, rather than replace it with a new one. Assuming you aren't just playing around, that could give you issues later on when you want to mix and match appearances.

// all do the same thing (add to overlays)
overlays += image(icon = 'aura.dmi', pixel_y = -2, layer = FLOAT_LAYER + 1)
overlays += new /image(icon = 'aura.dmi', pixel_y = -2, layer = FLOAT_LAYER + 1)
overlays += new /image { icon = 'aura.dmi'; pixel_y = -2; layer = FLOAT_LAYER + 1 }


I threw in the FLOAT_LAYER change just to make you aware it exists. You'd be surprised how overlooked it is given its usefulness. If you're interested in learning more about it, here's a good read on it. Re-read and noticed you did use it originally.