Civ4UnitInfos: Difference between revisions

From Civilization Modding Wiki
Jump to navigationJump to search
No edit summary
Line 1: Line 1:
The '''Civ4UnitInfos''' XML file controls data related to individual units: for example, a unit's strength value or hammer cost.  There are also more detailed options, affecting things like transport capability, prerequisites, and other complex features.
<font size="6">Summary</font>
----
The '''Civ4UnitInfos''' XML file controls data related to individual units: for example, a unit's strength value or production cost.  There are also more detailed options, affecting things like transport capabilities, prerequisites, and other complex features.
 
All tags must be opened and closed; the first is the 'open', the second the 'closed' tag. If nothing goes inside a 'list tag', then it should just be the opening tag with a "/" before the closing bracket.  The following tables contain all available tags, as well as their purpose and accepted values.


All tags must be opened and closed; the first is the 'open', the second the 'closed' tag. If nothing goes inside a 'list tag', then it should just be the opening tag with a / before the closing bracket.  The following tables contain all available tags, as well as their purpose and accepted values.


== Header Tags ==
== Header Tags ==


{| class="wikitable" border="1" style="text-align:left" cellpadding="5"
{| border="1" style="text-align:left" cellpadding="3" cellspacing="0"
|-
|-
! Tag !! Usage
! style="background:#efefef;" | Tag Name
! style="background:#efefef;" | Description
|-
|-
! UnitInfos
! Capture
| This begins and ends the file. Everything must go in between these two, or it will not work.
| Either NONE, or the unit which the unit turns into when captured
|-
! UnitInfo
| Each different unit's data is enclosed in a seperate tag like this.
|-
|-
! Class
! Class
| The class as defined in CIV4UnitClassInfos.xml. Class is the thing that holds, say, a Swordsman and a Praetorian together; each civilisation can only have one of each class.
| The class as defined in CIV4UnitClassInfos.xml. Class is the thing that holds, say, a Swordsman and a Praetorian together; each civilisation can only have one of each class.
|-
! Type
| The name of the unit; which must be unique
|-
! UniqueNames
| Only ever a closing tag. Just put it in, OK?
|-
! Special
| Should be NONE unless it comes under a heading in CIV4SpecialUnitInfos.xml; in which case write that.
|-
! Capture
| Either NONE, or the unit which the unit turns into when captured
|-
|-
! Combat
! Combat
Line 45: Line 34:
| Either NONE or a category of invisibility above. Means that the unit can see all units with this type of invisibility
| Either NONE or a category of invisibility above. Means that the unit can see all units with this type of invisibility
|-
|-
! Special
| Should be NONE unless it comes under a heading in CIV4SpecialUnitInfos.xml; in which case write that.
|-
! Type
| The name of the unit; which must be unique
|-
! UnitInfo
| Each different unit's data is enclosed in a seperate tag like this.
|-
! UnitInfos
| This begins and ends the file. Everything must go in between these two, or it will not work.
|-
! UniqueNames
| Only ever a closing tag. Just put it in, OK?
|}
|}


== Text Tags ==
== Text Tags ==


{| class="wikitable" border="1" style="text-align:left" cellpadding="5"
{| class="wikitable" border="1" style="text-align:left" cellpadding="5"
Line 63: Line 66:
| Almost always ADVISOR_MILITARY; the rationale that the game gives for reccomending the unit.
| Almost always ADVISOR_MILITARY; the rationale that the game gives for reccomending the unit.
|}
|}


== Boolean Tags ==
== Boolean Tags ==
Line 173: Line 177:
! bAlwaysHostile
! bAlwaysHostile
| Can attack enemy units without declaring war, and can be attacked without triggering a war. All nations treat it as an enemy unit.
| Can attack enemy units without declaring war, and can be attacked without triggering a war. All nations treat it as an enemy unit.
|-
! bAltDown
| If 1, the hotkey must be used with Alt
|-
! bShiftDown
| If 1, the hotkey must be used with Shift
|-
! bCtrlDown
| If 1, the hotkey must be used with Ctrl
|-
! bNoRevealMap
| A boolean - if 1, the unit does not reveal any tiles except the one it is currently standing on
|}
|}
== List Tags ==


All List tags consist of an opening/closing tag, then each entry is in another tag which is the same as the main tag take away the s.
All List tags consist of an opening/closing tag, then each entry is in another tag which is the same as the main tag take away the s.


== List Tags ==
{| class="wikitable" border="1" style="text-align:left" cellpadding="5"
{| class="wikitable" border="1" style="text-align:left" cellpadding="5"
|-
|-
Line 225: Line 243:
|-
|-
|}
|}


