Menus by Wade Clarke

This topic is for discussions related to Menus by Wade Clarke.

Menus is up to version 4 and is in the Inform public library. See this blog post for details:

importantastrolab.blogspot.com.a ā€¦ menus.html

-Wade

Thereā€™s an erroneous colon on line 1073 of Menus that causes it not to compile on Inform 6M62.

otherwise: [Preference must be 'main' or 'off']:

Ha! Thanks ian.

It figuresā€¦ the very first thing I discovered when I ran 6M62 was that it would no longer tolerate two colons in a row. Not that I set out to arrange colons like that, but it must be a common low-level blunder I make. Iā€™ll fix it up.

-Wade

OK, version 5 of Menus is out now and in the public library. It requires 6M62.

Basic Help Menu 4 goes with it and is also in the library

For more details, read my blog post: importantastrolab.blogspot.com.a ā€¦ 4-for.html

but for the most details, download the extensions and examine their docs.

-Wade

If you foolishly fail to set the mn_master_table variable, the interpreter violently explodes. Hereā€™s Gitā€™s output:

*** Run-time problem P21: Attempt to look up a non-existent correspondence in the table ā€˜table
of pagey menusā€™.

*** fatal error: Out-of-bounds memory access ***

If you launch a pre-version 5 project and donā€™t set the new variable as per the upgrade instruction in the docs (when play begins: now mn_master_table is the table of help contents), youā€™ll get what you got.

People starting a new project in version 5 donā€™t have to do any remembering because it has a default value thatā€™s compatible with the vanilla extension.

-Wade

I hope this topic is still active. I am still a bit novice to Inform, but have inserted menus, great feature. But players complain that the menu erases the history, they canā€™t scroll back, even if I skip ā€˜clear the screenā€™.

Is there any way to preserve or even play back the history when using menus?

Hi David. Iā€¦ think there is, from memory! Itā€™s been so long since anyone used my extension now. I feel like thereā€™s an option you can set that will prevent it clearing the screen. I will have a look myself, too.

-Wade

1 Like

Right, so thereā€™s no option for that built-in, but I found I was able to make it happen very easily by changing two lines in the extension.

Iā€™ve attached to this post a version of the extension that never clears the screen. The only other thing you may have to do isā€¦ if you are entering the menus in your game with the suggested bit of code from the extension docs:

Carry out asking for help:
	carry out the displaying activity;
	clear the screen;
	try looking;

ā€¦ just delete the ā€˜clear the screenā€™ line.

I tested the edited extension and removing that ā€˜clear the screenā€™ line from Carry out asking for help using the demo project, Robot Retrievers, and it worked. Let me know if it works for you in your project.
Menus.i7x (124.9 KB)
-Wade

2 Likes

OK, I will try that. I have been using the Emily Short version and will switch over. There are some setup details I have to change.

Thank you very much for the help. I saw the ā€˜clear the screenā€™ in the code, is it just a matter of omitting that one line?

It mostly works, thank you. Just a couple of glitches in the web version.

  • Directions for returning to menu and exiting donā€™t show up in the browser (not really a problem, I can patch them in)
  • Exiting the menu works first time, but not after selecting one of the choices (does this have something to do with only having a single menu not a menu of menus?). After selecting an item and seeing the description, I can ESC or Q back to the menu, but then cannot exit the menu.
  • *** Run-time problem P23: Attempt to look up a non-existent entry at column 6, row 3 of the table ā€˜Table of DiscovMenuā€™.

The middle problem is not present in the original Menus.i7x with browser, though the instructions are absent in the browser in both versions.

That last error shows up also in the Inform IDE, and I assume is because I build the menu on-the-fly using this structure:

Table of DiscovMenu
title subtable description toggle used bookpage localpage
ā€œblahā€ ā€“ ā€œblahā€ ā€“
ā€œblahā€ ā€“ ā€œblahā€ ā€“
with 10
blank rows

It errors the first time visiting the third row, one that was initially blank. I leave them blank because I donā€™t know ahead of time how many items will be in the menu. Blank rows are not displayed, but ā€œā€ rows are.

In case it is relevant, I am using Vorple.

NOTE: I fixed the P23 problem by adding these before using the previously blank row:
now used entry is 0;
now bookpage entry is 0;
now localpage entry is 0;

Oops, sorry for the lack of replies. I replied two messages ago but did so from the ā€˜reply by emailā€™ function (for the first time ever) - and it failed, about which failure I was just today informed. Let me know if youā€™re still having trouble and Iā€™ll try and help if you are.

-Wade

Not a problem, we are all busy and I was not held up.

I still cannot get past the middle problem. That is, after I select any item, then exit that selection, then input is frozen, no keys have any effect. I think the console still prints the elapsed time, but nothing happens.

Problem is browser only, no problem in Inform IDE.

If I exit the menu before any selection, that works. I assumed it was something with the stack pointer, and I tried a few bypasses, but I did not succeed. I did not dive too deeply into the code but found a different way to do what I needed.

Glad to hear you got through it.

Thatā€™s weird there is a browser-only problem. I might try to reproduce it.

-Wade