another Inform challenge for you


21 Jun 1995 12:55:57 -0600

I'm trying to code a routine in Inform for lycanthropy: the player changes into a wolf. I've already coded the ChangePlayer routine and the object that the player changes into, and they seem to work fine, except for one small problem. I'd like to see things run something like this:

Test Room

This is the room where the Implementors take their new creations for testing before releasing them into the real world.
There is a blue rag here.
There is a green rag here.
There is a brown rag here.

>TAKE BLUE RAG

You pick the blue rag up in your teeth.

>TAKE GREEN RAG

You can only carry one thing in your mouth at a time!

>DROP BLUE RAG

Dropped.

>TAKE ALL

The blue rag: You pick the blue rag up in your teeth.
The green rag: You can only carry one thing in your mouth at a time!
The brown rag: You can only carry one thing in your mouth at a time!

Now, with the code I currently have, I can get through this whole sequence, up until the "TAKE ALL" command, at which point the game crashes after picking up the first object and gives a "Fatal Error" message. Does anyone have any idea how I can forestall this from happening? Here is the bare-bones code for the wolf:

Object wolf "Grey Wolf"
with name "wolf" "grey" "greywolf"
description "You have become a wolf. Your fur is grey, and while \
your sight has become suddenly monochrome, your \
senses of smell and hearing have sharpened \
considerably.",
number 2,
before
[; Take: if (children(self)==2)
"You can only carry one thing in your mouth at a time!";
],
after
[; Take: print "You pick up "; DefArt(noun); "in your teeth.";
],
has animate proper;

I've tried changing the number assigned to the wolf-object, I've tried running the game in advanced and standard mode, and I've tried a variety of formulations for the before rule which prevents the player from taking more than one object. Nothing seems to get rid of that damn Fatal Error! Can anyone out there help me?

-- 
Paul O'Brian                                     obrian@ucsu.colorado.edu
"No one knows how I feel or what I say unless you read between my lines"
                                                      -Stevie Nicks