Formatting dialogue text in Inform7


I would like to write scene transitions using some form of dialogue. What I currently have is something like:

Person A:
Dialogue text of Person A which can span multiple lines.

Person B:
Dialogue text of Person B which can span multiple lines.


Is it possible in Inform7 to show the dialogue text as indented lines with e.g. two leading spaces on each line? Or are there other common ways to represent a dialogue between two speakers?

I just realized I made the tab three spaces but…


This is something that could be handled with Glk style hints, setting the stylehint_Indentation property for a particular style to a positive number, which means “indent every line of this from the left margin for me”. Most Glulx styling extensions will provide a way to do this; I need to check what the most up-to-date ones are.

Style hints are deprecated and not supported by all interpreters, but they’re still the standard way to do this.

1 Like

I use three in my substitution. It’s probably hard to account for every font configuration, but three consistently looked the best. I also have a five space sub, but I’ve only used that for weird situations (printing poems, for instance).

As is often the case, if you want to try to make it pretty, you’d have to go Vorple and web-only. But this might be passable:

lab is a room.
Alice is a person in the lab.
Bob is a person in the lab.

emsp is always unicode 8195.
laquo is always unicode 171.
raquo is always unicode 187.
br is always unicode 10.

to say (sv - sayable value) x (n - number): repeat with i running from 1 to n begin; say sv; end repeat;

to say tt: say fixed letter spacing.
to say /tt: say roman type.
to say b: say bold type.
to say /b: say roman type.

to have (p - person) say (t - text):
say "[b][p]:[/b][br]";
let num be the number of lines in t;
say "[tt] [laquo][/tt][line number 1 in t]";
repeat with i running from 2 to the number of lines in t begin;
  say "[br x 2][tt]  [/tt][line number i in t]";
end repeat;
say "[raquo][br x 2]"

when play begins:
have alice say "That would never work.[br]As you would know if you had even a remedial understanding of the subject.[br]Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris quis maximus sapien. Proin laoreet semper diam, convallis fringilla ante tincidunt ac.[br] Donec lacus velit, laoreet vitae ante ut, cursus aliquet quam. Vestibulum vehicula quis nisl ut vulputate. Quisque efficitur a nibh ac pulvinar. Fusce venenatis augue sit amet ipsum euismod, in efficitur augue faucibus. [br]Proin lobortis neque sit amet nulla lacinia, vitae mattis enim interdum. Proin tristique nec tortor eu feugiat. Donec at ullamcorper est.";
have bob say "I hope it doesn't get cold in that Ivory Tower, Alice. I'm going with my gut!";