state
Reads your Civilization V seat's visible game data—empire, units, cities, map, options, and legal actions—as JSON with no side effects, so you can choose and verify orders.
Instructions
Read the game as my seat sees it: the empire, units, cities, civs and city-states, the map, the league, spies, the screens, and the choices open to me (research, policies, beliefs, trade routes). Read-only, no side effect, usable while it is not my turn. Use it before an order (its rows ARE the orders) and after one to verify; use reference for what things do, question for what a popup asks, turn for the turn's own state.
How to call: what names the object, view the part of it (left out: the default view), id the one object. Objects and their views:
empire: default, demographics
notifications: default
screen: tech_tree, religion, culture, culture_works, great_people, domination, spaceship, wonders, intrigue, trade_routes, deals
league: default
spies: default
units: default, actions
unit: actions, targets, tactical, home
cities: default
city: screen, production, strikes
map: window, grid, index, frontier
civs: default
civ: summary, war, trade_catalog
city_state: summary, full
options: research, policies, beliefs, trade_routes, spy_cities
compare: default
Selectors, by view: x, y, radius for map/window and map/grid; radius alone for unit/tactical (centred on the unit); id for map/frontier (the explorer) and options/trade_routes (the caravan); mission for unit/targets; kind for options/beliefs and compare; detail ('summary' / 'full') where a view has both; since and limit for lists; item and yield_type for city/production to price one item; args for the rest by the old call's name.
Returns: the object as JSON (a list for units, cities, civs; one dict otherwise), with actions or call rows wherever something can be done: each row is a complete order() call to copy. A wrong what or view is refused with choices, and for an object that takes an id, a hint saying where the ids come from (unit ids from units, city-state ids from the minor: true rows of civs). Replies are the 1.x reads' replies unchanged.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | map/window and map/grid: the centre plot, with y | |
| y | No | with x | |
| id | No | the one object's id (unit, city, civ, city-state or spy; the explorer's unit id for map/frontier and the caravan's for options/trade_routes); a list of unit ids for units/actions | |
| args | No | the rest by the old call's name (compare's fields) | |
| item | No | city/production: price this one item | |
| kind | No | options/beliefs: the belief kind; compare: what to compare | |
| view | No | the part of the object, from the list below; the default view when left out | |
| what | Yes | the object: empire, notifications, screen, league, spies, units, unit, cities, city, map, civs, civ, city_state, options, compare | |
| limit | No | how many rows a list returns | |
| since | No | notifications: only those after this turn number | |
| detail | No | 'summary' or 'full' where a view offers both | |
| radius | No | map/window and map/grid: tiles around x, y; unit/tactical: tiles around the unit | |
| mission | No | unit/targets: the mission whose legal targets to list | |
| yield_type | No | city/production with item: the yield to price it in |