Help with individual Hyperlinks for Items and Things

It looks like that rulebook has been removed and replaced with the “processing hyperlinks” activity, so changing it to a “for processing hyperlinks” rule is probably the best option.

Okay so i tried this

For processing hyperlinks rule (this is the default command replacement by hyperlinks rule):  
	now the glulx replacement command is entry (current hyperlink ID) of the hyperlink list;
	rule succeeds.

which gives me this error

In Chapter 2 - Replace Flexible Windows hyperlink handling if necessary (for use with Flexible Windows by Jon Ingold), Section - Code for selecting the replacement command (replaces Section - Selecting the replacement command in Flexible Windows by Jon Ingold) in the extension Inline Hyperlinks by Daniel Stelzer:

Problem. You wrote 'now the glulx replacement command is entry (current hyperlink ID) of the hyperlink list'  : but this is a phrase which I don't recognise, possibly because it is one you meant to define but never got round to, or because the wording is wrong (see the Phrasebook section of the Index to check). Alternatively, it may be that the text immediately previous to this was a definition whose ending, normally a full stop, is missing?

I was trying to match this phrase:

 now (glulx replacement command is entry ( current hyperlink id ) of the hyperlink list - a phrase) 

But I didn't recognise 'glulx replacement command is entry ( current hyperlink id ) of the hyperlink list'.

Not sure if i did it the right way, not too sharp with inform

That…is interesting. And I’m not sure what it means either, unfortunately. “The hyperlink list” is a list defined in that extension, “entry (number) of (list)” is a built-in phrase, “the glulx replacement command” is defined in Glulx Entry Points by Emily Short, and “now (variable) is (value)” is built-in syntax…so likely the problem is somewhere else, and Inform is misreporting it. :confused:

Okay so i’ve been trying out a few things. And since the problems only arise when used together with Flexible Windows i decided to look into Flexible Windows, and i found something i don’t understand. In the Inline Hyperlinks extension its says this.

Section - Code for selecting the replacement command (replaces Section - Selecting the replacement command in Flexible Windows by Jon Ingold)

A hyperlink processing rule (this is the default command replacement by hyperlinks rule):  
	now the glulx replacement command is entry (current hyperlink ID) of the hyperlink list;
	rule succeeds.

It says replaces Section - Selecting the replacement command in Flexible Windows by Jon Ingold. However, Flexible Windows doesn’t have a section like that, maybe that is the problem? The hyperlink stuff in Flexible Windows is all contained in a chapter like this:

Part - Input events

Chapter - Hyperlinks

To say link (N - a number):
	(- if ( glk_gestalt( gestalt_Hyperlinks, 0 ) ) { glk_set_hyperlink( {N} ); } -).

To say end link:
	(- if ( glk_gestalt( gestalt_Hyperlinks, 0 ) ) { glk_set_hyperlink( 0 ); } -).

Processing hyperlinks for something is an activity on g-windows.
The processing hyperlinks activity has a number called the hyperlink ID.

After constructing a textual g-window (called win) (this is the request hyperlink events rule):
	if glk hyperlinks are supported:
		call glk_request_hyperlink_event for win;

A glulx input handling rule for a hyperlink-event (this is the default hyperlink handling rule):
	carry out the processing hyperlinks activity with the glk event window;

Before processing hyperlinks (this is the prepare for processing hyperlinks rule):
	now the hyperlink ID is the glk event val1;

Last for processing hyperlinks (this is the default hyperlink command replacement rule):
	repeat through the Table of Glulx Hyperlink Replacement Commands:
		if the hyperlink ID is link ID entry:
			now the glulx replacement command is replacement entry;
			rule succeeds;
	now the glulx replacement command is "";

Table of Glulx Hyperlink Replacement Commands
link ID (number)	replacement (text)
--

After processing hyperlinks for a g-window (called win) (this is the request hyperlink events again rule):
	call glk_request_hyperlink_event for win;

So maybe it’s trying to replace the wrong kind of rule?

Edit: I updated Flexible Windows as i had an older version. The version i have now doesn’t even have that part with hyperlinks. It actually has NOTHING at all regarding code with hyperlinks, yet the problem still persists. I read the changelog made, and it says this;

  • The hyperlink processing rules have been turned into the processing hyperlinks activity.

could this have anything to do with it?

Okay so i’ve been playing around for awhile now, trying to make this work and searching the interwebs. I found this guy called Nuku Valente, whom have several modified versions of extensions uploaded to github here: github.com/Nuku/Flexible-Survival

His version of Flexible Windows contains a bit of code concerning hyperlinks, an entire chapter in fact:

Section - Hyperlink event handling

A glulx hyperlink rule (this is the default hyperlink handling rule):
	[unless the status window is the hyperlink source:
		now the current hyperlink window is the window with the reference of the window in which the event occurred;]
	[now the current hyperlink ID is the link number of the selected hyperlink;]
	unless the current hyperlink ID is 0:
		[cancel glulx hyperlink request in the current hyperlink window;[just to be safe]]
		follow the hyperlink processing rules;
	if the status window is the hyperlink source:
		request glulx hyperlink event in status window;
	[otherwise:
		request glulx hyperlink event in the current hyperlink window.]