== Prerequisite Tags ==
== Prerequisite Tags ==
Line 267: Line 286:
! Flavors
! Flavors
| The 'flavours' of the unit - these relate to leader behavior in the AI
| The 'flavours' of the unit - these relate to leader behavior in the AI
|-
|}
== Integer Tags ==
{| class="wikitable" border="1" style="text-align:left" cellpadding="5"
|-
! Tag !! Usage
|-
! iAIWeight
|  The preference given by the AI to this unit, generally for Unique Units.
|-
! iCost
|  The cost in hammers of the unit
|-
|-
! HurryCostModifier
! HurryCostModifier
Line 296: Line 301:
! Moves
! Moves
| The number of movement points that the unit has.
| The number of movement points that the unit has.
|}
== Integer Tags ==
{| class="wikitable" border="1" style="text-align:left" cellpadding="5"
|-
|-
! bNoRevealMap
! Tag !! Usage
| A boolean - if 1, the unit does not reveal any tiles except the one it is currently standing on
|-
! iAIWeight
| The preference given by the AI to this unit, generally for Unique Units.
|-
! iCost
| The cost in hammers of the unit
|-
|-
! iAirRange
! iAirRange
Line 338: Line 354:
! iEspionagePoints
! iEspionagePoints
| Used for Spies - not sure of the exact effect
| Used for Spies - not sure of the exact effect
|-
|}
== Miscellaneous Tags ==
{| class="wikitable" border="1" style="text-align:left" cellpadding="5"
|-
! Tag !! Usage
|-
! TerrainImpassables
| Types of terrain that the unit cannot enter - generally Ocean
|-
! FeatureImpassables
| As above for terrain features - like Forests and Jungle
|-
! TerrainPassableTechs
| With these technologies, the unit can enter the terrain defined in TerrainImpassables
|-
! FeatureImpassables
| With these technologies, the unit can enter the features defined in FeatureImpassables
|-
|-
! iCombat
! iCombat
Line 415: Line 411:
! iHillsDefense
! iHillsDefense
| The bonus that the unit gets when defending hills
| The bonus that the unit gets when defending hills
|-
! iBombRate
| The damage that a unit does when carrying out an Air Bomb mission
|-
! iBombardRate
| The rate at which a unit Bombards a city
|-
! iCargo
| The number of units that the unit can carry
|-
! iConscription
| The number of this unit that can be drafted
|-
! iCultureGarrison
| The suppression value of a unit while garrisoned in a rebelling city
|-
! iExtraCost
| Affects the cost of the unit
|-
! iAsset
| Affects the AI's behaviour towards it in some way.
|-
! iPower
| Affects the amount that the AI factors it into the equation when determining your military power
|-
! iLeaderExperience
| The amount of experience which a certain leader gives this unit
|-
! iHotKeyPriority
| <font color=red>Not sure what this does</font>
|}
== Miscellaneous Tags ==
{| class="wikitable" border="1" style="text-align:left" cellpadding="5"
|-
! Tag !! Usage
|-
! TerrainImpassables
| Types of terrain that the unit cannot enter - generally Ocean
|-
! FeatureImpassables
| As above for terrain features - like Forests and Jungle
|-
! TerrainPassableTechs
| With these technologies, the unit can enter the terrain defined in TerrainImpassables
|-
! FeatureImpassables
| With these technologies, the unit can enter the features defined in FeatureImpassables
|-
|-
! TerrainNatives
! TerrainNatives
Line 452: Line 498:
| Resources that make the unit produce faster
| Resources that make the unit produce faster
|-
|-
! iBombRate
! DomainCargo
| The damage that a unit does when carrying out an Air Bomb mission
| The Domains (AIR, SEA, or LAND) that the unit can carry.
|-
! iBombardRate
| The rate at which a unit Bombards a city
|-
|-
! SpecialCargo
! SpecialCargo
| Any types of Special Unit that the unit can carry
| Any types of Special Unit that the unit can carry
|-
|-
! DomainCargo
! HotKey
| The Domains (AIR, SEA, or LAND) that the unit can carry.
| Never used in the original game - it can be used to define a hotkey for the unit
|-
|-
! iCargo
! FreePromotions
| The number of units that the unit can carry
| The promotions that this unit starts with
|-
! iConscription
| The number of this unit that can be drafted
|-
! iCultureGarrison
| The suppression value of a unit while garrisoned in a rebelling city
|-
! iExtraCost
| Affects the cost of the unit
|-
! iAsset
| Affects the AI's behaviour towards it in some way.
|-
! iPower
| Affects the amount that the AI factors it into the equation when determining your military power
|-
|-
! LeaderPromotions
| Promotions which a certain leader gives this unit
|}
|}


