Inform 6: can't start off with a menu

I’m using Inform 6, and am using a menu (namely, the altmenu object-based menu extension) to start the game off. This menu is used to change assorted options and variables before the game, as well as just to look snazzy. Calling the menu’s .select() in the Initialise routine doesn’t work too well, though; upon exiting the menu and starting the game proper, the library prints out an error message (10 (0, 0), the player-object is outside the object tree) and refuses to print any introductory text. The game carries on as normal from there. I’ve tried a thousand different ways of fixing this but absolutely nothing works, mostly trying different ways of plopping the player in the first room before the menu is selected. I’ve seen other I6 games that start with a menu, so I’m wondering, how exactly do I pull it off?

I haven’t tried that extension, but a cheap way around the problem might be to launch the menu during the first Look action rather than the Initialise routine.

Well, I tried various versions of that, but they all led to assorted weird results for me (like the player not ever being able to leave the menu, for whatever reason). However, I just instead decided to do a title screen that reads keystrokes, which performs essentially the same funcion. So, close enough, but the bug still strikes me as weird.

By the way, this is a totally unrelated question, sorry, but I don’t want to litter this forum with dozens of Inform 6 problems of mine and this one’s been bugging me for a week. Is there a way to get around the limitation where the parser only reads the first several characters of an object’s name? I’m trying to rig up a way for the player to call certain npcs by assigning them phone numbers as referrable-to names, which didn’t end up working (almost all phone numbers are the same to it because it gets as far as the 555-). The DM4 segment about parsing phone numbers doesn’t make it clear how/if the PhoneNumber token used as an example can be used to refer to an object in some way.

There are a couple of ways to work around that.

To do it in general – that is, have the phone number always be a synonym for the object: you’d run through the input buffer early (BeforeParsing) and replace any word that looks like a phone number with a distinctive word that refers to the player.

If you’re just doing this for a “call/telephone” verb, the phone number example (example 87) is probably what you want. The DialPhoneSub function would find the associated player and then invoke a different action, something like <>.

I tried BeforeParsing, but that just ran into the same issue, which is that it only pays attention to the first few letters. The DM4 DialPhoneSub example is definitely what I’m looking for, and I’ve been trying what you’re talking about (I already have a “call” verb), but I’m struggling with finding a way for the routine to associate a phone number with an npc. I can’t use PhoneNumber as a property on an object or anything; all it does is store the number to print back to the player, from what I’m seeing. “if (dialled_number (or PhoneNumber, or a few other things) == 3045551234)” (with or without any quotes around the phone number) doesn’t do anything for me either. I get the feeling that I’m missing something…probably obvious here.

BeforeParsing can pay attention to all the letters in each word in the input buffer. You have to go into the WordAddress() and WordLength() of each word, as ex87 does.

Keep the (few) meaningful phone numbers in an array somewhere, stored character-by-character. Compare the input buffer word against each. Once you recognize one, you can record which one it is, rather than trying to store the ten-character sequence (which is not worth the trouble).

Ah! I got it. I’d been checking the dialled_number->i against the phone number arrays’ ->i, instead of smaller chunks, which led to Inform telling me I’d broken the bounds of the array. Thank you very much, zarf, I’d been pulling my hair out over this.