intfiction.org

The Interactive Fiction Community Forum
It is currently Sat May 18, 2013 10:50 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sun Nov 06, 2011 4:58 pm 
Offline

Joined: Sun Nov 06, 2011 12:17 pm
Posts: 156
Location: Toledo, Ohio, USA
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. :D


Top
 Profile Send private message  
 
PostPosted: Sun Nov 06, 2011 8:04 pm 
Offline

Joined: Sun Mar 01, 2009 8:02 pm
Posts: 902
It's pretty easy. Here's how I defined 'grab' as a new synonym for 'take':

Code:
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':

Code:
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


Top
 Profile Send private message  
 
PostPosted: Mon Nov 07, 2011 12:08 am 
Offline

Joined: Tue Apr 27, 2010 1:02 pm
Posts: 797
You can also extend the existing "take" grammar, like so:

Code:
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.)


Top
 Profile Send private message  
 
PostPosted: Mon Nov 07, 2011 11:34 am 
Offline

Joined: Sun Nov 06, 2011 12:17 pm
Posts: 156
Location: Toledo, Ohio, USA
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


Top
 Profile Send private message  
 
PostPosted: Fri Nov 11, 2011 10:11 am 
Offline

Joined: Sun Nov 06, 2011 12:17 pm
Posts: 156
Location: Toledo, Ohio, USA
Tried your suggestions and everything works fine. Thanks a ton.

Ron


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group