== Art Tags ==
== Art Tags ==
Line 491: Line 522:
|-
|-
! fMaxSpeed
! fMaxSpeed
| '''Not sure what this does'''
| <font color=red>Not sure what this does</font>
|-
|-
! fPadTime
! fPadTime
| '''Not sure what this does'''
| <font color=red>Not sure what this does</font>
|-
|-
! iMeleeWaveSize
! iMeleeWaveSize
Line 501: Line 532:
! iRangedWaveSize
! iRangedWaveSize
| The number of models that engage in ranged combat at once
| The number of models that engage in ranged combat at once
|-
! UnitMeshGroups
! UnitMeshGroups
| Holds the unit's art data
| Holds the unit's art data
Line 509: Line 541:
! FormationType
! FormationType
| The formation that the unit adopts
| The formation that the unit adopts
|-
|}
== Ending Tags ==
{| class="wikitable" border="1" style="text-align:left" cellpadding="5"
|-
! Tag !! Usage
|-
! HotKey
| Never used in the original game - it can be used to define a hotkey for the unit
|-
! bAltDown
| If 1, the hotkey must be used with Alt
|-
! bShiftDown
| If 1, the hotkey must be used with Shift
|-
! bCtrlDown
| If 1, the hotkey must be used with Ctrl
|-
! iHotKeyPriority
| '''Not sure what this does'''
|-
! FreePromotions
| The promotions that this unit starts with
|-
! LeaderPromotions
| Promotions which a certain leader gives this unit
|-
! iLeaderExperience
| The amount of experience which a certain leader gives this unit
|-
|-
|}
|}

Revision as of 06:42, 13 May 2009

Summary


The Civ4UnitInfos XML file controls data related to individual units: for example, a unit's strength value or production cost. There are also more detailed options, affecting things like transport capabilities, prerequisites, and other complex features.

All tags must be opened and closed; the first is the 'open', the second the 'closed' tag. If nothing goes inside a 'list tag', then it should just be the opening tag with a "/" before the closing bracket. The following tables contain all available tags, as well as their purpose and accepted values.


Header Tags

Tag Name Description
Capture Either NONE, or the unit which the unit turns into when captured
Class The class as defined in CIV4UnitClassInfos.xml. Class is the thing that holds, say, a Swordsman and a Praetorian together; each civilisation can only have one of each class.
Combat The combat, out of UNITCOMBAT_MELEE, UNITCOMBAT_ARCHER, UNITCOMBAT_MOUNTED, UNITCOMBAT_GUN, UNITCOMBAT_SIEGE, UNITCOMBAT_NAVAL, UNITCOMBAT_AIR and UNITCOMBAT_HELICOPTER of the unit - used to determine bonuses in combat.
Domain DOMAIN_ - then AIR, SEA or LAND
DefaultUnitAI The default way in which the AI uses the unit.
Invisible Either NONE (either meaning not invisible or completely invisible, see below) or INVISIBLE_STEALTH or INVISIBLE_SUBMARINE
SeeInvisible Either NONE or a category of invisibility above. Means that the unit can see all units with this type of invisibility
Special Should be NONE unless it comes under a heading in CIV4SpecialUnitInfos.xml; in which case write that.
Type The name of the unit; which must be unique
UnitInfo Each different unit's data is enclosed in a seperate tag like this.
UnitInfos This begins and ends the file. Everything must go in between these two, or it will not work.
UniqueNames Only ever a closing tag. Just put it in, OK?


Text Tags

Description Either text or a key from the text files. The name displayed for the unit.
Civilopedia As above for the Civiliopedia entry
Strategy As above for the Sid's Tips, also displayed above the Civilopedia entry
Advisor Almost always ADVISOR_MILITARY; the rationale that the game gives for reccomending the unit.


Boolean Tags

All of these can either be 1 (on) or 0 (off)

