WSMartin's Collected Extensions

Since my extensions aren’t really making it onto the I7 website, (and because Jeremy made the suggestion) I’ve decided to post my I7 extensions here in a big fat lump, and any future extensions I write will also be posted here too. So enjoy.

Dynamic Exposition

My first extension, intended to be a framework for a quest journal system a la Neverwinter Nights.

[spoiler][code]Version 1/082712 of Dynamic Exposition by William S Martin begins here.

“Gives players access to a database that updates dynamically during play and announces modifications to the player. This allows easy implementations of journals, quest logs, the internet, and so forth. Requires Epistemology by Eric Eve.”

Include Epistemology by Eric Eve.

Chapter 1 - The Exposition List

All things have a list of numbers called an exposition-list.

All things has a table-name called the exposition-reference. The exposition-reference is usually the table of null exposition.

When play begins (this is the initial reference rule):
repeat with item running through all things:
if the exposition-reference of the item is table of null exposition:
next;
if there is an ID of 1 in the exposition-reference of the item:
add 1 to the exposition-list of the item.

To decide if the exposition-list of (item - a thing) is blank:
let N be the exposition-list of the item;
let X be the number of entries in N;
if X is 0:
decide yes;
else:
decide no.

Definition: A thing is researchable:
if the exposition-list of it is blank, decide no;
decide yes.

Chapter 2 - Printing the Exposition

Printing the exposition of something is an activity.

Rule for printing the exposition of something (called the item) (this is the standard exposition printing rule):
say “You look up information on [the item]:[paragraph break]”;
print the exposition of the item.

To print the exposition of (the item - a thing), as one paragraph, in italics:
let the current exposition be the exposition-list of the item;
if in italics:
say italic type;
if as one paragraph:
repeat with X running through the current exposition:
choose the row with ID of X from exposition-reference of the item;
say the exposition entry;
else:
repeat with X running through the current exposition:
choose the row with ID of X from exposition-reference of the item;
say the exposition entry;
say paragraph break;
say roman type.

Chapter 3 - Writing the Exposition

To decide whether (addition - a number) is already written for (current subject - a thing):
let current exposition be the exposition-list of the current subject;
repeat with individual entry running through the current exposition:
if individual entry is the addition:
decide yes;
decide no.

To write entry (addition - a number) for the/-- topic (current subject - a thing), silently, at start:
unless the addition is already written for current subject:
let current exposition be the exposition-list of the current subject;
let N be the number of entries in the current exposition;
if at start:
add addition at entry 1 in the exposition-list of the current subject;
else:
add addition to the exposition-list of the current subject;
if silently:
do nothing;
else:
mark current subject for announcement.

To say write entry (addition - a number) for the/-- topic (current subject - a thing):
unless the addition is already written for current subject:
let current exposition be the exposition-list of the current subject;
let N be the number of entries in the current exposition;
add addition to the exposition-list of the current subject;
mark current subject for announcement.

Chapter 4 - Researching action

Researching it on is an action applying to one visible thing and one touchable thing.

A thing can be expository. A thing is usually not expository.

Does the player mean researching something on an expository thing: it is very likely.

Rule for deciding the scope of the player while researching (this is the can research all known researchable things rule):
repeat with X running through known things:
place X in scope.

Understand “read about [something] in [something]” as researching it on when the second noun is an expository thing. Understand “look up [something] in [something]” as researching it on when the second noun is an expository thing. Understand “consult [something] on/about [something]” as researching it on (with nouns reversed) when the second noun is an expository thing. Understand "read [something] in [something]"as researching it on when the second noun is an expository thing. Understand “research [something] on/about [something]” as researching it on (with nouns reversed). Understand “research [something] in [something]” as researching it on.

Understand “research on/about/-- [something]” as researching it on. Understand “read on/about/-- [something]” as researching it on. Understand “look up [something]” as researching it on. Understand “r [something]” as researching it on.

Check researching it on (this is the can’t research on an expository thing rule):
if the second noun is not an expository thing:
say “You can’t use [the second noun] like that.” instead.

Check researching it on (this is the can’t research unresearchable objects rule):
if the noun is not researchable:
say “There is no entry about that.” instead.

Report researching it on (this is the standard research rule):
carry out the printing the exposition activity with the noun.

The default-expository is a thing that varies.

Rule for supplying a missing second noun while researching (this is the use default expository rule):
let N be the default-expository;
if N is in the location or the player is carrying N:
if the N is expository:
now the second noun is N;
else:
say “You need to specify an object to do research with.”;
else if there is an expository thing in the location:
let K be a random expository thing in the location;
now the second noun is K;
else:
say “You need to specify an object to do research with.”

Chapter 5 - Reporting Additions to the Expository

The announcement queue is a list of objects that varies.

To mark (item - a thing) for announcement:
if the item is not listed in the announcement queue:
add item to the announcement queue.

[The following was adapted from code in Eric Eve’s Epistemology:]

Carry out looking (this is the mark items to expository announce when looking rule):
unless in darkness:
repeat with item running through things that are enclosed by the location:
if the item is not enclosed by an opaque closed container:
if the item is unseen and the item is researchable:
mark item for announcement.

