In a previous post about no recovery from user input during a conversation with an NPC (which turns out to be not true, topics were missing a <.convstay> tag), I also grumbled about inconsistent parsing of user input.
tell about fails; the game requires tell about
…but…
ask about succeeds.
I didn’t see it at first, but now I believe the critical difference is AskTopic vs. TellTopic.
In the sample code posted with that previous post intended as a demonstration of the problem, there are two TellTopics. Run the game and see the problem. then change the TellTopics to AskTopics and the problem disappears.
Here’s the test code again, with the tCables topic changed to an AskTopic. Run the code, enter x self, then ask about cables (works) and tell about thumping (doesn’t work)…
#charset "us-ascii"
#include <tads.h>
#include "advlite.h"
versionInfo: GameID
IFID = '445C38A3-AD1B-4729-957A-F584600DE5C1'
name = 'test'
byline = 'by Jerry Ford'
htmlByline = 'by <a href="mailto:jerry.o.ford@gmail.com">
Jerry Ford</a>'
version = '1'
authorEmail = 'Jerry Ford <jerry.o.ford@gmail.com>'
desc = 'Testing conversation.'
htmlDesc = 'Testing conversation.'
;
gameMain: GameMainDef
/* the initial player character is 'candidate' */
initialPlayerChar = candidate
paraBrksBtwnSubcontents = nil
;
// candidate, initial player char
candidate: Actor 'you;self body' @testChamber
"You are a...well, that's what we're here to find out. <.p>"
globalParamName = 'candidate'
isHim = true
person = 2
contType = Carrier
dobjFor(Examine)
{
action()
{
if(gDobj == self)
{
"In your currently fogged state of mind, you slowly take stock
of yourself---face, hands, feet, arms, legs. \b
Cables are attached to various parts of your body.\b
<i>Thump thump. Thump thump.</i> You feel a rhythmic beating
inside your chest.
<.reveal selfExamined> <.p>";
}
else
inherited;
}
}
;
// candidate, initial player char
innerSelf: Actor 'voice in your head'
""
globalParamName = 'innerSelf'
person = 3
contType = Carrier
;
// ********* ConvAgendaItem *********************************************
+ ConvAgendaItem
isReady = (gRevealed('selfExamined'))
invokeItem()
{
"A voice inside your head speaks. \b
<i>Assess the data,</i> it instructs. <i>What did your self examination
discover?</i>
<.convnodet dataPoints><.p>";
isDone = true;
}
initiallyActive = true
;
// ********* ConvNodes **************************************************
+ selfDiscovery: ConvNode 'dataPoints'
;
++ cablesDiscovered: AskTopic @tCables
"<i>There are cables...I'm attached to...</i> you begin. <i>What are they?
What does it mean?</i>\b
<i>That's curious,</i> replies the inner voice. <i>I don't know. We'll need
more data. </i>
<.p>
<.convstayt>"
name = 'the cables'
;
++ heartBeat: TellTopic @tHeartBeat
"<i>I feel a rythmic thumping in my chest,</i> you silently tell your
inner voice. \b
<i>We have a heart beat, that's a data point,</i> the inner voice replies.
<i>We are alive. That's useful to know.</i>
<.p>
<.convstayt>"
name = 'the thumping sensation'
;
++ NodeContinuationTopic
"<I>Con't let the mind wander,</i> the voice says. <i> We must finish
this phase in order to move on.</i>
<.p>"
;
++ NodeEndCheck
canEndConversation(reason)
{
switch(reason)
{
case endConvBye:
"<q>No, not good bye,</q> the inner voice tells you. <i>We are
bound intricately and irrevocably.</i> <.p>";
return blockEndConv;
case endConvLeave:
"<i>There is nowhere to hide from me,</q> says the voice in your
head. <.p>";
return blockEndConv;
default:
return nil;
}
}
;
tCables: Topic 'the cables';
tHeartBeat: Topic 'the thumping sensations';
// ********* Rooms ********************************************************
testChamber: Room 'Test Chamber' 'test chamber'
"The test chamber.
<.p>"
;
// self discovery
selfDiscoveryScene: Scene
name = 'selfDiscovery'
startsWhen = candidate.isIn(testChamber) && !gRevealed('candidateNameSet')
endsWhen = gRevealed('candidateNameSet')
recurring = true
whenStarting()
{
if(!gRevealed('selfDiscoverySceneInitialized'))
{
commLink.connectTo(innerSelf);
gReveal('selfDiscoverySceneInitialized');
}
}
whenEnding()
{
commLink.disconnectFrom(innerSelf);
}
;