force
force <creature> <string>
Make a creature execute a command.
The named creature runs the command line as if it had typed it, regardless
of who owns the script. Use this to drive another creature; use
do to drive the owner itself.
Arguments
<creature>— the creature to act. Often$actor, the creature that triggered the event.<string>— the command line for that creature to run. Build it with interpolation, e.g."say thanks, $self".
Returns
null. Like the other action commands, a
successful force in the handle phase suppresses the event's default
action.
Examples
after command (say) {
force $actor "smile"
}
The actor is made to smile. The script compiles and runs to completion.
handle command (bow) {
force $actor "say I bow before you, $self."
}
When someone bows, that creature is forced to speak a line that names the
owner ($self), and the handle-phase force suppresses the default
bow.
See also
do— make the owner run a command.silently— run an owner command with output suppressed.- Strings and interpolation · Handlers, events, and phases