order
Gives an order to a creature by id, as the player would. action:
attack: attacktarget.move: walk topoint. Only the creature you control can be moved this way, so another party memberidis given control first and keeps it (the answer sayscontrolledandbefore). Creatures outside the party cannot be moved.ability: useability(an id fromabilities) ontargetor atpoint. For an item’s ability, such as a potion’s, also passitemoritemTag. An area ability with a range (such as Fireball;abilitiesgives each one’saoeandrange) aimed at a creature is aimed at the ground under it (aimedAt), unlessatCreatureis true. An ability used on oneself alone (targetType1 inabilities, such as a sustained mode) needs notarget: by command it is aimed at the creature itself, which turns a mode on or off.use: use the objecttarget, such as a door, chest or lever. Using a door toggles it;doorWassays whether it was open.
How the order is sent (via):
command: through the engine’s own order functions. The order counts as the player’s, and anything watching the command queue sees it. Any creature can obey. A use by command doesobjectAction.click: as if the player clicked, so anything hooked to clicks also runs (for example a mod that asks for an ability’s target when none is given). Only the creature you control can click, only in explore or combat mode, and a move cannot be clicked. An attack or use by click is carried out by every party member selected in the party bar (selected), and the answer cannot say who obeyed: check the events fromcursor.
via defaults to command, except: a use without objectAction by the creature you control goes by click, since a click picks the object’s own action (a plain use by command can leave a chest or door shut). Out of combat, an item’s ability by the creature you control also goes by click, since by command it does nothing there. Out of combat, when id is another party member, control is handed to it first for these, as for a move, and stays with it.
The answer says the order was given and includes a cursor; wait_for from it shows what happened (eluvian.command.started and eluvian.command.ended, and a mod’s own events).
Arguments
| Name | Type | Required | What |
|---|---|---|---|
action | "attack" | "move" | "ability" | "use" | yes | What to do. |
id | any | Who obeys, by creature id. Default: the creature you control. | |
atCreature | boolean | With ability: aim an area ability at the creature itself, not the ground under it. Default false. | |
target | any | The creature or object to act on, by id. | |
point | any | With move or ability: the point, {x, y, z} or [x, y, z]. | |
ability | integer | The ability’s id, from abilities. | |
item | any | For an item’s ability: the item’s id. | |
itemTag | string | For an item’s ability: the item’s tag, looked up in the creature’s inventory (for example gen_im_qck_health_101, a lesser health poultice). | |
via | "command" | "click" | How the order is sent. Default command, but click for a use without objectAction, or an item’s ability out of combat, by the creature you control. | |
objectAction | string | With use by command: what to do with the object, a PLACEABLE_ACTION_* name such as open, close, unlock, use, examine, disarm, dialog, open_inventory, trigger_trap, topple or area_transition. Default use. It must be an action the object accepts in its current state, or the command ends with COMMAND_FAILED: a locked chest takes unlock, then open_inventory. |
Call it as order over MCP, or POST /api/tool/order with the arguments as JSON.