The mark items to expository announce when looking rule is listed before the mark items as seen when looking rule in the carry out looking rules.

Carry out opening a container (this is the mark items to expository announce on opening a container rule):
repeat with item running through things that are enclosed by the noun:
if the item is unseen and the item is visible:
if the item is researchable:
mark item for announcement.

The mark items to expository announce on opening a container rule is listed before the mark items as seen on opening a container rule in the carry out opening rules.

[End code adapted from Eric Eve’s Epistemology]

Toggle expoannouncements is a truth state that varies. Toggle expoannouncements is usually true.

Printing the expository announcement of something is an activity.

Rule for printing the expository announcement of something (called the subject announced) (this is the standard expository announcement printing rule):
say “[italic type]New information on '”;
carry out the printing the name activity with subject announced;
say “’ has been added to the records.[roman type]”

This is the notify expository changes rule:
if the toggle expoannouncements is true:
repeat with current subject running through announcement queue:
carry out the printing the expository announcement activity with the current subject;
repeat with current subject running through announcement queue:
remove current subject from announcement queue.

The notify expository changes rule is listed after the note object acquisitions rule in the turn sequence rules.

When play begins (this is the suppress announcements by marking as seen rule):
now every visible thing is seen.

Table of Null Exposition
ID Exposition
a number a text

Dynamic Exposition ends here.

---- DOCUMENTATION ----

DEPENDENCIES: Epistemology by Eric Eve.

ACKNOWLEDGEMENTS: In addition to providing the required extension, I also adapted some of Eric Eve’s code. The code in question is marked by comments in the source.

Dynamic Exposition adds a dynamic database system that can be used as the basis to implement a variety of things. For example:

A) Journals, notebooks and so forth that records the player character’s thoughts and observations during play.

B) The internet, magical enyclopedias, crystal balls, Akashic records or any other device with access to a highly dynamic source of information.

C) The player’s thoughts and memories that change over time.

D) A quest log, that keeps track of things that a character needs to do. The example, the Adventures of Glubby, provides a basic framework for a quest log.

Some of these can be implemented with almost no work. For others, some assembly is required.

Chapter: How it Works

Dynamic Exposition is designed to simulate things like the internet and journals. It works much like a consulting: the player “consults” or “researches” a book or crystal ball or whatever, and a text is then displayed to the player. The significant difference between regular consulting and Dynamic Exposition is that Dynamic Exposition allows for much more variation in the output, and also allows for announcements when there are modifications made to expositions.

By default, exposition requires a physical “expository” thing that the player “reads” off of. However, it would not be difficult to simulate thinking and memories with dynamic exposition. It may require a new “thinking about” action.

Chapter: Setting up Dynamic Expositions

Dynamic Expositions requires a bit of work to get full use out of it. For smaller games, it could be better just to use the consult command to get what we need.

First, we need an expository thing. The expository thing is needed by the player to access the database. Keep in mind all expository things have access to the same database, no matter what. So it would make sense for an iPad, a computer and a smart phone to all be expository things that access the internet, but it would make no sense at all for Jack’s diary and Bill’s notebook to both be expository things.

The audio recorder is here. It is expository.

Each thing you want to have an exposition has a table known as its exposition-reference, which contains every entry you want for that particular object. The table must include two different columns: an ID column, containing a number, and an exposition column, containing a text. At an absolute minimum, you need something like this:

The salmon is a thing. The exposition-reference is the Table of Salmon Research.

Table of Salmon Research
ID	Exposition
 1	"Salmon are a sort of fish that like to swim upriver."

The ID entry acts as a reference for the Exposition text. When the exposition is invoked, it reads off a list of numbers contained in the object called an “exposition-list”, then reads off the corresponding Exposition entry in its exposition-reference. In general, you should never need to directly deal with the exposition-list for this extension to work as intended.

ID 1 is special. Any exposition corresponding to ID 1 is displayed even if it is not explicitly written to the exposition-list, making it the “default exposition”. If you don’t want to initially have any text displayed for that particular object, then simply skip ID 1. There’s no reason you couldn’t use an entirely random set of numbers as IDs, so long as each ID is unique on that table.

The exposition-list by default is blank. The extension defines anything with a non-empty exposition-list as researchable, allowing us to make lists of researchable objects.

After researching the index on the magic encyclopedia:
	say "[list of known researchable things]".

This allows the player to write something like LOOK UP INDEX IN BOOK and get everything the book expounds upon.

Also, it is recommended that we make at least one expository thing the default-expository. When a player doesn’t provide a second noun by default it will pick the default-expository, or else a random expository in the same location as the player.

This allows the player to write things like RESEARCH CHUPACABRA or even R CHUPACABRA without needing to type in something like RESEARCH DIARY ABOUT CHUPACABRA every time.

Chapter: Accessing and Writing to the Exposition

The exposition-list is “read” by using the a new researching action.

Instead of consulting the necronomicon about death, try researching the necronomicon about death.

What might the output of the above be?

You look up information on death. It reads:

"Death is a beginning and not an end"

