[I7]Conversation Options

I’m pretty new to inform7 and interactive fiction in general. I’ve played text based games but never made one myself and now I’m doing one for a school project. I’ve read much of the included documentation but I’m running into a snag. I’m trying to find a way in which the player chooses a specific action related to speech (confident, nervous, silence in this instance) and then the game responds according leading the player down that Skein. Here’s the code I have so far:

“Your response is:
NERVOUS,
CONFIDENT,
or SILENCE.”

North of The Police Station is a room called The Interrogation Room.

[Player choose an action. Dialogue progresses based on player choice.]

Understand the command “nervous”.Understand the command “confident”. Understand the command “silence”.

if the player writes nervous:
say “Your head is pouding and your mouth is dry. ‘I-I’m here to-uh.’ The officer looks up at you, quinting and fixing his glasses. ‘Question Mr. Gaines. Detective Lasky, right?’ ‘R-right’, you sttuter in reply. ‘Go right ahead.’”

It resolves in error and I know I have the code wrong I just haven’t figure out how to fix it. Any help with this is must appreciated.

You should probably try some conversation extension, e.g. Simple Chat by Mark Tilford. You can find it and several others at the Inform 7 site on this page: http://inform7.com/extensions/npc/#Saying_Complicated_Things

First, you can’t just tell I7 to understand some text: you have to tell it to understand it as something: generally, as a thing or an action.

So you could make ‘nervous’ into an action in its own right:

[code]Nervousing is an action applying to nothing. Understand “nervous” as nervousing.

Instead of nervousing: say “You squirm a bit, but there’s really nothing to be nervous about here.”

The current question is a thing that varies.
Officer’s Question is a thing. null is a thing.

Instead of nervousing when the current question is Officer’s Question:
say “Your head is pouding and your mouth is dry. ‘I-I’m here to-uh.’ The officer looks up at you, quinting and fixing his glasses. ‘Question Mr. Gaines. Detective Lasky, right?’ ‘R-right’, you sttuter in reply. ‘Go right ahead.’”;
now the current question is null.[/code]
But that seems like overkill: you’d need to create a separate action for every option, and unless the PC frequently used the same few commands, this seems unnecessary. You might do better to make your conversation with a multiple-choice menu extension such as Simple Chat or Questions.

Did you post the same question twice? The question you ask here seems identical to the one posted here.

Yeah, I did that by accident actually. I didn’t realize new topics needed moderator approval and when the first one didn’t show up, I thought I made some error in posting it.

Thanks for the help. I’ve tried it so far with both extensions and I’m always getting an error. Here is what I have using the Questions extension:

[code]now current question is “Can I help you?”;
now current menu is {1, 2, 3};
ask an open question, in number mode;

A number question rule (this is the number question rule):
if the current question is “Can I help you?”:
if the number understood is 1:
say “Your head is pounding and your mouth is dry. ‘I-I’m here to-uh.’ The officer looks up at you, quinting and fixing his glasses. ‘Question Mr. Gaines. Detective Lasky, right?’ ‘R-right’, you stutter in reply. ‘Go right ahead.’”;
exit.[/code]

And I’m getting these errors:

Problem. You wrote ‘now current question is “Can I help you?”’ : but this seems to say that a thing is a value, like saying ‘the chair is 10’.


Problem. You wrote ‘now current menu is {1, 2, 3}’ : again, this seems to say that a thing is a value.


