Comments (8)
Here is a version of the now-broken extension with a few debug printouts. These merely serve to demonstrate that the Inform 7 mechanisms of Inline Hyperlinks are working as expected.
from extensions.
By injecting printouts into the "handle glk event rule" I have zeroed in on these lines in Glulx Entry Points as the point where processing of the hyperlink seems to stop:
if the outcome of the rulebook is the replace player input outcome:
decide on GEP internal input replacement;
if the outcome of the rulebook is the require input to continue outcome:
decide on GEP internal input continuation;
The original:
if the outcome of the rulebook is the replace player input outcome:
decide on input replacement;
if the outcome of the rulebook is the require input to continue outcome:
decide on input continuation;
EDIT: I seem to have confirmed that the outcome of the handle glk rulebook is not a success with either version.
from extensions.
Upon further inspection, it appears that the "the handle glk event rule" is never invoked by the latest version of the extension, because the HandleGlkEvent
which previously called it was replaced by a new handler in Danni Willis' Glk Events.
By extension, the following lines are never run:
follow the input-cancelling rules;
follow the command-showing rules;
follow the command-pasting rules;
This apparently breaks Glulx Entry Points' ability to inject or replace player commands. I'm inclined to call this a bug in Glulx Entry Points.
from extensions.
It's very possible there are a ton of bugs - the state of affairs for hyperlinks in I7 is really poor. Sorry. I'm not sure if I'll have the time to look into this any time soon.
There are other hyperlink extensions. I'm not sure which is the most up to date.
from extensions.
It seems like repairing the "glulx replacement command" function in Glulx Entry Points might do a lot for the hyperlink situation. :)
I'm tinkering to see if I can work out how to restore functionality to the Handle Glk Event Rule. There are two problems with this:
- Both the Handle Glk Event Rule and the Glk Events extensions invoke the
glulx input handling rules
. They should probably operate on different rulebooks to avoid , but using a new rulebook in GEP would break compatibility with existing extensions (ie, broken extensions would stay broken until updated). - I'm not sure how to replicate the return value from HandleGlkEvent with Glk Events. I think its only effect is to either end or continue the current turn.
As a compromise on the first issue, I've implemented a small addition to GEP that patches the two handlers together and restores the command-pasting part of the hyperlinks feature:
GEP internal recursion flag is a number that varies. GEP internal recursion flag is initially 0.
A glulx input handling rule (this is the glulx input shim rule):
If GEP internal recursion flag is 1:
make no decision;
say "(IH0)";
Now GEP internal recursion flag is 1;
Let handler result be the value returned by glk event handling;
Now GEP internal recursion flag is 0;
Rule fails.
The glulx input shim rule is listed first in the glulx input handling rules.
...But I'm still trying to figure out how I can respect the handler result and actually submit the pasted command.
from extensions.
Here's a rather crude modification that restores the broken functionality without introducing a new rulebook. With these changes Inline Hyperlinks works again, although there are probably other better ways to fix things.
My changes are purely additions:
GEP internal recursion flag is a number that varies. GEP internal recursion flag is initially 0.
Stashed glk result is a number that varies. Stashed glk result is initially 0.
A glulx input handling rule (this is the glulx input shim rule):
If GEP internal recursion flag is 1:
make no decision;
Now GEP internal recursion flag is 1;
Now stashed glk result is the value returned by glk event handling;
Now GEP internal recursion flag is 0;
Rule succeeds.
The glulx input shim rule is listed first in the glulx input handling rules.
To decide what number is the value returned by glk event result recalling (this is the unstash glk event rule):
decide on stashed glk result.
Include (-
[ HandleGlkEvent ev context abortres newcmd cmdlen i ;
for (i=0:i<3:i++) evGlobal-->i = ev-->i;
(+ library input context +) = context;
return (+ value returned by glk event result recalling +) ;
];
-) before "Glulx.i6t".
Essentially what we're doing here is intercepting Glk Events' invocation of the input handling rules so we can dispatch Glulx Entry Points' own with additional logic... collecting the result... and later returning that result from HandleGlkEvent (which allows us to submit commands).
from extensions.
The command-replacement functionality in Glulx Entry Points is broken. Use this extension instead.
from extensions.
The command-replacement functionality in Glulx Entry Points is broken. Use this extension instead.
Thanks, I'll give that a try! That said, I think I've worked out how to repair Glulx Entry Points and I'll be making a PR shortly.
I notice far more extensions rely on Glulx Entry Points than rely directly on Glk Input Handling... But I think there's a (tidy, robust) way to fix GEP without breaking compatibility with anything.
from extensions.
Related Issues (20)
- Aaron Reedβs Smarter Parser has an infinite loop
- Request for Aaron Reed's Remembering HOT 1
- GEP/FW: investigate rearrange events HOT 2
- Menus bug: true and false hidden-row entries treated alike HOT 1
- Objects Matching Snippets is broken, and I have some unbroken code HOT 7
- Glulx Input Loops by Erik Temple doesn't compile under 6M62 HOT 1
- Simple Graphical Window: Public Library version has documentation error HOT 5
- Threaded Conversation by Chris Conley gives wrong parser errors in 6M62 HOT 6
- Version 12 of Tailored Room Description error HOT 3
- Destinations can't start with a number in Transit System extension HOT 5
- Licence of the extensions HOT 8
- Consolidated Multiple Actions by John Clemens doesn't compile
- "Glulx Real Time" needs updating for 6M62
- FW: Fix the acting main window on restart
- Approaches by Emily Short doesn't document "hurrying" HOT 1
- Undo Output Control by Erik Temple steps on #undef from 6.3.3 compiler HOT 3
- bug in can't eat other people's food rule when including Rideable Vehicles HOT 3
- Repository reorganization for multiple Inform versions HOT 22
- Set up automated testing for 9.3/10.1 branches HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from extensions.