Hi, i've been messing with some code to let my player pick up armor then use a verb to wear it and take it off. Unfortunetly, it's not working. Could someone help me out?
obj
verb
get()
set src in oview(0)
usr << "You get [src]"
Move(usr)
drop()
usr << "You drop [src]"
Move(usr.loc)
sword
verb
equip()
un_equip()
armor1
verb
equip()
overlays += /obj/overlay/armor1
un_equip()
overlays -= /obj/overlay/armor1
It works fine if i put it in another dm file, where my verbs are that don't deal with objects, like this:
mob
player
verb
say(msg as text)
view() << "[usr] says, \"[msg]\""
equip()
overlays += /obj/overlay/armor1
The problem is, i only want you to have the option to wear it after you've picked it up. Any help would be great.
P.S. I don't know if this is relavent, but here is the code in my other dm file which handles the "picking up" of the object:
obj
sword
DblClick()
set src in oview(1)
usr << "You get [src]"
Move(usr)
armor1
DblClick()
set src in oview(1)
usr << "You get [src]"
Move(usr)
Thanks in advance!
ID:150466
![]() Sep 20 2001, 1:27 pm
|
|
LexyBitch wrote:
What it does, then, is give the armor icon to the armor as an overlay... which doubtlessly doesn't show up, since you probably use the same or similar icons for the armor and overlay. Of course it shows up! Which reminds me. Someone broke into my house this past weekend, and replaced all of my belongings with exact duplicates. |
WHOSE overlays? You don't specify, so the it goes to default... src. The source of this verb is the armor. What it does, then, is give the armor icon to the armor as an overlay... which doubtlessly doesn't show up, since you probably use the same or similar icons for the armor and overlay. You need to specify here that it's the user's overlays that are being changed.