Newbie Questions: Narrative Voice and Text Format

[size=150]First Person[/size]

Way back when I first dabbled in I7, the go-to extension for changes in tense and narrative voice was Custom Library Messages by David Fisher, but using this extension with the latest version (and I notice I had to roll back a version of the CLM to make it compile) there’s now an error in one of the most common default messages, which doesn’t fill me with confidence about what less obvious errors may be present.

So, basically, what’s the best way to write a game in the first person? Given that I’m not really that interested in using the default actions, might it just be better not to use an extension? (Do I need a default message extension to change, for example, the response to restoring a saved game?)

[size=150]Banner Text[/size]

Given the emphasis on making I7 seem extra writerly and all the book metaphors in the IDE, this release/serial/build number thing sticks out like a sore thumb. I understand that I’m duty bound to show it at the start of the game, but is there some way to incorporate it into a better looking title?

The documentation offers this little gem:

Which is kind of like simplifying someone’s job by pushing them off a cliff. Any way to change the way this information is displayed without just chucking it? (It’d also be nice to do this without messing with the VERSION command.)

[size=150]Glulx Text Styles[/size]

Am I really only allowed two? Really really? Is there some way to centre text without using up a special style? I just want a title with normal text and two different sizes of large text - but centred. Which seems to be three different kinds of custom text under Glulx.

I did try mixing Glulx and Z-machine formats (Basic Screen Effects), but that then leads to an odd mix of formats in Gargoyle (some lines centred, others not).

Re: banner text,

I’m working on my first I7 game now, and I also didn’t want it appearing til the moment of my choosing.

Here’s what I’m doing:

[code]banner_on is a text variable.

When play begins: banner_on is “no”.

Rule for printing the banner text when banner_on is “no”: do nothing.[/code]

(Later on, when you want the banner to appear)

say banner text.

This makes the banner not appear at the start by default, then you can manually print it later on whenever you want. Alternately you can later switch banner_on to “yes”, if that’s necessary for some reason.

re: Text styles - I’d also like to know if I can easily centre some text.

I suppose Ron Newcomb’s Default Messages has replaced/will replace David Fisher’s for newer builds of Inform 7.
As for the default messages for out or world actions (like restoring a saved game), they are library messages just like any others.
(You could of course hack the Language Template, but that, I’m sure, would be more job than using the new Default Messages extension – and besides you would have to catch those pieces of text printed by Inform that are not included among the library messages per se and that (I think) the extension takes care of.)

When it comes to the banner text, the printing the banner text, as you know, in principle lets you do whatever you want with the banner – even nothing. But then, as you say, you should give the Inform developers their due somewhere else.
The opening release and serial number pertains to your own game; so, as far those go, you should be free to suppress them entirely. (They’re printed by an I6 routine called “VM_Describe_Release”.)
The I7 build and I6 version and library release that you’re required to mention are partly stored as I6 string constants (the I7 build and the I6 library release) and partly (the I6 version) printed by a core Inform 6 statement called “inversion” (see Printing Template B/print§9).

You can get at them in Inform 7 source text with something like this:

The I7Build is a text that varies. The I7build variable translates into I6 as "NI_BUILD_COUNT".
The I6Lib is a text that varies. The I6Lib variable translates into I6 as "LibRelease".
To say I6version:  (- inversion; -). 

You can do it like this:

Rule for printing the banner text when not requesting the story file version: say "[Story title] was written by [story author] in [story creation year]. Have fun!"

Stephen Granade’s Extended Banner extension offers a lot of ways to tweak this, with access to the individual variables.

Gargoyle doesn’t support paragraph indentation hints, font size hints, or any indentation hint apart from the default, flush left.

You can get the box quote effect by setting the text to monospaced output, measuring the width of the window, and padding the output with sufficient spaces on either side.

You have ten styles to work with (not counting input) but eight of these are allocated by default to normal, bold, italic, and bold italic styles in both monospace and proportional flavors. If you don’t care about some of these, you can repurpose them to your own ends.

David Fisher has expressed a desire to no longer maintain those venerable extensions Custom Library Messages and Default Messages, so I created replacements for both. DM is good as early as… build 5T18 if I remember correctly. CLM only goes back a build or three IIRC.

