Discussions about interactive fiction

Archive for April, 2011

[Inform 7] Special description messages and light/dark troubles.

So, we’re trying to have it so that the first time you examine yourself,
you get a special message. However, this is complicated by light and
dark; we can’t get it so that you won’t see the message if you try to
examine yourself in the dark (or, you don’t see the message but it
triggers the "first time" condition anyway). Pointers around this problem?


Stuart "Sslaxx" Moore

posted by admin in Uncategorized and have Comment (1)

TADS 3: Travel Guidance Messages

I like the T3 device that tells the player who goes the wrong way which
exits are apparent, and I understand how to fiddle with destName so that it
prints out different strings depending on the player’s current location.
Very nice. But this is a problem:

and west, back to down the road to the west.

Is there a convenient way to suppress the "to" in this output (but only from
certain player locations)? What one wants here is, "back down the road to
the west." I think I just need to know where the "to" is being printed from,
but it’s buried deep in the library, and I can’t find it by poking around in

In fact, it would be even better to suppress the "and west," as well, moving
the hyperlink to the end of the sentence, so that it reads "and back down
the road to the <link>west</link>."

Philosophically, this problem goes clear back to Adventure. The "to" assumes
that each location is discrete, whereas a road is continuous (but only in
two directions). If one is approaching the road from the south, "back to the
road" works fine, so we don’t want to suppress the "to" in _all_ cases —  
just in cases where one is already on the road.

Thanks in advance!

–Jim Aikin

posted by admin in Uncategorized and have Comments (2)

[Inform 7] Problems with power!

Section 0 – Physics and Logic.
[General - Improved darkness model!]
A lightsource is a kind of device. A lightsource can be switched on or
switched off.
RoomLightness is a kind of value.
The RoomLightnesses are varDark and varLit.
A room has a RoomLightness.
A room is usually varLit.

A PowerStatus is a kind of value. The PowerStatuses are varPoweredOn and
A room has a PowerStatus. A room is usually varPoweredOn.
A thing has a PowerStatus. A thing is usually varPoweredOff.
The player has a PowerStatus. The player is varPoweredOff.
[Before examining a thing: if the PowerStatus of the thing is
varPoweredOn, say "BLING.".]

The player has a RoomLightness.
The player is varDark.
Before switching on a lightsource carried by the player:
        now the RoomLightness of the player is varLit.
Before switching off a lightsource carried by the player:
        now the RoomLightness of the player is varDark.

[General - Newness of items]
A LookedAt is a kind of value.
The LookedAts are varLookedAt and varNotLookedAtYet.
The player has a LookedAt. The player is varNotLookedAtYet.
A thing has a LookedAt. A thing is usually varNotLookedAtYet.
After examining a noun:
        now the LookedAt of the noun is varLookedAt.

[General - Computers and Networking]
A computer is a kind of container. It is transparent, open, and lit.
A computer can be switched on or switched off if the room’s PowerStatus
is varPoweredOn.
Report examining a computer which contains something:
     say "At this workstation, you see: [is/are list of things in the

[ Before printing the name of a room:
        If the player is carrying a lit lightsource, now the RoomLightness of
the player is varLit. ]

Now, what we’re trying to get done here is that power can be supplied
both to rooms and to objects (primarily computers). The rooms can either
be powered (PowerStatus is varPoweredOn) or unpowered (PowerStatus is
varPoweredOff). If a room is powered, a computer can be turned on or
off, or if the player is carrying a powered device. However, we can’t
find the correct syntax to allow us to actually implement this!

Any ideas?

Stuart "Sslaxx" Moore

posted by admin in Uncategorized and have Comments (3)

TADS 3: Overriding the Underside Contents Lister

I’m hiding an object under another object. In response to ‘look under bed’,
T3 prints out a default message: "Under the bed is a bogeyman." I want to
override this — but only when the object is first discovered. On subsequent
look-under actions, the default message will work fine.

