Newsgroups: rec.arts.int-fiction
Path: nntp.gmd.de!Germany.EU.net!howland.reston.ans.net!news.sprintlink.net!crash!bbarnett
From: bbarnett@crash.cts.com (Bruce Barnett)
Subject: Inform Programming Quest.
Organization: /etc/organization
Date: Wed, 21 Dec 1994 17:03:16 GMT
Message-ID: <D167DH.FGF@crash.cts.com>
Sender: news@crash.cts.com (news subsystem)
Nntp-Posting-Host: crash.cts.com
Lines: 88

TO: gdr11@cl.cam.ac.uk (Gareth Rees)

Thanks for replying to my questions.

> What you need to do is provide a "scope routine that puts into scope the
> objects you want the player to be able to name.

Yeah, I've been trying to make the scope routines work, but so far they
aren't cooperating.  I'll keep trying . . .

> look at page 47,

I have the current plain text version of the manual, which has no pages,
but I think I've found all your references.

> Give these creatures "daemon" routines

Implementing the creatures is clearly going to require daemons.  I'm
already using several in other contexts.  Thanks very much for the
reference for the "single source shortest path" algorithm.  I'm going to
look that one up right after Christmas.

> You can give rooms numbers by declaring a new property with default
> zero . . . and give each room a different room_number . . .

Thanks for this one.  I've been trying to figure out how to sort out the
rooms from the other objects.
Robert Paige Rendell (rendell@fangorn.cs.monash.edu.au), although
professing not to know much about Inform, made the following suggestion.
What do you think?

   Maybe put all your rooms inside a 'meta-room' that the player never
   enteres... its only purpose is the contain all the other rooms in the game
   (since a room is simply another object, it can be contained in another
   room...) then you can use sibling(location) to step through the list,
   looping back to the first one when you get to the end.

   The only danger with this is if there's any code that assumes that the 'real'
   room (as opposed to, say, a vehicle, or a box you can crawl into, or some such)
   has no parent...

> "read the manual"!

Believe me, I have!  And, while I have much respect for and deep gratitude
to Graham Nelson for all his craftsmanship, work and his generosity in
making it all freely available, I must confess I have found the manual very
hard to read.  More examples and more straightforward examples would help a
lot.  Having no previous experience with object-oriented languages and not
being much of a programmer in any event, I find this all extremely
difficult.  A simple sequence  of "for" loops took me days to work out.
Here's what I eventually came up with that worked:

       before
       [ i j; Examine:
         if (location==Location_1)
         { print "<message 1>";
           if (location==Location_1)
           {for (i=1:i<=32000:i++) j=i;}
           if (location==Location_1)
           { print "<message 2>";
             if (location==Location_1)
             {for (i=1:i<=32000:i++) j=i;}
             if (location==Location_1)
             { print "<message 3>";
               if (location==Location_1)
               {for (i=1:i<=32000:i++) j=i;}
               if (location==Location_1)
               { print "<message 4>";
                 if (location==Location_1)
                 {for (i=1:i<=32000:i++) j=i;}
                 if (location==Location_1)
                 { print "<message 5>";
                   PlayerTo(Location_2); rtrue;
                 }
               }
             }
           }
         }
       ],

Now, I have absolutely no idea why it is necessary to put all those "if"
statements in this routine, nor why all the "j" assignments are necessary,
but nothing else I tried worked.  The manual didn't help either.  But I
have spent a lot of time reading it!


___ Blue Wave/QWK v2.12
                     
