intfiction.org

The Interactive Fiction Community Forum
It is currently Sun May 19, 2013 8:34 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 21 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
PostPosted: Mon Jul 02, 2012 11:15 pm 
Offline
User avatar

Joined: Sat May 08, 2010 9:25 pm
Posts: 958
Location: The Seattle Massive
Code:
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.


Top
 Profile Send private message  
 
PostPosted: Mon Jul 02, 2012 11:21 pm 
Offline
User avatar

Joined: Sat Jun 30, 2012 8:56 pm
Posts: 13
maga wrote:
Code:
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.


Top
 Profile Send private message  
 
PostPosted: Mon Jul 02, 2012 11:37 pm 
Offline
User avatar

Joined: Sat May 08, 2010 9:25 pm
Posts: 958
Location: The Seattle Massive
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'.


Top
 Profile Send private message  
 
PostPosted: Tue Jul 03, 2012 2:06 pm 
Offline
User avatar

Joined: Sat Jun 30, 2012 8:56 pm
Posts: 13
Ah! I'll give it a try tonight when I get home...thank you again for your help! :)


Top
 Profile Send private message  
 
PostPosted: Tue Jul 03, 2012 6:28 pm 
Offline
User avatar

Joined: Sat Jun 30, 2012 8:56 pm
Posts: 13
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?


Top
 Profile Send private message  
 
PostPosted: Tue Jul 03, 2012 7:08 pm 
Offline
User avatar

Joined: Sat May 08, 2010 9:25 pm
Posts: 958
Location: The Seattle Massive
I think you must have changed something elsewhere in the code. The following works fine for me:
Code:
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.'"


Top
 Profile Send private message  
 
PostPosted: Tue Jul 03, 2012 7:21 pm 
Offline
User avatar

Joined: Sat Jun 30, 2012 8:56 pm
Posts: 13
Yep...you're right. I tweaked something else and missed an indent somewhere; changed it again and it started to work.


Top
 Profile Send private message  
 
PostPosted: Tue Jul 03, 2012 10:16 pm 
Offline
User avatar

Joined: Sat Jun 30, 2012 8:56 pm
Posts: 13
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?

Code:
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.)


Top
 Profile Send private message  
 
PostPosted: Tue Jul 03, 2012 10:40 pm 
Offline
User avatar

Joined: Sat Jun 30, 2012 8:56 pm
Posts: 13
Rescued myself again (teehee!)

Quote:
Instead of asking Marlow about "[letters]", end the game saying "'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."


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


Top
 Profile Send private message  
 
PostPosted: Tue Jul 03, 2012 11:31 pm 
Offline
User avatar

Joined: Sat May 08, 2010 9:25 pm
Posts: 958
Location: The Seattle Massive
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.


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group