Tag Usage
bAnimal The unit is an animal; the Barbarian State controls it, it can spring from anywhere and it cannot enter cultural borders.
bFood A city does not generate food while building this unit
bNoBadGoodies When this unit is entering a Tribal Village, the villagers will never be hostile
bOnlyDefensive This unit cannot attack other units
bNoCapture This unit cannot capture cities
bQuickCombat ALways 0; not sure what it actually does
bRivalTerritory Can explore rival territory
bMilitaryHappiness Counts as a Military Unit in the eyes of the rabble
bMilitarySupport Costs money to maintain as part of your military, affected by Pacifism and the like.
bMilitaryProduction Counts as a military unit for production bonuses/penalties
bPillage Can pillage enemy tiles
bSpy Is a spy
bSabotage Should only be 1 in Vanilla or Warlords; can Sabotage Production
bDestroy Should only be 1 in Vanilla or Warlords; can Destroy Improvement
bStealPlans Should only be 1 in Vanilla or Warlords; can Steal Plans
bInvestigate Should only be 1 in Vanilla or Warlords; can Investigate City
bCounterSpy Should only be 1 in Vanilla or Warlords; can Perform Counterespionage
bFound Can found a city
bGoldenAge Counts as a Great Person to start a Golden Age
bInvisible Is invisible to all units
bFirstStrikeImmune Is immune to all First Strikes
bNoDefensiveBonus Does not receive defensive bonuses
bIgnoreBuildingDefense Ignores defensive bonuses from enemy buildings, like Walls and Castles
bCanMoveImpassible If the unit is a Submarine, it can go under Ice.
bCanMoveAllTerrain Can move across all terrain
bFlatMovementCost Pays a flat movement cost to enter all terrain
bIgnoreTerrainCost Ignores movement penalties from terrain
bNukeInnume Takes no damage from enemy nukes
bPrereqBonuses Needs the mentioned resources to be built (can be NONE)
bPrereqReligion Needs the mentioned religion to be built (can be NONE)
bMechanized Not sure what this does - used for all land units in a vehicle
bSuicide Kills itself upon attacking, like a Kamikaze in the Defence mod
bHiddenNationality Bears no marking of nationality
bAlwaysHostile Can attack enemy units without declaring war, and can be attacked without triggering a war. All nations treat it as an enemy unit.
bAltDown If 1, the hotkey must be used with Alt
bShiftDown If 1, the hotkey must be used with Shift
bCtrlDown If 1, the hotkey must be used with Ctrl
bNoRevealMap A boolean - if 1, the unit does not reveal any tiles except the one it is currently standing on


List Tags

All List tags consist of an opening/closing tag, then each entry is in another tag which is the same as the main tag take away the s.

Tag Usage
UnitClassUpgrades The Classes of unit to which this unit upgrades
UnitClassTargets Not sure what this one does
UnitCombatTargets Does whatever UnitClassTargets does, but is directed at a particular combat
UnitClassDefenders Not sure what this one does
UnitCombatDefenders Does whatever UnitClassDefenders does, but is directed at a particular combat
FlankingStrikes All unit classes against which the unit gets a Flank Attack
UnitAIs Inside here go the methods which the AI uses to command this unit. It dictates the roles which the unit is good for.
NotUnitAIs As UnitAIs, but for the tasks which the AI will never consider the unit for.
Builds For all the things that the unit can build on tiles; but not wonders that it can build in cities.
ReligionSpreads Put the religions which the unit can spread here, if it is a missionary.
CorporationSpreads Put the Corporations which the unit can spread here, if it is a CEO.
GreatPeoples If the unit can settle in a city, put the type of specialist it becomes here.
Buildings The buildings which the unit can construct in a friendly city.
ForceBuildings The buildings the unit can construct in any city.


Prerequisite Tags

Tag Usage
HolyCity If not NONE, then it is the Holy City needed to build the unit
ReligionType For units, always NONE.
StateReligion If not NONE, the State Religion needed to build this unit
PrereqReligion Either NONE, or the religion needed in a city to build this unit
PrereqCorporation Either NONE, or the corporation needed in a city to build this unit
PrereqBuilding Either NONE, or the building needed in a city to build this unit
PrereqTech Either NONE, or the technology that you need to build this unit
TechTypes Used as a list tag to enclose PrereqTech tags.
BonusType The resource needed to build this unit.
PrereqBonuses Used as a list tag to enclose BonusType tags.
ProductionTraits The leader traits which affect production of this unit, along with the value.
Flavors The 'flavours' of the unit - these relate to leader behavior in the AI
HurryCostModifier Impacts the Gold Hurry cost of the unit.
AdvancedStartCost The cost in points of the unit on Advanced Start.
AdvancedStartCostIncrease Affects the cost in points of the unit on Advanced Start
MinAreaSize Minimal number of water squares needed nearby to build sea vessels (20 for all sea units except Work Boats)
Moves The number of movement points that the unit has.


Integer Tags

