Message-ID: <3B13C6D9.669C95B2@csi.com>
Date: Tue, 29 May 2001 11:57:13 -0400
From: John Colagioia <JColagioia@csi.com>
Organization: No Conspiracy Here...
X-Mailer: Mozilla 4.77 [en] (Win98; U)
X-Accept-Language: en,fr,ru,es,it,ga,de,ja,gd,eu
MIME-Version: 1.0
Newsgroups: rec.arts.int-fiction
Subject: Re: [Inform] Statusline
References: <FRwQ6.1162$HK.38435@news.infostrada.it>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 208.34.37.104
X-Original-NNTP-Posting-Host: 208.34.37.104
X-Trace: excalibur.gbmtech.net 991151959 208.34.37.104 (29 May 2001 11:59:19 EST)
Lines: 35
X-Authenticated-User: jnc
X-Original-NNTP-Posting-Host: 127.0.0.1
Path: news.duke.edu!newsgate.duke.edu!nntp-out.monmouth.com!newspeer.monmouth.com!news.maxwell.syr.edu!newsfeed.frii.net!uunet!dca.uu.net!ash.uu.net!excalibur.gbmtech.net
Xref: news.duke.edu rec.arts.int-fiction:87658

Francesco Cordella wrote:
[...]

> I would like to have a Statusline that, next to the room name, will show
> also *where in the room* the player is. Ie:
> Dining room (on the couch)                                       Moves: 12
> I think many of you use this, so I hope you can help me without too much
> disturb.

I think this is the normal way of doing things.  It's just that you actually
have to be in something.  [Quick Test]  No, wait.  I see what you mean.  Hang
on, let's see how to do this...

OK, I looked into DrawStatusLine(), and I think I found the critical piece of
code.  There is a conditional that checks if the current location is "thedark."
The "else" portion then prints the current room or the "largest visible
enclosure" (for example, if you're trapped in a non-transparent box).  At the
end of that block, I added:

    if (parent (player) ~= visibility_ceiling)
        print " (on ", (the) parent (player), ")";

That is, if the player is not a direct child of the room, print out what the
player is on.  This could probably be made much better by:
1.  Checking to see if "supporter" or "container" is set (since you should be
"in" a container, of course).
2.  Looping from the parent(player) to visibility_ceiling, so that you can have:

        Dining Room (on the chair (in the box (on the table (on the platform))))

3.  Making sure #2 is stopped before it writes over the entire Status Line.

But that should get you going, I hope.


