Main Connecting Starting



Building: Actions

Actions

Actions are special commands defined in %action_whatever magic objects and stored on disk in their own files. You can stat these objects (eg. stat %action_stab) too see the attributes that define them, and edit them using standard editting commands like chstr or using webmake.

To create a new, empty action, use createaction whatever, where "whatever" is the name of your new action. This will create a new action object with no action definitions and saves it to disk.

Action Types

An action has one or more supported types:

TypeUsageExample
untargettedUsed without any argumentssmile
targettedUsed with a single argument which must be a player or mobilehug muon
object targettedUsed with a single argument which must be a concrete, inanimate objecthide sofa
propUsed with two arguments and a prepostionpoint stick at ffilc
textUsed with a text argument that may be of any lengthmutter whatever
targetted textUsed with a specially indicated person and a text argument of any lengthsing gareth> hush, nobber

Action strings

Each action type is associated with one or more strings.

(base)For simple actions, you can use one string to be shown to the actor, the audience and the target (if any)%1 smile%[s] at %a.
selfA string shown to the actorYou think you are tutting...
targetA string shown only to the target of targetted and prop actions%#a nod%<s> and smile%<s> at you. They must be absolutely fascinated!
othersA string show to anyone who can see the actor%#a order's a straitjacket for %[a].
prepositionFor prop targetted actions, the preposition that must be usedwith
errorFor text and targetted text actions, the string shown when arguments are missingSing what?

If the base attribute is used (eg. action.targetted) it will be used for all required action strings (eg. self, target and others). Specific attributes (eg. self) can be used to override this behaviour.

To make an action actually do something, first you need to set some strings on it:

AttributePurpose
action.untargettedDefines an untargetted action
action.untargetted.self
action.untargetted.others
action.targettedDefines an action targetted at a person
action.targetted.self
action.targetted.target
action.targetted.others
action.object_targettedDefines an action targetted at an object
action.object_targetted.self
action.object_targetted.others
action.prop_targettedDefines an action targetted at a person, using a prop object
action.prop_targetted.self
action.prop_targetted.target
action.prop_targetted.others
action.textDefines a text action
action.text.self
action.text.others
action.text.errorThe error message displayed when using a text action without supplying any text
action.aliasAn alternative name for the action which the mud's parser will accept
action.minlenThe shortest abbreviation of the action name that the mud will accept
action.commline_safeIf this action is used on a commline, ignore any lua and just use the plain action strings

Lua action gotchas:

Special Actions

If you set use.sleeping to 1 on an action object, people will be able to use it even when asleep. Obviously this isn't appropriate for most actions, but stuff like snore has it.

If you set use.the_voices to 1, if you use that action inside another player, they'll get special messaging that tells them that a voice inside their head is performing that action. Again, this doesn't make sense for all actions... anything with a somatic component (eg, pointing, hugging) woudl look silly. Vocal components only (such as laughter, or singing).

Action Contexts

If you want to let a normal verb be used like an action on a commline, you can make an action magicobject with the same name (eg. to give the push verb an action context, create the action magicobject %action_push. Set the action.override property on the new magicobject to stop it being turnged into a full action (because this will interfere with the real command). The command can then be fed to the actions command, or used after a # on a commline, and will show the action you've just defined. None of the normal verb logic will be triggered.

Currently, you can't use createaction to create override action objects... you must create the action file on disk first. This will be rectified in due course.

If you want to let a lua verb be used on a commline like an action, this is much easier. Just set action.* properties on it as if it were a normal action object, and everything else will just work.