If you’ve been following my buisquixe journey, you know that I’ve had trouble with errors like this:
Fatal Error: Printing text to a window that is waiting for line or character input is not allowed.
My understanding is that this kind of behavior can be related to Glulx Entry Points, a technology I don’t understand, but I’ve had a lot of luck getting rid of errors by breaking up rules that wait for player input: if the player consents
phrases, for instance, or rules with a wait for any key
prompt.
My new interest in hyperlinks has raised the challenge a few notches, though I’ve largely been successful with similar interventions. But in a large project, automation is often desirable, particularly in complex situations. Manipulating the texts in lists is something I’ve wanted to do.
For instance, I might only want to link actions in rooms where they are relevant, or to only link nouns when the action prompting the WDYM mean applies. Printing lists or repeating through tables seems especially disaster prone. These failures occur in the IDE (as do all similar errors), so there is no need to release a web page to see the problem.
lab is a room.
include simple multimedia effects for v10 by mathbrush.
include glulx entry points by emily short.
release along with a "bisquixe" interpreter.
scratch is a list of texts that varies.
scratch is initially { "[a]", "[b]", "[c]" };
to say a:
hyperlink "listening" as "listen".
to say b:
hyperlink "looking" as "look";
to say c:
hyperlink "smelling" as "smell";
instead of jumping:
say scratch;
test me with "jump" [and then click 'smell' (the other links are fine)]
Since the rule creating the links has only one phrase, there’s nowhere really to “hide” here. I did break it up into two rules, but nothing changed. I’m wondering–if anyone might know–if this technique is unavailable. Or perhaps there’s some clever trick? I do a lot with lists.
I would welcome any thoughts on the list thing, although I know this is a rather niche question. I’m really just looking to verify that there isn’t a way to use lists in this way. I’m also asking because I’ve stared at this so long that I don’t think I can really see it anymore.
I am using GEP 10.0.150101, though I have tried 10.0.250425. I even tried rolling my compiler back to 2015, but due to extensions and my own code that would be a difficult journey. I think I would just ditch the lists before pursuing that further.
as a fun aside, you can run regular expressions against hyperlinks. It treats the first text of the link pair as the one to be matched. So you can do things like this (it doesn’t cause problems, either).
carry out frobbing:
repeat with X running through scratch:
if X matches the regular expression ".{2}mp":
say X;