Newsgroups: rec.arts.int-fiction
From: Suzanne Britton <tril@igs.net>
Subject: Re: [TADS] A room without exits.
References: <B7FF9BB6.D73%gregg@midcoast.com>
Message-ID: <slrn9tkane.fo.tril@miranda.igs.net>
User-Agent: slrn/0.9.7.2 (Linux)
NNTP-Posting-Host: 216.58.91.238
Date: 26 Oct 2001 22:21:57 -0500
X-Trace: corp.newsgroups.com 1004152917 216.58.91.238 (26 Oct 2001 22:21:57 -0500)
Lines: 46
X-Comments: This message was posted through Newsfeeds.com
X-Comments2: IMPORTANT: Newsfeeds.com does not condone, nor support,  spam or any illegal or copyrighted postings.
X-Comments3: IMPORTANT: Under NO circumstances will postings containing illegal or copyrighted material through this service be tolerated!!
X-Report: Please report illegal or inappropriate use to <abuse@newsfeeds.com>
X-Abuse-Info: Please be sure to forward a copy of ALL headers, INCLUDING the body (DO NOT SEND ATTACHMENTS)
Organization: Newsfeeds.com http://www.newsfeeds.com 80,000+ UNCENSORED Newsgroups.
Path: news.duke.edu!newsgate.duke.edu!nntp-out.monmouth.com!newspeer.monmouth.com!newshub2.home.com!news.home.com!cpk-news-hub1.bbnplanet.com!news.gtei.net!news.maxwell.syr.edu!out.nntp.be!propagator-SanJose!in.nntp.be!corp.newsgroups.com
Xref: news.duke.edu rec.arts.int-fiction:93980

In article <B7FF9BB6.D73%gregg@midcoast.com>, Gregg V. Carroll wrote:

> I have a "room" that is a void; that is, all 10 possible exits (n, s, e, sw,
> up, down, etc.) all lead back to where the player started. Obviously, there
> will be a way to get out, just not by moving.
>
> Now, what I want to do is have a custom message (or messages plural, if I
> decide to get creative) printed anytime the player types in one of the 10
> possible directions, and my question is, is there any way to do this that's
> shorter than using a "description during travel" routine for each direction?

If you only want to do this for one room, it should be quite simple. Just
override the noexit method on that room.

traproom: room
    // [stuff here]
    noexit = "[custom msg]"
;

If you're going to have a bunch of rooms like this, you could use the
above as a superclass.

> I tried defining no exits at all, and then tried modifying the "noexit" bit
> in adv.t to the effect of "if player is in [room without an exit name] print
> [custom message] else print 'You can't go that way'"

It sounds like you're thinking functionally instead of object-oriented-ly :-)
"noexit" is not a single global function; it's an inherited property which can
be distinct on each room. By defining a custom noexit on traproom, you're
implicitly saying "give this room special treatment, leave the rest alone".

Hope that made sense.

Suzanne

--
tril@igs.net - http://www.igs.net/~tril/
"I'm aware of that, sweetheart. It's just that when I wake up to a hissing
goat skull on my nightstand, and it hops off and runs across the floor on
spider legs, I sleep a lot better knowing where it ran off to."
                                                          - Ted (Red Meat)


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----
