TADS 3 Library: command execution
This module defines functions that perform command execution.
Summary of Classes
Summary of Global Objects
Summary of Global Functions
_nestedAction (isReplacement, actor, actionClass, [objs])
Run a nested action. 'isReplacement' has the same meaning as in execNestedAction().
_newAction (transcriptClass, issuingActor, targetActor, actionClass, [objs])
Run an action as a new turn. Returns the CommandTranscript describing the action's results.
_replaceAction (actor, actionClass, [objs])
Run a replacement action.
_tryImplicitAction (issuingActor, targetActor, msgProp, actionClass, [objs])
Try an implicit action.
Returns true if the action was attempted, whether or not it succeeded, nil if the command was not even attempted. We will not attempt an implied command that verifies as "dangerous," since this means that it should be obvious to the player character that such a command should not be performed lightly.
execNestedAction (isReplacement, isRemapping, actor, action)
Execute a fully-constructed nested action.
'isReplacement' indicates whether the action is a full replacement or an ordinary nested action. If it's a replacement, then we use the game time taken by the replacement, and set the enclosing action (i.e., the current gAction) to take zero time. If it's an ordinary nested action, then we consider the nested action to take zero time, using the current action's time as the overall command time.
'isRemapping' indicates whether or not this is a remapped action. If we're remapping from one action to another, this will be true; for any other kind of nested or replacement action, this should be nil.
executeAction (targetActor, targetActorPhrase, issuingActor, countsAsIssuerTurn, action)
Execute an action, as specified by an Action object. We'll resolve the nouns in the action, then perform the action.
executeCommand (targetActor, issuingActor, toks, firstInSentence)
Execute a command line, as issued by the given actor and as given as a list of tokens.
If 'firstInSentence' is true, we're at the start of a "sentence." The meaning and effect of this may vary by language. In English, a sentence ends with certain punctuation marks (a period, semicolon, exclamation mark, or question mark), so anything after one of these punctuation marks is the start of a new sentence. Also in English, we can address a command to an explicit target actor using the "actor," prefix syntax, which we can't use except at the start of a sentence.
If the command line consists of multiple commands, we will only actually execute the first command before returning. We'll schedule any additional commands for later execution by putting them into the target actor's pending command queue before we return, but we won't actually execute them.
Run a previously-executed command as a nested action, re-resolving all of its objects to ensure they are still valid.
newActionObj (transcriptClass, issuingActor, targetActor, actionObj, [objs])
Run an action as a new turn. This is almost the same as _newAction, but should be used when the caller has already explicitly created an instance of the Action to be performed.
If issuingActor is nil, we'll use the current global issuing actor; if that's also nil, we'll use the target actor.
Returns a CommandTranscript object describing the result of the action.
prepareNestedAction (isReplacement, isRemapping, action)
Prepare a nested or replacement action for execution.
remapAction (inResolve, oldRole, remapInfo)
Perform a remapping to a new action. This is normally invoked through the remapTo() macro.
remapActionCreate (inResolve, oldRole, remapInfo)
Create a new action object for the given remapped action.
remapVerify (oldRole, resultSoFar, remapInfo)
Remap a 'verify' method for a remapped action. This is normally invoked through the remapTo() macro.
Resolve and execute a replacement action. This differs from the normal replacement action execution in that the action we execute requires resolution before execution.
withActionEnv (actionClass, actor, func)
Run some code in a simulated Action environment. We'll create a dummy instance of the given Action class, and set up a command transcript, then invoke the function. This is useful for writing daemon code that needs to invoke other code that's set up to expect a normal action processing environment.
TADS 3 Library Manual
Generated on 5/16/2013 from TADS version 3.1.3