Re: TADS: (Taking the kumquat first)


27 Aug 1995 00:38:53 GMT

In article <neilg.809482118@sfu.ca>, Neil K. Guy <neilg@kits.sfu.ca> wrote:
>scythe@u.washington.edu (Dan Shiovitz) [me] writes:
>
>>One (simple) idea that has occured to me is to just make verbs act like this:
>>doEat( actor ) =
>>{
>> if (self.location <> actor)
>> self.doTake(actor);
>> if (self.location = actor)
>> pass doEat;
>>}
>>Anyone see any major problems with this approach?
>
> I added taking the kumquats to my game, and generally followed a not
>dissimilar approach. However you need a lot more error checking than
>you have. You don't want the player able to pick up a telephone pole
>or some other fixed object when they try to eat it. A check in the
>verDoEat function for whether the item is, in fact, takeable, is
>pretty critical. And whether the player is carrying it, whether the
>item is visible but not takeable (inside a glass bottle for instance)
>and so on. It's doable, but you need a zillion special-case checks.

Yes indeed. Well, after some fiddling, I came up with this:
(As far as I know, it does all the checks necessary.)

modify item
takeTest( actor ) =
{
if (self.location <> actor)
{
"\n(Taking <<self.thedesc>> first)\n";
outhide(true);
self.verDoTake(actor);
if (outhide(nil))
{
self.verDoTake(actor);
exit;
}
else
{
self.doTake(actor);
}
if (self.location <> actor)
exit;
}
}
;

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

--

------------------------------------------------+-------------- The Grim Reaper ** scythe@u.washington.edu | Dan Shiovitz ** shiov@cs.washington.edu | Aude ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Sapere _Music of the Spheres_ : Coming Nov '95 | ------------------------------------------------+--------------