intfiction.org

The Interactive Fiction Community Forum
It is currently Thu May 23, 2013 5:35 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Using subtime - TADS1.3
PostPosted: Sun Dec 25, 2011 4:12 pm 
Offline

Joined: Sun Nov 06, 2011 12:17 pm
Posts: 156
Location: Toledo, Ohio, USA
Well, here I am using TADS3.1

I finally have subtime.t working well in my game except for a small problem. I am using a watch to tell the time and it works great. I would like to be able to tell the time using the following commands 'time' or 'read time' or 'look at time' or 'l time'.

I've been searching through the manuals but I can't find what I need to accomplish this. Once again, I'm looking here for someone to bail me out. :?:

Rong


Top
 Profile Send private message  
 
PostPosted: Sun Dec 25, 2011 4:29 pm 
Offline
User avatar

Joined: Tue Apr 20, 2010 2:48 pm
Posts: 687
Reading subtime.t suggests that the clockManager object can give you the info you need through its checkTimeFmt() method. So all you need is to create a new verb matches the commands you specified in your post and that prints whatever checkTimeFmt() returns.


Top
 Profile Send private message  
 
PostPosted: Mon Dec 26, 2011 2:57 pm 
Offline

Joined: Sun Nov 06, 2011 12:17 pm
Posts: 156
Location: Toledo, Ohio, USA
Thanks for the suggestion. Due to my problems with sight and memory, I have trouble remembering and noting things that I look for in the manuals. Would someone give me some examples on how to create and use the verbs I first mentioned in this post :?:

That will give me some things to print from this series of posts and use them as references.

RonG


Top
 Profile Send private message  
 
PostPosted: Mon Dec 26, 2011 4:23 pm 
Offline
User avatar

Joined: Tue Apr 20, 2010 2:48 pm
Posts: 687
Sure. Here is code for a LookAtTime action with verb rules that match your requirements:

TIME
READ TIME
READ THE TIME
LOOK AT TIME
LOOK AT THE TIME
L TIME

Code:
DefineIAction(LookAtTime)
    execAction()
    {
        "The time is <<clockManager.checkTimeFmt('hh:mma')>>\n";
    }
    // This action should consume no time (not advance the current turn.)
    // If you prefer that this action should consume actual game time,
    // then delete this.
    actionTime = 0;
;

VerbRule(LookAtTime)
    'time'
    | 'read' (| 'the') 'time'
    | 'look' 'at' (| 'the') 'time'
    | 'l' 'time'
    : LookAtTimeAction
    verbPhrase = 'look/looking at the time'
;


Top
 Profile Send private message  
 
PostPosted: Tue Dec 27, 2011 2:19 pm 
Offline

Joined: Sun Nov 06, 2011 12:17 pm
Posts: 156
Location: Toledo, Ohio, USA
Thanks for the help. Your example will help me a lot in my future dealings with new verbs.

RonG :D


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 1 guest


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