I tried adding this code to the Underside object:

 dobjFor(LookUnder) {
  action () {
   if (!bogeyman.discovered)
    "Lurking under the bed is a seven-foot-tall green bogeyman! ";

But the default message still prints after my custom message prints. It
appears that sometimes the inherited mechanism suppresses a default message
output, and sometimes it doesn’t….

Thanks for any tips!


posted by admin in Uncategorized and have Comments (24)

I7 build 4F59: Check telling it about when the noun is not John…

In my WIP, I had a line that stated

Check telling it about when the noun is not Javier:
--blah blah--


but after upgrading to 4F59, it doesn’t compile, stating:

You wrote ‘Check telling it about when the noun is not John’  , which
seems to introduce a rule taking effect only if the action is ‘telling
it about when the noun is not John’. The part after ‘when’ (or ‘while’)
was fine, but the earlier words did not make sense as a description of
an action, so I am unable to place this rule into any rulebook.

Is there a workaround, or is this a true bug?


posted by admin in Uncategorized and have Comment (1)

TADS 3: Manually Switching Actor State

I need to be able to manually switch an Actor to the InConversationState,
bypassing the normal HelloTopic mechanism. (As an example, let’s suppose
that the NPC is sitting reading a newspaper. If the player attempts to read
the paper over his shoulder, that will trigger a special conversation that
would render any HelloTopic conversation redundant.)

So I call setCurState(guyTalking). This works — the NPC switches to the
InConversationState. But: If the player then leaves the room, the
ImpByeTopic is not being triggered in the normal manner, and the NPC does
not drop back to the ConversationReadyState.

I know this is what’s happening, because if I leave the room and immediately
return, (a) no ImpByeTopic text is printed, (b) he’ll still be described as
in the InConversationState when I return, and (c) his counter will cause him
to drop back to the ConversationReadyState two turns after I return (the
default being a value of 4).

It appears I need to do something beyond calling setCurState. But what?

[Note: This may be a bug in the library. I wouldn't know.]



posted by admin in Uncategorized and have Comments (3)

TADS 3: doScript, StopEventList, & spaghetti code

Let’s see if I can describe this succinctly. If the player tries to use a
certain door, an NPC will move to stop her. This requires a StopEventList,
because I want three different texts, the third one being repeated if
necessary. But I can’t put the StopEventList in the FakeConnector itself,
because some other stuff needs to happen. Specifically, the NPC needs to
switch from ConversationReady to InConversation, and may need to introduce
himself as well. So it’s more OO to put all of the code in the NPC object.

So the FakeConnector simply calls a doorBlock method in the NPC.

The doorBlock method does three things: It prints some introductory text
(which is always the same), sets the NPC to the InConversation state (which
isn’t quite working, as noted in my other post), and then calls the NPC’s
doorBlockEventList.doScript(). That event list is where the variable text is

Now, the first time this dramatic event transpires, it’s possible that the
NPC will not yet have introduced himself to the player. So the first item in
doorBlockEventList (the StopEventList) can’t be an invariant block of text.
It has to be a function pointer to yet another method, firstDoorBlock, which
will take care of making the introduction if need be. The second and third
events in doorBlockEventList are simply single-quoted strings.

This all seems very sensible to me. But here’s the problem:

firstDoorBlock, the pointer to the method, is getting triggered three times
each time the player tries to use the door, when it should be getting
triggered either once (because it’s the first event) or not at all.

It gets triggered three times EVERY time the event list’s doScript method is
called. We know that the curScriptState value of the event list _is_ getting
incremented, because the second time the player tries to use that door we
see "intro text" "text A" "text A" "text B" "text A", and the third and
subsequent times we see "intro text" "text A" "text A" "text C" "text A".
(The very first time, we get "intro text" "text A" "text A" "text A".)

So I try replacing the function call with a single-quoted text string. If I
do that, the sequence of events becomes normal. The first time we get "intro
text" "test string", the second time we get "intro text" "text B", and the
third and subsequent times we get "intro text" "text C".

This would lead one to believe that somehow the firstDoorBlock method is
looping back on itself when called. Except, well, it’s only happening three
times, so it isn’t an infinite loop. And there isn’t anything in that method
that could cause a loopback. So, uhhh, is it possible that StopEventList is
going all kookoo-brains when it sees a function pointer instead of a
single-quoted string?

I’m pretty sure this is user error, not a library problem, but I’ll be
darned if I can understand what’s going on. Inspired guesses would be very


posted by admin in Uncategorized and have Comment (1)

What's everybody working on?

..In terms of works of IF, or game authoring tools/software?

Regards, dnw.

posted by admin in Uncategorized and have Comments (24)

TADS 3: approximation mappings

hi all,
1) from cmap.htm in the sysman folder:
"Since the Unicode character set includes character assignments for
nearly every character used in a written language anywhere in the
world, and most local character sets on existing operating systems and
terminals include character assignments for only a few languages, most
of the characters in the Unicode character set will not be displayable
on most computers… In many cases, however, you might want to provide
an "approximate" mapping for some characters. An approximate mapping
lets you specify a local character that is similar enough to a
particular Unicode character… For example, if your computer can
display only plain ASCII characters (so it doesn’t have any accented
letters in its character set), you might want to use a regular "a" as
an approximation for the various accented "a" characters… ";
2) from readme.txt in the charmap folder:
"The mappings files are compiled and collected together into the
single file cmaplib.t3r… for most platforms, you should simply copy
this file directly to the directory containing the TADS 3 executables.
Note that cmaplib.t3r uses a binary-portable format, so the same
cmaplib.t3r works on every platform – there’s no need to recompile it
locally for byte-order differences or anything else… ";
3) in us-ascii.txt in the charmap folder there is a fine list of
approximation mappings.

