In 0 A.D., entities (units and buildings and other world objects) consist of a collection of components, each of which determines part of the entity's behaviour. Entity template XML files specify the list of components that are loaded for each entity type, plus initialisation data for the components.
This page lists the components that can be added to entities and the XML syntax for their initialisation data.
Available components:
<element name="AIProxy"> <interleave> <empty/> </interleave> </element>
Controls the damage resistance of the unit.
<Armour> <Hack>10.0</Hack> <Pierce>0.0</Pierce> <Crush>5.0</Crush> </Armour>
Hack
Hack damage protection.
Value type: non-negative decimal (e.g. 0.0 or 2.5).
Pierce
Pierce damage protection.
Value type: non-negative decimal (e.g. 0.0 or 2.5).
Crush
Crush damage protection.
Value type: non-negative decimal (e.g. 0.0 or 2.5).
<element name="Armour"> <interleave> <element name="Hack"> <ref name="nonNegativeDecimal"/> </element> <element name="Pierce"> <ref name="nonNegativeDecimal"/> </element> <element name="Crush"> <ref name="nonNegativeDecimal"/> </element> </interleave> </element>
Controls the attack abilities and strengths of the unit.
<Attack> <Melee> <Hack>10.0</Hack> <Pierce>0.0</Pierce> <Crush>5.0</Crush> <MaxRange>4.0</MaxRange> <RepeatTime>1000</RepeatTime> <Bonuses> <Bonus1> <Civ>pers</Civ> <Classes>Infantry</Classes> <Multiplier>1.5</Multiplier> </Bonus1> <BonusCavMelee> <Classes>Cavalry Melee</Classes> <Multiplier>1.5</Multiplier> </BonusCavMelee> </Bonuses> </Melee> <Ranged> <Hack>0.0</Hack> <Pierce>10.0</Pierce> <Crush>0.0</Crush> <MaxRange>44.0</MaxRange> <MinRange>20.0</MinRange> <PrepareTime>800</PrepareTime> <RepeatTime>1600</RepeatTime> <ProjectileSpeed>50.0</ProjectileSpeed> <Bonuses> <Bonus1> <Classes>Cavalry</Classes> <Multiplier>2</Multiplier> </Bonus1> </Bonuses> </Ranged> <Charge> <Hack>10.0</Hack> <Pierce>0.0</Pierce> <Crush>50.0</Crush> <MaxRange>24.0</MaxRange> <MinRange>20.0</MinRange> </Charge> </Attack>
Melee
Optional.
Hack
Hack damage strength.
Value type: non-negative decimal (e.g. 0.0 or 2.5).
Pierce
Pierce damage strength.
Value type: non-negative decimal (e.g. 0.0 or 2.5).
Crush
Crush damage strength.
Value type: non-negative decimal (e.g. 0.0 or 2.5).
MaxRange
Maximum attack range (in metres).
Value type: non-negative decimal (e.g. 0.0 or 2.5).
RepeatTime
Time between attacks (in milliseconds). The attack animation will be stretched to match this time.
Value type: positive integer (e.g. 1 or 5).
Bonuses
Optional.
Civ
Optional.
If an entity has this civ then the bonus is applied.
Value type: text.
Classes
If an entity has all these classes then the bonus is applied.
Value type: text.
Multiplier
The attackers attack strength is multiplied by this.
Value type: non-negative decimal (e.g. 0.0 or 2.5).
Ranged
Optional.
Hack
Hack damage strength.
Value type: non-negative decimal (e.g. 0.0 or 2.5).
Pierce
Pierce damage strength.
Value type: non-negative decimal (e.g. 0.0 or 2.5).
Crush
Crush damage strength.
Value type: non-negative decimal (e.g. 0.0 or 2.5).
MaxRange
Maximum attack range (in metres).
Value type: non-negative decimal (e.g. 0.0 or 2.5).
MinRange
Minimum attack range (in metres).
Value type: non-negative decimal (e.g. 0.0 or 2.5).
PrepareTime
Time from the start of the attack command until the attack actually occurs (in milliseconds). This value relative to RepeatTime should closely match the "event" point in the actor's attack animation.
Value type: non-negative integer (e.g. 0 or 5).
RepeatTime
Time between attacks (in milliseconds). The attack animation will be stretched to match this time.
Value type: positive integer (e.g. 1 or 5).
ProjectileSpeed
Speed of projectiles (in metres per second). If unspecified, then it is a melee attack instead.
Value type: non-negative decimal (e.g. 0.0 or 2.5).
Bonuses
Optional.
Civ
Optional.
If an entity has this civ then the bonus is applied.
Value type: text.
Classes
If an entity has all these classes then the bonus is applied.
Value type: text.
Multiplier
The attackers attack strength is multiplied by this.
Value type: non-negative decimal (e.g. 0.0 or 2.5).
Charge
Optional.
Hack
Hack damage strength.
Value type: non-negative decimal (e.g. 0.0 or 2.5).
Pierce
Pierce damage strength.
Value type: non-negative decimal (e.g. 0.0 or 2.5).
Crush
Crush damage strength.
Value type: non-negative decimal (e.g. 0.0 or 2.5).
MaxRange
Value type: non-negative decimal (e.g. 0.0 or 2.5).
MinRange
Value type: non-negative decimal (e.g. 0.0 or 2.5).
Bonuses
Optional.
Civ
Optional.
If an entity has this civ then the bonus is applied.
Value type: text.
Classes
If an entity has all these classes then the bonus is applied.
Value type: text.
Multiplier
The attackers attack strength is multiplied by this.
Value type: non-negative decimal (e.g. 0.0 or 2.5).
<element name="Attack"> <interleave> <optional> <element name="Melee"> <interleave> <element name="Hack"> <ref name="nonNegativeDecimal"/> </element> <element name="Pierce"> <ref name="nonNegativeDecimal"/> </element> <element name="Crush"> <ref name="nonNegativeDecimal"/> </element> <element name="MaxRange"> <ref name="nonNegativeDecimal"/> </element> <element name="RepeatTime"> <data type="positiveInteger"/> </element> <optional> <element name="Bonuses"> <zeroOrMore> <element> <anyName/> <interleave> <optional> <element name="Civ"> <text/> </element> </optional> <element name="Classes"> <text/> </element> <element name="Multiplier"> <ref name="nonNegativeDecimal"/> </element> </interleave> </element> </zeroOrMore> </element> </optional> </interleave> </element> </optional> <optional> <element name="Ranged"> <interleave> <element name="Hack"> <ref name="nonNegativeDecimal"/> </element> <element name="Pierce"> <ref name="nonNegativeDecimal"/> </element> <element name="Crush"> <ref name="nonNegativeDecimal"/> </element> <element name="MaxRange"> <ref name="nonNegativeDecimal"/> </element> <element name="MinRange"> <ref name="nonNegativeDecimal"/> </element> <element name="PrepareTime"> <data type="nonNegativeInteger"/> </element> <element name="RepeatTime"> <data type="positiveInteger"/> </element> <element name="ProjectileSpeed"> <ref name="nonNegativeDecimal"/> </element> <optional> <element name="Bonuses"> <zeroOrMore> <element> <anyName/> <interleave> <optional> <element name="Civ"> <text/> </element> </optional> <element name="Classes"> <text/> </element> <element name="Multiplier"> <ref name="nonNegativeDecimal"/> </element> </interleave> </element> </zeroOrMore> </element> </optional> </interleave> </element> </optional> <optional> <element name="Charge"> <interleave> <element name="Hack"> <ref name="nonNegativeDecimal"/> </element> <element name="Pierce"> <ref name="nonNegativeDecimal"/> </element> <element name="Crush"> <ref name="nonNegativeDecimal"/> </element> <element name="MaxRange"> <ref name="nonNegativeDecimal"/> </element> <element name="MinRange"> <ref name="nonNegativeDecimal"/> </element> <optional> <element name="Bonuses"> <zeroOrMore> <element> <anyName/> <interleave> <optional> <element name="Civ"> <text/> </element> </optional> <element name="Classes"> <text/> </element> <element name="Multiplier"> <ref name="nonNegativeDecimal"/> </element> </interleave> </element> </zeroOrMore> </element> </optional> </interleave> </element> </optional> </interleave> </element>
Radius
Value type: non-negative integer (e.g. 0 or 5).
Bonus
Optional.
Value type: positive integer (e.g. 1 or 5).
Time
Optional.
Value type: non-negative integer (e.g. 0 or 5).
Speed
Optional.
Value type: positive integer (e.g. 1 or 5).
<element name="Auras"> <interleave> <oneOrMore> <element> <choice> <name>Allure</name> <name>Infidelity</name> <name>Heal</name> <name>Courage</name> <name>Fear</name> </choice> <interleave> <element name="Radius"> <data type="nonNegativeInteger"/> </element> <optional> <element name="Bonus"> <data type="positiveInteger"/> </element> </optional> <optional> <element name="Time"> <data type="nonNegativeInteger"/> </element> </optional> <optional> <element name="Speed"> <data type="positiveInteger"/> </element> </optional> </interleave> </element> </oneOrMore> </interleave> </element>
Specifies per category limits on number of buildings that can be constructed for each player.
<BuildLimits> <Limits> <CivilCentre/> <ScoutTower>25</ScoutTower> <Fortress>10</Fortress> <Special> <LimitPerCivCentre>1</LimitPerCivCentre> </Special> </Limits> </BuildLimits>
LimitMultiplier
Value type: positive decimal (e.g. 1.0 or 2.5).
Limits
LimitPerCivCentre
Specifies that this limit is per number of civil centres..
Value type: non-negative integer (e.g. 0 or 5).
<element name="BuildLimits"> <interleave> <element name="LimitMultiplier"> <ref name="positiveDecimal"/> </element> <element name="Limits"> <zeroOrMore> <element> <anyName/> <choice> <text/> <element name="LimitPerCivCentre"> <data type="nonNegativeInteger"/> </element> </choice> </element> </zeroOrMore> </element> </interleave> </element>
Specifies building placement restrictions as they relate to terrain, territories, and distance.
<BuildRestrictions> <BuildRestrictions> <PlacementType>land</PlacementType> <Territory>own</Territory> <Category>Special</Category> <Distance> <FromCategory>CivilCentre</FromCategory> <MaxDistance>40</MaxDistance> </Distance> </BuildRestrictions> </BuildRestrictions>
PlacementType
Specifies the terrain type restriction for this building..
Value is one of:
land
shore
Territory
Specifies territory type restrictions for this building..
Category
Specifies the category of this building, for satisfying special constraints..
Value is one of:
CivilCentre
House
ScoutTower
Farmstead
Market
Barracks
Dock
Fortress
Field
Temple
Wall
Fence
Mill
Stoa
Resource
Special
Distance
Optional.
Specifies distance restrictions on this building, relative to buildings from the given category..
FromCategory
Value is one of:
CivilCentre
MinDistance
Optional.
Value type: positive integer (e.g. 1 or 5).
MaxDistance
Optional.
Value type: positive integer (e.g. 1 or 5).
<element name="BuildRestrictions"> <interleave> <element name="PlacementType"> <choice> <value>land</value> <value>shore</value> </choice> </element> <element name="Territory"> <list> <oneOrMore> <choice> <value>own</value> <value>ally</value> <value>neutral</value> <value>enemy</value> </choice> </oneOrMore> </list> </element> <element name="Category"> <choice> <value>CivilCentre</value> <value>House</value> <value>ScoutTower</value> <value>Farmstead</value> <value>Market</value> <value>Barracks</value> <value>Dock</value> <value>Fortress</value> <value>Field</value> <value>Temple</value> <value>Wall</value> <value>Fence</value> <value>Mill</value> <value>Stoa</value> <value>Resource</value> <value>Special</value> </choice> </element> <optional> <element name="Distance"> <interleave> <element name="FromCategory"> <choice> <value>CivilCentre</value> </choice> </element> <optional> <element name="MinDistance"> <data type="positiveInteger"/> </element> </optional> <optional> <element name="MaxDistance"> <data type="positiveInteger"/> </element> </optional> </interleave> </element> </optional> </interleave> </element>
Allows the unit to construct and repair buildings.
<Builder> <Rate>1.0</Rate> <Entities datatype="tokens"> structures/{civ}_barracks structures/{civ}_civil_centre structures/celt_sb1 </Entities> </Builder>
Rate
Construction speed multiplier (1.0 is normal speed, higher values are faster).
Value type: positive decimal (e.g. 1.0 or 2.5).
Entities
Space-separated list of entity template names that this unit can build. The special string "{civ}" will be automatically replaced by the unit's four-character civ code.
Value type: text.
datatype
Required value: tokens
<element name="Builder"> <interleave> <element name="Rate"> <ref name="positiveDecimal"/> </element> <element name="Entities"> <attribute name="datatype"> <value>tokens</value> </attribute> <text/> </element> </interleave> </element>
DefaultArrowCount
Value type: non-negative integer (e.g. 0 or 5).
GarrisonArrowMultiplier
Value type: non-negative decimal (e.g. 0.0 or 2.5).
<element name="BuildingAI"> <interleave> <element name="DefaultArrowCount"> <data type="nonNegativeInteger"/> </element> <element name="GarrisonArrowMultiplier"> <ref name="nonNegativeDecimal"/> </element> </interleave> </element>
Specifies the construction/training costs of this entity.
<Cost> <Population>1</Population> <PopulationBonus>15</PopulationBonus> <BuildTime>20.0</BuildTime> <Resources> <food>50</food> <wood>0</wood> <stone>0</stone> <metal>25</metal> </Resources> </Cost>
Population
Population cost.
Value type: non-negative integer (e.g. 0 or 5).
PopulationBonus
Population cap increase while this entity exists.
Value type: non-negative integer (e.g. 0 or 5).
BuildTime
Time taken to construct/train this unit (in seconds).
Value type: positive decimal (e.g. 1.0 or 2.5).
Resources
Resource costs to construct/train this unit.
food
Value type: non-negative integer (e.g. 0 or 5).
wood
Value type: non-negative integer (e.g. 0 or 5).
stone
Value type: non-negative integer (e.g. 0 or 5).
metal
Value type: non-negative integer (e.g. 0 or 5).
<element name="Cost"> <interleave> <element name="Population"> <data type="nonNegativeInteger"/> </element> <element name="PopulationBonus"> <data type="nonNegativeInteger"/> </element> <element name="BuildTime"> <ref name="positiveDecimal"/> </element> <element name="Resources"> <interleave> <element name="food"> <data type="nonNegativeInteger"/> </element> <element name="wood"> <data type="nonNegativeInteger"/> </element> <element name="stone"> <data type="nonNegativeInteger"/> </element> <element name="metal"> <data type="nonNegativeInteger"/> </element> </interleave> </element> </interleave> </element>
DelayTime
Time to wait before starting to sink, in seconds.
Value type: non-negative decimal (e.g. 0.0 or 2.5).
SinkRate
Initial rate of sinking, in metres per second.
Value type: non-negative decimal (e.g. 0.0 or 2.5).
SinkAccel
Acceleration rate of sinking, in metres per second per second.
Value type: non-negative decimal (e.g. 0.0 or 2.5).
Inactive
Optional.
If this element is present, the entity will not do any decaying.
<element name="Decay"> <interleave> <element name="DelayTime"> <ref name="nonNegativeDecimal"/> </element> <element name="SinkRate"> <ref name="nonNegativeDecimal"/> </element> <element name="SinkAccel"> <ref name="nonNegativeDecimal"/> </element> <optional> <element name="Inactive"> <empty/> </element> </optional> </interleave> </element>
Approximation of the entity's shape, for collision detection and outline rendering. Shapes are flat horizontal squares or circles, extended vertically to a given height.
<Footprint> <Square width="3.0" height="3.0"/> <Height>0.0</Height> </Footprint>
<Footprint> <Circle radius="0.5"/> <Height>0.0</Height> </Footprint>
Square
Set the footprint to a square of the given size.
width
Size of the footprint along the left/right direction (in metres).
Value type: positive decimal (e.g. 1.0 or 2.5).
depth
Size of the footprint along the front/back direction (in metres).
Value type: positive decimal (e.g. 1.0 or 2.5).
Circle
Set the footprint to a circle of the given size.
radius
Radius of the footprint (in metres).
Value type: positive decimal (e.g. 1.0 or 2.5).
Height
Vertical extent of the footprint (in metres).
Value type: non-negative decimal (e.g. 0.0 or 2.5).
<element name="Footprint"> <interleave> <choice> <element name="Square"> <attribute name="width"> <ref name="positiveDecimal"/> </attribute> <attribute name="depth"> <ref name="positiveDecimal"/> </attribute> </element> <element name="Circle"> <attribute name="radius"> <ref name="positiveDecimal"/> </attribute> </element> </choice> <element name="Height"> <ref name="nonNegativeDecimal"/> </element> </interleave> </element>
Max
Value type: positive integer (e.g. 1 or 5).
List
Value type: text.
datatype
Required value: tokens
EjectHealth
Value type: non-negative decimal (e.g. 0.0 or 2.5).
BuffHeal
Value type: positive integer (e.g. 1 or 5).
<element name="GarrisonHolder"> <interleave> <element name="Max"> <data type="positiveInteger"/> </element> <element name="List"> <attribute name="datatype"> <value>tokens</value> </attribute> <text/> </element> <element name="EjectHealth"> <ref name="nonNegativeDecimal"/> </element> <element name="BuffHeal"> <data type="positiveInteger"/> </element> </interleave> </element>
Deals with hitpoints and death.
<Health> <Max>100</Max> <RegenRate>1.0</RegenRate> <DeathType>corpse</DeathType> </Health>
Max
Maximum hitpoints.
Value type: positive integer (e.g. 1 or 5).
Initial
Optional.
Initial hitpoints. Default if unspecified is equal to Max.
Value type: positive integer (e.g. 1 or 5).
RegenRate
Hitpoint regeneration rate per second. Not yet implemented.
Value type: non-negative decimal (e.g. 0.0 or 2.5).
DeathType
Behaviour when the unit dies.
Value is one of:
vanish
corpse
remain
Healable
Indicates that the entity can be healed by healer units.
Value type: boolean (true or false).
Repairable
Indicates that the entity can be repaired by builder units.
Value type: boolean (true or false).
<element name="Health"> <interleave> <element name="Max"> <data type="positiveInteger"/> </element> <optional> <element name="Initial"> <data type="positiveInteger"/> </element> </optional> <element name="RegenRate"> <ref name="nonNegativeDecimal"/> </element> <element name="DeathType"> <choice> <value>vanish</value> <value>corpse</value> <value>remain</value> </choice> </element> <element name="Healable"> <data type="boolean"/> </element> <element name="Repairable"> <data type="boolean"/> </element> </interleave> </element>
Specifies various names and values associated with the unit type, typically for GUI display to users.
<Identity> <Civ>hele</Civ> <GenericName>Infantry Spearman</GenericName> <SpecificName>Hoplite</SpecificName> <Icon>units/hele_infantry_spearman.png</Icon> </Identity>
Civ
Civilisation that this unit is primarily associated with.
Value is one of:
gaia
cart
celt
hele
iber
pers
rome
GenericName
Generic English-language name for this class of unit.
Value type: text.
SpecificName
Optional.
Specific native-language name for this unit type.
Value type: text.
SelectionGroupName
Optional.
Name used to group ranked entities.
Value type: text.
Tooltip
Optional.
Value type: text.
Rollover
Optional.
Value type: text.
History
Optional.
Value type: text.
Rank
Optional.
Value is one of:
Basic
Advanced
Elite
Classes
Optional.
datatype
Required value: tokens
Formations
Optional.
datatype
Required value: tokens
Icon
Optional.
Value type: text.
<element name="Identity"> <interleave> <element name="Civ"> <choice> <value>gaia</value> <value>cart</value> <value>celt</value> <value>hele</value> <value>iber</value> <value>pers</value> <value>rome</value> </choice> </element> <element name="GenericName"> <text/> </element> <optional> <element name="SpecificName"> <text/> </element> </optional> <optional> <element name="SelectionGroupName"> <text/> </element> </optional> <optional> <element name="Tooltip"> <text/> </element> </optional> <optional> <element name="Rollover"> <text/> </element> </optional> <optional> <element name="History"> <text/> </element> </optional> <optional> <element name="Rank"> <choice> <value>Basic</value> <value>Advanced</value> <value>Elite</value> </choice> </element> </optional> <optional> <element name="Classes"> <attribute name="datatype"> <value>tokens</value> </attribute> <list> <zeroOrMore> <choice> <value>Unit</value> <value>Infantry</value> <value>Melee</value> <value>Cavalry</value> <value>Ranged</value> <value>Mechanical</value> <value>Ship</value> <value>Siege</value> <value>Champion</value> <value>Hero</value> <value>Elephant</value> <value>Chariot</value> <value>Mercenary</value> <value>Spear</value> <value>Sword</value> <value>Bow</value> <value>Javelin</value> <value>Sling</value> <value>Support</value> <value>Animal</value> <value>Organic</value> <value>Structure</value> <value>Civic</value> <value>CivCentre</value> <value>Economic</value> <value>Defensive</value> <value>Gates</value> <value>Wall</value> <value>BarterMarket</value> <value>Village</value> <value>Town</value> <value>City</value> <value>ConquestCritical</value> <value>Worker</value> <value>Female</value> <value>Healer</value> <value>Slave</value> <value>CitizenSoldier</value> <value>Trade</value> <value>Warship</value> <value>SeaCreature</value> <value>ForestPlant</value> <value>DropsiteFood</value> <value>DropsiteWood</value> <value>DropsiteStone</value> <value>DropsiteMetal</value> </choice> </zeroOrMore> </list> </element> </optional> <optional> <element name="Formations"> <attribute name="datatype"> <value>tokens</value> </attribute> <list> <zeroOrMore> <choice> <value>Loose</value> <value>Box</value> <value>ColumnClosed</value> <value>LineClosed</value> <value>ColumnOpen</value> <value>LineOpen</value> <value>Flank</value> <value>Skirmish</value> <value>Wedge</value> <value>Testudo</value> <value>Phalanx</value> <value>Syntagma</value> <value>Formation12</value> </choice> </zeroOrMore> </list> </element> </optional> <optional> <element name="Icon"> <text/> </element> </optional> </interleave> </element>
xp
Optional.
Value type: non-negative integer (e.g. 0 or 5).
food
Optional.
Value type: non-negative integer (e.g. 0 or 5).
wood
Optional.
Value type: non-negative integer (e.g. 0 or 5).
stone
Optional.
Value type: non-negative integer (e.g. 0 or 5).
metal
Optional.
Value type: non-negative integer (e.g. 0 or 5).
<element name="Loot"> <interleave> <optional> <element name="xp"> <data type="nonNegativeInteger"/> </element> </optional> <optional> <element name="food"> <data type="nonNegativeInteger"/> </element> </optional> <optional> <element name="wood"> <data type="nonNegativeInteger"/> </element> </optional> <optional> <element name="stone"> <data type="nonNegativeInteger"/> </element> </optional> <optional> <element name="metal"> <data type="nonNegativeInteger"/> </element> </optional> </interleave> </element>
<element name="Looter"> <interleave> <empty/> </interleave> </element>
Type
Value is one of:
food
wood
stone
metal
structure
settlement
unit
support
hero
Colour
Optional.
r
Value type: integer.
g
Value type: integer.
b
Value type: integer.
<element name="Minimap"> <interleave> <element name="Type"> <choice> <value>food</value> <value>wood</value> <value>stone</value> <value>metal</value> <value>structure</value> <value>settlement</value> <value>unit</value> <value>support</value> <value>hero</value> </choice> </element> <optional> <element name="Colour"> <attribute name="r"> <data type="integer"> <param name="minInclusive">0</param> <param name="maxInclusive">255</param> </data> </attribute> <attribute name="g"> <data type="integer"> <param name="minInclusive">0</param> <param name="maxInclusive">255</param> </data> </attribute> <attribute name="b"> <data type="integer"> <param name="minInclusive">0</param> <param name="maxInclusive">255</param> </data> </attribute> </element> </optional> </interleave> </element>
Causes this entity to obstruct the motion of other units.
<Obstruction/>
Static
width
Value type: positive decimal (e.g. 1.0 or 2.5).
depth
Value type: positive decimal (e.g. 1.0 or 2.5).
Unit
radius
Value type: positive decimal (e.g. 1.0 or 2.5).
Active
If false, this entity will be ignored in collision tests by other units but can still perform its own collision tests.
Value type: boolean (true or false).
BlockMovement
Whether units should be allowed to walk through this entity.
Value type: boolean (true or false).
BlockPathfinding
Whether the long-distance pathfinder should avoid paths through this entity. This should only be set for large stationary obstructions.
Value type: boolean (true or false).
BlockFoundation
Whether players should be unable to place building foundations on top of this entity. If true, BlockConstruction should be true too.
Value type: boolean (true or false).
BlockConstruction
Whether players should be unable to begin constructing buildings placed on top of this entity.
Value type: boolean (true or false).
DisableBlockMovement
If true, BlockMovement will be overridden and treated as false. (This is a special case to handle foundations).
Value type: boolean (true or false).
DisableBlockPathfinding
If true, BlockPathfinding will be overridden and treated as false. (This is a special case to handle foundations).
Value type: boolean (true or false).
<element name="Obstruction"> <interleave> <choice> <element name="Static"> <attribute name="width"> <ref name="positiveDecimal"/> </attribute> <attribute name="depth"> <ref name="positiveDecimal"/> </attribute> </element> <element name="Unit"> <attribute name="radius"> <ref name="positiveDecimal"/> </attribute> </element> </choice> <element name="Active"> <data type="boolean"/> </element> <element name="BlockMovement"> <data type="boolean"/> </element> <element name="BlockPathfinding"> <data type="boolean"/> </element> <element name="BlockFoundation"> <data type="boolean"/> </element> <element name="BlockConstruction"> <data type="boolean"/> </element> <element name="DisableBlockMovement"> <data type="boolean"/> </element> <element name="DisableBlockPathfinding"> <data type="boolean"/> </element> </interleave> </element>
Allows this entity to be owned by players.
<Ownership/>
<element name="Ownership"> <interleave> <empty/> </interleave> </element>
Allows this entity to exist at a location (and orientation) in the world, and defines some details of the positioning.
<Position> <Anchor>upright</Anchor> <Altitude>0.0</Altitude> <Floating>false</Floating> <TurnRate>6.0</TurnRate> </Position>
Anchor
Automatic rotation to follow the slope of terrain.
Value is one of:
upright
pitch
pitch-roll
Altitude
Height above terrain in metres.
Value type: decimal (e.g. -10.0 or 0.0 or 2.5).
Floating
Whether the entity floats on water.
Value type: boolean (true or false).
TurnRate
Maximum graphical rotation speed around Y axis, in radians per second.
Value type: positive decimal (e.g. 1.0 or 2.5).
<element name="Position"> <interleave> <element name="Anchor"> <choice> <value>upright</value> <value>pitch</value> <value>pitch-roll</value> </choice> </element> <element name="Altitude"> <data type="decimal"/> </element> <element name="Floating"> <data type="boolean"/> </element> <element name="TurnRate"> <ref name="positiveDecimal"/> </element> </interleave> </element>
Entity
Value type: text.
RequiredXp
Value type: positive integer (e.g. 1 or 5).
<element name="Promotion"> <interleave> <element name="Entity"> <text/> </element> <element name="RequiredXp"> <data type="positiveInteger"/> </element> </interleave> </element>
<element name="RallyPoint"> <interleave> <empty/> </interleave> </element>
Displays a rally point marker where created units will gather when spawned
<RallyPointRenderer> <MarkerTemplate>special/rallypoint</MarkerTemplate> <LineThickness>0.75</LineThickness> <LineStartCap>round</LineStartCap> <LineEndCap>square</LineEndCap> <LineColour r="20" g="128" b="240"/> <LineDashColour r="158" g="11" b="15"/> <LineCostClass>default</LineCostClass> <LinePassabilityClass>default</LinePassabilityClass> </RallyPointRenderer>
MarkerTemplate
Template name for the rally point marker entity (typically a waypoint flag actor).
Value type: text.
LineTexture
Texture file to use for the rally point line.
Value type: text.
LineTextureMask
Texture mask to indicate where overlay colors are to be applied (see LineColour and LineDashColour).
Value type: text.
LineThickness
Thickness of the marker line connecting the entity to the rally point marker.
Value type: decimal (e.g. -10.0 or 0.0 or 2.5).
LineColour
r
Value type: integer.
g
Value type: integer.
b
Value type: integer.
LineDashColour
r
Value type: integer.
g
Value type: integer.
b
Value type: integer.
LineStartCap
Value is one of:
flat
round
sharp
square
LineEndCap
Value is one of:
flat
round
sharp
square
LinePassabilityClass
The pathfinder passability class to use for computing the rally point marker line path.
Value type: text.
LineCostClass
The pathfinder cost class to use for computing the rally point marker line path.
Value type: text.
<element name="RallyPointRenderer"> <interleave> <element name="MarkerTemplate"> <text/> </element> <element name="LineTexture"> <text/> </element> <element name="LineTextureMask"> <text/> </element> <element name="LineThickness"> <data type="decimal"/> </element> <element name="LineColour"> <attribute name="r"> <data type="integer"> <param name="minInclusive">0</param> <param name="maxInclusive">255</param> </data> </attribute> <attribute name="g"> <data type="integer"> <param name="minInclusive">0</param> <param name="maxInclusive">255</param> </data> </attribute> <attribute name="b"> <data type="integer"> <param name="minInclusive">0</param> <param name="maxInclusive">255</param> </data> </attribute> </element> <element name="LineDashColour"> <attribute name="r"> <data type="integer"> <param name="minInclusive">0</param> <param name="maxInclusive">255</param> </data> </attribute> <attribute name="g"> <data type="integer"> <param name="minInclusive">0</param> <param name="maxInclusive">255</param> </data> </attribute> <attribute name="b"> <data type="integer"> <param name="minInclusive">0</param> <param name="maxInclusive">255</param> </data> </attribute> </element> <element name="LineStartCap"> <choice> <value>flat</value> <value>round</value> <value>sharp</value> <value>square</value> </choice> </element> <element name="LineEndCap"> <choice> <value>flat</value> <value>round</value> <value>sharp</value> <value>square</value> </choice> </element> <element name="LinePassabilityClass"> <text/> </element> <element name="LineCostClass"> <text/> </element> </interleave> </element>
Types
<element name="ResourceDropsite"> <interleave> <element name="Types"> <list> <oneOrMore> <choice> <value>food</value> <value>wood</value> <value>stone</value> <value>metal</value> </choice> </oneOrMore> </list> </element> </interleave> </element>
Lets the unit gather resources from entities that have the ResourceSupply component.
<ResourceGatherer> <MaxDistance>2.0</MaxDistance> <BaseSpeed>1.0</BaseSpeed> <Rates> <food.fish>1</food.fish> <metal.ore>3</metal.ore> <stone.rock>3</stone.rock> <wood.tree>2</wood.tree> </Rates> <Capacities> <food>10</food> <metal>10</metal> <stone>10</stone> <wood>10</wood> </Capacities> </ResourceGatherer>
MaxDistance
Max resource-gathering distance.
Value type: positive decimal (e.g. 1.0 or 2.5).
BaseSpeed
Base resource-gathering rate (in resource units per second).
Value type: positive decimal (e.g. 1.0 or 2.5).
Rates
Per-resource-type gather rate multipliers. If a resource type is not specified then it cannot be gathered by this unit.
food
Optional.
Food gather rate (may be overridden by "food.*" subtypes).
Value type: positive decimal (e.g. 1.0 or 2.5).
wood
Optional.
Wood gather rate.
Value type: positive decimal (e.g. 1.0 or 2.5).
stone
Optional.
Stone gather rate.
Value type: positive decimal (e.g. 1.0 or 2.5).
metal
Optional.
Metal gather rate.
Value type: positive decimal (e.g. 1.0 or 2.5).
treasure
Optional.
Treasure gather rate (only presense on value makes sense, size is ignored).
Value type: positive decimal (e.g. 1.0 or 2.5).
food.fish
Optional.
Fish gather rate (overrides "food").
Value type: positive decimal (e.g. 1.0 or 2.5).
food.fruit
Optional.
Fruit gather rate (overrides "food").
Value type: positive decimal (e.g. 1.0 or 2.5).
food.grain
Optional.
Grain gather rate (overrides "food").
Value type: positive decimal (e.g. 1.0 or 2.5).
food.meat
Optional.
Meat gather rate (overrides "food").
Value type: positive decimal (e.g. 1.0 or 2.5).
food.milk
Optional.
Milk gather rate (overrides "food").
Value type: positive decimal (e.g. 1.0 or 2.5).
wood.tree
Optional.
Tree gather rate (overrides "wood").
Value type: positive decimal (e.g. 1.0 or 2.5).
wood.ruins
Optional.
Tree gather rate (overrides "wood").
Value type: positive decimal (e.g. 1.0 or 2.5).
stone.rock
Optional.
Rock gather rate (overrides "stone").
Value type: positive decimal (e.g. 1.0 or 2.5).
stone.ruins
Optional.
Rock gather rate (overrides "stone").
Value type: positive decimal (e.g. 1.0 or 2.5).
metal.ore
Optional.
Ore gather rate (overrides "metal").
Value type: positive decimal (e.g. 1.0 or 2.5).
treasure.food
Optional.
Food treasure gather rate (overrides "treasure").
Value type: positive decimal (e.g. 1.0 or 2.5).
treasure.wood
Optional.
Wood treasure gather rate (overrides "treasure").
Value type: positive decimal (e.g. 1.0 or 2.5).
treasure.stone
Optional.
Stone treasure gather rate (overrides "treasure").
Value type: positive decimal (e.g. 1.0 or 2.5).
treasure.metal
Optional.
Metal treasure gather rate (overrides "treasure").
Value type: positive decimal (e.g. 1.0 or 2.5).
Capacities
Per-resource-type maximum carrying capacity.
food
Food capacity.
Value type: positive decimal (e.g. 1.0 or 2.5).
wood
Wood capacity.
Value type: positive decimal (e.g. 1.0 or 2.5).
stone
Stone capacity.
Value type: positive decimal (e.g. 1.0 or 2.5).
metal
Metal capacity.
Value type: positive decimal (e.g. 1.0 or 2.5).
<element name="ResourceGatherer"> <interleave> <element name="MaxDistance"> <ref name="positiveDecimal"/> </element> <element name="BaseSpeed"> <ref name="positiveDecimal"/> </element> <element name="Rates"> <interleave> <optional> <element name="food"> <ref name="positiveDecimal"/> </element> </optional> <optional> <element name="wood"> <ref name="positiveDecimal"/> </element> </optional> <optional> <element name="stone"> <ref name="positiveDecimal"/> </element> </optional> <optional> <element name="metal"> <ref name="positiveDecimal"/> </element> </optional> <optional> <element name="treasure"> <ref name="positiveDecimal"/> </element> </optional> <optional> <element name="food.fish"> <ref name="positiveDecimal"/> </element> </optional> <optional> <element name="food.fruit"> <ref name="positiveDecimal"/> </element> </optional> <optional> <element name="food.grain"> <ref name="positiveDecimal"/> </element> </optional> <optional> <element name="food.meat"> <ref name="positiveDecimal"/> </element> </optional> <optional> <element name="food.milk"> <ref name="positiveDecimal"/> </element> </optional> <optional> <element name="wood.tree"> <ref name="positiveDecimal"/> </element> </optional> <optional> <element name="wood.ruins"> <ref name="positiveDecimal"/> </element> </optional> <optional> <element name="stone.rock"> <ref name="positiveDecimal"/> </element> </optional> <optional> <element name="stone.ruins"> <ref name="positiveDecimal"/> </element> </optional> <optional> <element name="metal.ore"> <ref name="positiveDecimal"/> </element> </optional> <optional> <element name="treasure.food"> <ref name="positiveDecimal"/> </element> </optional> <optional> <element name="treasure.wood"> <ref name="positiveDecimal"/> </element> </optional> <optional> <element name="treasure.stone"> <ref name="positiveDecimal"/> </element> </optional> <optional> <element name="treasure.metal"> <ref name="positiveDecimal"/> </element> </optional> </interleave> </element> <element name="Capacities"> <interleave> <element name="food"> <ref name="positiveDecimal"/> </element> <element name="wood"> <ref name="positiveDecimal"/> </element> <element name="stone"> <ref name="positiveDecimal"/> </element> <element name="metal"> <ref name="positiveDecimal"/> </element> </interleave> </element> </interleave> </element>
Provides a supply of one particular type of resource.
<ResourceSupply> <Amount>1000</Amount> <Type>food.meat</Type> </ResourceSupply>
KillBeforeGather
Whether this entity must be killed (health reduced to 0) before its resources can be gathered.
Value type: boolean (true or false).
Amount
Amount of resources available from this entity.
Value type: non-negative integer (e.g. 0 or 5).
Type
Type of resources.
Value is one of:
wood.tree
wood.ruins
stone.rock
stone.ruins
metal.ore
food.fish
food.fruit
food.grain
food.meat
food.milk
treasure.wood
treasure.stone
treasure.metal
treasure.food
<element name="ResourceSupply"> <interleave> <element name="KillBeforeGather"> <data type="boolean"/> </element> <element name="Amount"> <data type="nonNegativeInteger"/> </element> <element name="Type"> <choice> <value>wood.tree</value> <value>wood.ruins</value> <value>stone.rock</value> <value>stone.ruins</value> <value>metal.ore</value> <value>food.fish</value> <value>food.fruit</value> <value>food.grain</value> <value>food.meat</value> <value>food.milk</value> <value>treasure.wood</value> <value>treasure.stone</value> <value>treasure.metal</value> <value>treasure.food</value> </choice> </element> </interleave> </element>
Allows this entity to be selected by the player.
<Selectable/>
<element name="Selectable"> <interleave> <empty/> </interleave> </element>
<element name="Settlement"> <interleave> <empty/> </interleave> </element>
Lists the sound groups associated with this unit.
<Sound> <SoundGroups> <walk>actor/human/movement/walk.xml</walk> <run>actor/human/movement/walk.xml</run> <attack>attack/weapon/sword.xml</attack> <death>actor/human/death/death.xml</death> </SoundGroups> </Sound>
SoundGroups
<element name="Sound"> <interleave> <element name="SoundGroups"> <zeroOrMore> <element> <anyName/> <text/> </element> </zeroOrMore> </element> </interleave> </element>
Max
Maximum stamina (msecs of running).
Value type: positive integer (e.g. 1 or 5).
<element name="Stamina"> <interleave> <element name="Max"> <data type="positiveInteger"/> </element> </interleave> </element>
BarWidth
Value type: decimal (e.g. -10.0 or 0.0 or 2.5).
BarHeight
Value type: decimal (e.g. -10.0 or 0.0 or 2.5).
HeightOffset
Value type: decimal (e.g. -10.0 or 0.0 or 2.5).
<element name="StatusBars"> <interleave> <element name="BarWidth"> <data type="decimal"/> </element> <element name="BarHeight"> <data type="decimal"/> </element> <element name="HeightOffset"> <data type="decimal"/> </element> </interleave> </element>
HealthDecayRate
Decay rate in hitpoints per second.
Value type: positive integer (e.g. 1 or 5).
<element name="TerritoryDecay"> <interleave> <element name="HealthDecayRate"> <data type="positiveInteger"/> </element> </interleave> </element>
OverrideCost
Optional.
Value type: non-negative integer (e.g. 0 or 5).
Root
Value type: boolean (true or false).
Weight
Value type: non-negative integer (e.g. 0 or 5).
Radius
Value type: non-negative integer (e.g. 0 or 5).
<element name="TerritoryInfluence"> <interleave> <optional> <element name="OverrideCost"> <data type="nonNegativeInteger"> <param name="maxInclusive">255</param> </data> </element> </optional> <element name="Root"> <data type="boolean"/> </element> <element name="Weight"> <data type="nonNegativeInteger"/> </element> <element name="Radius"> <data type="nonNegativeInteger"/> </element> </interleave> </element>
Allows the building to train new units.
<TrainingQueue> <Entities datatype="tokens"> units/{civ}_support_female_citizen units/{civ}_support_trader units/celt_infantry_spearman_b </Entities> </TrainingQueue>
Entities
Space-separated list of entity template names that this building can train. The special string "{civ}" will be automatically replaced by the building's four-character civ code.
Value type: text.
datatype
Required value: tokens
<element name="TrainingQueue"> <interleave> <element name="Entities"> <attribute name="datatype"> <value>tokens</value> </attribute> <text/> </element> </interleave> </element>
Controls the unit's movement, attacks, etc, in response to commands from the player.
<UnitAI/>
DefaultStance
Value is one of:
violent
aggressive
defensive
passive
stand
FormationController
Value type: boolean (true or false).
FleeDistance
Value type: positive decimal (e.g. 1.0 or 2.5).
NaturalBehaviour
Behaviour of the unit in the absence of player commands (intended for animals).
Value is one of:
violent
aggressive
defensive
passive
skittish
domestic
RoamDistance
Value type: positive decimal (e.g. 1.0 or 2.5).
RoamTimeMin
Value type: positive decimal (e.g. 1.0 or 2.5).
RoamTimeMax
Value type: positive decimal (e.g. 1.0 or 2.5).
FeedTimeMin
Value type: positive decimal (e.g. 1.0 or 2.5).
FeedTimeMax
Value type: positive decimal (e.g. 1.0 or 2.5).
<element name="UnitAI"> <interleave> <element name="DefaultStance"> <choice> <value>violent</value> <value>aggressive</value> <value>defensive</value> <value>passive</value> <value>stand</value> </choice> </element> <element name="FormationController"> <data type="boolean"/> </element> <element name="FleeDistance"> <ref name="positiveDecimal"/> </element> <optional> <interleave> <element name="NaturalBehaviour"> <choice> <value>violent</value> <value>aggressive</value> <value>defensive</value> <value>passive</value> <value>skittish</value> <value>domestic</value> </choice> </element> <element name="RoamDistance"> <ref name="positiveDecimal"/> </element> <element name="RoamTimeMin"> <ref name="positiveDecimal"/> </element> <element name="RoamTimeMax"> <ref name="positiveDecimal"/> </element> <element name="FeedTimeMin"> <ref name="positiveDecimal"/> </element> <element name="FeedTimeMax"> <ref name="positiveDecimal"/> </element> </interleave> </optional> </interleave> </element>
Provides the unit with the ability to move around the world by itself.
<UnitMotion> <WalkSpeed>7.0</WalkSpeed> <PassabilityClass>default</PassabilityClass> <CostClass>infantry</CostClass> </UnitMotion>
FormationController
Value type: boolean (true or false).
WalkSpeed
Basic movement speed (in metres per second).
Value type: positive decimal (e.g. 1.0 or 2.5).
Run
Optional.
Speed
Value type: positive decimal (e.g. 1.0 or 2.5).
Range
Value type: positive decimal (e.g. 1.0 or 2.5).
RangeMin
Value type: non-negative decimal (e.g. 0.0 or 2.5).
RegenTime
Value type: positive decimal (e.g. 1.0 or 2.5).
DecayTime
Value type: positive decimal (e.g. 1.0 or 2.5).
PassabilityClass
Identifies the terrain passability class (values are defined in special/pathfinder.xml).
Value type: text.
CostClass
Identifies the movement speed/cost class (values are defined in special/pathfinder.xml).
Value type: text.
<element name="UnitMotion"> <interleave> <element name="FormationController"> <data type="boolean"/> </element> <element name="WalkSpeed"> <ref name="positiveDecimal"/> </element> <optional> <element name="Run"> <interleave> <element name="Speed"> <ref name="positiveDecimal"/> </element> <element name="Range"> <ref name="positiveDecimal"/> </element> <element name="RangeMin"> <ref name="nonNegativeDecimal"/> </element> <element name="RegenTime"> <ref name="positiveDecimal"/> </element> <element name="DecayTime"> <ref name="positiveDecimal"/> </element> </interleave> </element> </optional> <element name="PassabilityClass"> <text/> </element> <element name="CostClass"> <text/> </element> </interleave> </element>
MaxSpeed
Value type: non-negative decimal (e.g. 0.0 or 2.5).
AccelRate
Value type: non-negative decimal (e.g. 0.0 or 2.5).
TurnRate
Value type: non-negative decimal (e.g. 0.0 or 2.5).
OvershootTime
Value type: non-negative decimal (e.g. 0.0 or 2.5).
FlyingHeight
Value type: decimal (e.g. -10.0 or 0.0 or 2.5).
ClimbRate
Value type: non-negative decimal (e.g. 0.0 or 2.5).
<element name="UnitMotionFlying"> <interleave> <element name="MaxSpeed"> <ref name="nonNegativeDecimal"/> </element> <element name="AccelRate"> <ref name="nonNegativeDecimal"/> </element> <element name="TurnRate"> <ref name="nonNegativeDecimal"/> </element> <element name="OvershootTime"> <ref name="nonNegativeDecimal"/> </element> <element name="FlyingHeight"> <data type="decimal"/> </element> <element name="ClimbRate"> <ref name="nonNegativeDecimal"/> </element> </interleave> </element>
Range
Value type: non-negative integer (e.g. 0 or 5).
RetainInFog
Value type: boolean (true or false).
AlwaysVisible
Value type: boolean (true or false).
<element name="Vision"> <interleave> <element name="Range"> <data type="nonNegativeInteger"/> </element> <element name="RetainInFog"> <data type="boolean"/> </element> <element name="AlwaysVisible"> <data type="boolean"/> </element> </interleave> </element>
Display the unit using the engine's actor system.
<VisualActor> <Actor>units/hellenes/infantry_spearman_b.xml</Actor> </VisualActor>
<VisualActor> <Actor>structures/hellenes/barracks.xml</Actor> <FoundationActor>structures/fndn_4x4.xml</FoundationActor> </VisualActor>
Actor
Filename of the actor to be used for this unit.
Value type: text.
FoundationActor
Optional.
Filename of the actor to be used the foundation while this unit is being constructed.
Value type: text.
Foundation
Optional.
Used internally; if present the unit will be rendered as a foundation.
SilhouetteDisplay
Value type: boolean (true or false).
SilhouetteOccluder
Value type: boolean (true or false).
SelectionShape
Optional.
Bounds
Determines the selection box based on the model bounds.
Footprint
Determines the selection box based on the entity Footprint component.
Box
Sets the selection shape to a box of specified dimensions.
width
Value type: positive decimal (e.g. 1.0 or 2.5).
height
Value type: positive decimal (e.g. 1.0 or 2.5).
depth
Value type: positive decimal (e.g. 1.0 or 2.5).
Cylinder
Sets the selection shape to a cylinder of specified dimensions.
radius
Value type: positive decimal (e.g. 1.0 or 2.5).
height
Value type: positive decimal (e.g. 1.0 or 2.5).
<element name="VisualActor"> <interleave> <element name="Actor"> <text/> </element> <optional> <element name="FoundationActor"> <text/> </element> </optional> <optional> <element name="Foundation"> <empty/> </element> </optional> <element name="SilhouetteDisplay"> <data type="boolean"/> </element> <element name="SilhouetteOccluder"> <data type="boolean"/> </element> <optional> <element name="SelectionShape"> <choice> <element name="Bounds"> <empty/> </element> <element name="Footprint"> <empty/> </element> <element name="Box"> <attribute name="width"> <ref name="positiveDecimal"/> </attribute> <attribute name="height"> <ref name="positiveDecimal"/> </attribute> <attribute name="depth"> <ref name="positiveDecimal"/> </attribute> </element> <element name="Cylinder"> <attribute name="radius"> <ref name="positiveDecimal"/> </attribute> <attribute name="height"> <ref name="positiveDecimal"/> </attribute> </element> </choice> </element> </optional> </interleave> </element>