Newsgroups: rec.arts.int-fiction
Path: nntp.gmd.de!news.rwth-aachen.de!news.rhrz.uni-bonn.de!news.uni-stuttgart.de!rz.uni-karlsruhe.de!news.uni-kl.de!news.belwue.de!fu-berlin.de!cs.tu-berlin.de!uni-erlangen.de!uni-regensburg.de!lrz-muenchen.de!informatik.tu-muenchen.de!Germany.EU.net!wizard.pn.com!news-in.tiac.net!news.kei.com!newsfeed.internetmci.com!ncar!uchinews!kjfair
From: kjfair@midway.uchicago.edu (Kenneth Fair)
Subject: Re: [Inform] Newbie asking easy questions
X-Nntp-Posting-Host: ngrh-34.rh.uchicago.edu
X-Kook-Number-2: 14
Message-ID: <kjfair-1904960041450001@uchinews.uchicago.edu>
X-Kook-Code-2: (Grubor+++)*2 Boursy+ Palmer+++++++
Sender: news@midway.uchicago.edu (News Administrator)
Organization: University of Chicago School of Law
X-Newsreader: Yet Another NewsWatcher 2.2.0b6
References: <4l68re$3dg@lll-winken.llnl.gov>
Date: Fri, 19 Apr 1996 05:41:44 GMT
Lines: 90

In article <4l68re$3dg@lll-winken.llnl.gov>, Kathleen Fischer
<kfischer@greenhouse.llnl.gov> wrote:

>Me again... Newbie at large looking for a few good answers:
>
>1. What IS the difference between intial, describe, and description.  I tried
>coding up a room that had all three, but only two were ever printed... So, now
>I'm confused.  Initial seems to happen whenever I enter the room, but its
>printed BEFORE the name of the room.  Then either the description/describe was
>printed (sorry, can't remember at the moment), but the remaining one didn't
>seem to get used.  Why?  If I added a before [;Look: "hi mom"], then that was
>the only thing printed.   :(    I'm confused.

For objects inside rooms, "initial" gives the description you see when
you look around.  Thus, <Look> gives a room's description and the initials
of the objects in that room.

"Description" is what you get when you look at an object.  <Examine> object
will return the description, as will <Look> when you are inside a room
object.

"Describe", as far as I understand it, lets you override the initial and
description properties and come up with a generic routine that traps both
<Look> and <Examine> actions.

For a room, this is a bit different.  I don't know, but it sounds to me
like "initial" for a room does exactly what you say it does - print
something as you enter the room.  Then "describe" was probably overriding
"description".

You should probably be able to stick with just "initial" and "description"
unless you're trying to do something really funky with the way objects
appear.  Furthermore, you probably won't much need to use "initial" with
rooms either.

(I'm sure at this point I'll get several corrections from people who
actually know what they're talking about.  But I like taking a shot
at these questions anyway to test my own understanding of how the whole 
thing works.)


>2. I want to, at some point, capture input from the player and save it. For
>example: my NPC professor will demand "What is your philosophy on life?" and
>then take whatever they player says and, say, write it up on a chalkboard.  How
>do I implement this? I presume I need to capture the input before the parser
>gets a hold of it.  Do I need use GamePreRoutine(?)  Is there a better way?

See the "Magic Toyshop" sample code for how to write on a blackboard.


>3. I want to create a class to cover the similarities between several rooms,
>say, classrooms.  Each classroom would have a professor, a main desk, and
>several student desks.
>
>Can I create a class that has "Nearby" objects such that creating the class
>refers to them by default?  Somehow from a first pass (admittably quick... but
>let's see YOU try to read for content with your two year old in the room)
>reading I don't see how to do this this.  As near as I can tell I need to
>create a teacher class, a desk class, a room class, and then for each instance
>of a classroom I need to "glue" then whole thing together by hand.  Bummer.

I misread your question at first.  I don't know if this is possible or not,
although I suspect it isn't.  But why not just define the classroom object
and Nearby all of the other objects?  After all, "Nearby" isn't any longer
than "Object".

 Class teacher_class
 ...

 Class desk_class
 ...

 Object classroom "Classroom"
 ...

 Nearby mrs_k "Mrs. Krabapple"
 class teacher_class
 ...

 Nearby desk_1 "student desk"
 class desk_class
 ...

and so on.

--
KEN FAIR - U. Chicago Law  | Power Mac! | Net since '90 | Net.cop
kjfair@midway.uchicago.edu | CABAL(tm) Member | I'm w/in McQ - R U?
   "Next to being witty yourself, the best thing is to quote
    another's wit" - C.N.Bovee