my question: is the list of approximation mappings included in the
source that produces cmaplib.t3r? that would be neat, but it isn’t
clear from the docs which come in the distribution (3.0.12).

if nobody remembers, i’d like to test the output (accented letters) of
a test.t3 on your computer. i need a volunteer from outside west
europe (my character set on a windows machine is cp1252).

max "torredifuoco" bianchi

posted by admin in Uncategorized and have Comment (1)

Inform7: confusion between classes and instances

i made a class called "bar" with a new property "semi-filed" and
defined 3 instances of it. but when i try to change a non-semi-filed
instance to semi-filed, inform wont compile…


"niztest2_bars" by niz

The boring_room is a room. The window is here. The file is here.

A bar is a kind of thing. A bar can be semi-filed. A bar is usually not

The description of a bar is usually "The [noun] is surprisingly thin,
but nevertheless too much for your bare hands.[if the bar is
semi-filed] Youve hacked through half of it, not long to go now.[end

The left bar, the middle bar and the right bar are bars. The left bar,
the middle bar and the right bar are in the window.

Understand "central" as the middle bar.

Understand "bars" as bar.

Instead of cutting a bar when the player has the file and the bar is
not semi-filed:
                say "You start cutting through the [noun], getting half way through
in little time.";
                now the bar is semi-filed.

Instead of cutting a bar when the player has the file and the bar is
                say "You quickly finish the job on the [noun], wriggling the stumps
loose and throwing them out of the window.";
                remove the bar from play.


i get this compile error:
Problem. You wrote ‘now the bar is semi-filed’  : but this is not
explicit enough, and should be a definite relationship between specific
things, like ‘now the cat is in the bag’, not something more elusive
like ‘now the cat is not carried by a woman.’

dont instances inherit the properties of their class? why dont the
"bar" instances have semi-filed property? cant see whats wrong with
"now the bar is semi-filed".

any help appreciated, cheers!

posted by admin in Uncategorized and have Comments (3)