emit
emit <type> <string> [actor] [victim]
Send an act-style message, rendered per observer with $-code grammar.
emit is the richer sibling of echo. Where echo sends one
fixed line to a target, emit runs the message through the game's act
system: each viewer sees the message phrased from their own point of view,
with $-codes filled in from the actor and victim, and verbs and
pronouns agreeing automatically. Use it for emotes and combat-style lines
where "you" versus a third party's name matters.
Arguments
<type>— a string selecting who sees the message and which role they play:room— everyone in the actor's room.char— only the actor (the line is addressed to them).vict— only the victim.notvict— everyone in the room except the actor and the victim.zone— every player in the owner's zone.
<string>— the act-style message. See Act codes below. Because the codes start with$, write the message as a single-quoted (literal) string so script interpolation leaves them alone — or use a double-quoted string and escape each code's$as\$.[actor]— the creature that is the$nsubject. Defaults to the owner mob (for an object or room owner, to a creature in its room).[victim]— the creature that is the$Ntarget, for messages that name a second party.
Returns
null. Like the other action commands, a
successful emit in the handle phase suppresses the event's default
action.
Act codes
The message text is filled in per observer: the same $n shows the
actor's name to onlookers but reads as you to the actor themselves. The
common codes are:
$n— the actor's name (the subject).$N— the victim's name.$e/$s/$m— the actor's subject / possessive / object pronoun (she / her / her).$E/$S/$M— the victim's pronouns.$%/$^— a verb-agreement suffix (s/es), empty for the viewer who is the actor — so"$n grin$%"reads you grin to the actor and Puff grins to everyone else.
Examples
after command (say) {
emit room '$n stirs the air with a slow, deliberate gesture.'
}
Everyone in the room sees the actor's name; the actor sees you. The
message is single-quoted so $n reaches the act system unchanged.
Mix interpolation with literal codes by escaping the act $ in a
double-quoted string:
after command (say) {
emit room "\$n glances at [name $actor] and nods slowly."
}
Here [name $actor] is interpolated by the script while \$n is left for
the act system to fill in per viewer.
See also
echo— send one fixed line, with no act-style grammar.do— make the owner perform a command that may emit its own messages.- Strings and interpolation — single- versus double-quoted
strings and escaping
$. - Handlers, events, and phases