Newsgroups: rec.arts.int-fiction
Path: gmd.de!xlink.net!zib-berlin.de!netmbx.de!Germany.EU.net!EU.net!howland.reston.ans.net!news.cac.psu.edu!news.pop.psu.edu!ctc.com!news.mic.ucla.edu!unixg.ubc.ca!nntp.cs.ubc.ca!newsserver.sfu.ca!sfu.ca!neilg
From: neilg@kits.sfu.ca (Neil K. Guy)
Subject: Re: My next TADS question
Message-ID: <neilg.764979813@sfu.ca>
Sender: news@sfu.ca (seymour news)
Organization: Simon Fraser University, Burnaby, B.C., Canada
References: <2n9j39$e5o@usenet.rpi.edu>
Date: Tue, 29 Mar 1994 22:23:33 GMT
Lines: 46

tulled@cii3112-06.its.rpi.edu (David Michael Tuller) writes:

>dullroom: room
>	sdesc = "Dull Room"
>	ldesc = "This is an extraordinarily dull room. "
>	eastroom = dullroom2
>	east = { return eastroom; }
>;

>Now, TADS will give you an error message because you are returning a property
>or method instead of an object. Is there any way to get around this? [...]

 Yes. Return an object instead of a property or variable. :)

 Basically you want this:

 east = { return( self.eastroom ); }

 That should work, since you're returning a real object (if eastroom
is defined as pointing to an object).

> [...] (TADS probably isn't programmed to do 
>something like this, though)

 No, TADS handles this sort of thing perfectly. For instance, I have a
lot of code in my game that does things like this:

   north =
   {
      if ( theThingummybob.isActive )
         return( excitingNewRoom );
      else
      {
         "The thingummybob prevents you from travelling that way! ";
         return( nil );
      }
   }

 Thus if the thingummybob object is switched on (isActive) I go to the
new place. Otherwise I get an error message and stay put. Note that
you *have* to return (nil) if the player doesn't end up anywhere.
Otherwise you get a 1010 error.

 - Neil K.
-- 
  49N 16' 123W 7'  /  Vancouver, BC, Canada  /  n_k_guy@sfu.ca
