I think the hard, I7 programming paradigm answer is: Don’t try (actually trying anyway considered after some context)
I7 wants to parse a full command every turn, and it wants to consider all of the world model that’s exposed to the player on that turn as it does this.
It’s really only got one built-in mechanism to make doing anything else easy, and that’s “If the player consents” – which makes it easy to ask a yes or no question, have irrelevant input culled, and then allow the author to react. This is why writing or negotiating with extensions to produce discrete choice menus in I7 is traditionally a chore at least. I’ve discussed this topic before a few times so I’ll just link to my most recent incidence of it as of me typing this: Recommendations for learning about menu based dialogue systems - #11 by severedhand
… So if you want to try presenting a ‘Skirt or shorts?’ type question anyway, there is no best practice, only what will work best in your context.
Doing it the way Sabine has done, by changing the command prompt and using ‘After reading a command’… has the huge advantage of allowing you to screen out the rest of the world model and unwanted commands by adding a few pieces of rejecting code to the routine. So if you have only a few incidences of this in your program, this could be a good way to go.
If you want to build a system, it’s probably not. Maybe then you could go to Hybrid Choices or similar extension, which would present a list of alternatives that you could construct. It’s most people’s go-to for presenting options, though I have this real bee in my bonnet about the world model being exposed and the turn loop continuing when I want to ask closed questions, so it has never vibed with me.
Another way, alluded to in my post that I linked to, and which I’m personally fond of ,is using the ‘hacky keypress’ method. (Btw, I just coined this term ‘hacky keypress’. It’s not really any more or less hacky than Sabine’s method.) Really, this is presenting a list of options and asking the player to choose one by pressing a number or letter key. Again, a titanic advantage of this method is that it cuts out all the world model and unwanted commands. The program literally stops and waits for a keypress, and you can send it straight back into the wait if it doesn’t get one you asked for. It also allows you to act on the response mid-turn, which Sabine’s method does not. It is easier to program than Hybrid Choices, and could be made into a system. But, you have to be happy with the game going to ‘taking a keypress’ mode for a moment. If for any reasons you want the player to always respond by typing a command and pressing ENTER, then you wouldn’t want to use the ‘hacky keypress’ method, and maybe Hybrid Choices would be more your style.
So to triage… I would try to avoid entering situation where you need to ask player a non yes or no question in the first place by programming in the parser. You know, in Sabine’s example (except that hers may be for a cheat/help command, but forget that for a moment) the player could just type ‘wear skirt’ to wear the skirt and ‘wear shorts’ to wear the shorts. If we allow ‘get dressed’, I’d prioritise whichever of the two items was available, and if both are, I’d cheat by always favouring one over the other for an in-character reason I’d present: “The shorts will be more practical for what I’m doing today.”
Next stage of triage is, exploit the ‘If the player consents’ mechanism if you can, because it’s built-in.
Next stage is, settle on a workaround or workarounds. Changing the prompt and using ‘After reading a command’, or using an extension that creates choices, or using the hacky keypress method, or doing something else I haven’t thought of right now.
-Wade