ID:150236
 
I have my get verb working just fine, except that I can pickup the doors that I have scattered throughout the game.

What I tried to do was set a variable under obj and have the verb check it to see if it's allowed to pick it up or not. If the object can't be picked up, hide the verb. The problem i'm having is, it always hides the verb.

Here's the code:
obj
var/dontget = 0
verb
get()
set src in view(0)
if (!dontget)
usr << "You pick up [src.name]."
usr.contents += src
del(src)
else
set hidden = 1
Evilkevkev wrote:
I have my get verb working just fine, except that I can pickup the doors that I have scattered throughout the game.

What I tried to do was set a variable under obj and have the verb check it to see if it's allowed to pick it up or not. If the object can't be picked up, hide the verb. The problem i'm having is, it always hides the verb.

I believe the "set hidden" command is something special to the verb syntax and doesn't execute like a command, so the verb can't be hidden like that. However, you might be able to try src.verbs-=src.verbs.get. I haven't messed much with dynamic verb adding/deleting, so that might or might not work.

Another thing you may want to do is to categorize your objects differently. For example, create an obj/item type for anything that can be picked up, obj/item/equipment for anything you can equip, etc. Each of these would have its own extra verbs, so ordinary objs wouldn't have the get verb.

Lummox JR
In response to Lummox JR
src.verbs-=src.verbs.get
That didn't work so i'll just put the get verb under obj/item and anything that i want to allow to be taken i'll put it under there.

Thanks for your help.