order
Executes state-changing Civilization V actions for owned units, cities, empires, diplomacy, and spies, returning changed state or a specific refusal when a move is invalid.
Instructions
An order to something I own: to the target kind, id which one, action the verb, args its arguments by name. It changes the game, and most of it cannot be undone (a disbanded unit, a declared war, a purchase). Not a read: inspect shows the state and hands back the rows, question / answer settle what a popup asks, turn(action='finish') ends the turn. to: actions --
unit: move, mission, promote, upgrade, disband, trade_route, plunder
city: produce, purchase, dequeue, sell_building, buy_plot, specialist, work_plot, governor, status, strike, great_work
empire: research, policy, ideology, switch_ideology, pantheon, religion, enhance_religion, reformation, faith_purchase
civ: propose_deal, negotiate, peace, demand, friendship, declare_war, denounce, event
city_state: gift_gold, gift_unit, gift_improvement (or a city-state screen button by its name: pledge, revoke_pledge, bully_gold, bully_unit, declare_war, make_peace)
league: propose, repeal, vote
spy: move, coup
How: copy the rows a read hands back (actions, call) as they are; id is a unit, city, civ, city-state or spy id (empire and league take none); args holds what the row holds (a plot's x and y, an item's name, a deal's items, an amount). An order runs whole or not at all. action_id: a token of mine; a retry with the same one replays the stored reply instead of acting twice.
Returns {ok: true, ...} with what changed (a unit's new plot and moves left, a city's queue, a deal's answer), or {ok: false, err, choices / accepts, example}: the verb is not one of the target's (choices lists them), an argument is missing (accepts names the shape, example a complete call), or the game refuses it (err names the rule, e.g. the unit has no moves, the city is not mine, another client of my seat holds this turn's claim). Nothing is acted on when ok is false.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | which unit, city, civ, city-state or spy; empire and league take none | |
| to | Yes | the target kind, something I own | |
| args | No | the action's arguments by name, as the copied row has them; a refusal shows the shape with an example | |
| action | Yes | the verb, by target -- unit: move, mission, promote, upgrade, disband, trade_route, plunder; city: produce, purchase, dequeue, sell_building, buy_plot, specialist, work_plot, governor, status, strike, great_work; empire: research, policy, ideology, switch_ideology, pantheon, religion, enhance_religion, reformation, faith_purchase; civ: propose_deal, negotiate, peace, demand, friendship, declare_war, denounce, event; city_state: gift_gold, gift_unit, gift_improvement, or a city-state screen button by its name (pledge, revoke_pledge, bully_gold, bully_unit, declare_war, make_peace); league: propose, repeal, vote; spy: move, coup | |
| action_id | No | a token of my choosing: a retry with the same action_id replays the stored result instead of acting twice |