The thing with Glulx styles has been a thorn in our sides for too long! :slight_smile: Er, I mean, I believe it’s on zarf’s plate to move to CSS, but that work isn’t done yet. I don’t know whether or not completing that falls within the scope of his Mad Plan currently in progress. If it does, I’d suggest just sitting on your hands for a few months.

It does. Now that I’ve cleared out the “easy” bits – the past couple of month of small Glk updates – styles are the next milestone. But they’re not going to be a fast milestone. The subject is tangled up with a couple of other ideas: HTML embedding, Javascript calls, and more interpreter control over how text is streamed out.

I can only ask for more patience.

I’m thinking of working on an alternative IO system as well. I think it would help everyone if very clear use cases were presented. What would your ideal IO system be capable of?

For example mine would have:

  • The ability to specify text styles by a label (in HTML terms by class). No numerical IDs!
  • The ability to specify unique one-off styles that can’t be pre calculated (in HTML terms a style attribute)
  • Specify the basic type of style of each for use in a non-HTML system. This should include things like: block/inline, proportional/monospace, emphasis, header. Of course if you’re using the default I7 extension for this IO system it should also support standard Glk as well, using these basic styles as Glk styles.
  • Generate a structure on the fly, and then stream data to anything in that structure, not only top level structures. Ideally I’d have something like the following:[code]
