Newsgroups: rec.arts.int-fiction
Path: gmd.de!nntp.gmd.de!xlink.net!howland.reston.ans.net!math.ohio-state.edu!cyber2.cyberstore.ca!nntp.cs.ubc.ca!newsserver.sfu.ca!sfu.ca!neilg
From: neilg@kits.sfu.ca (Neil K. Guy)
Subject: Re: TADS problem
Message-ID: <neilg.771018570@sfu.ca>
Sender: news@sfu.ca (seymour news)
Organization: Simon Fraser University, Burnaby, B.C., Canada
References: <2t1vid$drm@news.u.washington.edu> <2t2e9h$9r3@hpbs3591.boi.hp.com>
Date: Tue, 7 Jun 1994 19:49:30 GMT
Lines: 33

bblohm@boi.hp.com (Bill Blohm) writes:

>I'm no expert yet, just starting out myself.  But it seems to me that
>you need to make it something like:

>    verDoFasten( actor ) =
>    {
>       if( self.fastened = true )
>         "It's already fastened! ";
>       else if( not Me.location.ischair )
>         "You're not even sitting down! ";
>       else
>       {
>         "You securely fasten the seatbelt. ";
>          self.fastened := true;
>       }
>    }

 Actually, no! This code is incorrect because it makes a state change
to the game (it sets the self.fastened variable). Because the verify
code segments are often called silently for use with the
disambiguation routines you should *never* change game state within a
verify statement. Otherwise you may mysteriously find your seatbelt
fastening all by itself even though you never explicitly asked to
fasten it...

 For more info on this consult the TADS manual whenever you get it or
my TADS tip sheet which is available from ftp.gmd.de. I think I talk
about the verify statements in there somewhere...

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