The first part, “You look up information on death. It reads:” does not have to be written out in the exposition-reference of the second noun. It is a text that is printed as a part of the “printing the exposition of” activity which introduces the text we are about to read. This can be customized, as we can see later.

The second part is the actual exposition entry of the second noun.

We may also make dynamic additions to any recordall text with the phrase “write entry (a number) for the topic (a thing)”

Let’s say that the player discovers some terrible secret about death:

After consulting the encyclopedia about death for the first time, write entry 2 for the topic death.

Which refers to entry 2 of the exposition-reference, “Legal death is when your heart stops.”

This adds a new paragraph to your exposition for death. Before writing, the phrase automatically checks to see if it is about to write a duplicate entry into the exposition, so you don’t need to worry about using that phrase liberally.

This phrase also has a number of options.

write entry 2 for the topic beer, silently.

The “silently” option suppresses the modification announcement cause by the use of the “write” phrase. More is written about this in Chapter 4 - Announcement of Entries.

write entry 2 for the topic beer, at start.

By default, the phrase puts the new addition at the end of the exposition-list. This instead tacks it in the beginning.

Finally, the extension adds a say phrase to write to exposition within the text. This phrase doesn’t allow any of the same options above.

After drinking the beer:
	say "Drink to your health![write entry 2 for the topic beer]"

Chapter: Using the Consult Action

While the consulting and researching action use the same commands, the extension attempts to understand by context when to use the researching action and the consulting action.

You can use the consulting action to simulate more static databases, like a mundane, papery encyclopedia, and still have the function of the expository.

The magic encyclopedia an expository thing.

The mundane encyclopedia is a thing.

So long as either one or the other is in scope, the game will generally understand which action to use with CONSULT THE ENCYCLOPEDIA ABOUT DRAGONS. If they are both in scope, you might want to clarify with some contextual understand commands.

Chapter: Customizing the Output

The way which expositions are displayed can be very heavily customized. The Mysteries of Mars example shows you how you can customize messages depending on what object is being expounded upon.

Rule for printing the exposition of a planet (called the current planet):
	say "Classification: [classification of current planet][paragraph break]Diameter: [diameter of the current planet][paragraph break]Gravity: [gravitation pull of current planet][pargraph break]Average Temperature: [temp of current planet][paragraph break]Current records of planet:[paragraph break]";
	print the exposition of the current planet;
	say "END TRANSMISSION".

Whenever a new rule is written for the exposition of something, it should include the phrase “print the exposition of…”

By default, each new entry is printed as a seperate paragraph. We can, however, choose to group it in just a single paragraph by using the “as one paragraph” option with the “print exposition of” phrase.

Rule for printing the exposition of a hastily scribbled thing (called the item):
	print the exposition of the item, as one paragraph.

Chapter: Announcements of Entries

Dynamic Exposition has the capacity to print an announcement every time something is written to it. By default, it is turned off, so if the feature doesn’t appeal to us, we don’t need to worry about this section at all.

If, however, we do want to play around with it, we can write in our code:

*:
The toggle expoannouncements is true.

This activates the announcement system. Every time a player sees a researchable thing for the first time, or a new entry is written to the announcement system, the game will print an announcement declaring new information is available on that subject.

If we only want certain items to be announced, we can make a new rule for items we don’t want announced and leave them blank.

Rule for printing the expository announcement of an unimportant thing:
	do nothing.

The second way we can suppress a expository announcement is to use the “silently” option on the “write (text) for the topic (thing).”

We can use the same rule to play around with announcements for different things:

Rule for printing the expository announcement of an unfortunate thing:
	say "As you're writing the entry in the journal, you prick your finger with the nib of your pen.";
	now the player is bleeding.

This will replace the standard expository announcement with this text, in addition to making the unfortunate player bleed.

Example: * Asylum - Demonstrates how you can use dynamic exposition to simulate memories and thoughts.

*: “Asylum”

Include Dynamic Exposition by William S Martin.

Considering is an action applying to one thing.
Understand "think about [something]" and "consider [something]" as considering.

Check considering:
	if the noun is not researchable:
		say "There's nothing special to think about [the noun]."

Report considering:
	carry out the printing the exposition activity with the noun.

The standard exposition printing rule is not listed in the for printing the exposition rulebook.

Rule for printing the exposition of something (called the item):
	say "You search your recollections...";
	print the exposition of the item.

The standard expository announcement printing rule is not listed in the for printing the expository announcement rulebook.

Rule for printing the expository announcement of something (called the item):
	say "[italic type]Memories of [the item] return to you...[roman type]".

Section - The Cell

The padded cell is a room. The description is "Padded walls, like thick, cold quilts, line your cell."

The photo is in the padded cell. "A lonely photo lies in the center of your cell." The exposition-reference is the Table of Photo Research. The description is "[if the player is not carrying the photo]It's pretty indistinct, but it looks like the picture of a woman.[else]It [write entry 3 for the topic photo]depicts the face a woman, dark, shoulder-length hair, beaming eyes and face.[end if]"

After taking the photo for the first time:
	say "You tenatively pick up the photo...";
	write entry 2 for the topic photo.

