Newsgroups: rec.arts.int-fiction
Path: gmd.de!Germany.EU.net!mcsun!uunet!noc.near.net!howland.reston.ans.net!agate!headwall.Stanford.EDU!nntp.Stanford.EDU!jreese
From: jreese@leland.Stanford.EDU (james reese)
Subject: A Little Debugging Tool
Message-ID: <1993May19.054244.25696@leland.Stanford.EDU>
Summary: To help debug a TADS game
Sender: news@leland.Stanford.EDU (Mr News)
Organization: DSG, Stanford University, CA 94305, USA
Date: Wed, 19 May 93 05:42:44 GMT
Lines: 45

	With much help by Mike Roberts, I came up with the following little
pieces of code to help with debugging a TADS game. It allows the author to
*ZAP* himself to any location in the game, in order to test rooms/puzzles/etc.
The code is as follows:

/***Put this is your code.t file***/
gotoVerb: deepverb
     sdesc = "goto"
     verb = 'goto'
     validDo(actor, obj, seqno) = { return(true); }
     doDefault(actor, prep, io) = { return([]); }
     doAction = 'Goto'
;

/***This next bit goes in your modified version of adv.t under room: thing***/
verDoGoto(actor) = {}
doGoto(actor) =
{
     "\b<ZOT!>\b";;
     actor.travelTo(self);
}
;

To make this work, all you have to do is add a noun to each room  object (ie, 
noun = 'biblehall'), and then you're all set. Here it is in action:


>goto biblehall
 
<ZOT!>
 
Hallway Outside of the Gutenberg Bible Display Room
   Lined with ornate columns to the south, this hallway of marble leads out of sight east and west, but the main attraction is the wall of glass to the north, which gives view of the room holding an original Gutenberg Bible.  Next to the glass wall, set flush, is a digital keypad.


	When I originally began programming in TADS, I automatically assigned
a 'noun' attribute to each room, so this code proved quite useful to me in the
debugging process. Feel free to use it (as long as you don't sell it, blah-blah
-blah in accordance with usual legal/moral/just plain nice practices). Let me
know if you have any comments, problems, questions or improvements. Oh, and
remember to remove it before distributing the game :) .

Jim!
jreese@leland.stanford.edu
"Damnit, Jim's an intern, not a doctor!"
