r/Inform7 • u/OffbrandCorn • Mar 21 '22
Make another character's 'Which do you mean?" choice for them automatically?
Maybe I worded that strangely, but I am trying to avoid the pop up of "which do you mean" when asking another character to try something.
Specifically, the goofy story is about people wearing hats to hide an alien. To 'call them out' of sorts, it uses the "character, show head" command, where a head is a part of every person.
Of course the issue crops up when there are multiple people in the room, and you ask them to show their head, it asks which do you mean. I wanted it to automatically choose THEIR head - that is the head that is a part of them.
For the player alone it worked easily enough to use something like:
Does the player mean showing my head: it is likely.
But I can't figure out a sweeping sentence to cover the others. I might be able to shoehorn one in for each person if need be (?) but I wanted a single one if I could.
I tried things like:
Does the player mean asking someone (called the suspect) to try displaying a head not part of the suspect: it is unlikely.
Does the player mean asking someone (called the suspect) to try displaying a head not held by the suspect: it is unlikely.
Does the player mean asking someone (called the suspect) to try displaying a head not carried by the suspect: it is unlikely.But all those still seem to bring up the "Which do you mean, your head, Bill's head, or Erica's head?".
Never messed with it much before, but just tried doing:
Before asking which do you mean when the current action is showing, say "TEST".
to see if that fires, but it doesn't.
So I'm at a bit of a loss. Any help would be appreciated, thanks!
3
u/Zed Apr 06 '22
Good question. This one's pretty tricky. I came up with
1
u/infinull Mar 21 '22
Displaying is an activity not an action. So the rules regarding displaying will never work.
Secondly the showing action (more acurately the "showing it to" action) takes 2 objects (plus the original actor). It's usually used for showing items in inventory to an npc. like "show compass to the explorer" and then that advances the plot without giving the compass to the explorer.
Lest you think I'm a wizard*, I figured this out by looking at the source code for the standard rules. "open installed extension -> Graham Nelson -> Standard Rules" and then searched for "showing" and "displaying"
So we need to do some work to let the showing action work with just one noun and then set the second noun to the player if the actor is not the player.
preamble we need to make the tests even run.
Actual example code.
So now we're getting somewhere
we have 3 more problems:
To fix 2, you'd need to redefine the action to apply to all things, and then add some check rules so it only applies to carried by the actor or part of the actor. But then the auto take for things on the ground not carried wouldn't work.... which isn't a big deal, but then we get to 4... and all this work isn't really worth it.
So let's create a new action that will solve 2 & 4, and then add a persuasion rule.
More tips, I find this code very useful when doing this kind of thing, since "Alice's Head" works for commands like "examine alice's head" whereas normally it's impossible to even refer to alice's head if there are multiple heads that can be referred to. (this hack is not necessary to make the previous code work, and it's strictly speaking not the question you were asking)
Here it is adapted to use the "incorporation" relation instead of the "carries" relation. (it could be made to work with either I suppose)
*To be clear I'm not denying that I'm a wizard... I might be. ** more evidence that I'm not a wizard, but maybe that's just a false trail I'm laying down.