intfiction.org

The Interactive Fiction Community Forum
It is currently Sun Dec 16, 2018 2:12 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Multiple AskTopics
PostPosted: Thu Aug 02, 2018 11:33 am 
Offline

Joined: Wed Jul 25, 2018 8:55 am
Posts: 18
Still struggling with conversations. This time it's AskTopics. Here is my code derived from the Learning T3 document:

Code:
startRoom: Room 'start room' 'start room' "Start room. ";
+me: Actor;

robert: Person 'robert' 'robert' "Robert. ";

mary: Person 'mary' 'mary' @startRoom "Mary. "
    isHer = true
    isProperName = true
;

+ maryTalking: ActorState
    isInitState = true
    specialDesc = "Mary is looking at you. "
;

+ TopicGroup
    isActive = true // MODIFIED FROM (mary.curState is in (maryWalking, maryTalking))
;
++ AskTopic @mary  "blah blah mary ";
++ AskTopic @robert   "blah blah robert ";


I get a response for "ask about mary", but no response for "ask about robert."

>ask about mary
(asking mary)
blah blah mary


>ask about robert
Mary does not respond.

Thanks


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Multiple AskTopics
PostPosted: Thu Aug 02, 2018 5:03 pm 
Offline

Joined: Sat Jul 16, 2011 3:48 pm
Posts: 309
Mary is located @startRoom together with player character, but Robert does not. So player can ask Mary about herself, but Robert is not in the room (Robert isn't located anywhere). And therefore player and Mary doesn't meet him and therefore doesn't know he even exists. Player knows about objects he seen in the game world unless you explicitly mark object with isKnown = true property and then you can talk about such object even before you first see it.


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Multiple AskTopics
PostPosted: Sat Aug 04, 2018 1:21 am 
Offline

Joined: Sat Jul 16, 2011 3:48 pm
Posts: 309
Code:
+ TopicGroup
    isActive = true // MODIFIED FROM (mary.curState is in (maryWalking, maryTalking))
;

Just one side note - TopicGroup is a nice tool to control activity of bunch of topics at one place instead of setting isActive on every single topic, but it is usually necessary only in few specific situations, when you need a bunch of topics available in more then one ActorState, but not all. I suppose that maryWalking is ConversationReadyState. You don't need topics (apart from Hello/GoodbyeTopic) in this state since it won't have any effect, conversation is always switched from ConversationReadyState into InConversationState when player asks something, so effectively your (commented out) code means isActive = mary.curState == maryTalking and therefore you can just place such topics under maryTalking with plus signs.


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Multiple AskTopics
PostPosted: Sat Aug 04, 2018 5:50 pm 
Offline

Joined: Wed Jul 25, 2018 8:55 am
Posts: 18
Ah, I see (said the blind man to the deaf woman as he picked up his hammer and saw). So if I want to ask an npc about something, the player has to already encountered it either via game play or explicitly in code. Thanks.


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 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