ID:155196
 
I am trying to set a verb to only function under multiple paths. This will eliminate the problem I have with all objects displaying a broken function for the user.

So far I am preventing the code from executing on certain objects by using a var called get. if the get isn't true, the verb get/drop won't even work for that object. But I would prefer not to use this method as it may let the user think the process is broken. Not only that, but if I can hide it, it will be much cleaner.

I've tried different things such as obj{insert final path here}, obj/door;obj/rock and I've tried obj/door|obj/rock

There doesn't seem to be anything related to what I'm trying to do within the guide, and I have no idea where to even look for something like this in the reference.

obj
verb
// *****Get and Drop*****
get()
if(src.get == 1)
set src in oview(1)
set category = "Object"
loc = usr
drop()
set src in usr
set category = "Object"
loc = usr.loc


I want it to work like this instead

obj/Rock or obj/Torch or obj/whatever else there is
verb
// *****Get and Drop*****
get()
if(src.get == 1)
set src in oview(1)
set category = "Object"
loc = usr
drop()
set src in usr
set category = "Object"
loc = usr.loc
I don't really understand what you're trying to do.


Here Get() and Drop() are on both Rock an Torch since both objects are under the path /obj/Items
obj/Items
verb
Get()
Drop()
Rock
Torch


You can use this to hide verbs
obj/verb/Drop()
set hidden = 1 // hides the verb.
set category = null // The verb won't appear in Commands tab


Just a suggestion, you could use Click() or DblClick() ro drop and get items.
obj/Items
DblClick()
if(src in usr)
// drop
else
// get


You could also add the following to let the player know what they can click.
obj/Items
mouse_over_pointer = MOUSE_HAND_POINTER

In response to Rotem12
I guess I could just set everything I want that to work with under a different directory like obj/items. Why didn't I think of that. That is so much simpler... >.<
Yeah, you can define two different types. One for objects that can be picked up and dropped, and one for objects that can't. Then everything can inherit from either of those two types.