ID:167613
 
is it possible make a code where u can equip armor and the image meshes with your character and u dont have to create a whole new image
You could add an overlay.
Oh, yes. Overlays. relatively simple. Basically, you're glueing icons together.
obj
overlayer
icon = 'icon1.dmi'
icon_state = "overlayer"
mob
icon = 'mob.dmi'
icon_state = "Player"
var/toggle = 1
verb
Overlay()
if(toggle == 1)
toggle --
usr.overlays += /obj/overlayer
else
toggle ++
usr.overlays -= /obj/overlayer

That is the basic idea. I believe you can figure that out.

--Vito
No. You can't show an image without an image. But I think this is what your looking for:

obj
shirt
icon='ICON.dmi'
verb
Equip()
if(usr.shirt==0)
usr.shirt=src
usr<<"You equip [src]."
usr.overlays+=icon('ICON.dmi')
return
Unequip()
if(usr.shirt==src)
usr.shirt=0
usr<<"You unequip [src]."
usr.overlays-=icon('ICON.dmi')
return
verb
Examine()
usr<<"\A [src]."
Take()
set src in oview(0)
usr<<"You take the [src]."
Move(usr)
Drop()
if(usr.shirt==src)
usr.shirt=0
usr<<"You unequip the [src]."
usr.overlays-=icon('ICON.dmi')
Move(usr.loc)
usr<<"You drop your [src]."
mob/var/shirt=null
In response to Vito Stolidus
Yuck. Use the =! operator to toggle boolean vars, and seeing as it's boolean, use if(var) instead of if(var==1) (as it's robust).

To WallyB: Urgh, I suggest you look at http://developer.byond.com/hub/Wizkidd0123/EquipmentDemo.
In response to Artemio
Don't you mean the != opperator?
In response to Vito Stolidus
i tried to do that really quick and when i did the bottom image only appeared like i made a person then the armor and when i clicked overlay it would only appear if i made the image bigger than the mob
In response to Mxjerrett
Does mine work?
In response to WallyB
umm havent tried
In response to WallyB
no it says undefined var
In response to Mxjerrett
Try it now...
In response to WallyB
it keeps saying undefined var
In response to WallyB
WallyB wrote:
Artemio wrote:
Yuck. Use the =! operator to toggle boolean vars, and seeing as it's boolean, use if(var) instead of if(var==1) (as it's robust).

To WallyB: Urgh, I suggest you look at http://developer.byond.com/hub/Wizkidd0123/EquipmentDemo.

Use the =! operator? Don't you mean the != operator?

He made a mistake, big deal? The whole thing isn't an operator, = is an operator and ! is an operator. He's referring to doing this:

var = !var

or
var =! var


Which says that var is not var, the opposite of var. So if it was 1, it's now 0, if it's 0, it's now 1.
In response to WallyB
Sure, I'm insulting your "coding skills".
From what I've seen of you around the forums you're just a wanna-be badass who thinks he can program competently.
Your code has a little design error, there, that could easily be fixed if you took a look at Wizkidd0123's demo.

What the hell is HSoWaW? It's nothing I've heard of.
And as Audeuro said, I meant =!... I'm using it as if it were an operator.
In response to Artemio
if you are insulting my codeskills then go ahead because i have only been trying to code for a little while. i will get how to code eventually
In response to Mxjerrett
Mxjerrett wrote:
if you are insulting my codeskills then go ahead because i have only been trying to code for a little while. i will get how to code eventually


Err.... clone?