Table of Photo Research
ID	Exposition
2	"A long time ago, you knew this woman."
3	"Yes... you were married to this woman a long time ago. What happened to her?"

Test me with "x photo / take photo / consider photo / x photo / consider photo"

Example: ** Mysteries of Mars - Implements a very simple dynamic journal system where scanning an object writes a text to the exposition of an object. Also, demonstrates how you can vary exposition outputs and announcements depending on the object.

*: “Mysteries of Mars”

Include Dynamic Exposition by William S Martin.

The rocky hills are a room. South of the rocky hills is the martian base. North of the rocky hills is the martian desert. North of the martian desert are the craggy cliffs. North of the craggy cliffs are the ice caps.

The player is in the martian base. The player is carrying a scanotron.

The player is carrying an info-display. The info-display is an expository thing.

The default-expository is the info-display.

The toggle expoannouncements is true.

The hab-tech is a thing. It is in the martian base. It is fixed in place. The exposition-reference is the Table of Hab-tech Research.

Table of Hab-tech Research
ID	Exposition
1	"You live in a hab-tech. They are quite plain on the inside."
2	"Your scanotron tells you that the hab-tech is mostly made of titanium."

Some fascinating rocks are a thing. It is in the rocky hills. The exposition-reference is the Table of Fascinating Rocks Research.

Table of Fascinating Rocks Research
ID	Exposition
1	"The rocks have fascinating flecks of color in them. You must investigate them."
2	"Scans indicate high levels of crystal formations that are causing the flecks of color."

The petrified plant is a thing. It is in the martian desert. The exposition-reference is the Table of Petrified Plant Research.

Table of Petrified Plant Research
ID	Exposition
1	"Embedded in a rock you can see what you believe to be are ancient fronds."
2	"Scans indicate amino acids in the rock. Your hunch about them being fossils is correct."

The massive crystal is a thing. It is fixed in place. It is in the craggy cliffs. The exposition-reference is the Table of Massive Crystal Research.

Table of Massive Crystal Research
ID	Exposition
1	"You discovered this fascinating blue crystal in the rocky hills."
2	"You detected carbon within the crystals."

The alien artifact is a thing. It is fixed in place. It is in the ice caps. The exposition-reference is the Table of Alien Artifact Research.

Table of Alien Artifact Research
ID	Exposition
1	"The ancient (presumably Martian) baton-looking object is just a featureless metal tube."
2	"When you scanned the object, it produced what looks like an alien script. Fascinating."

Rule for printing the exposition of something when the second noun is an info-display:
	say "[italic type]You search for '[the noun]' in the info-display. It prints:[roman type][paragraph break]";
	print the exposition of the noun;
	say "END TRANSMISSION".

Rule for printing the exposition of the alien artifact when the second noun is an info-display:
	say "Your info-display is nearly smoking as you access information on the alien artifact.... [paragraph break]";
	print the exposition of the alien artifact;
	say "END TRANSMISSION".

Rule for printing the expository announcement of something (called the item) when the player carries an info-display:
	say "[italic type]Your info-display beeps with new information on [the item][roman type]."

Rule for printing the expository announcement of something (called the item) while scanning and the player carries an info-display:
	say "[italic type]New information on [the item] has been uploaded from the scanotron[roman type]."

Rule for printing the expository announcement of the alien artifact while the player carries an info-display:
	say "BZZT! Your info-display suddenly goes haywire! It calms after a moment."

Section - Scanning

Scanning is an action applying to one visible thing.

Understand "scan [something]" as scanning.

Check scanning:
	if the actor is not carrying a scanotron:
		say "You can't scan without a scanotron." instead.

Check scanning:
	if 2 is already written for the noun:
		say "Your scanner detects nothing new." instead.

Check scanning:
	if the noun is not researchable:
		say "That object isn't interesting to scan." instead.

Carry out scanning:
	write entry 2 for the topic noun.

Test me with "r hab-tech / scan hab-tech / r hab-tech / n / n / n / n / r artifact / scan artifact / r artifact"

Example: *** The Adventures of Glubby - Uses the dynamic journal system as the basis for a simple quest log, like what is found in other games. This takes record of tasks that need to be done. The extension also demonstrates how you can use phrases to make use of blank entries, never needing to directly fill in the exposition-reference tables.

*: “The Adventures of Glubby”

Include Dynamic Exposition by William S Martin.

Section - Rules

The toggle expoannouncements is true.

A quest is a kind of subject. A quest can be inactive, newly started, started or finished. A quest is usually inactive.

To update (current quest - a quest) with (addition - a text):
	if the current quest is not started:
		do nothing;
	else:
		repeat through the exposition-reference of the current quest:
			if the ID entry is 1 or the ID entry is 2 or the ID entry is 3:
				next;
			if there is no exposition entry:
				now the exposition entry is the addition;
				write entry ID entry for the topic current quest;
				break.
		
	

To complete (current quest - a quest) with (addition - a text):
	if the current quest is not started:
		do nothing;
	else:
		now the exposition corresponding to an ID of 3 in the exposition-reference of the current quest is the addition;
		write entry 3 for the topic current quest;
		now the current quest is finished.

