Player walks into a room.
The other guy in the room initiates a conversation that consists of two topics. When those topics are used, their curiositySatisfied properties get set to nil by the library.
Player walks out of the room, then returns.
The other guy initiates the conversation again (which is what I want). But the topics’ curiositySatisfied properties are now true, so they are no longer available for use and the conversation never gets off the ground the second time around.
Now leave and return, expecting to have the conversation again…
There are no topics available in the ConvNode.
So, to fix this, I explicitly reset the curiositySatisfied props to nil, in the actorAfterTravel() method where the conversation is initiated. So far so good.
But once I have explicitly set curiositySatisfied to nil, the library won’t ever set it back to true.
That means I can never get past the first topic, because its curiositySatisfied property will never be true again.
The conversation is hung up on the “begin” topic, since it will never have a true value for curiositySatisfied.
Here’s the test-bed source…
[code]#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
Jerry Ford’
version = ‘1’
authorEmail = ‘Jerry Ford jerry.o.ford@gmail.com’
desc = ‘Testing reusing topics objects.’
htmlDesc = ‘Testing reusing topic objects.’
;
gameMain: GameMainDef
initialPlayerChar = me
paraBrksBtwnSubcontents = nil
;
me: Actor ‘me’ @room
“The main man.<.p>”
isHim = true
person = 2
actorAfterTravel(traveler, connector)
{
if(connector == nextRoom)
{
firstTopic.curiositySatisfied = nil;
otherGuy.initiateTopic(connector);
}
}
;
room: Room ‘room’
“The room. <.p>”
east = nextRoom
;
nextRoom: Room ‘next room’
“The next room. <.p>”
west = room
;
otherGuy: Actor ‘agent;;man person;him’ @nextRoom
desc = “<<otherGuy.theName>> stands in the middle of the room. <.p>”
;
- InitiateTopic @nextRoom
“Let’s talk, the other guy says. <.p>
<.convnodet talkTheTalk>”
; - ConvNode ‘talkTheTalk’
;
++ NodeContinuationTopic
“Keep talking, the other guy says.<.p>
<.topics>”
;
++ NodeEndCheck
canEndConversation(reason)
{
switch(reason)
{
case endConvBye:
“No, don’t go, the other guy says.<.p> <.topics>”;
return blockEndConv;
case endConvLeave:
“You can’t just walk away,the other guy says.<.p>
<.topics>”;
return blockEndConv;
default:
return nil;
}
}
;
++ firstTopic: SayTopic ‘begin talking’
“Well, now, there is that, you say. <.convstayt><.p>”
;
++ secondTopic: SayTopic ‘continue talking’
“But on the other hand, you add. <.p>”
isActive = firstTopic.curiositySatisfied
;[/code]
Full disclosure—I do have a workaround, a setTopicCuriosityProp(topic, value) function that I use to manage the curiositySatisfied property, but shouldn’t that property management task be the library’s responsibility?
Jerry