Updating specialdesc by location

Hi there,

I’ve been toying around with Tads for a while and I’ve managed to muddle through most things I’ve encountered so far. However, I’ve come up against something I don’t know how to do.

I have an NPC that the PC encounters regularly throughout the game. I’ve used several actor states to cover different encounters but this has led to my current difficulty. During one of the encounters, the PC has to escort her to safety. The NPC isn’t following the PC in an actor state but rather gets an all-clear from them before moving to the next room. The NPC correctly follows the route from start to finish, responds appropriately to all my expectations and retains access to the entire state conversation suite until handing over to the new actor state, which has a different set of conversations. My only problem is that I want the NPC to have a different special desc in each of the rooms they pass through.

So, my question is whether it’s possible to edit the special desc presented by an NPC without changing her actor state?

I’ve tried a variety of things that seemed like they might’ve been the obvious solution, such as varieties of
seako.specialDesc = ‘xyz’
seako_ambushState.specialDesc = ‘xyz’


I’m not sure what exactly this means. If you want NPC to follow PC, than you should use AccompanyingState and AccompanyingInTravelState. See TADS 3 Tour Guide for examples and explanation. Instead of ShuffledEventList you will probably use same if/switch for sayDeparting(conn) and specialDesc.

specialDesc and stateDesc should be double quoted string, ie. "{The sarah/she} is standing beside you. ". Double quoted string is a method displaying the string, not a literal string constant. You can also use method instead, such as:

specialDesc() { if(something) "Some text. "; if(otherthing) "Other text. "; }


specialDesc = "<<if something>>Some text. <<else if otherthing>>Other text. "

Hi there,

Sorry, to explain the first part: The NPC is not following the PC’s every movement. Instead, the PC can:
go ahead by themselves and come back
tell the NPC to go ahead alone
or that they both PC and NPC should go ahead together, with that conversation then moving both of them into the next room.

To provide some more background, the player is a samurai bodyguard to a general. The game is divided into several chapters, each set around one highlight of their campaigns together. ‘Enemy’ is a topic that is always available, with a lot of differing context and response that is controlled by actor state throughout. However, one of the chapters features the PC and NPC being ambushed, with the chapter revolving around them making their way to safety. Asking about ‘enemy’ here, the NPC provides a response about combat chances versus the next set of enemies. I originally had several actor states (depending on the NPC health, armament and other factors) but found no effective way to make the relevant conversation topic available to all of them. I eventually settled on consolidating into one actor state but that led to the specialdesc problem. The NPC is supposed to show her health and state in the room desc, for easy reference.

I tried double and single quotes, brackets… I just wasn’t able to find a way to make the specialDesc change on command. On the other hand, your second suggest fix of using “specialDesc() {}” with contextual code inside was absolutely perfect and has solved my problem. Thank you very much!

I’d also like to enquire about an alternative that occurred to me last night; Is it possible to extend an actor state, such that several states inherit from a root one? That way, conversation in the parent state would be available to the child states, but not states where they are meaningless. On the other hand, is it possible to make a collection of conversation topics and make them available to states?


I think you could almost certainly do that by defining separate objects and having the TopicEntry object nested in the ActorState call the code in your separate objects. But there may be a better way. TopicEntry objects (such as AskTopic, TellTopic, and so on) can be nested as child objects below the Actor object itself rather than below ActorStates – and TopicEntry objects can have AltTopics nested below them. You should be able to set it up so that the AltTopic is active when the Actor is in one or more given ActorStates. See p. 223 in “Learning T3”.

Hi there,

I’d nested topics beneath the actor object and used altTopic extensively, but using altTopic on the latter topics to test for actorState never occurred to me. In further testing, I added a chapter variable to several states and was able to test for that, too!

My original question is answered and the new details provided also allow me to use my original and preferred method of several actor states during the ambush. Thank you!


Also look on the TopicGroup class as documented in Learning T3. It is a tool for issuing a common isActive for a bunch of topics. It can be located for example under Actor and Topics under it. It can be an alternative or supplement to AltTopic switching.