To start (current quest - a quest) with (addition - a text):
	if the current quest is not inactive:
		do nothing;
	else:
		now exposition corresponding to an ID of 2 in the exposition-reference of the current quest is the addition;
		write entry 2 for the topic current quest;
		now the current quest is newly started.

Rule for printing the exposition of a quest (called the current quest):
	say "DUM-dee-dee-DUM! The epic [current quest] is [if current quest is started]underway[else]completed[end if]! Here is a list of your mighty achievements thus far...[paragraph break]";
	print the exposition of current quest.

Rule for printing the expository announcement of a newly started quest (called the current quest):
	say "DUM-dee-dee-DUM! You have a new quest... [the current quest]!";
	now the current quest is started.

Rule for printing the expository announcement of a started quest (called the current quest):
	say "DERP-dee-dee-DOO! You have exquisitely advanced [the current quest]!"

Rule for printing the expository announcement of a finished quest (called the current quest):
	say "DERP-dee-dum-DOO-dee-dum-DEE! You have completed [the current quest]!"

The quest log is a subject.

Instead of researching the quest log on something:
	say "Current quests: [list of started quests]";
	say "[paragraph break]";
	say "Completed quests: [list of finished quests]".

Section - The Scenario

The forest is a room. East of the forest is the mill. Inside of the mill is the mill interior.

The quest journal is a thing. It is expository. The player is carrying the quest journal.

The default-expository is the quest journal.

The apple is a thing.

The barrel is a container. It is open. It is in the forest.

The player is in the forest.

After going to the mill for the first time:
	Update Visit the Mill with "You have strode through the forest toward the mill. All that is left is to go inside the mill."

After going to the mill interior for the first time:
	complete visit the mill with "Bravely, you have entered the mill, and even assigned to a new, even more glorious task!";
	say "You enter the mill, screaming with triumph. Suddenly the miller appears out of nowhere, saying breathlessly, 'Good sir! I need an apple placed in a barrel in the forest! This is an important task... do you think you can do it for me?'[paragraph break]Before you have a chance to respond, he tosses you a glossy, red apple, and then leaves immediately.[paragraph break]You're about to undertake the task, you hear his voice: 'Whatever you do, don't drop the apple!'";
	start put-apple-in-barrel with "The miller has given you the mighty task to put an apple inside a barrel. He specifically asked you not to drop the apple.";
	now apple is in the player.

When play begins:
	say "You have a valiant quest... to visit the mill east of the river!"

There is a quest called Visit the Mill. The printed name is "the quest to visit the mill". The exposition-reference is the Table of Mill Quest. It is started.

Understand "quest to visit the mill" as visit the mill.

There is a quest called Put-Apple-in-Barrel. The printed name is "the quest to put the apple in the barrel". The exposition-reference is Table of Barrel Quest

Understand "put apple in barrel" as put-apple-in-barrel.

After going to the mill while the player is carrying an apple for the first time:
update put-apple-in-barrel with "You have strode with alacrity across with the apple."

After going to the forest while the player is carrying an apple for the first time:
update put-apple-in-barrel with "Amazing! You are almost there! Now just put the apple in the barrel."

After inserting the apple into the barrel for the first time:
complete put-apple-in-barrel with "You put the apple in the barrel! You put the apple in the barrel! You put the apple in the barrel! You put the apple in the barrel! You put the apple in the barrel! The miller will be so happy!"

After dropping the apple for the first time:
say "Nooooo! you dropped the apple!";
complete put-apple-in-barrel with "You insolent worm! You dropped the apple! Now the miller will be in despair!"

Table of Mill Quest
ID	Exposition
1	"You have bequeathed upon thyself the task of putting the apple in the barrel."
2	--
3	--
4	--
5	--
6	--
7	--
8	--


Table of Barrel Quest
ID	Exposition
2	--
3	--
4	--
5	--
6	--
7	--
8	--

test me with "r quest log / e / r visit the mill / go inside / r visit the mill / r quest log / go outside / drop apple / take apple / w / insert apple into barrel / r quest log / r put apple in barrel"

[/code][/spoiler]

Event Chains

A very simple extension that provides a table-based alternative to ordering events, as opposed to dozens of rules or long IF…ELSE IF chains. It has been extremely useful for me.

[spoiler][code]Event Chains by William S Martin begins here.

Checker rules is a rulebook.

Toggle rules is a rulebook.

To step through chain (current table - a table name), terminating:
let N be the number of filled rows in the current table;
let K be 0;
repeat through the current table:
increment K;
unless N is K and not terminating:
if there is checker entry:
follow the checker entry;
if rule succeeded:
blank out the whole row;
next;
else if rule failed:
if there is a subtable entry:
step through chain subtable entry;
break;
if there is a reply entry:
say the reply entry;
say paragraph break;
if there is a toggle entry:
follow the toggle entry;
if the rule succeeded:
blank out the toggle entry;
break;
else:
next;
else:
if there is a subtable entry:
step through chain subtable entry;
break;
if there is a reply entry:
say the reply entry;
say paragraph break;
if there is a toggle entry:
follow the toggle entry;
if rule succeeded:
blank out the toggle entry;
blank out the whole row;
break;
else:
if there is a subtable entry:
step through chain subtable entry;
break;
if there is a reply entry:
say the reply entry;
say paragraph break;
if there is a toggle entry:
follow the toggle entry;
if rule succeeded:
blank out the toggle entry;
break.

