Revisiting Menus

Now that I’ve finished Leadlight Gamma, I’ve installed the new Inform 7 and I’m looking to update my Menus extension, which I wrote for 6G60.

On Github, there’s a version that some people tweaked to get it to compile in 6L38, but it doesn’t actually work (I mean, it compiles, but it doesn’t run right anymore).

The example in the extension runs but the resultingmenu system is messed up. If I turn on my extension’s debug mode, the example has a fatal runtime crash while printing debug messages during startup, with a ‘Stack overflow in function call’ error.

This debug message is printed at the first moment the extension looks at a subtable in a table, which corresponds to the point beyond which the menu system is screwed up if you just run the example without debug mode.

The extension uses recursive code. IE There’s an action which can run itself while already running, up to 4 or 5 times, and backs out of incidences of running itself. So this seems to be failing in 6L38 the first time it tries to go beyond the top level, which wasn’t a problem in 6G60.

It could be a parlance incompatibility between versions or it could be a bug in 6L38. I’ve been trying to work out the problem but I figure someone who understands Inform more deeply may be able to spot the problem much faster.

If you’d like to have a look, the attached zip file has the inform project with the example from the extension, and my WIP of the 6L38 version of the extension.

Debug mode is turned on, so when you run the example with the extension installed, you’ll see the last message it prints before the crash, making it easy to find that message in the code and look around there. If you want to turn debug mode off, just delete the line ‘now mn_debug is 2’ from the head of the inform project.

Thanks much for any help.

-Wade
2files.zip (489 KB)

I haven’t looked at it, but did you fix the bug that the player cannot select a menu option labelled H due to it being a reserved letter?

I actually made it a joke in GROOVE BILLYGOAT.

I fixed that, plus I made Q the same as ESC. This is because mobile devices sometimes have no ESC key.

-Wade

Indeed they don’t. FYI, though, I pestered the iFrotz dev about this, and now three-fingered-tap counts as ESC in iFrotz. :slight_smile: