Newsgroups: rec.arts.int-fiction
Path: gmd.de!xlink.net!howland.reston.ans.net!agate!headwall.Stanford.EDU!nntp.Stanford.EDU!jreese
From: jreese@leland.Stanford.EDU (james reese)
Subject: Re: More TADS Questions
Message-ID: <1993Oct4.045625.22244@leland.Stanford.EDU>
Summary: Goto function code included
Sender: news@leland.Stanford.EDU (Mr News)
Organization: DSG, Stanford University, CA 94305, USA
References: <1993Oct1.203352.8334@midway.uchicago.edu>
Date: Mon, 4 Oct 93 04:56:25 GMT
Lines: 47

In article <1993Oct1.203352.8334@midway.uchicago.edu> lyn6@midway.uchicago.edu writes:
>A question:
>Is there a way to use the debugger or some kind of auto-sript to avoid playing
>a portion of the game in order to get to the newly compiled code.
>
>Nick
>

Here's some code I've generated (with help from and thanks to Mike Roberts):

You have to set up each room that
you can "goto" with an identifying noun.  (You probably wouldn't even
need to make it possible to go to every possible room this way; it
would probably be good enough to pick a few strategic points in the
game and make them accessible this way.)
 
Assuming you add a noun to each room, you should be able to add a
verb that accomplishes the teleportation.  The only differences
between this and the usual verbs is that you want to allow any
object, whether present or not, to be used as a direct object.
 
  gotoVerb: deepverb
    validDo(actor, obj, seqno) = { return(true); }
    doDefault(actor, prep, io) = { return([]); }
    verb = 'goto'
    doAction = 'Goto'
  ;
 
Now all you have to do is add verDoGoto and doGoto to the basic
room class in adv.t:
 
  verDoGoto(actor) = {}
  doGoto(actor) =
  {
    "*** Poof!\ ***\nYou're magically transported to...\b";
    actor.travelTo(self);
  }
 
-----

Hope this helps,

Jim!
jreese@leland.stanford.edu
"For Pete's sake, Jim, you're supposed to be
    a brain surgeon...Look intelligent."

