I think this is a rather niche question that I probably could have asked Mathbrush about directly, but just in case anyone else has encountered this.
I am unable to construct hyperlinks from a table of texts and insert them in the status window (via table of fancy status in Basic Screen Effects). I can add links manually to the table for constructing the status line. I can print those same links from tables within the game’s text and they work fine. I just can’t get from table to table.
An illustration might help. Note the unlinked text in the upper left, linked text at right and in the room description. Apologies for the longer example, but I think it will be more useful than my clumsy explanation.
lab is a room.
the description of lab is "[lab description]".
ball is in lab.
hat is in lab.
shoe is in lab.
include basic screen effects by emily short.
include simple multimedia effects for v10 by mathbrush.
[using a feature from basic screen effects]
rule for constructing the status line:
fill status bar with the table of link testing;
rule succeeds;
table of link testing
left central right
"" "" ""
"" "" ""
"" "" ""
table of status line texts
item
"examine hat"
"examine ball"
"examine shoe"
when play begins:
build the link list;
fill the right-hand side;
every turn:
build the link list;
fill the right-hand side;
to build the link list:
let N be one;
let T be a text;
repeat through the table of status line texts:
now T is item entry;
choose row N from the table of link testing;
now left entry is "[link T]";
increment N;
to say link (t - a text):
hyperlink "[t]" as "[t]";
to say lab description:
repeat through the table of status line texts:
say "[link item entry][line break]";
to fill the right-hand side:
repeat with L running from one to three:
choose row L from the table of link testing;
now right entry is "[link static entry]";
static entry is always "examine ball".
It might be something quite obvious; I’ve stared at this so long that I don’t really see it anymore.
This means we can eliminate Basic Screen Effects from the picture. My guess is that it’s something related to substituted text or that thing that ‘unpacks’ text while checking if it’s about to be printed and executes code too early (or maybe the hyperlinking step happens before the table copying step is finished). I’ll keep looking at it!
Edit:
I can also verify that filling the table from a list rather than another table still drops hyperlinks:
statuslist is a list of text that varies.
statuslist is {"examine hat", "examine ball", "examine shoe"}
to build the link list:
let N be one;
repeat with T running through statuslist:
choose row N from the table of link testing;
now left entry is "[link T]";
increment N;
Okay, I think it is strongly related to substituted forms. Here’s a really basic example that strips links:
"Test room" by Brian Rushton
lab is a room.
include basic screen effects by emily short.
include simple multimedia effects for v10 by mathbrush.
Release along with a "Bisquixe" interpreter.
to say link (t - a text):
hyperlink "[t]" as "[t]";
T is some text that varies. T is "X ME"
Linktext is some text that varies. Linktext is "[link T]"
Instead of waiting:
say linktext;
say line break;
say the substituted form of linktext;
I’m going to check to see if tables always strip out commands. I’ll keep you updated!
Edit:
It’s kind of bizarre. Changing your ‘link’ command to try jumping instead of hyperlinking does this:
So it looks like storing text with effects in it into tables can act a little goofy. I’ll keep looking
Editedit: Another interesting approach:
Adding the static link after the dynamic link makes both bad:
to build the link list:
let N be one;
let T be a text;
repeat through the table of status line texts:
now T is item entry;
choose row N from the table of link testing;
now left entry is "[link T][link static entry]";
increment N;
But if we put in just the link static entry, it works perfect. So the dynamic parsing is what’s killing the links.
Editeditedit:
With this toy game:
"Test room" by Brian Rushton
lab is a room.
include basic screen effects by emily short.
include simple multimedia effects for v10 by mathbrush.
Release along with a "Bisquixe" interpreter.
Table of Link Testing
item
""
""
""
Instead of waiting:
showme the contents of table of link testing;
say hyperlink list;
Table of fill-in text
bob
"examine me"
"examine you"
"roody doo doo doo"
When play begins:
repeat with current running from one to three:
choose row current in the table of fill-in text;
let temp be bob entry;
choose row current in the table of link testing;
now item entry is "[link temp]";
To say link (t - a text):
hyperlink t as t;
It doesn’t hyperlink anything ever, but the hyperlink list prints out those three texts, showing that it intended to hyperlink things at some point
Okay, based on my research this is a general issue with Inform removing all special printing instructions from substituted text (this includes things like bolded text). There is an extension called Format Capture that can fix it, I’ve heard, but I couldn’t find it on Github.
If the number of rows in your table is fixed, hardcoding it will work just fine:
"Test room" by Brian Rushton
lab is a room.
the description of lab is "[lab description]".
ball is in lab.
hat is in lab.
shoe is in lab.
include basic screen effects by emily short.
include simple multimedia effects for v10 by mathbrush.
Release along with a "Bisquixe" interpreter.
[using a feature from basic screen effects]
rule for constructing the status line:
fill status bar with the table of link testing;
rule succeeds;
table of link testing
left central right
"" "" ""
"" "" ""
"" "" ""
table of status line texts
item
"examine hat"
"examine ball"
"examine shoe"
Permvar1 is some text that varies. Permvar1 is "[item in row 1 in table of status line texts]".
Permvar2 is some text that varies. Permvar2 is "[item in row 2 in table of status line texts]".
Permvar3 is some text that varies. Permvar3 is "[item in row 3 in table of status line texts]".
when play begins:
build the link list;
fill the right-hand side;
every turn:
build the link list;
fill the right-hand side;
to build the link list:
choose row 1 in table of link testing;
now left entry is "[link permvar1]";
choose row 2 in table of link testing;
now left entry is "[link permvar2]";
choose row 3 in table of link testing;
now left entry is "[link permvar3]";
to say link (t - a text):
hyperlink "[t]" as "[t]";
to say lab description:
repeat through the table of status line texts:
say "[link item entry][line break]";
to fill the right-hand side:
repeat with L running from one to three:
choose row L from the table of link testing;
now right entry is "[link static entry]";
static entry is always "examine ball".
Since the permanent variables are just accessing your table, you can just change the table as usual to update the hyperlinks, like:
Instead of jumping:
now item in row 1 of the table of status line texts is "cry";
I tried this out, and jumping changed the upper-left link.
This is the furthest I’ll pursue it for now, as keeping the formatted text in substituted text requires some fancy I6 code.
If you have a variable number of status line elements, I might be able to help you write some code related to that (most likely making a bigger set of permanent variables and blanking unused ones).
You end up with problems when you embed temporary variables in texts for later dynamic expansion.
This works… is there a better way to do this that gives back some of the flexibility you want? Maybe, but I can’t look at it further now.
lab is a room.
ball is in lab.
hat is in lab.
shoe is in lab.
include basic screen effects by emily short.
include simple multimedia effects for v10 by mathbrush.
release along with a "Bisquixe" interpreter.
rule for constructing the status line:
fill status bar with the table of link testing;
rule succeeds;
table of link testing
left central right
"" "" ""
"" "" ""
"" "" ""
to say link (t - a text):
hyperlink "[t]" as "[t]";
t1, t2, t3 are texts that vary.
when play begins:
now t1 is "examine hat";
now t2 is "examine ball";
now t3 is "examine shoe";
choose row 1 in the table of link testing;
now left entry is "[link t1]";
choose row 2 in the table of link testing;
now left entry is "[link t2]";
choose row 3 in the table of link testing;
now left entry is "[link t3]";
It is probably a little skunky, but I am grabbing rooms from a table, massaging their printed names, then throwing those in a table as in Mathbrush’s example. This is the only way these values will be accessed, so it will at least be easy to keep an eye on them.
I’ll think about Zed’s concerns and make changes if I can find a way forward. For now, though, let’s consider this oddball request closed!