Creating a dynamically named verb is rather simple, simply add the verb like you would a new object, supplying the name as an argument of new().
Now instead of the verb being named 'Activate' it will be called 'One' but it'll still execute Activate() when used. Pretty handy, huh?
The new() proc for verbs can take three arguments, the first is the atom you're giving the verb to, the second is the name of the verb, and the third is the description of the verb.
Unfortunately things like dynamic settings for categories and other 'set' stuff isn't avaliable. Maybe some day!
Lets take a look at a more open-ended example of the above that'll make use of the third argument of new().
This will handle all of the verb naming and addition inside of the object's New() proc so that you only have to create the object to gain access to the verbs. You'll end up with a unique verb for each object, each with its own verb description.
Using this method you'll make it easier for people to create macros and keep their stuff organized, as opposed to having a long odd-looking command input when you need to provide which object to use the Activate() verb on.
Removing verbs can be done in a similar fashion, you wouldn't think new() would be used for deleting something; but it is!
verbs -= new/obj/myobjs/proc/Activate(usr,"One")
Will remove the command named 'One' from the list.
That's about all there is to dynamic verbs, I'm sure you guys can find new and creative ways of using them. I'd love to hear about them, so don't hesitate to page me :).
Next time, look-up and look-down type operators, what are they for and why doesn't anybody use them?