I have a group of characters who are sketchily implemented in one part of my map. I want attempts to interact with them to be rejected with the same custom message. So far, I have:
A party-goer is a kind of person. The Party Pad is a room. Samir is a male party-goer in the Party Pad. Alice is a female party-goer in the Party Pad
Instead of asking a party-goer about something: say “These are Juan’s friends, not yours. They’re elegant and graceful, witty and articulate. Your basic timidity about your squat podginess prevents you from introducing yourself.”
So far so good, but I can’t figure out how to redirect another action to the ASK action. I must have tried nearly a dozen variations on this:
Instead of telling a party-goer about something (called the theme): try asking the party-goer about the theme.
A quick Google search hasn’t turned anything up, and I can’t find anything quickly in either of the built-in manuals or in Aaron Reed’s Creating Interactive Fiction with Inform 7. Can anyone point me in the right direction, please?
Instead of telling someone who is a party-goer about something: try asking the noun about it.
A slightly better way of doing it might be :
Check telling someone who is a party-goer about something: try asking the noun about it instead.
n.b. There may be more elegant ways of doing this!! Later edit :
Just playing around with this. I’m genuinely curious as to why the following doesn’t work
Instead of telling someone (called the askee) who is a party-goer about something (called the askthing): try asking the askee about the askthing instead.
It really doesn’t like that second substitution. I’m seeing this in the documentation as an example :
Rule for writing a paragraph about a person (called the target) who wears a hat (called attire):
So it looks like double subs are ok. Is this a special case?
The main issue here is that what you’re asking/telling about isn’t a thing or even an object but a snippet of the player’s command, called “the topic understood.”* See §17.5 of Writing with Inform. I don’t think you can give a temporary variable name to the snippet using “(called…)” [EDIT: this was incorrect; see zarf’s comment below], but it’s OK–you can just use “the topic understood.”:
Instead of telling a party-goer (called the guest) about something: try asking the guest about the topic understood.
Or, as Ade said, “it” works here too. (I’m never quite sure where “it” works, and it’s hard to look up in the documentation! So I go with “the topic understood.”
And as Ade pointed out kind of implicitly, if you don’t want to create a temp variable name for the person you’re talking to, you can use “the noun” which refers to the first object that the action applies to. When you use “the party-goer” inform doesn’t know which party-goer you mean.
*Snippets aren’t actually topics and this can get confusing if you get too deep into it. Fortunately, “The topic understood” is pretty much the only snippet you’re likely to need to worry about, except that “the player’s command” is technically a snippet, so you can just use those names whenever you need them.
FWIW, snippets are represented internally as a number, which encodes the word of the command where it starts (in the hundreds place I think) and how many words it comprises–so they’re very different from text variables.
Ah! That makes sense - of course. I think the confusion arose for me from the actual referral in the original command : Instead of… about something. It’s that ‘something’ that implies it’s a thing - not a topic. This is a little confusing in Inform, as you said matt. I would have considered :
Instead of telling someone (called the askee) about something: try asking the askee about it.
Instead of telling someone (called the askee) about a topic: try asking the askee about it.
to be 2 different things - with the first checking against an object in scope, and the second treating the second part of the player’s command as a snippet. The fat that the first is still ‘topic understood’ surprises me!
Interesting! Thanks, Matt.
That works! Every time I think I’m getting a handle on Inform syntax, my normal English syntax creeps back in and drags me away from the space in my head where I’m trying to cram Inform syntax in alongside Python and LISP and Pascal syntax.
Thank you both. Back to writing.
That’s a very typical thing that happens about mid-way through learning Inform 7. You’re past “oh this is so easy I can do anything” to “how does anyone ever accomplish this?” Next up is “Oh, this is so easy, I can do anything! (with caveats)”
If there were only a compact syntax reference somewhere! The Phrasebook and the other parts of the Index are helpful, but I kind of just want a list of all possible syntactical constructions.
People ask for this regularly, but I don’t think it would look like what you want.
In this case, you had the syntax right! What you got wrong was the type of the second argument of the telling action. You wrote “something” (“a thing”) rather than “a topic”.
This would also have worked:
Instead of telling someone (called the askee) about a topic (called the askthing):
try asking the askee about the askthing instead.
Ah! That was the syntax I was actually fumbling for. Of course, thinking about the parameters in terms of types is what I was failing to do.
Thank you, zarf.
So basically, it’s OK to say “Instead of telling someone about something” because Inform allows a bare “something” to stand in for any value.
But it’s not OK to say “Instead of telling someone about something (called the askthing)” because when you have “something (called foo)” Inform really expects a thing (or object?), and in order to assign a temporary variable in the rule header you do need to match the right type.
Have I got that right?
That’s what it looks like. I suspect the use of bare “something” is a special case in the compiler code.