Tag Usage
iAIWeight The preference given by the AI to this unit, generally for Unique Units.
iCost The cost in hammers of the unit
iAirRange Only for Air Units; the range at which it can operate
iAirUnitCap Should be 0
iDropRange The range at which the unit can 'jump' from a friendly city
iNukeRange The range at which the 'nuke' can be launched - missiles only
iWorkRate The rate at which the unit improves tiles
iBaseDiscover The rate at which the unit discovers new tiles
iDiscoverMultiplier Affects the rate at which the unit discovers new tiles
iBaseHurry Amount of production in a city the unit can hurry
iHurryMultiplier Multiplier of the above
iBaseTrade The basic amount of money that the unit makes from a Trade Mission
iTradeMultiplier Affects the amount of money that the unit makes from a Trade Mission
iGreatWorkCulture The amount of culture that the unit generates with a Great Work
iEspionagePoints Used for Spies - not sure of the exact effect
iCombat The unit's base strength
iCombatLimit Always 100 - purpose unclear
iAirCombat The unit's base strength for Air Units
iAirCombatLimit Always 100 - purpose unclear
iXPValueAttack The value, in Experience Points, that this unit is worth on the attack
iXPValueDefense The value, in Experience Points, that this unit is worth on the defence
iFirstStrikes The number of automatic First Strikes that the unit has
iChanceFirstStrikes The number of First Strike Chances that the unit has
iInterceptionProbability The odds an Air Unit has of intercepting an enemy trying to carry out a mission in the area.
iEvasionProbability For air and parachute units; the odds of evading interception
iWithdrawalProb The amount of Withdrawal Chance that the unit has
iCollateralDamage The amount of Collateral Damage that the unit does
iCollateralDamageLimit The maximum amount of collateral damage that the unit can do; so the minimum Strength that the target can be at.
iCollateralDamageMaxUnits The greatest number of enemy unit that the unit can inflict damage on
iCityAttack The bonus that the unit gets when attacking cities
iCityDefense The bonus that the unit gets when defending cities
iAnimalCombat The bonus that the unit gets against Animals, in attack or defence.
iHillsAttack The bonus that the unit gets when attacking hills
iHillsDefense The bonus that the unit gets when defending hills
iBombRate The damage that a unit does when carrying out an Air Bomb mission
iBombardRate The rate at which a unit Bombards a city
iCargo The number of units that the unit can carry
iConscription The number of this unit that can be drafted
iCultureGarrison The suppression value of a unit while garrisoned in a rebelling city
iExtraCost Affects the cost of the unit
iAsset Affects the AI's behaviour towards it in some way.
iPower Affects the amount that the AI factors it into the equation when determining your military power
iLeaderExperience The amount of experience which a certain leader gives this unit
iHotKeyPriority Not sure what this does


Miscellaneous Tags

Tag Usage
TerrainImpassables Types of terrain that the unit cannot enter - generally Ocean
FeatureImpassables As above for terrain features - like Forests and Jungle
TerrainPassableTechs With these technologies, the unit can enter the terrain defined in TerrainImpassables
FeatureImpassables With these technologies, the unit can enter the features defined in FeatureImpassables
TerrainNatives This affects the terrain animals spawn in
FeatureNatives This affects the features animals spawn in
TerrainAttacks Attack bonuses that the unit gets in different terrain
TerrainDefenses Defence bonuses that the unit gets in different terrain
FeatureAttacks Attack bonuses that the unit gets in different features
FeatureDefenses Defence bonuses that the unit gets in different features
UnitClassAttackMods The bonuses/penalties that the unit gets against specific units in attack
UnitClassDefenseMods The bonuses/penalties that the unit gets against specific units in defence
UnitCombatMods The bonuses/penalties that the unit gets against different combats
UnitCombatCollateralImmunes The unit combats that this unit does not recieve collateral damage from
DomainMods The bonuses/penalties that the unit gets against Air, Sea or Land units
BonusProductionModifiers Resources that make the unit produce faster
DomainCargo The Domains (AIR, SEA, or LAND) that the unit can carry.
SpecialCargo Any types of Special Unit that the unit can carry
HotKey Never used in the original game - it can be used to define a hotkey for the unit
FreePromotions The promotions that this unit starts with
LeaderPromotions Promotions which a certain leader gives this unit


Art Tags

iGroupSize The number of models in the unit
fMaxSpeed Not sure what this does
fPadTime Not sure what this does
iMeleeWaveSize The number of models that engage in melee combat
iRangedWaveSize The number of models that engage in ranged combat at once
UnitMeshGroups Holds the unit's art data
EarlyArtDefineTag From CIV4ArtDefinesUnit - what the unit looks like in-game
FormationType The formation that the unit adopts