Newsgroups: rec.arts.int-fiction
Path: gmd.de!xlink.net!howland.reston.ans.net!vixen.cso.uiuc.edu!uchinews!ellis!lyn6
From: lyn6@ellis.uchicago.edu (caitrin  lynch)
Subject: TADS Help
Message-ID: <1993Oct4.160335.7417@midway.uchicago.edu>
Sender: news@uchinews.uchicago.edu (News System)
Reply-To: lyn6@midway.uchicago.edu
Organization: University of Chicago -- Academic & Public Computing
Date: Mon, 4 Oct 1993 16:03:35 GMT
Lines: 56

Recently I have been trying to implement a way for the player to move anywhere
in the game and be able to pick up any objects regardeless of whether they are
present or not. The following is the result. The 'goto' verb is almost entirely
the work of Jim Reese (thank you!) except for the validDoList which allows it
to work with TADS 2.1. In order for this to work, you must add a noun to the
room you want to 'teleport' to. Then within the game type "goto 'noun'". Of
course if you want to be able to reach every room then you must add a noun to
each room, but it is easier and just as efficient to add a noun to a few
strategically placed rooms. The second part 'bget' allows the player to get
any object, although I have only tested it with objects the player needs to 
have to finish the game. Don't know what would happen with fixeditems for 
example. At any rate just type 'bget' in place of get. Of course the purpose
of all this is to make the game easier to test and de-bug, so all this code 
should be removed before anyone else plays the game.

Nick


gotoVerb: deepverb       // backdoor to get to other rooms
     validDo( actor, obj, seqno ) = { return( true );}
     validDoList( actor, prep, dobj ) = { return( true );}
     doDefault( actor, prep, io ) = { return( [] );}
     verb = 'goto'
     doAction = 'Goto' 
;

modify room
     verDoGoto( actor ) = {}
     doGoto( actor ) = 
     {
          "With a puff of green smoke, you are transported to...\b";
          actor.travelTo( self );
     } 
;

bgetVerb: deepverb       // backdoor to take anything
     validDo( actor, obj, seqno ) = { return( true );}
     validDoList( actor, prep, dobj ) = { return( true );}
     doDefault( actor, prep, io ) = { return( [] );}
     verb = 'bget'
     doAction = 'Bget'
;

modify item
     verDoBget( actor ) = {}
     doBget( actor ) =
     {
          "Okay!!!";
          self.moveInto( Me );
     }
;

I hope this is helpfull to some people and not too elementary as to be not
worth posting. I find code like this to be very helpfull and hope others will 
post similar things. 