Table of Null Chain
checker toggle subtable reply
a rule a rule a table name a text

Event Chains ends here.

---- DOCUMENTATION ----

Event Chains is a small extrension that doesn’t add any new functionality into the game. Instead, it provides an alternative way to order events through a table, as opposed to rules or lengthy IF…ELSE IF statements. It was especially made for conversations, but it can be applied to any set of complex events.

Event Chains was intended for situations where one specific trigger could produce a variety of different effects, depending on a wide variety of conditions in a specific order. For example, talking to someone at different points in the game will produce different replies, perhaps triggering events under certain conditions, or when there’s a timed event that triggers rules. Event Chains is a little complex to use casually. It will save a considerable amount of time and space, however for very complicated interactions, and very useful when you want things considered in a very specific order.

Take this example:

Instead of talking to Hugh while the player is not carrying the luggage and Hugh is not carrying luggage: say "'Sir, I need your luggage.'"

After talking to Hugh when the player has the luggage:
	now Hugh is carrying the luggage;
	say "'Thank you, sir,' he says, taking your bag."

After talking to Hugh when Hugh is carrying the luggage: say "'Thank you, sir.'"

After talking to Hugh when Hugh is carrying the luggage for the fifth time:
	say "In a fit of rage, Hugh punches you in the face.";
	now the player is bruised.

This would work, however, it uses many rules, and if we have a conversation-heavy game, our conditions are probably going to get ever more arcane, like “After talking to Hugh when Susie is in the parking lot and Hugh is carrying the luggage and the player carries the airplane ticket which is stamped for the fifth time during scene10”.

In response, our author might write the following:

Counter is a number that varies.

After talking to Hugh:
	if Hugh is not carrying the luggage and the player is not carrying the luggage:
		say "'Sir I need your luggage.'";
	else if the player is carrying the luggage:
		say "'Thank you, sir,' he says, taking your bag.";
		now Hugh is carrying the luggage;
	else:
		increment the counter;
		if the counter is not 5:
			say "'Thank you, sir.'";
		else:
			say "In a fit of rage, Hugh punches you in the face.";
			now the player is bruised.

Which would work also, but would be rather awkward, and it isn’t modular.

Event Chains provides an elegant, modular solution to situations like these.

Section: How it works

Event chains provide a phrase that moves down a table, stopping when it meets the first row it can access. Here’s a breakdown:

  1. Starting from top, it looks for a non-blank table row,

  2. When it finds one, it looks to see if there’s a checker entry, which is a rule that tests for conditions.
    –if it doesn’t have a checker entry, it stops there, follows the rule in the toggle entry, says the reply entry, and then blanks out the entire row.
    –if it does, it tests the checker entry, moving to step 3.

  3. The event chain checks the checker entry.
    –if the checker rule succeeds, it moves to step 5.
    –if there is no outcome, it moves onto the next entry without blanking out the row.
    –if the rule fails, the event chain stops, following step 4.

  4. This step should only be considered when the check rule failed. When that happens, chain stops on that row, follows the toggle rule and says the reply entry, if there is one or both.

  5. This step is considered when the check rule succeeds, or if there is no checker rule. The chain stops on this row, follows the toggle rule, says the reply entry, then blanks the row out, never following it again.

Using this system, the examples above would look something like this:

*:
After talking to Hugh:
step through chain Table of Hugh Conversation.

Table of Hugh Conversation
checker	toggle	reply
chk001 rule	--	"'Sir, I need your luggage.'"
--	tg001 rule	"'Thank you sir,' he says, taking your luggage."
--	--	"'Thank you sir.'"
--	--	"'Thank you sir.'"
--	--	"'Thank you sir.'"
--	--	"'Thank you sir.'"
--	tg002 rule	"In a fit of rage, Hugh punches you in the face."
--	--	"'Thank you sir'"

Checker rule (this is the chk001 rule):
	if the player is carrying the luggage:
		rule succeeds;
	else:
		rule fails.

Toggle rule (this is the tg001 rule):
	now Hugh is carrying the luggage.

Toggle rule (this is the tg002 rule):
	now the player is bruised.

This is functionally identical to the other two examples aboves, except 1) it functions using only one After rule, decreasing the chance of a conflict with other rules, or things happening in the order that you don’t want them to occur, and 2) it doesn’t require the use of a counter.

One caveat: an Event Chain will never delete the last row of a table, unless you use the “terminating” phrase option, which can delete the last row. So saying:

step through chain Table of Hugh Conversation, terminating

will cause the Event Chain to delete even the last row if the Checker rule doesn’t fail.

