Newsgroups: rec.arts.int-fiction
Path: nntp.gmd.de!news.rwth-aachen.de!news.ruhr-uni-bochum.de!news.uni-stuttgart.de!uni-regensburg.de!lrz-muenchen.de!informatik.tu-muenchen.de!Germany.EU.net!EU.net!howland.reston.ans.net!vixen.cso.uiuc.edu!uchinews!kjfair
From: kjfair@midway.uchicago.edu (Kenneth Fair)
Subject: Re: [inform] Need help with initial command for implementing in Room...
X-Nntp-Posting-Host: ngrh-34.rh.uchicago.edu
X-Kook-Number-2: 14
Message-ID: <kjfair-1904960046160001@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: <4l5nu1$71o@news7.erols.com>
Date: Fri, 19 Apr 1996 05:46:16 GMT
Lines: 49

In article <4l5nu1$71o@news7.erols.com>, djan@erols.com wrote:

>Hi! I've downloaded the inform 5.5 compiler and libraries, read Reeves' 
>masterpiece (Designer's Manual)and looked over some of the posts in the group.
>
>I'm trying to get a statement printed when my player enters a room where a 
>door closes automatically and locks. I thought the "initial" statement would 
>do the job for me, but instead I'm getting the description statement. Here's 
>part of the code:
>
>Object Room_4 "Front First Floor Hall"
>with description
>            "You are in the front hall of the first floor. There are \
>             cobwebs streching everywhere. Paint is peeling off the \
>              walls. The hall extends further to the north, although \
>              it is too dark to see what the rest of the hall looks likes. \
>              The wooden floor groans as you walk ...",
>initial
>      "CRASH!!! The door swings shut, making your heart stop. \
>       You rush back to the door and try to open it. No good! \
>       It's locked ! (Why did you even THINK of coming inside \
>       this godforsaken place ?) ",
>
>name "hall""front""first""floor",
>has scenery,
>has light;

The way I would do this is with a function in the previous room:

Object Room_3 "Front Porch"
with description "You're on a spooky front porch.",
      n_to [;
         print "CRASH!! The door swings shut... ^";  ! make sure you have the ^
         return Room_4;
      ],


Then just insure that you put in Room_4:

      s_to "You tug and strain at the door, but it's definitely locked.",


You might also look into the code for doors to do some of the automatically.

-- 
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?

  The Internet was not created for companies to make money from.
