Using alternate verbs in TADS3 command.

Using alternate verbs on TADS3.

I would like to be able to use alternate verbs in a comand. In other words, I want to be able to use such related verbs as get/grab/lift/handle/etc. to get an object. I’ve tried different approaches but get either assembly errors or a response such as ‘lift’ is not required or used. This should apply also to ‘heavy’ objects and the like.

Would appreciate some help with this. Thanks in advance. :smiley:

It’s pretty easy. Here’s how I defined ‘grab’ as a new synonym for ‘take’:

VerbRule(Grab) 'grab' dobjList : TakeAction verbPhrase = 'grab/grabbing (what)' ;

The section in the Technical Manual on how to create verbs pretty much assumes you’re creating entirely new actions. The syntax above allows you to add new vocabulary to an existing action (in this case, TakeAction).

There are other ways to do it, which might be useful in special cases. You could create an entirely new GrabAction, and then modify the Thing class so that it would usually map ‘grab’ to ‘take’:

modify Thing dobjFor(Grab) asDobjFor(Take) ;

Having done this, you could then override the mapping in special cases. For instance, ‘grab princess’ might be mapped to the hugging action instead.

–JA

You can also extend the existing “take” grammar, like so:

modify grammar predicate(Take) :
    ('take' | 'pick' 'up' | 'get' | 'grab' | 'handle') dobjList
    | 'pick' dobjList 'up' :
    verbPhrase = 'take/taking (what)'
;

(The grammar predicates are listed in the Library Reference Manual under Grammar > Predicate.)

Thanks a ton for such a rapid reply to my problem. Looks like the answers are there. Will give it a shot soon as I’m able.

Ron

Tried your suggestions and everything works fine. Thanks a ton.

Ron