Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

I7: Changing the default room description header

2 views
Skip to first unread message

Gareth

unread,
Jun 16, 2006, 10:29:47 PM6/16/06
to
This is probably a really simple question, but I'm new to Inform 7 and
couldn't figure out an easy answer.

I'm working on a game in which the player and other characters have
several postures available. For example, the player can SIT on a sofa,
LIE on it, or STAND on it all with different results. I've created a
posture property, defined some new verbs, and so far everything is
working well.

Here's my question. I'd like to modify the room description header to
include the player's posture. So for example you'd get something like

Living Room (sitting on the sofa)

instead of

Living Room (on the sofa).

Delving into the libraries, it looks like I need to replace the default
"room description heading rule" with a new rule of my own creation.
Unfortunately, the default heading rule is written in Inform 6, and I
know zero about I6. If I did, I suppose I could figure out what the
underlying I6 code does and rewrite the whole thing in I7, adding the
reference to posture. Is there any easier way?

Gareth

unread,
Jun 16, 2006, 11:10:39 PM6/16/06
to

Okay, I just located David Fisher's very cool extension that allows
customization of library messages. It looks like it would allow what
I'm trying to do, but I'm getting an Inform 6 compiler error when I try
to include it:

auto.inf(14522): Error: Expected name for new object or its textual
short name but found LibraryMessages

Does anyone know what could be causing this?

vaporware

unread,
Jun 16, 2006, 11:21:36 PM6/16/06
to
Gareth wrote:
[...]

> Here's my question. I'd like to modify the room description header to
> include the player's posture. So for example you'd get something like
>
> Living Room (sitting on the sofa)
>
> instead of
>
> Living Room (on the sofa).
>
> Delving into the libraries, it looks like I need to replace the default
> "room description heading rule" with a new rule of my own creation.
> Unfortunately, the default heading rule is written in Inform 6, and I
> know zero about I6. If I did, I suppose I could figure out what the
> underlying I6 code does and rewrite the whole thing in I7, adding the
> reference to posture. Is there any easier way?

I don't think there is. I've taken a look at the rule and tried to
rewrite it in I7, and as a bonus, added a "describing the player's
stance" activity to make it easy to tweak. The line breaks need a
little tweaking, but I'm going to blame that on Inform's tendency to
throw a line break wherever it can.

<code>
"Describing the stance" by Jesse McGrew

Part 1 - Framework

A procedural rule: substitute the new room heading rule for the room
description heading rule.

To decide which number is print player flag: (- (print_player_flag) -).

This is the new room heading rule:
if the person asked is not the player, make no decision;
say "[conditional paragraph break][bold type]";
if in darkness, carry out the printing the name of a dark room
activity;
otherwise say the location;
say roman type;
if the holder of the player is not a room
begin;
begin the describing the player's stance activity;
if handling the describing the player's stance activity
begin;
if the player is on a supporter (called sup), say " (on [the sup])";
otherwise if the player is in a container (called cont), say " (in
[the cont])";
end if;
end the describing the player's stance activity;
end if;
if the print player flag is 1, say " (as [the player])";
say "[line break][run on paragraph]".

Describing the player's stance is an activity.

Part 2 - Example

Home is a room.

The couch is here. It is an enterable supporter.

The fort is here. It is an enterable container.

The table is here. It is an enterable supporter.

Rule for describing the player's stance when the player is on the
couch: say " (relaxing on the couch)".

Rule for describing the player's stance when the player is in a
container (called place): say " (hiding in [the place])".

Rule for describing the player's stance when the player is on a
supporter (called place): say " (standing on [the place])".

Test me with "get on couch / look / get in fort / look / get on table /
look".
</code>

vw

ChicagoDave

unread,
Jun 17, 2006, 12:24:10 AM6/17/06
to

Did you make the I6 library change mentioned in the docs?

David C.

Gareth

unread,
Jun 17, 2006, 1:49:35 PM6/17/06
to

vaporware wrote:

> I don't think there is. I've taken a look at the rule and tried to
> rewrite it in I7, and as a bonus, added a "describing the player's
> stance" activity to make it easy to tweak. The line breaks need a
> little tweaking, but I'm going to blame that on Inform's tendency to
> throw a line break wherever it can.

Thanks! That works perfectly.

There are a few other things I want to change about the way rooms are
described, so I guess I need to learn enough Inform 6 to be able to
translate the library routines into I7.

-G

Gareth

unread,
Jun 17, 2006, 1:50:36 PM6/17/06
to

ChicagoDave wrote:

> Did you make the I6 library change mentioned in the docs?

Ah, I hadn't even noticed that. Thanks for the tip. I made the change
and everything seems to work.

-G

0 new messages