Hey everyone. I’ve encountered a bug while working in the weeds of Inform 7 and I’m not sure if it’s been reported before.
I tried checking the Mantis bug tracker at this link but I’m only seeing a blank page. I also found this thread detailing a similar bug but it doesn’t seem to have been resolved.
Background
I’m trying to rework the quest log in The Weight of a Soul to generate a list of texts, separated by subcategory. The subcategories are defined as Inform 7 objects. This is so that I can do fancy formatting tricks with the subcategories in Vorple (hyperlinks, tabbed pages) without having to hardcode them.
The solution I’m working with is creating a new kind of object – “objective subcategory” – and defining a rulebook, called the objective generation rules, which will produce different lists of texts depending on which objective subcategory it’s run on. This is what I have right now:
Defining objective subcategories
Section 2.3.12.4.2 - Objective Subcategories
An objective subcategory is a kind of object.
Every objective subcategory has some text called the heading name.
The objective generation rules is an objective subcategory based rulebook producing a list of texts.
To decide which list of objective subcategories is the list of applicable objective subcategories:
let L be a list of objective subcategories;
if the Reden-objectives are applicable, add the Reden-objectives to L;
[...]
decide on L.
Example of an objective subcategory
Section 2.3.12.4.3 - Reden Objectives
The Reden-objectives are an objective subcategory. The heading name of the Reden-objectives is "Reden".
To decide if Reden-objectives are applicable:
if Reden Investigation is happening, decide yes;
decide no.
An objective generation rule for Reden-objectives:
let L be a list of texts;
if the enabled of zoiro-mourning-alldone is false:
add "[bullet] Go to Riggertown and ask Zoiro about his brother's activities" to L;
if clue-reden-shack is true and Reden's Shack is unvisited:
add "[bullet] Look for a place in Lower Riggertown where Reden could have stayed" to L;
if clue-crowsnest is true:
add "[bullet] Go to the Shanty Quarter and investigate the Crow's Nest pub" to L;
otherwise:
if Reden's Shack is visited:
add "[bullet] Investigate Reden's shack in Lower Riggertown for clues" to L;
if clue-reden-zoironest is true and Gangway is unvisited:
add "[bullet] Find out more about a pub involving a [']bird's nest[']" to L;
rule succeeds with result L.
Printing the list of objectives, with subcategory technology
To say journal-text-objectives:
let current-objectives be the list of current objectives;
if the number of entries in current-objectives is 0:
say "I have no particular objective at the moment.";
otherwise:
repeat with current objective running through current-objectives:
say "[line break][current objective]";
let applicable-subcategories be the list of applicable objective subcategories;
say "Found applicable subcategories.";
repeat with applicable-subcategory running through applicable-subcategories:
say "Checking applicable-subcategory: [applicable-subcategory].";
let objectives-produced be the list of texts produced by the objective generation rules for the applicable-subcategory;
say "Got objectives-produced.";
if objectives-produced is not {}:
say "[paragraph break][italic type][heading name of applicable-subcategory][roman type][line break]";
repeat with current objective running through objectives-produced:
say "[line break][current objective]";
Expected Output
The output is intended to look something like this:
Current objectives:
• Investigate the victims of the disease and identify the transmission vector
Found applicable subcategories.
Checking applicable-subcategory: Reden-objectives.
Got objectives-produced.
Reden
• Go to Riggertown and ask Zoiro about his brother's activities
Buggy Output
This is what I actually get when running the code:
Current objectives:
• Investigate the victims of the disease and identify the transmission vector
Found applicable subcategories.
Checking applicable-subcategory: Reden-objectives.
Glulxe fatal error: Memory access out of range (-7FFFFFD2)
Thoughts
The source is compiling without any errors in the IDE and the code seems to work as intended up until the interpreter crashes. I assume this is some kind of low level compiler bug, but I really have no idea what’s going on. I’m posting this here in the hope that someone who knows Inform 7 better than I do will see it and maybe help with my problem.