CommandTopic class | actor.t[3214]

A command topic. This is used to respond to orders given to an NPC, as in "BOB, GO EAST." The match object for this kind of topic entry is an Action class; for example, to create a response to "BOB, LOOK", we'd create a CommandTopic that matches LookAction.

If you're designing a CommandTopic for a command can be accepted from a remote location, such as by telephone, you should be aware that the command will be running in the NPC's visual sense context. This means that if the player character can't see the NPC, the topic result message will be hidden - the NPC's visual sense context hides all messages generated while it's in effect if the PC can't see the NPC. This is usually desirable, since most messages relay visual information that wouldn't be visible to the player character if the PC can't see the subject of the message. However, if you've specifically designed your CommandTopic to work remotely, this isn't at all what you want, since you've already taken the remoteness into account in the message and thus want the message to be displayed after all. The way to handle this is to wrap the message in a callWithSenseContext() with a nil sense context. For example:

topicResponse()
{ callWithSenseContext(nil, nil, {: "Here's my message!" }); }

`class CommandTopic : TopicEntry`

Superclass Tree (in declaration order)

`CommandTopic`
`TopicEntry`
`object`

Subclass Tree

(none)

Global Objects

(none)

Summary of Properties

`includeInList`

Inherited from `TopicEntry` :
`altTalkCount altTopicList impliesGreeting isActive isConversational matchObj matchScore talkCount topicGroupActive topicGroupScoreAdjustment topicResponse`

Summary of Methods

`isMatchPossible matchTopic setTopicPronouns`

Inherited from `TopicEntry` :
`addAltTopic addSuggestedTopic addTopic adjustScore anyAltIsActive breakTopicTie checkIsActive deferToEntry getActor getTopicOwner handleTopic initializeTopicEntry noteAltInvocation noteInvocation`

Properties

`includeInList` OVERRIDDEN | `actor.t[3216]`

we go in the command topics list

Methods

`isMatchPossible (actor, scopeList)`OVERRIDDEN | `actor.t[3247]`

we can always match, since the player can always type in any possible action

`matchTopic (fromActor, obj)`OVERRIDDEN | `actor.t[3219]`

match the topic

`setTopicPronouns (fromActor, topic)`OVERRIDDEN | `actor.t[3250]`

we have no pronouns to set

TADS 3 Library Manual
Generated on 5/16/2013 from TADS version 3.1.3