When I log in and equip an item I get the un-equip ability for the item but if I leave the game with the item equiped then load back my game the unequip function is gone and I cant un-equip the item. How can I stop this from happening? Here is the code:
obj
weapons
verb/equip()
set src in usr
if(!usr.ArmEqu)
usr.baseatk+=src.batkadd
usr.maxatk+=src.matkadd src.verbs+=/obj/weapons/proc/unequip src.verbs-=/obj/weapons/verb/equip usr.RArmE = 1
else
usr << "Cannot equip there" proc/unequip()
set src in usr usr.Damage-=src.damageadd
src.verbs-=/obj/weapons/proc/unequip
src.verbs+=/obj/weapons/verb/equip usr.ArmEqu = 0
Thank you for any help.
ID:176754
Dec 14 2002, 12:03 pm
|
|
The problem is that the verbs are only ever added when you equip the item, but not when the item is read from a savefile. Try this:
The main thing to pay attention to in that code is the override of Read(): It checks to see if it's equipped after it loads. (This may in fact not work right, if the object is loaded before the mob's var that says it's equipped. You might also need to override mob.Read().) If it is equipped, then it sets up the verbs as they should be.
Verbs don't save along with everything else, which is why you're seeing this effect.
Or, you can do an alternative:
Lummox JR