Ok, I think have some answers here. Bear with me.
DefaultAgendaTopic
is an AgendaManager
and a DefaultAnyTopic
. The second base class ensures that it’s invoked when all other responses fail, i.e., it’s a catch-all to prevent a boring default response (“Bob does not respond”).
However, it only invokes the DefaultAnyTopic
functionality if its AgendaManager
side cannot find an appropriate agenda to use for the response. What’s more, a DefaultAgendaTopic
is only active if it has one or more agendas in its list:
active = (inherited && agendaList != nil && agendaList.length > 0)
This means it’s a catch-all, but only if it is managing one or more available agendas. Otherwise, it’s ignored (and adv3Lite is free to find another topic response, or use a boring built-in response).
So, to see the default response, you need to have (a) at least one agenda added to the DefaultAgendaTopic
but (b) none of those agendas are isReady = true
. (Setting an agenda’s isDone = true
will drop it from the AgendaManager
list, so those don’t count.)
I tried this:
+ novel: Thing 'a novel'
;
+ Actor 'Bob'
;
++ defaultAgenda: DefaultAgendaTopic
topicResponse() {
"Default agenda item";
}
;
++ ConvAgendaItem, PreinitObject
invokeItem() {
"ConvAgendaItem";
}
isReady = novel.examined
isDone = novel.isIn(gPlayerChar)
initiallyActive = true
execute() {
// this adds the ConvAgendaItem to the DefaultAgendaTopic's agendaList
defaultAgenda.addToAgenda(self);
}
;
Note that the ConvAgendaItem
is only ready when the novel is examined, and is done (disabled) when the player is holding the same.
Here’s the result:
> ask bob about novel
Default agenda item
> x novel
You see nothing special about the novel.
ConvAgendaItem
> ask bob about novel
ConvAgendaItem
> get novel
Taken.
> ask bob about novel
Bob does not respond.
Note that the ConvAgendaItem
is activated the moment the novel was examined—that’s the magic of agendas vs. topics, the NPC attempting to “seize control of the conversation” in Eric Eve’s words. It remains active until the player picks up the novel. The final built-in response is because the DefaultAgendaTopic
has no more available agenda items. If we add another non-ready ConvAgendaItem
to its list, then we’d get the “Default agenda item” response.
So, what’s important here is that agendas should (in most cases) not simply be enabled with isReady = true
and left that way, unless the NPC is really of a one-track mind. The intended case is for them to be enabled and disabled depending on changes in your game world. The DefaultAgendaTopic
is intended to provide a response when the actor has some available agendas, but none are ready at the moment. (Its response could, for example, suggest the player do something to activate one of those agendas.)
Hope this helps.