intfiction.org

The Interactive Fiction Community Forum
It is currently Sun Dec 16, 2018 2:13 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Sun Aug 12, 2018 6:12 pm 
Offline

Joined: Wed Nov 12, 2014 5:20 pm
Posts: 201
I finally fixed the bug I mentioned in my last post, by copying the primary input buffer into the secondary.

Now I've found a new thing to be annoyed about. When clicking the compass rose to enter a command, most interpreters will first print a line break before echoing the new command, like this:
Code:
> 
north
The temporary barrier is locked. We’d need to set the
code-lock to the right number.
rather than
Code:
> north
The temporary barrier is locked. We’d need to set the
code-lock to the right number.
This has always been the case on every interpreter except Zoom, which is what the Mac Inform IDE uses. But for some reason it hasn't really bothered me until now.

As far as I can tell, the Glk API specifies that there should be a line break printed when cancelling a line event, and the only way to avoid this is to turn off line input echo with glk_set_echo_line_event() if the interpreter supports it. So the only way to do what I want seems to be to turn off line input echo permanently at the start of the game and then write lots of code to "manually" echo all input except when clicking on a graphic link.

Am I right? Is there really no simpler way?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sun Aug 12, 2018 7:03 pm 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5839
That is the situation. If you don't want the interpreter to handle echoing, you have to handle it.

(Zoom is definitely wrong in its behavior, but it hasn't been updated since before I added the glk_set_echo_line_event feature.)

One possible workaround is to leave the echoing behavior as-is, but print a prompt before the synthetic command:

Code:
> 
> north
The temporary barrier is locked. We’d need to set the
code-lock to the right number.


There's an extra blank prompt line but at least the command isn't sitting there naked.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sun Aug 12, 2018 7:07 pm 
Offline
User avatar

Joined: Wed Oct 14, 2009 4:02 am
Posts: 2568
Could you call glk_set_echo_line_event just before canceling the event and then call it again afterwards? Or when the spec says all subsequent events does that mean it's too late?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sun Aug 12, 2018 7:16 pm 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5839
Yeah, it's too late. You're supposed to know what your plan before you request line input.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sun Aug 12, 2018 8:02 pm 
Offline

Joined: Wed Nov 12, 2014 5:20 pm
Posts: 201
Thanks! Actually it was easier than I feared to hack input echo into VM_ReadKeyboard(), though it remains to be seen what subtle bugs it causes.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon Aug 13, 2018 9:10 am 
Offline

Joined: Wed Nov 12, 2014 5:20 pm
Posts: 201
Actually, Spatterlight seems to behave like Zoom in this respect.

I pushed the new input echo suppression code. You'd think it would break something, but it seems to work fine so far.

Now we just have to make CM run on those new Emglken interpreters in Lectrote.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon Aug 13, 2018 10:15 am 
Offline
User avatar

Joined: Wed Oct 14, 2009 4:02 am
Posts: 2568
Does it not run in Lectrote? It should!

Btw, I never really got around to figuring out how to profile CM. But now I want to so that I can see which of Lectrote's Glulx terps is fastest.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon Aug 13, 2018 11:01 am 
Offline

Joined: Wed Nov 12, 2014 5:20 pm
Posts: 201
Git will show a *** fatal error: Out-of-bounds memory access *** at startup. Glulxe will just show an eternal spinning "Loading…" compass.

Well, we wrote that code that shows the total play time at the end if there is a "testing" file present. I guess that would work if we can make the game actually run.

Edit: I can make it start on Git if I disable Startup Precomputation. But it won't register pressing the enter key when trying to answer the initial question.


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group