MultiLoc AskTellTopics

Is it possible to make a typical AskTellTopic response be contained in multiple locations (actor stated in this case)?

I have a character with multiple ActorStates under which s/he would have different responses to conversation topics, but there are several topics that would get the same invariable response. Previously, I would easily paste the topic onto each state, or have an AskTellTopic in each state that would point back to a single unified one, but I’m trying to keep the code and text from balooning uncontrollably fro once and that sounds like it would be the cleanest way to do it.

Nothing really critical obviously, it’s just trying to keep things neat and tidy. So far, trying to splice in the MultiLoc class doesn’t work.

Try to put the invariable topics in the actor directly, rather than in each of its states.

That could work for most, but there are still some other topics I would like to be active in several states, but not all, and unless I’m getting this wrong, topics contained in the actor itself will override all actorState-contained topics.

No, it’s the opposite. Topic is searched first in the current ConvNode, if any. If not found, then it is searched in current ActorState, if any is active. If not found, it is searched in Actor itself. So ConvNode overrides ActorState which in turn overrides Actor. But when I say “overrides”, I mean that one topic about one specific object will override topic about the same object in other layer. Topics about different objects are mixed from actors, states and nodes together and equally available.

When you insert topic in Actor object, you can still use isActive property to write a true/nil condition deciding whatever the topic should be active or not. Try something like: isActive = location.curState is in (state1, state2)

It will work fine and intuitive most of time, just one minor exception to remember is to not put DefaultAnyTopic in ActorState or it will take over and block any topic in Actor database. If you need specific DefaultAnyTopic in ActorState and still have access to topics contained in Actor, you should write following to DefaultAnyTopic under ActorState: deferToEntry(entry) { return !entry.ofKind(DefaultTopic); }