I get a ‘nil object reference’ on the following line in file actor.t (line 4864 of the ‘handleConversation(otherActor, topic, convType)’ method for class ‘ConversationReadyState’):
Conversations in TADS are rather big chapter in Learning T3 manual and it will take you some time to grasp. Talk to NPC is part of hello/goodbye protocol which are discussed in chapter 14.6. Follow the examples in the book. You’ve got error because ConversationReadyState is meant to be used together with InConversationState and please follow the exact containment hierarchy given by plus signs:
[code]npc: Actor ‘npc’ ‘npc’ @startRoom "Npc "
;
// one plus sign to locate into NPC
InConversationState
attentionSpan = 5
specialDesc = "Description for room. "
stateDesc = "Description for examine. "
;
// two plus sign to locate ConversationReadyState always inside InConversationState
++npcDefault: ConversationReadyState
specialDesc = "Description for room. "
stateDesc = "Description for examine. "
isInitState = true
;
// one or two plus signs for topics depending whatever it is global topic or only for this particular state
++ AskTopic @dagger
"npc says somthing about slaying monsters. "
isActive = true // Not necessary, everything is active by default
;
[/code]
There are more advanced examples with Hello and ByeTopic n the book to give you smooth conversation, but always watch out for containment hierarchy, HelloTopic should be located into ReadyState with three plus signs.