To request glulx hyperlink event in (win - a g-window):
	(-  if (glk_gestalt(gestalt_Hyperlinks, 0)) glk_request_hyperlink_event({win}.ref_number); -)

To cancel glulx hyperlink request in (win - a g-window):
	(-  if (glk_gestalt(gestalt_Hyperlinks, 0)) glk_cancel_hyperlink_event({win}.ref_number); -)

To request glulx hyperlink event in the/-- status window:
	(-  if (glk_gestalt(gestalt_Hyperlinks, 0)  && gg_statuswin) glk_request_hyperlink_event(gg_statuswin); -)
	
To cancel glulx hyperlink event in the/-- status window:
	(-  if (glk_gestalt(gestalt_Hyperlinks, 0) && gg_statuswin) glk_cancel_hyperlink_event(gg_statuswin); -)

To decide whether the status window is the hyperlink source:
	(- (gg_event-->1==gg_statuswin) -)

[To decide which g-window is the window with (N - a number):
	repeat with item running through g-windows:
		if N is the ref-number of item:
			decide on item;
	decide on main-window.]


Section - Placing hyperlinks
	
To say link (N - a number):
	(-  if (glk_gestalt(gestalt_Hyperlinks, 0)) glk_set_hyperlink({N}); -)

To say end link:
	(-  if (glk_gestalt(gestalt_Hyperlinks, 0)) glk_set_hyperlink(0); -)


Section - Processing hyperlinks

The hyperlink processing rules are a rulebook.

The current hyperlink ID is a number that varies.


Section - Selecting the replacement command

The last hyperlink processing rule (this is the default command replacement by hyperlink rule):  
	repeat through the Table of Glulx Hyperlink Replacement Commands:
		if the current hyperlink ID is link ID entry:
			now the glulx replacement command is replacement entry;
			rule succeeds;
	now glulx replacement command is "".


Table of Glulx Hyperlink Replacement Commands
link ID	replacement
a number	some text

I took that part and copy pasted it into my version of Flexible Windows, and that actually solved the previous error. I however received new errors regarding this new chunk of code i just copypasted in. I outcommented the bits of code, and it kinda works now (or atleast succesfully compiles). It doesn’t give me any errors, and it display the hyperlinks, they are however Unclickable.

I don’t know if this helps maybe?

Just a little history here, in case it helps: I haven’t updated Inline Hyperlinks in a long time (two versions of Inform, perhaps? The last version I did used indexed text, which is no longer a thing. Someone else may have updated it though). Additionally, since the last update of Inline Hyperlinks, Dannii has taken over maintenance of Flexible Windows and made many, many changes to it–including removing all of the hyperlink-related code a few months ago. In addition, I think that Dannii may also have made changes to Glulx Entry Points, on which both extensions depend. So it likely won’t be any easy thing to sort through by version to get this working.

My recommendation would be that you start with the newest possible versions of each of these extensions and essentially rewrite Inline Hyperlinks to work with the newest FW and GEP.

But if Dannii has removed all the hyperlink-related code, then what is the incompatibility about? I have been sifting through some older Flexible Windows code, and that has hyperlink code, and it makes sense for me to have hyperlinks in your windows, so why was it removed and why would it cause compatibility issues if flexible windows no longer has anything to do with hyperlinks?

I can’t seem to update glulx entry points for some reason, maybe because it’s essential? i am using 6L38, should i update? Last time i tried my project received all kinds of incompatibilities, and it seemed like most extensions we’re for that version only anyway, so i didn’t.

Inline Hyperlinks still expects Flexible Windows to have the old hyperlink-related code, and refers to it, and so Inform gets confused when it’s not there.

I forget exactly why Dannii said he removed it (you can search for his explanation if you want, I think it might be on this forum somewhere) but I suspect he wanted to avoid compatibility problems in case the author wanted to use Flexible Windows with a different hyperlink extension.

If you’re not sure how to update/rewrite Inline Hyperlinks, as Erik suggested, you could maybe report an issue on Github saying that Inline Hyperlinks doesn’t work with the latest Flexible Windows, and some other people may be able to help. I can look at it later; I don’t know whether it’ll be within my ability to help though.

Well when you outcomment the part in Inline Hyperlinks by Daniel Stelzer, you get these errors:

Problem. In the line 'say "[item described] - [link][bracket] [...] ake [the item described][end link]"'  , I was expecting that 'link' would be something to 'say', but it didn't look like any form of 'say' that I know. So I tried to read 'link' as a value of some kind (because it's legal to say values), but couldn't make sense of it that way either. 

 Sometimes this happens because punctuation has gone wrong - for instance, if you've omitted a semicolon or full stop at the end of the 'say' phrase.

I was trying to match this phrase:

 say "[link - sayable value]" 

But I didn't recognise 'link'.



--------------------------------------------------------------------------------
In Chapter 3a - Debugging (not for release), Section - Previewing the hyperlink list (for use without Extended Debugging by Erik Temple) in the extension Inline Hyperlinks by Daniel Stelzer:

Problem. In the sentence 'Display the hyperlink list using indices'  , I was expecting to read a list of texts, but instead found some text that I couldn't understand - 'hyperlink list'.

I was trying to match one of these phrases:

1.  display (hyperlink list - list of texts) using indices 

2.  display (hyperlink list using indices - figure name) 

But I didn't recognise 'hyperlink list' or 'hyperlink list using indices'.
 

Problems occurring in translation prevented the game from being properly created. (Correct the source text to remove these problems and click on Go once again.)

Which tells me that even though that code is for replacing something in flexible windows, it’s still reliant on that piece of code somehow?

I haven’t looked at it in depth, but you could look at the old Flexible Windows, and try to figure this out:

In the old version of Flexible Windows (whatever version has the section names that Inline Hyperlinks is referring to), find the named sections that Inline Hyperlinks is trying to replace. Do those sections constitute all the hyperlink code in the old Flexible Windows? Or is there more hyperlink code in Flexible Windows?

If Inline Hyperlinks is trying to replace all the hyperlink sections in Flexible Windows, then I don’t think the old hyperlink code from Flexible Windows is needed at all. You could try commenting out the entire chapter of Inline Hyperlinks that says “for use with Flexible Windows” in the heading.

Sorry, I don’t have time to look into it further right now.

Thats what i did and got the error with [link] not being recognized, which makes 0 sense to me as “To say link” is described pretty clearly.

It’s because the “for use without Flexible Windows” parts aren’t being included. If you remove that from the heading, it will hopefully work.

That did the trick! It’s all working like a charm now! Thank you guys for the help!

Removing the entirety of chapter 2 and deleting “for use without Flexible Windows” made it all work.

Draconis, would it be helpful for someone to modify the Github version of Inline Hyperlinks to make those changes? I.e. remove the “For use with Flexible Windows” chapter and the “for use without Flexible Windows” heading?

Updated. Thanks for testing!

Sorry for this mess! I removed the hyperlinks section from FW because it was only tangentially related to the extension. My hope in the future is to write a kind of unifying hyperlinks extension that combines the best of all the others.

FWIW the reason that I added hyperlinks to Flexible Windows is to enable basic hyperlink functionality in all windows, something that would otherwise have required yet another hyperlinks extension. (Basic Hyperlinks only provides it in the main window.) A unified extension is a great idea, as long as it includes multi-window support.

Definitely. The greater plan is to make most extensions multi-window aware, so that FW would only be for creating and controlling extra windows.

This conversation died down at the end of July. What’s the situation today for a multi-window (Flexible Windows off github) solution to hyperlinks?

From reading the 3 pages on this topic, it seems there is a modified github.com/i7/extensions/blob/m … rlinks.i7x Inline Hyperlinks out there that now works with the newer Flexible Windows?

Working sample Inform 7 code welcome :wink: Something that hyperlinks commands like West, East, Look?

Ok, I see someone checked in a new extension 5 days ago on Github :wink: The published documentation is still incorrect on inform.com website (found a topic here from 2011 https://intfiction.org/t/problem-with-hyperlinks-in-a-flexible-windows-subwindow/2407/4 that explained the documentation error).

Working Sample!

"FlexibleWindowsHyperlinksA" by "Community"

The story genre is "Other". The release number is 1.  [genre: https://intfiction.org/t/defining-the-story-genre/4615/1 ]
The story headline is "Glulx technical demonstration".

[Include version 15/161003 of Flexible Windows by Jon Ingold.]
[DEPENDENCY: Simple Graphical Window automatically includes Flexible Windows by Jon Ingold]
Include version 10/161003 of Simple Graphical Window by Emily Short.

[
A bit of history: Flexible Windows had a Hyperlinks feature up until version 15. It was removed fron the extension because it did not really fit with the name of the extension. "Hyperlinks by Dannii Willis" was created in October 2016 to provide the functionality that previously existed in earlier versions of Flexible Windows.
]
Include Hyperlinks by Dannii Willis.

[ The mere inclusion of the Simple Graphical Window extension automatically creates a window named 'graphic window' ]

The measurement of the graphics window is 6 [units?].

The background color of the graphics window is "#FF00FF". [magenta]

[
======================================================================================
==  Hyperlink table
======================================================================================
]

Table of Glulx Hyperlink Replacement Commands (continued)
	link ID  	replacement  
	1  	"GO East"  
	2  	"GO West"  
	3	"restart"

[
======================================================================================
==  Main Story Logic of rooms
======================================================================================
]

When play begins:
        now the right hand status line is "[link 3]reset story[end link]"

Place is a room.  "This is a Place that seems to be the center of the universe.  To the [link 1]East[end link] a wide field opens, while to the [link 2]West[end link] a narrow path winds into the Wild."

Wild West is a room, west of Place.  "Welcome to the Wild West! Rodeo starts shortly.  [link 1]Easterly narrow trail[end link] might return you to Place."

Field is a room, east of Place. "This is a large open field. [link 2]West[end link] is the central Place room."