Hyperlink Interface by Leonardo Boselli

Hi guys, I really love the idea behind Hyperlink Interface by Leonardo Boselli, but it won’t compile. Can anyone help me fix it? I’m currently getting these errors from it:

okay i can’t “help you”-help you but I just wanna point out,

wouldn’t it be easier to show the code you have, rather than just the problem it’s in?

Knowing is half the battle.

G I JOOOOEEEEE

Well I can post all the bits that it caused problems with? I’ll just start with the first three errors. I’ll point out the lines Inform has problems with.

First when play begins: let T be an indexed text; let T be "menu"; add T to List of Hyperlink Glulx Replacement Commands; let T be "look"; add T to List of Hyperlink Glulx Replacement Commands; let T be "inventory"; add T to List of Hyperlink Glulx Replacement Commands; let T be "topics"; add T to List of Hyperlink Glulx Replacement Commands; let T be "things"; add T to List of Hyperlink Glulx Replacement Commands; let T be "exits"; add T to List of Hyperlink Glulx Replacement Commands; change the command prompt to "[set link 2] l [end link]|[set link 3] i [end link]| [set link 1]menu[end link]>"; [<--- This line] repeat with CT running from (HI min hyperlinks) to (HI max hyperlinks): let T be ""; add T to List of Hyperlink Glulx Replacement Commands.

Rule for printing the name of a direction (called dir) while looking (this is the Hyperlink Interface highlight directions while looking rule): now the saved direction is dir; carry out the direction hyperlinking activity. [<------This line]

Rule for printing a parser error when parser error is not a verb I recognise (this is the Hyperlink Interface not a verb I recognise rule) : show HI message for not-a-verb-I-recognise. [Acknowledge that the player may be trying to type a hyperlink, not just a verb.]

This isn’t very well explained on the website, but most of the extensions on the extensions page that you’re getting this from are for older versions of Inform and won’t compile with the new one. Check the date–I think the up-to-date extensions will be April 2014 or later. You might also want to look at this thread.

Many up-to-date extensions that can’t be found in the Public Library are on an inform 7 repository on GitHub. You can find Inline Hyperlinks by Daniel Stelzer and Basic Hyperlinks by Emily Short there. Not sure if any of those mimcs Boselli’s extension in the way you want.

My Handbook (available from musicwords.net/if/i7hb.htm) has an Appendix that gives some basic instructions on how to fix old broken extensions. For one thing, ‘change … to’ can easily be fixed by amending it to ‘now … is’. The phrase ‘indexed text’ can usually be fixed by deleting the word ‘indexed’. There’s probably a new phrase used instead of ‘carry out’, and probably someone here can tell you what it is. The last error you mention, “Rule for printing a parser error…”, may possibly be related to a change in the wording or name of a rule in the Standard Rules. Searching this file may give you the information you need to edit the extension.

Thanks a lot, I didn’t know that. I found an updated version of the Hyperlink Interface, but unfortunately there is still one bug in it. It looks like it might be easy to solve though, if anyone wants to give it a shot? If so you would really help me as this is a major piece of extra functionality.

[code][This routine is lifted straight from the example in the Inform 7 docs.]

Understand “exits” as listing exits. Listing exits is an action out of world applying to nothing. [<---- This line causes the bug]

Definition: a direction (called thataway) is viable if the room thataway from the location is a room.

Carry out listing exits (this is the Hyperlink Interface carry out listing exits rule):
let count of exits be the number of viable directions;
if the count of exits is 0, say “[It] [seem] there [are] nowhere to go.” (A);
otherwise say “From here, [if the number of viable directions is 1]the only way out [are] to[otherwise][we] [can go] to[end if] [a list of viable directions].” (B).[/code]

It looks like you have another extension defining the same action. What other extensions are you using?

This is actually a change in the syntax for the stuff invovled in printing a parser error–the global variable that stores the parser error is now “latest parser error” rather than just “parser error,” and all the command parser errors have names ending in “error.” So instead of

Rule for printing a parser error when parser error is not a verb I recognise

you now say

Rule for printing a parser error when the latest parser error is not a verb I recognise error

(See section 18.35 of Writing with Inform.)

I think “Carry out the … activity” should still be good though; not sure why that line didn’t work.

[quote=“Skylark”]
Thanks a lot, I didn’t know that. I found an updated version of the Hyperlink Interface, but unfortunately there is still one bug in it. It looks like it might be easy to solve though, if anyone wants to give it a shot? If so you would really help me as this is a major piece of extra functionality.

[quote]
In Chapter - Screen Reader Mode, Section - Exits in the extension Hyperlink Interface by Leonardo Boselli:

Problem. You wrote ‘Listing exits is an action out of world applying to nothing’ : but that seems to be an action already existing, so it cannot be redefined now. If you would like to reconfigure an action in the standard set - for instance if you prefer ‘unlocking’ to apply to only one thing, not two - create a new action for what you need (‘keyless unlocking’, perhaps) and then change the grammar to use the new action rather than the old (‘Understand “unlock [something]” as keyless unlocking.’).

If you are running the extension Exit Lister it will conflict with this. If you need both extensions I would comment out exit listing in the hyperlink extension and add it into Exit Lister as a specific function triggered by specific conditions. If you have exit listing defined elsewhere you will need to decide on one or the other or difine them as seperate actions (functions).

Ah, that sounds like it might be Exit Descriptions by Matthew Fletcher, forgot that was still on but I’m not sure if it’s to blame as I can’t test it until I fix some other stuff. I updated Flexible windows from the database to try and make it work, and then had to do the same with two of Emily Short’s extensions to make that work, and then it started complaining about this text Inline hyperlinks is supposed to replace in Flexible windows: :confused:

[code][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.][/code]

Quoted out that text and it compiles, but I still can’t get Flexible Windows to work, and now Hyperlink Database is giving me this:

I could probably solve the first one by copy-paste, but I don’t dare touch any of them. Can anyone help me sort this mess out? :stuck_out_tongue: