Newbie help, please - conversation table... :(

I’m writing a very simple game, and it’s been going well (slow, but well). But I’m having trouble with a commentary table, and I’m just not sure what to do about it. I’ve been using the ‘complimentary peanuts’ example; the player has to have a conversation with Marlow. This is the code I’ve written:

[code]section - speech

Asking someone about something is speech.
Telling somebody about something is speech.
Answering someone that something is speech.
Asking for someone for something is speech.

Instead of speech when the noun is Marlow:
repeat through Table of Marlow’s commentary:
if the topic understood includes topic entry:
say “[commentary entry] [paragraph break]”;
rule succeeds;
say “Marlow just looks at you.”

Table of Marlow’s Commentary
topic commentary
“knew” “‘Intimacy grows quick out there,’ Marlow say. `I knew him as well as it is possible for one man to know another.’”
“admire” "‘He was a remarkable man,’ Marlow says, unsteadily. He seems to pause, looking at you, before he goes on. ‘It was impossible not to…’
“mother” “‘I hadn’t heard that his mother had died,’ Marlow says. ‘It must…it must have been very hard on you both.’”
“remember” “‘I will always remember him,’ says Marlow. ‘His words…the things he wrote…they will always remain.’”
“life/waste” “‘He…his end was in every way as…as worthy as his life.’ For a moment, Marlow looks as though he is angry.”
“hello/hi” “‘Hi,’ he says. He looks uncomfortable, but you want to hear what he has to say. ‘How have you been?’ he asks. ‘Lonely,’ you say. ‘I’ve been so…so lonely.’”[/code]

But this is the error I get:

It’s highlighting this section:

Instead of speech when the noun is Marlow: repeat through Table of Marlow's commentary: if the topic understood includes topic entry: say "[commentary entry] [paragraph break]";

Any help would be a huge…well, a huge help! :slight_smile:

Oops…figured it out. Sorry!

Hooray! Self-rescue is the best rescue.

Heh…I’m not quite rescued yet… :\ I’ve tackled an increment problem in another section (and fixed it, too, I think), but the conversation table is giving me all kinds of grief…

[code]section - speech

Asking someone about something is speech.
Telling somebody about something is speech.
Answering someone that something is speech.
Asking someone for something is speech.

Instead of speech when the noun is Marlow:
repeat through Table of Marlow’s Commentary:
if the topic understood includes topic entry, say “[commentary entry] [paragraph break]”;
rule succeeds;
say “Marlow just looks at you.”

Table of Marlow’s Commentary
topic commentary
“knew” “‘Intimacy grows quick out there,’ Marlow say. `I knew him as well as it is possible for one man to know another.’”

"admire"	"'He was a remarkable man,' Marlow says, unsteadily. He seems to pause, looking at you, before he goes on. 'It was impossible not to...'"

"mother"	"'I hadn't heard that his mother had died,' Marlow says. 'It must...it must have been very hard on you both.'"

"remember"	"'I will always remember him,' says Marlow. 'His words...the things he wrote...they will always remain.'"

"life/waste"	"'He...his end was in every way as...as worthy as his life.' For a moment, Marlow looks as though he is angry."

"hello/hi"	"'Hi,' he says. He looks uncomfortable, but you want to hear what he has to say. 'How have you been?' he asks. 'Lonely,' you say. 'I've been so...so lonely.'"

[/code]

Is there a special indent thing I need to be doing here? The error I get is

I think that the extra hard returns you put in to break up the table are the culprit.

Should I be using tabs instead of hard returns? Or is there a break function?

The samples make it look like the table has to be all neat and tidy, like this:

[code]Table of Marlow’s Commentary
topic commentary
“knew” “‘Intimacy grows quick out there,’ Marlow says.
`I knew him as well as it is possible
for one man to know another.’”

"admire"	"'He was a remarkable man,' Marlow 
			says, unsteadily. He seems to pause, 
			looking at you, before he goes on. 
			'It was impossible not to...'"

"mother"	"'I hadn't heard that his mother had died,' 
			Marlow says. 'It must...it must have 
			been very hard on you.'"

"remember"	"'I will always remember him,' says Marlow. 
			'His words...the things he wrote...
			they will always remain.'"

"life/waste"	"'He...his end was in every way 
			as...as worthy as his life.' 
			For a moment, Marlow looks as 
			though he is angry."

"hello/hi"	"'Hi,' he says. He looks uncomfortable, 
			but you want to hear what he has to say. 
			'How have you been?' he asks.[paragraph break]
			'Lonely,' you say. 'I've been so...so lonely.'"[/code]

But that’s full of hard returns.

Oh…wait…I see what you mean. Thank you!

(learning Inform 7 is maddening. Delightful, but maddening!) Thank you for the help!

Erm…but now that increment thing (is it an array?) is doing a number on me.

[code]Marlow has a number called guilt. The guilt of Marlow is 0.

Every turn:
increment the guilt of Marlow.
if the guilt of Marlow is 2 and Marlow is visible, say “He looks uncomfortable.”;
if the guilt of Marlow is 3 and Marlow is visible, say “Marlow looks past you, out the window. Looks at the coffee table. Looks around the room.”;
if the guilt of Marlow is 4 and Marlow is visible, say “He doesn’t sigh. He doesn’t try to excuse himself. You talk and you talk, and you find that you can’t stop talking. You tell him about Phil’s mother dying. You tell him how your parents didn’t think he was good enough for you. How you both planned for a future together. Bought the house together, though Phil put it in your name before he left for Africa. How he hadn’t planned to go overseas, but when the opportunity came, it was just too good to pass up. ‘We knew he’d be promoted if he went,’ you say. ‘He was going to go as far as he could…he talked about running for office…he would have gone far. I know he would have.’ Marlow just looks you, weakly.”;
if the guilt of Marlow is 10 and Marlow is visible, say “‘I just…I just want to ask you something,’ you say.[paragraph break] Marlow looks at you, and you can see his expression change. He knows what you’re going to ask. He looks at you again, and he looks as though he wants to say something.[paragraph break] You wait. [paragraph break]Finally, he looks at his hands, and takes a deep breath. ‘I have…letters you wrote to him,’ he says. He reaches into his coat pocket and hands them to you. They are bundled together and wrapped with an elastic. ‘Kurtz said that you liked to write letters instead of emailing.’ [paragraph break]You smile weakly, but you feel as though you want to vomit. These letters, addressed to Phil in your handwriting. The extra stamps you had to buy, the airmail stickers…all there. He’d opened them carefully, you see. In among the letters is a picture of you. You stare down at it.[paragraph break]There’s nothing more to talk about. You know it’s time to say goodbye to Charlie Marlow.[paragraph break]‘Goodbye,’ says Marlow. [paragraph break]You want to tell him that it’s okay…that you know the truth. That the people with him - with both of them - have already come to talk to you, have already told you that Phil was sick when he died. So terribly sick that he ranted, that he didn’t make much sense. That he talked about his plans for those people in the jungle, for the things he thought he could do. That he talked about all sorts of things. You want to tell Marlow that you know that Phil didn’t talk about you when he died. He didn’t say anything about you, and you’ve tried to understand that. You know that you should tell Marlow that it’s okay, that he didn’t have to lie to you. [paragraph break]But Marlow looks like he’s going to cry, and so before he does, you open the door and let him leave. You watch him go, Phil’s letters clutched in your hand.”;
if the guilt of Marlow is greater than 11 and Marlow is visible, end the story.[/code]

Never mind, never mind…worked that out, too. Good lord. This is like a comedy of errors (on my part).

You can put hard returns inside a text string, but not between the rows of a table (or, generally, anywhere else within a section of code). A double hard return in a text string will produce a paragraph break, apparently! I didn’t know that until I started poking around.

For readability, it’s nice to have tables formatted in a legible way, but I7 really doesn’t care about that.

Sorry…last newbie wail for help for the night. This one still has me stumped:

if the topic understood includes the topic entry, say "[commentary entry] [paragraph break]";

Any time you’re using a substitution inside a text string, rather than the literal text, you need the square brackets.

Those are the square brackets, though, aren’t they? If I put square brackets around ‘topic entry,’ it still returns an error.

Sorry; I fixed two things and only explained one. That line of your code didn’t have square brackets around ‘commentary’ – that’s not causing the error, but it would mean that the actual commentary wouldn’t have been printed.

The important error is that you were calling it ‘topic’ rather than ‘the topic entry’.

Ah! I’ll give it a try tonight when I get home…thank you again for your help! :slight_smile:

Oo…that did work! Corrected the error, but when I type ‘say hi to Marlow’ it doesn’t pick up on the commentary entry. Is there something funny I should be doing there, too?

I think you must have changed something elsewhere in the code. The following works fine for me:

foo is a room.

Marlow is a man in foo.

Asking someone about something is speech.
Telling somebody about something is speech. 
Answering someone that something is speech.
Asking someone for something is speech. 

Instead of speech when the noun is Marlow: 
	repeat through Table of Marlow's Commentary:
		if the topic understood includes the topic entry:
			say "[commentary entry] [paragraph break]";
			rule succeeds;
	say "Marlow just looks at you."

Table of Marlow's Commentary
topic	commentary 
"knew"	"'Intimacy grows quick out there,' Marlow says. `I knew him as well as it is possible for one man to know another.'"
"admire"	"'He was a remarkable man,' Marlow says, unsteadily. He seems to pause, looking at you, before he goes on. 'It was impossible not to...'"
"mother"	"'I hadn't heard that his mother had died,' Marlow says. 'It must...it must have been very hard on you.'"
"remember"	"'I will always remember him,' says Marlow. 'His words...the things he wrote...they will always remain.'"
"life/waste"	"'He...his end was in every way as...as worthy as his life.' For a moment, Marlow looks as though he is angry."
"hello/hi"	"'Hi,' he says. He looks uncomfortable, but you want to hear what he has to say. 'How have you been?' he asks.[paragraph break] 'Lonely,' you say. 'I've been so...so lonely.'"

Yep…you’re right. I tweaked something else and missed an indent somewhere; changed it again and it started to work.

I think this is the last pestering newbie question…

I switched my conversational framework over to conversation responses by Erik Eve, and it’s working really well. But I want to force the game to end when a response is given to particular ‘ask Marlow about’ - and it’s just not working.

Is it possible to have a statement where the player, if asking Marlow about letters, will get a canned statement that ends the game? Can I append the ‘end the game finally’ statement to the end of the ‘say’ block in a way that will make it shut the game down?

Response of Marlow when asked-or-told about "[letters]": say "'I just...I just want to ask you something,' you say. Marlow looks at you, and you can see his expression change. He knows what you're going to ask. 'I want to know if he...talked about me. At the end.'[paragraph break]You wait. [paragraph break]'Y-yes,' says Marlow. 'His last words were of you.'[paragraph break]. You want to tell him that it's okay...that you know the truth. That the people with him - with both of them - have already come to talk to you, have already told you that Phil was sick when he died. So terribly sick that he ranted, that he didn't make much sense. That he talked about his plans for those people in the jungle, for the things he thought he could do. That he talked about all sorts of things. You want to tell Marlow that you know that Phil didn't talk about you when he died. He didn't say anything about you, and you've tried to understand that. You know that you should tell Marlow that it's okay, that he didn't have to lie to you. [paragraph break]But Marlow looks like he's going to cry, and so before he does, you open the door and let him leave. You watch him go, Phil's letters clutched in your hand." end the game finally

(that code isn’t working…I’m just trying to work out a way to use the ‘end the game finally’ in a way that will end as soon as the player asks about letters.)

Rescued myself again (teehee!)

It prints out with *** before the text in the game…is there a way to strip that out?

The asterisks are there because the text in ‘end the game saying’ is intended to be a brief headline, rather than a hefty paragraph. See Ending the Story in the Recipe Book for how to do things differently; in either case, you’d want to put the big block of text in a separate ‘say’ statement, immediately before ending the game.