A request for assistance: hyperlinks in lists (GEP probably?)

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;
2 Likes

With the numerous flaws found in Bisquixe, I wonder if it’s just a lost cause at this point. Although I should say that

But if you persevere, I’d have to say this is really odd. For some reason the hyperlinks only fail on the last item in a list. Changing the order of the list makes whatever the new last items is fail. Why is that?

I’ll look at it more but this is bizaare behavior.

Edit:
I can confirm that if you add a non-hyperlink item to the list, then the last element of the list now works. Bizarre behavior.

1 Like

Yeah, I think it’s kind of like waiting on yes/no answers, keypress, or the chosen letter. The general message suggests that there is unfinished business somewhere.

What are the numerous flaws? I feel like this is the only thing that comes up. I mean, I’m sure I could come up with a wish list (ha ha) but in all seriousness I think it’s a nice tool for people who aren’t up to learning CSS or Vorple. It grants new capabilities to beginning authors. I think that’s great!

1 Like

I tried printing the list using the entries in a substituted form, but unfortunately doing so strips the links and just leaves the words. :frowning:

instead of jumping:
	let T be a text;
	let N be the number of entries in scratch;
	let F be the number of entries in scratch;
	repeat with presto running through scratch:
		if N is F:
			now T is "[presto], ";
		otherwise if N is greater than 2:
			now T is the substituted form of "[T][presto], ";
		otherwise if N is 2:
			now T is the substituted form of "[T][presto], or ";
		otherwise if N is 1:
			now T is the substituted form of "[T][presto]?";
		say line break;
		decrement N;
	say T;

Ha this is so clunky. What a heroic effort

1 Like

Okay, here’s some black magic:

Take your original code, and add a single space after the word “smelling”:

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)]

This seems to be related to the paragraph break problem that has plagued authors for a decade. Adding the space cancels one of the hidden paragraph breaks provided by printing rules.

2 Likes

Wow, what a weird thing! I can definitely work with this. Thank you!

1 Like

I have no idea why these particular symptoms are appearing, but the “hyperlink X as Y” and “set link” phrases don’t check whether “expanding text for comparison purposes”, meaning it calls glk_set_hyperlink any time the text is evaluated, whether it’s being printed to the screen or not. I suspect this is doing something weird if this happens when the output stream is in the wrong state.

If so, checking this variable within “hyperlink X as Y” and only printing (not linking) the text if it’s true might help?

1 Like

At this point in my Inform journey, I don’t understand things like that, though I would like to. Is there a path to understanding things like this? How would I go about learning enough to evaluate this sort of thing?

I think this tech is good. I talk to young people who enjoy choice-based IF. Often! There are a lot of factors that quash their interest in parser games. Appearance is high on the list! Learning the diction is high on the list! Wishbringer–and hey, I love Wishbringer–isn’t going to get them through the door. I think a pertinent question is how/can these players learn to enjoy Wishbringer? Bisquixe has a low skill floor for beginning authors. It allows them to introduce welcoming formatting and interface features without requiring sophisticated programming techniques (or any programming techniques, really).

I’d love to be able help authors get into it, and pitch in when there are problems, but I don’t know how to go about learning what I would need to learn.

In an ideal world, these would be implementation details that authors wouldn’t need to worry about, only the creators of extensions like Glulx Entry Points. And as such, the official documentation mostly glosses over them. So unfortunately, the best way to learn about it is to mess around with arcane Inform 6 template code and Glk calls until it starts to make sense, which is not a great experience.

If this really is the problem, though, I’d say it qualifies as a bug in Simple Multimedia Effects, and hopefully fixing it will mean authors don’t need to worry about it ever again. It should Just Work.

1 Like