intfiction.org

The Interactive Fiction Community Forum
It is currently Fri Dec 14, 2018 6:09 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon Jul 30, 2018 10:08 pm 
Offline

Joined: Wed Jul 25, 2018 8:55 am
Posts: 18
I've read various docs and I can't figure this out. I'm trying to do something along these lines:

> talk to npc

npc says "something about a dagger."

> ask npc about dagger

npc says "something about slaying monsters."

I've tried the following as far as the second part goes:

Code:
npc: Actor 'npc' 'npc' @startRoom "Npc "
;
+npcDefault: ConversationReadyState
    isInitState = true
;
++ AskTopic @dagger
    "npc says <q>somthing about slaying monsters.</q> "
   
    isActive = true
;


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'):

Code:
inConvState.handleConversation(otherActor, topic, convType);


The Watch Expressions window indicates it's the inConvState object that's nil. I'm clearly missing a step (or two), but I don't know what it is.

I have no idea how to handle the simple talk to npc action

Thanks.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Jul 31, 2018 1:24 am 
Offline

Joined: Sat Jul 16, 2011 3:48 pm
Posts: 309
RThompson654321 wrote:
I've read various docs and I can't figure this out. I'm trying to do something along these lines: [...] I have no idea how to handle the simple talk to npc action


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 <q>somthing about slaying monsters.</q> "
   
    isActive = true // Not necessary, everything is active by default
;


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.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Jul 31, 2018 4:07 pm 
Offline

Joined: Wed Jul 25, 2018 8:55 am
Posts: 18
Thank you. I had read that (the entire chapter, in fact) but for some reason was stuck on the concept. This helped.


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 5 guests


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