unit form creates or modifies a unit.
unit id [ type ] properties...
This form defines a unit. If a numeric id is supplied and matches
the id of an existing unit, then that unit will be modified by
properties, and the optional type will be interpreted as a
new type for the unit. Otherwise a new unit will be created, with
either id as its id or a arbitrarily-selected one if id is
already in use. If the unit's id is newly-generated and no type has
been specified, then type #0 (first-defined type) will be the type of
the unit. An id of
0 can never match an existing unit id, so
effect will be as if it had been omitted.
Form: unit-type-name x y [ side-id ] properties...
This is an abbreviated form, in which the x,y position is required, and
an optional side id may be included. The side id will come from
unit-defaults if not specified. The unit-type-name may be
any valid unit type name or defined name. This form always results in a
Since there may be many units whose properties are similar, there is a "default unit" whose properties fill in missing properties in individual unit declarations.
unit-defaults [ modifier ] properties...
This form sets the default values for all subsequent units read in, in
this and every other module not yet loaded. The set of defaults is
additive, so for instance you can repeatedly change the default side of
units. If the symbol
reset has been supplied for the optional
modifier, then all the defaults will be changed to the basic
default values, as described in this manual.
This is the symbol used to reset unit defaults; see above.
When true, unit forms actually cause units to be created. When false,
the unit forms are saved away and can be used later by a unit form to
supply values for properties. Defaults to
This section lists properties of individual units. In general, they default to the most common or reasonable values, so need not always be specified, even in a saved game.
@ x y [ z ]
This property is the position of the unit. Defaults to
which causes the unit to be placed randomly. The optional altitude
z can also be set separately with the property
z below. If
z is even and the unit is in the open, then the unit's altitude is
z/2; if z is odd, then (z-1)/2 is the type of connection
terrain that the unit is on.
This property is identical to the optional z part of the
This property is the side of the unit. It can be either a side name,
noun, or adjective (string) or an id (number). A value of
"independent" means that the unit is independent.
This property is the original side of the unit. It can be either a side
name, noun, or adjective (string), or an id (number). A value of
"independent" means that the unit is/was originally
independent. Defaults to the unit's actual side when first read in or
This property is the unique numeric id of the unit. Defaults to a game-selected value.
This property is the name of the unit.
This property is the number of the unit, which starts at
goes up. Defaults to
0, which means that the unit is unnumbered.
This property is the current completeness of the unit. If negative,
indicates that the unit will appear at a time and place specified by the
appear x-property. Defaults to the
cp for the type.
This property is the current hit points of the unit. Will be restricted
to the range [0, hp-max]. An hp of 0 means that the unit is dead and
will not appear in the game. Defaults to
hp-max for the unit's
This property is the combat experience of the unit. Experience starts at 0 for new units and goes up with each engagement in combat.
This property is the morale of the unit. Morale ranges from 0 to a
maximum set by
This property is a bit vector indicating the sides that are currently tracking the unit's movements. The unit's own side is not included.
This property is the amounts of supplies being carried by the unit.
0 for each material type.
This property is the level of tooling to build each type of unit.
0 for each unit type.
This property is the id, name, or symbol of the unit's transport.
0, meaning that unit is not in any transport.
This property is the unit's true feelings towards each side, including
its own side. Defaults to
0 for each side.
This property is the turn on which a unit will appear. The unit's cp
must also be negative, and its position must be negatives of its
position. Defaults to
This property is the turn on which a unit will disappear from the game.
Occupants will be ejected if possible; otherwise they will disappear
also. Defaults to
This property is true when the unit should choose its own research topics.
This property is true when the unit should choose its own construction task.
This property is true when the unit should choose its own research topics.
The ID of the unit created by this unit. Reset once the building stage starts.
This property is the current advance that the unit is researching.
This property is the unit's population (currently unused).
This property is the unit's production for each material type.
This property is a symbol that is unique to this unit. This symbol may
appear instead of a unit id, for instance as the value of the property
in. Defaults to
This property is a list of side names that the unit may be given to
during setup. (See side property
units.) Defaults to
This property is the number of action points left to the unit for this turn.
This property is the initial number of action points for this turn, computed at the beginning of the turn.
This property is the actual number of moves (cell entries) executed so far in the current turn.
This property is the next action that the unit will perform.
plan type [ creation-turn ] properties...
This property describes the unit's current plan.
A unit with this type of plan does nothing. It is used when a side has no player.
This plan type is for units on a side that is being run directly by the side. This is the normal plan type for units when a human player is playing.
This plan type is for units that defend areas or other units.
This plan type is for units that are to be aggressive.
This plan type is for units that explore the world.
This plan type is for units to build more units (like cities) that can themselves build more units.
This plan type is for units to improve themselves, such as by adding special types of occupants.
A unit with this plan type will act randomly.
This property is the main goal of a unit's plan. Defaults to
This property is the formation goal of a unit's plan. If defined, it is
a position goal that the unit should try to achieve when it is not
trying to achieve the main goal. Defaults to
This property is the complete task agenda for the unit's plan. It is a
list of tasks. Defaults to
This property is true if the unit is asleep. Defaults to
This property is true if the unit is in reserve. Defaults to
This property is true if the unit's activity has been delayed until all
others have acted. Defaults to
This property is true if the unit is waiting for orders. Defaults to
This property is true if the unit can be controlled by any AI associated
with the side. Defaults to
This property is true if the unit should react when supply is low.
This property is true if the unit considers its supply to be low.
This property is true if the unit is waiting for transport. Defaults to
This property is the turn upon which a plan should go into effect.
This property is the turn upon which a plan should be removed. If the
0, then the plan is not scheduled to be removed.
The possible types of goals are these:
This section lists all the types of tasks that a unit may perform. Every task includes the two parameters ex and re; the first is a record of how many times the task has been executed, and the second records how many times the task has failed. (Xconq will retry a failed task several times before abandoning it.)
build ex re u n n2 unit-id
This type of task directs the unit to build n units of type u. n2 is the number already built in the run and unit-id is the (optional) id of a unit already being built.
capture ex re unit-id
collect m x y
This type of task directs the unit to acquire material of type m at or around x,y and to deliver it to the nearest unit that can accept the material.
disband ex re
This type of task directs the unit to disband itself.
hit-position ex re x y z
This type of task directs the unit to attack or fire on any unfriendly units at the given location.
hit-unit ex re unit-id
move-dir ex re dir n
This type of task directs the unit to move in direction dir for a distance of n cells.
move-to ex re x y z dist
This type of task directs the unit to move to a distance of no more than dist cells from the given location.
occupy ex re unit-id
This type of task directs the unit to attempt to enter the given unit-id, moving adjacent to it first if necessary.
pickup ex re unit-id
This type of task directs the unit to move towards the given unit-id.
repair ex re unit-id
resupply ex re
This type of task directs the unit to replenish its supplies, whether by doing more production or by moving to another unit that has supplies available.
sentry ex re n
This task type directs the unit to stay where it is for the next n turns.