ID:143140
 
Code:
My object code
obj
robe
icon = 'Black Robe.dmi'

verb
get()
set name = "Get"
set category = "Commands"
set src in view(1)
usr << "You pick up the [src]"
src.loc = contents
del(src)



Code:
my equip verb
player
verb
wear(obj/O in contents)
set category = "Commands"
set name = "Wear"
usr.overlays = "[O]"
usr << " You wear [O]"

Problem description:

I've tried editing my wear command many times.. I tried
usr.overlays += "[O]"

and my recent attempt is up there but i'll display again
usr.overlays = "[O]"

I even tried editing the get command so it adds the robe to your characters overlay RIGHT when you pick it up but that is retarded so now I think i'll just ask for help cause overlays hate me xD For some reson the robe just dosent show up on my player icon and when I use wear it dosent give me a list of the objects in my contents. I also tried taking:
del(src)

out of my code but that still didnt help
Brejik wrote:
Code:
My object code
> obj
> robe
> icon = 'Black Robe.dmi'
>
> verb
> get(obj/robe/B in oview(1))
> set name = "Get"
> set category = "Commands"
> usr << "You pick up the [src]"
> B += contents
> del(B)
>

Code:
my equip verb
> player
> verb
> wear(obj/O in contents)
> set category = "Commands"
> set name = "Wear"
> usr.overlays += "[O]"
> usr << " You wear [O]"
>

There this should work(I hope :P)
In response to Vegetassj9
now it adds the robe but its in the middle of my character should I assign a higher layer to it or something?
In response to Brejik
You have to edit the icon for that
In response to Vegetassj9
o...k... and how do you s'pose I do that?
In response to Brejik
No edit the layer, you were right. just make all your things MOB_LAYER+1
In response to Vegetassj9
Everything there is wrong. And so is your avatar, because VGcats isn't funny.

First off: the argument to the get() verb is silly, unneeded, and causes it to work totally differently from how it should.

Second: the set name and set category are unneeded. The name is the same as the default (well, big G instead of little g, but it's superficial and I prefer lower-case anyway). The category is the default category anyway.

The line "You pick up the [src]" is wrong. [src] should become "the [name]" anyway, assuming name is lower-case (and thus, improper).

The line B += contents makes no sense. I assume you've just got it backwards, in which case it's just silly. src.Move(usr) is appropriate here.

And then the del(B) line just makes no sense in any way. Why are you deleting something when picking it up? Well, ignoring the fact that B is nonsense anyway, and that you probably meant to put in src.

In your Wear() verb, you're allowing a player to select any obj, which is probably not a good idea. You make the same mistake with the sets. You're adding a text string to overlays, which is wrong. Your message to usr has a superfluous space which - though not major - means that I can say every line is wrong.

As for an equipment system that doesn't suck... http://developer.byond.com/hub/Goku72/ EquipmentInventory_System doesn't seem so bad, and it only took me half a minute of searching for "equipment".