Whether Event Chains is useful is entirely subjective. Personally, I feel as though Event Chains has helped my code get cleaner, is less likely to have a bug and much more likely to do things in the order that I want them done, but that is entirely my experience alone. Event Chains in different situations can be more work, and it isn’t designed to be a total replacement for the rule-based system. While you could, theoretically, run an entire action using an event chain alone by use a STEP THROUGH CHAIN phrase during a CHECK rule, it isn’t recommended.

The checker and toggle rulebooks are purely to organize rules. You should never run through the rulebook, as in ABIDE BY THE CHECKER RULES.

Section: Subtables

Event Chains provides support for sub-tables (or sub-chains). If a chain has a subtable entry, it will follow that entry, as in:

Table of First Chain
toggle checker reply subtable
– -- “First subtable chain.” Table of Second Chain

Table of Second Chain
toggle checker reply subtable
– -- “Second subtable chain.” –

Subtable support is untested, it is provided as is for people who are interested.
[/code][/spoiler]

Roman Numerals

A simple extension that converts a number into a roman numeral.

[spoiler][code]Version 1/121107 of Roman Numerals by William S Martin begins here.

To say (N - a number) as/in roman numerals/numbers:
if N is greater than 32767:
say “{Roman Numerals extension failed: number too large}”;
else if N is 0:
say “{Roman Numerals extension failed: cannot represent 0}”;
else if N is less than 0:
say “{Roman Numerals extension failed: cannot represent negative numbers}”;
else:
let the numeral be an indexed text;
let X be N divided by 1000;
let Y be the remainder after dividing N by 1000;
let Z be the remainder after dividing N by 100;
let W be the remainder after dividing N by 10;
if X is greater than 0:
repeat with temp1 running from 1 to X:
now the numeral is “[numeral]M”;
if Y is greater than 99:
let C be Y divided by 100;
if C is:
– 1: now the numeral is “[numeral]C”;
– 2: now the numeral is “[numeral]CC”;
– 3: now the numeral is “[numeral]CCC”;
– 4: now the numeral is “[numeral]CD”;
– 5: now the numeral is “[numeral]D”;
– 6: now the numeral is “[numeral]DC”;
– 7: now the numeral is “[numeral]DCC”;
– 8: now the numeral is “[numeral]DCCC”;
– 9: now the numeral is “[numeral]CM”;
– otherwise: now the numeral is “[numeral]{hundreds place error}”;
if Z is greater than 9:
let D be Z divided by 10;
if D is:
– 1: now the numeral is “[numeral]X”;
– 2: now the numeral is “[numeral]XX”;
– 3: now the numeral is “[numeral]XXX”;
– 4: now the numeral is “[numeral]XL”;
– 5: now the numeral is “[numeral]L”;
– 6: now the numeral is “[numeral]LX”;
– 7: now the numeral is “[numeral]LXX”;
– 8: now the numeral is “[numeral]LXXX”;
– 9: now the numeral is “[numeral]XC”;
– otherwise: now the numeral is “[numeral]{tens place error}”;
if W is greater than 0:
if W is:
– 1: now the numeral is “[numeral]I”;
– 2: now the numeral is “[numeral]II”;
– 3: now the numeral is “[numeral]III”;
– 4: now the numeral is “[numeral]IV”;
– 5: now the numeral is “[numeral]V”;
– 6: now the numeral is “[numeral]VI”;
– 7: now the numeral is “[numeral]VII”;
– 8: now the numeral is “[numeral]VIII”;
– 9: now the numeral is “[numeral]IX”;
– otherwise: now the numeral is “[numeral]{ones place error}”;
say the numeral.

To say (N - a number) as/in small roman numerals/numbers: say “[N as roman numerals]” in lower case.

Roman Numerals ends here.

---- DOCUMENTATION ----

An extremely simple extension. Convert a number to a roman numeral. Doesn’t work on negative numbers or 0.

Try not to use numbers over 10,000, they will look odd and process slowly. Really big numbers might break the system, so the upper limit is numbers up to 32,767 (which happens to be the upper limit of non-glulx Inform, funny that).

To convert a number, simply use the phrase “[A number] as/in roman numerals/numbers”. You can also use “[A number] as/in small roman numerals/numbers” to have them printed as “i”,“vi”, “mmxci” etc.

A quick thanks to jacksonmead, climbingstars, Ned Yompus and Felix Larsson from the Intfiction.org forum who provided feedback that was incorporated into the final version of this extension.

Example: * Romanize the Numbers! - An easy way to test the features of this extension.

*: “Romanize the Numbers”

Include Roman Numerals by William S Martin.

The Roman forum is a room. "This forum exists for a specific purpose: to convert unworthy arabic numbers to virtuous Roman ones. To begin the arduous task of converting the numbers of the universe, shout 'romanize' and then the number you wish to change. Shout 'small romanize' in case you want delightful lower case roman numerals."

Romanizing is an action applying to one number.
Understand "romanize [a number]" as romanizing.

Check romanizing:
	if the number understood is less than 1:
		say "Zero and negative numbers haven't been invented yet!" instead.

Check romanizing:
	if the number understood is greater than 10,000:
		say "It's a mouthful to say more than X Ms." instead.