[/code]There is no reason why the banner should be shown in a monospaced font! I could also, at any time, remove the time
and have the whole thing centered (but probably not automatically... instead I'd add a second class to .room. Automatically would be nice but seems too risky.) * Be able to specify fallback content. If I was displaying a video I want to specify a still image to show if we don't have video capability, and if we can't even show images, specify a rich (ie, styleable) text fallback. Even if a system is capable of using these things, the textual fallback should be exposed to accessibility APIs. * Listen to click events and handle them appropriately. It should be possible to attach handlers to anything you can select by class. (Possibly also other types of events?)

So everyone, what would your ideal IO system be capable of?

Let’s see: I want to be able to easily set default formatting for the whole game, default formatting for certain parts of the game (and different windows, if applicable), and easy on-the-fly changes.

I’d like the ability to import things like fonts, in standard formats.

Numerical IDs don’t bother me that much; I’d rather have the flexibility of hex colors than the convenience of named colors. For things like unicode characters, though, absolutely.

Oh, and (we’re still talking about Glulx, right?) syntactic similarity to Z-code Basic Screen Effects would be a plus. I just know I’ll be constantly making mistakes; HTML trips me up enough as it is.

Importing fonts… hmm it could be done. WOFF support is coming along.

For numerical IDs I was referring to things like “windows”, rather than having windows 1, 2, 3 and 4 I’d rather have “main”, “status”, “map” and “hints” for example. But of course I don’t like the idea of windows in the first place. This is particularly the case with the classes. Zarf’s original CSS proposal had only numerical classes, and although the expectation was that I7 would take care of the numbers it’s still a bad idea IMO.

Also, as I’m envisioning it now, there’d be no direct link from Glulx to the HTML. Possibly a structure could be specified with YAML, but the idea would be to keep it super simple. Basically: find the elements of a class and do something to them, which could be to add another class, to remove them, to add children, to stream text. Something similar to jQuery in other words… how does the following sound? The styles for .status and .room would be in a CSS file in the Blorb.

! Add child node .room to .status
IOmakeChild('status', 'room');

! Replace the contents of .room with the room title
IOreplaceContents('room', (name) location);

That’s perfect, thanks.

It’s certainly not my intention to bang the drum for change, I just wanted to be sure I’d properly understood the current state of things.

I could probably do away with monospace italic or something. Could someone provide an example of how to do this?

I wondered if something like that was the case. I do wish the extensions page was a little more transparent about which extensions are maintained/functional.

But funnily enough, your extension has an issue in the exact same place as David Fisher’s.

[code]“Test Game” by “C.E.J. Pacian”

Include Custom Library Messages by Ron Newcomb.

The story tense is present tense.
The story viewpoint is first person.

The Square is a room.

In the Square is a table.

On the table is an apple.[/code]

Which leads to:

Am I doing something wrong? (And is there something about the default description for supporters that makes it especially tricky to get right?)

That looks like a version of (fixed in the latest build) bug 38. The culprit seems to be library message 4 for the looking action, which (in Ron’s extension) currently is:

"On [the library message object] [list the contents of library message object with as a sentence list option +  tersely list option + not listing concealed items list option + is-are list option + including contents list option + giving brief inventory information list option + listing marked items only list option]."

I think the problem is that “on which is an apple” marks the apple, so the “listing marked items only list option” means there isn’t anything to list. At least, deleting that option seems to make the bug go away in this case, which you can do by dropping this into your code:

Table of custom library messages (continued) library-action library-message-id library-message-text looking action 4 "On [the library message object] [list the contents of library message object with as a sentence list option + tersely list option + not listing concealed items list option + is-are list option + including contents list option + giving brief inventory information list option]."

(I’m a sleep-deprived noob, so my only reason for thinking this is the problem is that this patch seemed to work. Ron be able to definitively fix it for you when he’s up on the West Coast.)

…oh, hm, these messages don’t seem to be working well with past tense here. If you change the story to past tense you still get “You could see a table (on which is an apple) there” and “On the table is an apple.”

[EDIT: Originally I had a stray “[if something that is not the player is on the library message object]” in my revised rule, because I had bug 38 on my mind.]

Ah, so it does. Thanks Matt for the quick diagnoses. I’ve also included a patch that should cure the list-writer’s insistence on the present:[code]Include (-
[ Switch__TX t;
if ((t & 1) == 0) {
IS__TX = " is";
ARE__TX = " are";
IS2__TX = "is ";
ARE2__TX = “are “;
IS3__TX = “is”;
ARE3__TX = “are”;
} else {
IS__TX = " was”;
ARE__TX = " were”;
IS2__TX = "was ";
ARE2__TX = "were ";
IS3__TX = “was”;
ARE3__TX = “were”;

[ Overrides the one in the Standard Rules ]
To list the contents of (O - an object),
with newlines,
giving inventory information,
as a sentence,
including contents,
including all contents,
giving brief inventory information,
using the definite article,
listing marked items only,
prefacing with is/are,
not listing concealed items,
suppressing all articles
and/or with extra indentation:
(- Switch__TX((+ story tense +)); WriteListFrom(child({O}), {phrase options}); -). [/code]

I’ll submit version 2 of CLM to Mark now.

I get the sense that anything dealing with the Inform 6 list-writer is particularly tricky to change, at least if you don’t know Inform 6 reasonably well. Ron’s code looks like a black box to me, through no fault of his own. And the “examine supporters” rule, which is the one that’s firing here, is written in Inform 6, I think.

More or less. The examine supporters rule is itself an Inform 7 carry out rule, but it mainly issues a library message that does very little but calling the WriteListFrom function, which is in Inform 6.

What is the rule? I was expecting to find it in the standard rules, but a search on “examine supporters” came up empty.

Odd. It’s there, far as I can see. Maybe you mistyped?

Anyway, here’s the rule:

Carry out examining (this is the examine supporters rule): if the noun is a supporter: if something described which is not scenery is on the noun and something which is not the player is on the noun: issue library message looking action number 4 for the noun; now examine text printed is true.

I’m starting to feel mildly paranoid now. These are the “carry out examining” rules I found in the copy of the Standard Rules I just opened:

[code]Carry out examining (this is the examine undescribed containers rule):
if the noun goes undescribed by source text and
the noun is a container,
convert to the searching action on the noun.

Carry out examining (this is the examine undescribed devices rule):
if the noun goes undescribed by source text and
the noun is a device,
stop the action with library message examining action number 3
for the noun.

Carry out examining (this is the examine undescribed things rule):
if the noun goes undescribed by source text,
stop the action with library message examining action number 2
for the noun.

Carry out examining (this is the examine directions rule):
if the noun is a direction,
stop the action with library message examining action number 5
for the noun.

Carry out examining (this is the standard examining rule):
say “[the description of the noun][line break]”.

Carry out examining (this is the examine described devices rule):
if the noun is a device,
stop the action with library message examining action number 3
for the noun.[/code]

The “examine supporters” rule fires and is named as such when I turn on rules tracing, it just doesn’t appear when I open the Standard Rules extension.

From the release notes for 6E59 (June 2010):

Since in your case:

It looks like you’re using a more current version of I7 for compilation, but an old (pre-June 2010) version of the standard rules for reference purposes.