Problem. You wrote ‘ask an open question, in number mode’ : but I can’t find a verb here that I know how to deal with, so I am ignoring this sentence altogether. (I notice there’s a comma here, which is sometimes used to abbreviate rules which would normally be written with a colon - for instance, ‘Before taking: say “You draw breath.”’ can be abbreviated to ‘Before taking, say…’ - but that’s only allowed for Before, Instead and After rules. I mention all this in case you meant this sentence as a rule in some rulebook, but used a comma where there should have been a colon ‘:’?

I’ve been milling over this for hours and hours reading every bit of documentation and example. I hate to admit I’m dense but that seems to be the case and I’m having a really hard time fixing these problems.

You need to provide some context, otherwise Inform doesn’t know when exactly that should happen. You need a rule that tells what should trigger the question, for example:

After going to the interrogation room for the first time: now the current question is "Can I help you?"; now current menu is {1, 2, 3}; ask an open question, in number mode.

Well, this is my answer from the other post.

One way you could do it is like this.

[code]“Test”

Include Reactable Quips by Michael Martin.

The Police Station is A Room. The Interrogation Room is north of The Police Station.

Yourself can be nervous, confident, silent or neutral. Yourself is neutral.

After looking in the interrogation room: deliver the officer talk quip.

Table of Quip Texts (continued)
quip quiptext
Officer Talk “The office leads you into the interrogation room. How are you feeling?”
Feel Silent “The officer looks up at you, quinting and fixing his glasses. ‘Question Mr. Gaines. Detective Lasky, right?’. You say nothing.”
Feel Nervous “Your head is pounding and your mouth is dry. ‘I-I’m here to-uh.’ The officer looks up at you, quinting and fixing his glasses. ‘Question Mr. Gaines. Detective Lasky, right?’ ‘R-right’, you stutter in reply. ‘Go right ahead.’”
Feel Confident “Your head is pounding and your mouth is dry. The officer looks up at you, quinting and fixing his glasses. ‘Question Mr. Gaines. Detective Lasky, right?’ ‘Indeed I am. Go right ahead.’, you reply confidently.”

Table of Quip Followups (continued)
quip option result
Officer Talk “Silent” Feel Silent
Officer Talk “Nervous” Feel Nervous
Officer Talk “Confident” Feel Confident

After quipping when the current quip is feel silent: now the player is silent.

After quipping when the current quip is feel nervous: now the player is nervous.

After quipping when the current quip is feel confident: now the player is confident.[/code]

It involves using the “Reactable Quips by Michael Martin” extension, which you can find here.

Also you can automatically move a player from one room to another by using one of these two.

move the player to (the name of the room);
now the player is in (the name of the room);

Hope this helps.

So I tried this with The Police Station and I got this error concerning the second line:

I really don’t get it. Current question isn’t supposed to have any conditions. Anything put between the brackets is supposed to be a menu item for the player to chose, and then one the player chooses it the next piece of fiction is presented. Sort of like the conversation wheels in games like Mass Effect, just in text.

It’s a simple enough concept, I just don’t understand how syntax works for any of it, apparently.

You’re misreading the documentation, I’m afraid.

First of all, the syntax is “now the current question menu is { … }” (note the word “question”). Secondly, the items inside the brackets are supposed to be the text of the options, not the numbers. The extension does the numbering automatically. Finally, you don’t want number mode – that means that the player can enter any number, not just one of the options. It’s meant for things like asking for an age or a pin code. You want menu mode instead, which numbers the options. So:

After going to the police station for the first time:
    now the current question is "Can I help you?";
    now current question menu is {"Yes", "No", "Maybe"};
    ask an open question, in menu mode.

Thanks for the help. But it seems once I change one thing. Something else goes wrong. I’ve been spending the entire day (since 11am) trying to fix things on my own but I keep running into snags and I don’t really understand why. As you said, I’m probably misreading the documentation but I’m following the example code pretty much exactly the way its written, so I don’t know what else to do.

After I did what you advised, the game runs. But when I type something, I7 doesn’t understand anything. I changed the code below to match the code you gave.

A menu question rule (this is the menu rule): if the current question is "Can I help you?": if the text understood is nervous: say "Your head is pounding and your mouth is dry. 'I-I'm here to-uh.' The officer looks up at you, quinting and fixing his glasses. 'Question Mr. Gaines. Detective Lasky, right?' 'R-right', you stutter in reply. 'Go right ahead.'"; exit.

Now, if I understand this correctly, the player should be able to chose one of the three options I give them, and then the next piece of dialogue behind “say” should appear. The only ting I can think of so far is maybe switching it to a text question. This is the error that I get:

Again, the same error as before, just in a different place. I don’t really understand what’s being said here but there ought to be no condition after the if statement. It should just move on to the next line.

The “condition” in the error refers to what you’re testing with the if statement. Basically it’s saying that it doesn’t understand the if statement. For example, in the phrase “if the turn count is 10”, the “turn count is 10” is a condition which the if statement tests. In this case the compiler tries to make sense of “the text understood is nervous” which should be a condition whose truth value can be tested (the player replied “nervous” or they did not).

The problem here is that there is no “text understood”. The extension uses “current answer”. Also, the word “nervous” should be in quotes.

A menu question rule (this is the menu rule): if the current question is "Can I help you?": if the current answer is "nervous": say "Your head is pounding and your mouth is dry. 'I-I'm here to-uh.' The officer looks up at you, quinting and fixing his glasses. 'Question Mr. Gaines. Detective Lasky, right?' 'R-right', you stutter in reply. 'Go right ahead.'"; exit.

BUT if you still have the numbered menu, the player doesn’t type in their answers as text but chooses a number so you should use “number understood”. The extension doesn’t know (or care) which of the options represents nervousness, only which number the player chose.

A menu question rule (this is the menu rule): if the current question is "Can I help you?": if the number understood is 1: say "Your head is pounding and your mouth is dry. 'I-I'm here to-uh.' The officer looks up at you, quinting and fixing his glasses. 'Question Mr. Gaines. Detective Lasky, right?' 'R-right', you stutter in reply. 'Go right ahead.'"; exit.

I know it must get frustrating but I just wanted to thank you for all your help again. I’m very new to I7 and I kinda feel dumb because I keep running into problem after problem. Once I fix one thing, another thing breaks. I spend all day trying to fix it and then I come here to complain about it not working. :frowning:

This is the code I have so far:

[code]Include questions by Michael Callaghan.

The Police Station is a room. Officer is a man in The Police Station. "The smell of half-burnt cigarrettes and cheap coffee fills your nostrils as always and the dull roar of business as usual doesn’t even register in your mind. This job has taken it’s toll on you but a little sanity is a small sacrifice for money in your pocket and food on the table. An officer sits at the front desk, shuffling papers about. He clears his throat.
Your response is:

  1. NERVOUS|
  2. CONFIDENT|
  3. SILENCE."

After going to The Police Station for the first time:
now current question is “Can I help you?”;
now current question menu is {“nervous”, “confident”, “silence”};
ask an open question, in menu mode;

A menu question rule (this is the menu rule):
if the current question is “Can I help you?”:
if the current answer is “nervous”:
say “Your head is pounding and your mouth is dry. ‘I-I’m here to-uh.’ The officer looks up at you, squinting and fixing his glasses. ‘Question Mr. Gaines. Detective Lasky, right?’ ‘R-right’, you stutter in reply. ‘Go right ahead.’”;
exit.
[/code]

Now it’s telling me it doesn’t understand when I type nervous. Maybe I’m not typing correctly or something but I’ve tried it every way in the book and the game will not advance. I figure once I get this one question working then I’ll know how to do the rest because they follow the same format. I keep trying to get help from the examples but so far, following them has caused more problems.

The question never triggers because the player never goes to the Police Station: they start out there.

If you put an anteroom on the police station and make the player start there instead, it will work as intended. (But phrased that way it’ll prevent the player from looking around the room, so you would need to do it a bit differently than ‘after going to’.) Alternatively, you could make the question trigger when play begins: but that would put it up before the description of the first room. So you probably want ‘after looking for the first time’, since the player effectively tries LOOK the first turn that they’re in any room.

You also aren’t using the extension quite correctly. If you use it in menu mode, Questions expects the player to respond with a number. So you should either keep it in menu mode and change ‘the current answer’ to ‘if the number understood is 1’, or change ‘a menu question rule’ and ‘ask an open question, in menu mode’ to a text question rule and text mode.