Carry out romanizing:
	say "[the number understood as roman numerals]".

Small romanizing is an action applying to one number.
Understand "small romanize [a number]" as small romanizing.

Check small romanizing:
	if the number understood is less than 1:
		say "Zero and negative numbers haven't been invented yet!" instead.

Check small romanizing:
	if the number understood is greater than 10,000:
		say "It's a mouthful to say more than X Ms." instead.

Carry out small romanizing:
	say "[the number understood as small roman numerals]".[/code][/spoiler]

Reserved.

Roman Numerals is not working:
Many Compiler errors:

see below:

This is the report produced by Inform 7 (build 6G60) on its most recent run through:

Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 1’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]C”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 2’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]CC”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 3’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]CCC”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 4’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]CD”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 5’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]D”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 6’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]DC”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 7’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]DCC”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 8’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]DCCC”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 9’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]CM”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- otherwise’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]{hundreds place error}”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘if Z is greater than 9’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 1’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]X”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 2’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]XX”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 3’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]XXX”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 4’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]XL”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 5’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]L”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 6’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]LX”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 7’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]LXX”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 8’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]LXXX”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 9’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]XC”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- otherwise’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]{tens place error}”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘if W is greater than 0’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 1’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]I”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 2’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]II”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 3’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]III”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 4’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]IV”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 5’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]V”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 6’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]VI”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 7’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]VII”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 8’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]VIII”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- 9’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]IX”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘-- otherwise’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘now the numeral is “[numeral]{ones place error}”’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. In the phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ , the phrase ‘say the numeral’ came as a surprise since it was not a case in an ‘if X is…’ but was instead some other miscellaneous instruction.
Problem. The phrase or rule definition ‘To say (N - a number) as/in roman numerals/numbers’ is written using the ‘colon and indentation’ syntax for its 'if’s, 'repeat’s and 'while’s, where blocks of phrases grouped together are indented one tab step inward from the ‘if …:’ or similar phrase to which they belong. But the tabs here seem to be misaligned, and I can’t determine the structure. The first phrase going awry in the definition seems to be ‘if N is greater than 32767’ , in case that helps.
This sometimes happens even when the code looks about right, to the eye, if rows of spaces have been used to indent phrases instead of tabs.

Problem. The phrase or rule definition ‘Check romanizing’ is written using the ‘colon and indentation’ syntax for its 'if’s, 'repeat’s and 'while’s, but that’s only allowed if each phrase in the definition occurs on its own line. So phrases like ‘if the number understood is less than 1’ , which follow directly on from the previous phrase, aren’t allowed.
Problem. The phrase or rule definition ‘Check romanizing’ is written using the ‘colon and indentation’ syntax for its 'if’s, 'repeat’s and 'while’s, but that’s only allowed if each phrase in the definition occurs on its own line. So phrases like ‘if the number understood is greater than 10,000’ , which follow directly on from the previous phrase, aren’t allowed.
Problem. The phrase or rule definition ‘Check small romanizing’ is written using the ‘colon and indentation’ syntax for its 'if’s, 'repeat’s and 'while’s, but that’s only allowed if each phrase in the definition occurs on its own line. So phrases like ‘if the number understood is less than 1’ , which follow directly on from the previous phrase, aren’t allowed.
Problem. The phrase or rule definition ‘Check small romanizing’ is written using the ‘colon and indentation’ syntax for its 'if’s, 'repeat’s and 'while’s, but that’s only allowed if each phrase in the definition occurs on its own line. So phrases like ‘if the number understood is greater than 10,000’ , which follow directly on from the previous phrase, aren’t allowed.

You probably copy–pasted the extensions directly from the forum view. That doesn’t preserve tab stops necessary to the code.

Instead, begin by pushing the “Quote” button in the bottom right corner of the post. Then simply copy–paste the extension from there. That procedure should preserve the tab stops in the extension code.

It might be better to add these files to the I7 Github space, and just link to it from here. Far superior to distributing via the forum.

Well, fancy that! There is another place for Inform extensions! I didn’t know of that site! It would be better to put them there rather than here. Maybe this post should be made sticky so that more people are aware of Friends of I7 @ GitHub.

You might want to try re-emailing the extension over to the extension librarian.

I expect that they’re kind of putting a pause on the extensions site while waiting for the upcoming release of Inform 7.

And if anyone wants access to the Friends of I7 Github group, just let me know your GitHub username and I’ll add you. It’s an unofficial place for extensions and other projects which may or may not be up to scratch. I’ve put my experimental (and failed) extensions there for example, as well as copies of the ones on the extensions site.

Or (maybe) not. I just received a new extension and a modification on an existing one from the I7 extensions page. They’re now in the Extensions archive, if anybody’s interested (snipurl.com/26b6yek).

Sorry, my internet has been spotty recently.

I’ll check out Github. And now that I see i7 extensions are being reupdated I’ll give them a second shot.

did this ever make it to a working file? i’d love to get it in my space story. :slight_smile:

EDIT:
I got it in my space story. ^^ TNG has spoiled me.
THANKS!!!