ID:149872
 
how do you give an icon state to an overlay?? I just cant figure it out.
You make it an /obj, and overlay that object:

obj/overlay
icon='overlaymain.dmi'
icon_state-"overlay"
layer=MOB_LAYER+1

mob/Login()
..()
src.overlays+=/obj/overlay
In response to Nadrew
ok well it tryed something like that but it didnt work i think your is a little diffrent though.
In response to Scoobert
thanks it worked, but im now sure what i did diffrently
In response to Scoobert
I'll just tag on this post..
I'm wondering what kinda of Icon organization scheme some of you out there are using icon wise for your overlays?

-Do you just use 1 overlay say for clothing?
-When you turn to the side does your clothing and angle
of the overlay change?
-Do you group all your overlays in 1 icon file? Or add it to your current say weapons or clothing icon file(s)?

Just looking for some ideas...

LJR
In response to LordJR
the answer to all of thoughs is yes, but i dont have any weapons or cloths yet
In response to LordJR
One of the first things most people like about my game is that "dressing up part in the beginning"...lol

The way my system works is that there's a separate .dmi for every overlay/piece of clothing... Each of these files has an icon_state that corresponds to every icon_state that the character icon has... Through the magic of BYOND...any overlays added to a character automatically change when the character's icon_state changes as long as they're named the same...

So if my character moves north...his icon_state changes to "North"... And since all of my overlay files have a "North" icon_state...they all change with him...

It works really well...
In response to SuperSaiyanGokuX
SuperSaiyanGokuX wrote:
One of the first things most people like about my game is that "dressing up part in the beginning"...lol

The way my system works is that there's a separate .dmi for every overlay/piece of clothing... Each of these files has an icon_state that corresponds to every icon_state that the character icon has... Through the magic of BYOND...any overlays added to a character automatically change when the character's icon_state changes as long as they're named the same...

So if my character moves north...his icon_state changes to "North"... And since all of my overlay files have a "North" icon_state...they all change with him...

It works really well...

Cool.. That I didn't know.. Do you have to set the icon up as a movement icon too? Also what of animated icons? Just name the animation the same, make it a movement icon, and name it the same. And it will work?? cool... Also I plan on making smaller graphics for each weapon held as well as for all the pieces of armor.

LJR
In response to Scoobert
Scoobert wrote:
the answer to all of thoughs is yes, but i dont have any weapons or cloths yet

Those

Clothes
In response to LordJR
None of my icons or icon_states are movement icons... All I needed to do is name them all with the correct names...and then change my base mob icon's direction under the North(), South(), East() and West() procs... Once his icon is changed...the overlays automatically change to that state as well (as long as they've got their own respective states that are named the same...)

As for animations...I have no idea if it works with them as well... But I would venture to guess that it does...

One thing to remember about overlays is that it sticks the last one on top... That is probably pretty obvious...but the problem arises when someone turns around... Say they have a cape overlay and an armor overlay... From the front...obviously, you'd want the cape overlay to be on the bottom...and then the armor overlay in front of that... It works when you're looking at the guy from the front...but when they turn around...suddenly their armor is on top of their cape...

So you have to design the various states just right to make sure they look right from all angles...

And take something like a sword, for instance... If it gets equipped in the right hand...and they turn sideways so their left side is facing you...their body should be blocking the view of the sword (or at least part of it)... So the icon_state for the sword for that direction has to be only partial...

So it's a really cool system...but you've got to plan it right...
In response to SuperSaiyanGokuX
If you use directional icons for your mob and overlays, you don't even need to change the icon_state. The overlays will try to match the direction and icon state of the atom it is overlayed upon. The only way to override that is to overlay with an atom like Nadrew demonstrated.
In response to FIREking
oh no......I cant spell. If you cant read it dont bother it kuz it might bite!!!
In response to Scoobert
ok i can get the overlays and stuff to work but the one thing that messes up is even if you don't have the clothes in your inventory you can still wear them the wear verb is always there and i don't know how to make the verb only appear when you get the item can some one help?
In response to Acid--Man
thats not ha hard one do oview(0) i think thats how it goes, like set in oveiw(0) dont copy that kuz its not exsact. But that should do it.
In response to Scoobert
ok in the reference it says

var/const
ARMOR_LAYER = FLOAT_LAYER-1
CLOTHES_LAYER = FLOAT_LAYER-2
obj/overlay
armor
icon = 'armor.dmi'
layer = ARMOR_LAYER
clothes
icon = 'clothes.dmi'
layer = CLOTHES_LAYER
mob/verb
wear_clothes()
overlays += /obj/overlay/clothes
wear_armor()
overlays += /obj/overlay/armor
remove_clothes()
overlays -= /obj/overlay/clothes
remove_armor()
overlays -= /obj/overlay/armor

i used that...the verbs always work even when the mob doesn't have the clothes how do i stop that and make it so you must get the clothes for the verbs to appear? and if i set something in oview(0) what is it?
In response to Acid--Man
You would have to make the verbs attached to the object itself, or just objects in general.
In response to Nadrew
Heres a basic overlay code...

mob/var/chest = 0
obj/shirt
icon = 'clothes.dmi'
icon_state = "shirt"
layer = MOB_LAYER + 1
verb
wear_remove()
set name = "Wear/Remove"
if(usr.chest == 0)
usr.overlays += /obj/shirt
usr.chest = 1
else
usr.overlays -= /obj/shirt
usr.chest = 0
obj
verb/get()
set category = "Commands"
set src in oview(1)
src.loc = usr
verb/drop()
set category = "Commands"
set src in usr
src.loc = usr.loc

Basically overlays place the graphic over the users icon if you use the right coding... I use "layer = MOB_LAYER + 1" because it is easier. If you want an overlay that goes over another, just make the object and raise the mob_layer up to the needed level.