Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Glulx Real Time" needs updating for 6M62 #68

Open
LeopoldTal opened this issue Apr 17, 2021 · 0 comments
Open

"Glulx Real Time" needs updating for 6M62 #68

LeopoldTal opened this issue Apr 17, 2021 · 0 comments

Comments

@LeopoldTal
Copy link

LeopoldTal commented Apr 17, 2021

Current build failure

The extension "Glulx Real Time" by Erik Temple does not compile on 6M62. The culprit is these lines

if the current glk event is glk-initiated:
	event-outcome be glk event handled in null-event context;[Handles the event; we'll just ignore the outcome since it doesn't stem from player input.]

which are repeated in the chapters "Delaying input until all timers end" and "Delaying input until just one timer has ended".

The goal of these lines is to handle an event and throw away the result. But Inform 6M62 does not like unread variables:

You wrote 'let event-outcome be glk event handled in null-event context' , but when a temporary value is created inside an 'if ..., ...' or an 'otherwise ...', it only lasts until that line is complete - which means it can never be used for anything, because it goes away as soon as created. To make something more durable, create it before the 'if' or 'otherwise'.

I have an ugly fix, but it's probably possible to do better:

@@ -161,6 +161,9 @@ Definition: A g-event is glk-initiated if it is timer-event or it is sound-notif
 To decide what number is glk event handled in (ev - a g-event) context:
        (- HandleGlkEvent(gg_event, {ev}, gg_arguments) -)
 
+To ignore (event-outcome - a number):
+       do nothing.
+
 
 Chapter - Delaying input until all timers end
 
@@ -172,6 +175,7 @@ To delay input until all timers are complete:
                wait for glk input;
                if the current glk event is glk-initiated:
                        let event-outcome be glk event handled in null-event context;[Handles the event; we'll just ignore the outcome since it doesn't stem from player input.]
+                       ignore event-outcome.
                        
 
 Chapter - Delaying input until just one timer has ended
@@ -184,6 +188,7 @@ To delay input until (chron - a virtual timer) is complete:
                wait for glk input;
                if the current glk event is glk-initiated:
                        let event-outcome be glk event handled in null-event context;[Handles the event; we'll just ignore the outcome since it doesn't stem from player input.]
+                       ignore event-outcome.

Updates in dependencies

"Glulx Real Time" depends on "Glulx Entry Points" by Emily Short, which has been updated many times since the latest version of "Glulx Real Time".

I don't really understand the changes, and most of them seem to be simply moving functionality to the dependencies. Could someone take a look and see if "Glulx Real Time" should be changed in response?

"Glulx Real Time" also requires "Basic Screen Effects" by Emily Short, because it uses wait for any key and wait for the SPACE key. However, it does not include it, instead relying on the user to do so. Is that intentional?

I've cross-posted this issue to the IntFiction forum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants