X-Newsreader: Geminisoft Pimmy 3.2 Eng - www.geminisoft.com
From: "John Colagioia" <JColagioia@csi.com>
Newsgroups: rec.arts.int-fiction
Subject: Re: [Inform] Newbie needs help!
Date: Mon, 24 Jun 2002 08:33:06 -0400
References: <f2c2c0f5.0206231451.1d7eeff8@posting.google.com>
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: ool-182f30fa.dyn.optonline.net
X-Original-NNTP-Posting-Host: ool-182f30fa.dyn.optonline.net
Message-ID: <3d17119e$1@excalibur.gbmtech.net>
X-Trace: excalibur.gbmtech.net 1024922014 ool-182f30fa.dyn.optonline.net (24 Jun 2002 08:33:34 -0400)
Organization: ProNet USA Inc.
Lines: 54
X-Authenticated-User: jnc
Path: news.duke.edu!newsgate.duke.edu!nntp-out.monmouth.com!newspeer.monmouth.com!news.maxwell.syr.edu!netnews.com!xfer02.netnews.com!news.tufts.edu!uunet!dca.uu.net!excalibur.gbmtech.net
Xref: news.duke.edu rec.arts.int-fiction:105392

nsfeldman@hotmail.com (nfeldman) wrote:
>I'm trying to write my first game and I've already run into two
>problems that have brought the whole process to a screeching halt.
>
>Problem 1.
>I need to give my player a head.  I was using an object:
[...]
>There are a lot of problems with this.  I don't know how to keep it
>from showing up on the inventory, for one.

This is fairly easy, because there's code you can steal in the
Designer's Manual.  See exercise #102, with solution on p496 (506,
when you explain it to Acrobat) for a rather complete
implementation.

>Also, it doesn't really
>seem necessary since the only purpose of the head is to be touched
>once, it isn't used for anything.

Any player worth his salt (like, after the game is over and there's
some time to kill) will try to attack the head, put it in any
container, cut it, burn it, stand on it, and pretty much apply
every verb in the Inform standard library.

OK, not *any* player.  A bunch will.  And using an object will
make it easier to quiet those people down.

[...]
>Second problem: I have a large room with dim light.  This room is
>divided up into 3 separate objects.
>When you enter the first part of the room (call it Room_Enterance) the
>description is something like: "You are in a cavernous room.  The
>lighting is dim but a shape ahead of you and to the right may be a
>table."
>Now, the table isn't a child of Room_Enterance but I want X Table to
>return "You can't make out any details from this distance"

This is probably a scope hacking issue.  The way I like to do things
like this (which may not be your cup of tea, depending on what else
your game needs) is to put the "far away" room *in* the current room
as a container (nontransparent, naturally) with a description method
that handles the different levels (and a parse_name to catch all the
internal objects).

I don't want to try to throw together code like this on-the-fly,
though, so I won't try an example just now.

At:

http://www.ifarchive.org/indexes/if-archiveXinfocomXcompilersXinform6XlibraryXcontributions.html

you may wish to look at the Scoper.h and outofrch.h libraries.
They may not do exactly what you're looking for, but may
inspire a usable solution.
