TOTAL WAR WIKI

Total War: ATTILA KIT - Unit Tags

Unit tags

24 April 2015

14:56

 

<unit> tag

 

Child of: <army>

 

The <unit> tag allows definition of an individual unit on the battlefield, as a member of an army and an alliance. Units in an army are internally assigned an index integer, ascending from 0.

 

Attributes

 

Attributes are defined with the <unit> tag itself, and are optional.

 

ATTRIBUTE

DESCRIPTION

script_name

Gives the unit a string name, which the script can subsequently read and identify the unit with. Example:

 

<unit script_name="Roman_Cav_01">

<!-- unit declaration -->

</unit>

num_soldiers

Specifies the number of men in the unit. Note that the number given here will be scaled according to the player's performance settings on their computer. By default infantry units contain 160 men, ranged 120, cavalry 80 and certain others, such as onager and elephant crews, 20. However, it is not required to stick to this regime. Example:

 

<unit num_men="200">

<!-- unit declaration -->

</unit>

hide_prebattle

Prevents this unit from being shown on the pre-battle loading screen. Example:

 

<unit hide_prebattle="true">

<!-- unit declaration -->

</unit>

 

Mandatory Child Tags

 

The <unit> tag must contain the following child tags:

 

TAG

DESCRIPTION

<unit_type>

Defines the type of unit, which must be a key from the main_units table. This is defined as an attribute "type" of the unit_type tag as follows:

 

<unit_type type="att_cel_celtic_warriors" />

<position>

Defines the starting position of this unit on the battlefield. The unit must be able to start the battle at this position (i.e. it must be within the designated deployment zone, or be capable of guerrilla deployment) or the game will reposition it. The co-ordinates must be stated as "x" and "y" attributes within the position tag as follows:

 

<position x="-302.2" y="116.7" />

<orientation>

Defines the starting orientation of this unit on the battlefield. The orientation is specified in radians (0 being north), and must be given as a "radians" attribute of the orientation tag as follows:

 

<orientation radians="3.14" />

 

In the example above, the unit is facing south.

 

Optional Child Tags

 

The <unit> tag may optionally contain the following child tags:

 

TAG

DESCRIPTION

<width>

Defines the starting width of the unit, in metres. The width is given as a "metres" attribute of the width tag as follows:

 

<width metres="25.5" />

<general>

Defines that this unit is the general of this army.

<unit_experience>

Defines this unit's level of experience, which is shown on the unit card as chevrons and makes the unit fight more effectively in battle. The experience value is given as a "level" attribute of the unit_experience tag and should be an integer between 0 (no experience) and 9 (three gold chevrons) as follows:

 

<unit_experience level="4" />

<unit_capabilities>

Allows definition of custom capabilities for this unit.

 

Example

 

<unit>

<unit_type type="att_rom_palatina_guards"/>

<position x="-96.85" y="-244.52"/>

<orientation radians="0.00"/>

<width metres="21.70"/>

<unit_experience level="0"/>

<general>

<name>2147350398</name>

<star_rating level="5"/>

</general>

<unit_capabilities>

<firing_drill>fire_volley</firing_drill>

<special_ability>com_shock_and_awe</special_ability>

<special_ability>att_gen_fast_03</special_ability>

</unit_capabilities>

</unit>

 

 

 

 

 

 

 

 

 

 

 

 

<general> tag

 

Child of: <unit>

 

The <general> tag allows designation of a unit as the general of the army. Each defined army should have one unit assigned to be the general.

 

Optional Child Tags

 

The <general> tag may optionally contain the following child tags:

 

TAG

DESCRIPTION

<star_rating>

Defines the star rating for this general, which is the command the general has over his army. The star rating is given as a "level" attribute of the star_rating tag and should be an integer between 0 (no rating) and 9 (max-level general) as follows:

 

<star_rating level="4" />

<name>

Sets the name of the general. This can be supplied as an un-localised (i.e. un-translated) string, or as a key to an entry in the names table. Examples:

 

<name>Alexander the Great</name> <!-- un-localised -->

<name>2147343827</name> <!-- Vercingetorix from names table -->

<uniform>

Sets the uniform this general uses. This defines their entire look, including their face. The supplied value should be a key to the agent_uniforms table.

 

<uniform>Vercingetorix</uniform>

 

 

 

 

 

 

 

 

 

 

 

<unit_capabilities> tag

 

Child of: <unit>

 

The <unit_capabilities> tag allows specification of custom abilities for a unit if required.

 

Optional Child Tags

 

The <unit_capabilities> tag may contain the following child tags:

 

TAG

DESCRIPTION

<shot_type>

Designates that the unit supports the specified shot type. Supported shot types are listed in the projectile_shot_type_enum table. If no shot types are defined, the unit gets the default assortment of shot types for that unit type. If shot types are defined, then the unit gets only those shot types defined. Example:

 

<shot_type>artillery_whistling</shot_type>

<special_ability>

Defines a special ability for this unit. If no special abilities are specified, the unit is granted the default set for that unit type. If any special abilities are defined, then the unit gets only those special abilities defined. The value given must be a key to an entry in the unit_special_abilities table in the database (new special abilities cannot be added to this table, although existing entries can be modified). Example:

 

<special_ability>wedge_formation</special_ability>

 

 

 

 

 

 

 

 

 

<building_mountable_artillery>

 

Child of: <army>

 

Allows definition of an item of artillery mounted on a building belonging to an army. This is used in siege battles to set out defensive weapons.

 

The tag setup of <building_mountable_artillery> is the same as for a <unit> tag, so declare items of mountable artillery in the same manner as any other unit. A mountable artillery unit cannot be the general, however.

 

Example

 

<building_mountable_artillery>

<unit_type type="att_rom_onager_bastion" />

<position x="-360" y="-415"/>

<orientation radians="0"/>

<width metres="20"/>

<unit_experience level="0"/>

</building_mountable_artillery>