Civ4UnitInfos: Difference between revisions

From Civilization Modding Wiki
Jump to navigationJump to search
(Now compatible with the XML template.)
No edit summary
Line 18: Line 18:
|-
|-
! Capture
! Capture
| Either NONE, or the unit which the unit turns into when captured
| Either NONE, or the unit which the unit turns into when captured.
|-
|-
! 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 civilization can only have one of each class.
|-
|-
! Combat
! 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.
| The combat type, 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 & defense.
|-
|-
! Domain
! Domain
| DOMAIN_ - then AIR, SEA or LAND
| DOMAIN_ - then AIR, SEA or LAND.
|-
|-
! DefaultUnitAI
! DefaultUnitAI
Line 33: Line 33:
|-
|-
! Invisible
! Invisible
| Either NONE (either meaning not invisible or completely invisible, see below) or INVISIBLE_STEALTH or INVISIBLE_SUBMARINE
| Either NONE (either meaning not invisible or completely invisible, see below) or INVISIBLE_STEALTH or INVISIBLE_SUBMARINE.
|-
|-
! SeeInvisible
! SeeInvisible
| 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
! Special
Line 42: Line 42:
|-
|-
! Type
! Type
| The name of the unit; which must be unique
| The name of the unit; which must be unique.
|-
|-
! UnitInfo
! UnitInfo
Line 64: Line 64:
! style="background:#efefef;" | Description
! style="background:#efefef;" | Description
|-
|-
! HolyCity
! AdvancedStartCost
| If not NONE, then it is the Holy City needed to build the unit
| The cost in points of the unit on Advanced Start.
|-
|-
! ReligionType
! AdvancedStartCostIncrease
| For units, always NONE.
| Affects the cost in points of the unit on Advanced Start.
|-
|-
! StateReligion
! BonusType
| If not NONE, the State Religion needed to build this unit
| The resource needed to build this unit.
|-
|-
! PrereqReligion
! Flavors
| Either NONE, or the religion needed in a city to build this unit
| The 'flavours' of the unit - these relate to leader behavior in the AI.
|-
|-
! PrereqCorporation
! HolyCity
| Either NONE, or the corporation needed in a city to build this unit
| If not NONE, then it is the Holy City needed to build the unit.
|-
|-
! PrereqBuilding
! HurryCostModifier
| Either NONE, or the building needed in a city to build this unit
| Impacts the Gold Hurry cost of the unit.
|-
|-
! PrereqTech
! MinAreaSize
| Either NONE, or the technology that you need to build this unit
| Minimal number of water squares needed nearby to build sea vessels (20 for all sea units except Work Boats).
|-
|-
! TechTypes
! Moves
| Used as a list tag to enclose PrereqTech tags.
| The number of movement points that the unit has.
|-
! BonusType
| The resource needed to build this unit.
|-
|-
! PrereqBonuses
! PrereqBonuses
| Used as a list tag to enclose BonusType tags.
| Used as a list tag to enclose BonusType tags.
|-
|-
! ProductionTraits
! PrereqBuilding
| The leader traits which affect production of this unit, along with the value.
| Either NONE, or the building needed in a city to build this unit.
|-
! PrereqCorporation
| Either NONE, or the corporation needed in a city to build this unit.
|-
|-
! Flavors
! PrereqReligion
| The 'flavours' of the unit - these relate to leader behavior in the AI
| Either NONE, or the religion needed in a city to build this unit.
|-
|-
! HurryCostModifier
! PrereqTech
| Impacts the Gold Hurry cost of the unit.
| Either NONE, or the technology that you need to build this unit.
|-
|-
! AdvancedStartCost
! ProductionTraits
| The cost in points of the unit on Advanced Start.
| The leader traits which affect production of this unit, along with the value.
|-
|-
! AdvancedStartCostIncrease
! ReligionType
| Affects the cost in points of the unit on Advanced Start
| For units, always NONE.
|-
|-
! MinAreaSize
! StateReligion
| Minimal number of water squares needed nearby to build sea vessels (20 for all sea units except Work Boats)
| If not NONE, the State Religion needed to build this unit.
|-
|-
! Moves
! TechTypes
| The number of movement points that the unit has.
| Used as a list tag to enclose PrereqTech tags.
|}
|}


Line 123: Line 123:
! style="background:#efefef;" | Tag Name
! style="background:#efefef;" | Tag Name
! style="background:#efefef;" | Description
! style="background:#efefef;" | Description
|-
! Advisor
| Almost always ADVISOR_MILITARY; the rationale that the game gives for reccomending the unit.
|-
! Civilopedia
| As above for the Civiliopedia entry.
|-
|-
! Description
! Description
| Either text or a key from the text files. The name displayed for the unit.  
| Either text or a key from the text files. The name displayed for the unit.  
|-
! Civilopedia
| As above for the Civiliopedia entry
|-
|-
! Strategy
! Strategy
| As above for the Sid's Tips, also displayed above the Civilopedia entry
| 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.
|}
|}


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


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


===Lists (Multi-line) ===
All List tags consist of an opening/closing tag, which is shown here, and then each entry within it is another tag with the same name as the parent tag, minus the "s" (i.e. singular, rather than plural).


{| border="1" style="text-align:left" cellpadding="3" cellspacing="0"
{| border="1" style="text-align:left" cellpadding="3" cellspacing="0"
Line 415: Line 411:
! style="background:#efefef;" | Description
! style="background:#efefef;" | Description
|-
|-
! UnitClassUpgrades
! Builds
| The Classes of unit to which this unit upgrades
| For all the things that the unit can build on tiles; but not wonders that it can build in cities.
|-
! UnitClassTargets
| '''Not sure what this one does'''
|-
|-
! UnitCombatTargets
! Buildings
| Does whatever UnitClassTargets does, but is directed at a particular combat
| The buildings which the unit can construct in a friendly city.
|-
|-
! UnitClassDefenders
! CorporationSpreads
| '''Not sure what this one does'''
| Put the Corporations which the unit can spread here, if it is a CEO.
|-
|-
! UnitCombatDefenders
! FlankingStrikes
| Does whatever UnitClassDefenders does, but is directed at a particular combat
| All unit classes against which the unit gets a Flank Attack.
|-
|-
! FlankingStrikes
! ForceBuildings
| All unit classes against which the unit gets a Flank Attack
| The buildings the unit can construct in '''''any''''' city.
|-
|-
! UnitAIs
! GreatPeoples
| Inside here go the methods which the AI uses to command this unit. It dictates the roles which the unit is good for.
| If the unit can settle in a city, put the type of specialist it becomes here.
|-
|-
! NotUnitAIs
! NotUnitAIs
| As UnitAIs, but for the tasks which the AI will never consider the unit for.
| 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
! ReligionSpreads
| Put the religions which the unit can spread here, if it is a missionary.
| Put the religions which the unit can spread here, if it is a missionary.
|-
|-
! CorporationSpreads
! UnitClassDefenders
| Put the Corporations which the unit can spread here, if it is a CEO.
| <font color=red>Not sure what this one does.</font>
|-
! UnitClassTargets
| <font color=red>Not sure what this one does.</font>
|-
! UnitClassUpgrades
| The Classes of unit to which this unit upgrades.
|-
|-
! GreatPeoples
! UnitCombatDefenders
| If the unit can settle in a city, put the type of specialist it becomes here.
| Does whatever UnitClassDefenders does, but is directed at a particular combat.
|-
|-
! Buildings
! UnitCombatTargets
| The buildings which the unit can construct in a friendly city.
| Does whatever UnitClassTargets does, but is directed at a particular combat.
|-
|-
! ForceBuildings
! UnitAIs
| The buildings the unit can construct in '''''any''''' city.
| Inside here go the methods which the AI uses to command this unit. It dictates the roles which the unit is good for.
|-
|-
|}
|}
Line 467: Line 463:
! style="background:#efefef;" | Description
! style="background:#efefef;" | Description
|-
|-
! TerrainImpassables
! BonusProductionModifiers
| Types of terrain that the unit cannot enter - generally Ocean
| Resources that make the unit produce faster.
|-
! DomainCargo
| The Domains (AIR, SEA, or LAND) that the unit can carry.
|-
! DomainMods
| The bonuses/penalties that the unit gets against Air, Sea or Land units.
|-
! FeatureAttacks
| Attack bonuses that the unit gets in different features.
|-
! FeatureDefenses
| Defence bonuses that the unit gets in different features.
|-
|-
! FeatureImpassables
! FeatureImpassables
| As above for terrain features - like Forests and Jungle
| Used to specify terrain features (Jungle, Forest, etc.) that the unit will ''never'' be able to enter.
|-
|-
! TerrainPassableTechs
! FeatureNatives
| With these technologies, the unit can enter the terrain defined in TerrainImpassables
| This affects the feature types animals spawn in.
|-
! FreePromotions
| The promotions that this unit starts with.
|-
|-
! FeatureImpassables
! HotKey
| With these technologies, the unit can enter the features defined in FeatureImpassables
| Never used in the original game - it can be used to define a hotkey for the unit.
|-
|-
! TerrainNatives
! LeaderPromotions
| This affects the terrain animals spawn in
| Promotions which a certain leader gives this unit.
|-
|-
! FeatureNatives
! SpecialCargo
| This affects the features animals spawn in
| Any types of Special Unit that the unit can carry.
|-
|-
! TerrainAttacks
! TerrainAttacks
| Attack bonuses that the unit gets in different terrain
| Attack bonuses that the unit gets in different terrain.
|-
|-
! TerrainDefenses
! TerrainDefenses
| Defence bonuses that the unit gets in different terrain
| Defence bonuses that the unit gets in different terrain.
|-
|-
! FeatureAttacks
! TerrainImpassables
| Attack bonuses that the unit gets in different features
| Used to specify terrain types (Ocean, Desert, etc.) that the unit will ''never'' be able to enter.
|-
! TerrainNatives
| This affects the terrain types animals spawn in.
|-
|-
! FeatureDefenses
! TerrainPassableTechs
| Defence bonuses that the unit gets in different features
| With these technologies, the unit can enter the terrain defined in TerrainImpassables.
|-
|-
! UnitClassAttackMods
! UnitClassAttackMods
| The bonuses/penalties that the unit gets against specific units in attack
| The bonuses/penalties that the unit gets against specific unit classes in attack.
|-
|-
! UnitClassDefenseMods
! UnitClassDefenseMods
| The bonuses/penalties that the unit gets against specific units in defence
| The bonuses/penalties that the unit gets against specific unit classes in defence.
|-
! UnitCombatMods
| The bonuses/penalties that the unit gets against different combats
|-
|-
! UnitCombatCollateralImmunes
! UnitCombatCollateralImmunes
| The unit combats that this unit does not recieve collateral damage from
| The unit combats that this unit does not recieve collateral damage from.
|-
|-
! DomainMods
! UnitCombatMods
| The bonuses/penalties that the unit gets against Air, Sea or Land units
| The bonuses/penalties that the unit gets against different combats.
|-
! 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
|}
|}


Line 541: Line 534:
! style="background:#efefef;" | Description
! style="background:#efefef;" | Description
|-
|-
! iGroupSize
! EarlyArtDefineTag
| The number of models in the unit  
| From CIV4ArtDefinesUnit - what the unit looks like in-game.
|-
! FormationType
| The formation that the unit adopts.
|-
|-
! fMaxSpeed
! fMaxSpeed
| <font color=red>Not sure what this does</font>
| <font color=red>Not sure what this does.</font>
|-
|-
! fPadTime
! fPadTime
| <font color=red>Not sure what this does</font>
| <font color=red>Not sure what this does.</font>
|-
! iGroupSize
| The number of models in the unit.
|-
|-
! iMeleeWaveSize
! iMeleeWaveSize
| The number of models that engage in melee combat
| The number of models that engage in melee combat.
|-
|-
! 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.
|-
! EarlyArtDefineTag
| From CIV4ArtDefinesUnit - what the unit looks like in-game
|-
! FormationType
| The formation that the unit adopts
|-
|-
|}
|}

Revision as of 20:44, 14 May 2009

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.

This page is missing information. Do not remove this notice until it is complete.


Tags

Headers

These tags typically bracket other tags, sometimes the entire file, and are generally used to specify more than one piece of data.

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 civilization can only have one of each class.
Combat The combat type, 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 & defense.
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?


Prerequisites

These tags must be included when writing new entries, or the game will crash or otherwise malfunction.

Tag Name Description
AdvancedStartCost The cost in points of the unit on Advanced Start.
AdvancedStartCostIncrease Affects the cost in points of the unit on Advanced Start.
BonusType The resource needed to build this unit.
Flavors The 'flavours' of the unit - these relate to leader behavior in the AI.
HolyCity If not NONE, then it is the Holy City needed to build the unit.
HurryCostModifier Impacts the Gold Hurry cost of the unit.
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.
PrereqBonuses Used as a list tag to enclose BonusType tags.
PrereqBuilding Either NONE, or the building needed in a city to build this unit.
PrereqCorporation Either NONE, or the corporation needed in a city to build this unit.
PrereqReligion Either NONE, or the religion needed in a city to build this unit.
PrereqTech Either NONE, or the technology that you need to build this unit.
ProductionTraits The leader traits which affect production of this unit, along with the value.
ReligionType For units, always NONE.
StateReligion If not NONE, the State Religion needed to build this unit.
TechTypes Used as a list tag to enclose PrereqTech tags.


Text

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


Integers

All of these tags have a numerical value. Though it sometimes can be negative, it usually is not.

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


Boolean

All of these can either be 1 (on, or true) or 0 (off, or false). Be careful, as you can wind up with a double-negative, which the game will interpret as "True".

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


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


Miscellaneous

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


Art

These tags are directly related to the rendering of art for the entry.

Tag Name Description
EarlyArtDefineTag From CIV4ArtDefinesUnit - what the unit looks like in-game.
FormationType The formation that the unit adopts.
fMaxSpeed Not sure what this does.
fPadTime Not sure what this does.
iGroupSize The number of models in the unit.
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.


Example

<UnitInfo>
  <Class>UNITCLASS_LION</Class>
  <Type>UNIT_LION</Type>
  <UniqueNames/>
  <Special>NONE</Special>
  <Capture>NONE</Capture>
  <Combat>NONE</Combat>
  <Domain>DOMAIN_LAND</Domain>
  <DefaultUnitAI>UNITAI_ANIMAL</DefaultUnitAI>
  <Invisible>NONE</Invisible>
  <SeeInvisible>NONE</SeeInvisible>
  <Description>TXT_KEY_UNIT_LION</Description>
  <Civilopedia>TXT_KEY_CONCEPT_ANIMALS_PEDIA</Civilopedia>
  <Strategy>TXT_KEY_UNIT_ANIMAL_STRATEGY</Strategy>
  <Advisor>NONE</Advisor>
  <bAnimal>1</bAnimal>
  <bFood>0</bFood>
  <bNoBadGoodies>0</bNoBadGoodies>
  <bOnlyDefensive>0</bOnlyDefensive>
  <bNoCapture>0</bNoCapture>
  <bQuickCombat>0</bQuickCombat>
  <bRivalTerritory>0</bRivalTerritory>
  <bMilitaryHappiness>0</bMilitaryHappiness>
  <bMilitarySupport>0</bMilitarySupport>
  <bMilitaryProduction>0</bMilitaryProduction>
  <bPillage>0</bPillage>
  <bSpy>0</bSpy>
  <bSabotage>0</bSabotage>
  <bDestroy>0</bDestroy>
  <bStealPlans>0</bStealPlans>
  <bInvestigate>0</bInvestigate>
  <bCounterSpy>0</bCounterSpy>
  <bFound>0</bFound>
  <bGoldenAge>0</bGoldenAge>
  <bInvisible>0</bInvisible>
  <bFirstStrikeImmune>0</bFirstStrikeImmune>
  <bNoDefensiveBonus>1</bNoDefensiveBonus>
  <bIgnoreBuildingDefense>0</bIgnoreBuildingDefense>
  <bCanMoveImpassable>0</bCanMoveImpassable>
  <bCanMoveAllTerrain>0</bCanMoveAllTerrain>
  <bFlatMovementCost>0</bFlatMovementCost>
  <bIgnoreTerrainCost>0</bIgnoreTerrainCost>
  <bNukeImmune>0</bNukeImmune>
  <bPrereqBonuses>0</bPrereqBonuses>
  <bPrereqReligion>0</bPrereqReligion>
  <bMechanized>0</bMechanized>
  <bSuicide>0</bSuicide>
  <bHiddenNationality>0</bHiddenNationality>
  <bAlwaysHostile>0</bAlwaysHostile>
  <UnitClassUpgrades/>
  <UnitClassTargets/>
  <UnitCombatTargets/>
  <UnitClassDefenders/>
  <UnitCombatDefenders/>
  <FlankingStrikes/>
  <UnitAIs>
     <UnitAI>
        <UnitAIType>UNITAI_ANIMAL</UnitAIType>
        <bUnitAI>1</bUnitAI>
     </UnitAI>
  </UnitAIs>
  <NotUnitAIs/>
  <Builds/>
  <ReligionSpreads/>
  <CorporationSpreads/>
  <GreatPeoples/>
  <Buildings/>
  <ForceBuildings/>
  <HolyCity>NONE</HolyCity>
  <ReligionType>NONE</ReligionType>
  <StateReligion>NONE</StateReligion>
  <PrereqReligion>NONE</PrereqReligion>
  <PrereqCorporation>NONE</PrereqCorporation>
  <PrereqBuilding>NONE</PrereqBuilding>
  <PrereqTech>NONE</PrereqTech>
  <TechTypes/>
  <BonusType>NONE</BonusType>
  <PrereqBonuses/>
  <ProductionTraits/>
  <Flavors/>
  <iAIWeight>0</iAIWeight>
  <iCost>-1</iCost>
  <iHurryCostModifier>0</iHurryCostModifier>
  <iAdvancedStartCost>-1</iAdvancedStartCost>
  <iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
  <iMinAreaSize>-1</iMinAreaSize>
  <iMoves>1</iMoves>
  <bNoRevealMap>0</bNoRevealMap>
  <iAirRange>0</iAirRange>
  <iAirUnitCap>0</iAirUnitCap>
  <iDropRange>0</iDropRange>
  <iNukeRange>-1</iNukeRange>
  <iWorkRate>0</iWorkRate>
  <iBaseDiscover>0</iBaseDiscover>
  <iDiscoverMultiplier>0</iDiscoverMultiplier>
  <iBaseHurry>0</iBaseHurry>
  <iHurryMultiplier>0</iHurryMultiplier>
  <iBaseTrade>0</iBaseTrade>
  <iTradeMultiplier>0</iTradeMultiplier>
  <iGreatWorkCulture>0</iGreatWorkCulture>
  <iEspionagePoints>0</iEspionagePoints>
  <TerrainImpassables/>
  <FeatureImpassables/>
  <TerrainPassableTechs/>
  <FeaturePassableTechs/>
  <iCombat>2</iCombat>
  <iCombatLimit>100</iCombatLimit>
  <iAirCombat>0</iAirCombat>
  <iAirCombatLimit>0</iAirCombatLimit>
  <iXPValueAttack>4</iXPValueAttack>
  <iXPValueDefense>2</iXPValueDefense>
  <iFirstStrikes>0</iFirstStrikes>
  <iChanceFirstStrikes>0</iChanceFirstStrikes>
  <iInterceptionProbability>0</iInterceptionProbability>
  <iEvasionProbability>0</iEvasionProbability>
  <iWithdrawalProb>0</iWithdrawalProb>
  <iCollateralDamage>0</iCollateralDamage>
  <iCollateralDamageLimit>0</iCollateralDamageLimit>
  <iCollateralDamageMaxUnits>0</iCollateralDamageMaxUnits>
  <iCityAttack>0</iCityAttack>
  <iCityDefense>0</iCityDefense>
  <iAnimalCombat>0</iAnimalCombat>
  <iHillsAttack>0</iHillsAttack>
  <iHillsDefense>0</iHillsDefense>
  <TerrainNatives>
     <TerrainNative>
        <TerrainType>TERRAIN_GRASS</TerrainType>
        <bTerrainNative>1</bTerrainNative>
     </TerrainNative>
     <TerrainNative>
        <TerrainType>TERRAIN_PLAINS</TerrainType>
        <bTerrainNative>1</bTerrainNative>
     </TerrainNative>
     <TerrainNative>
        <TerrainType>TERRAIN_DESERT</TerrainType>
        <bTerrainNative>1</bTerrainNative>
     </TerrainNative>
  </TerrainNatives>
  <FeatureNatives/>
  <TerrainAttacks/>
  <TerrainDefenses/>
  <FeatureAttacks/>
  <FeatureDefenses/>
  <UnitClassAttackMods/>
  <UnitClassDefenseMods/>
  <UnitCombatMods/>
  <UnitCombatCollateralImmunes/>
  <DomainMods/>
  <BonusProductionModifiers/>
  <iBombRate>0</iBombRate>
  <iBombardRate>0</iBombardRate>
  <SpecialCargo>NONE</SpecialCargo>
  <DomainCargo>NONE</DomainCargo>
  <iCargo>0</iCargo>
  <iConscription>0</iConscription>
  <iCultureGarrison>0</iCultureGarrison>
  <iExtraCost>0</iExtraCost>
  <iAsset>1</iAsset>
  <iPower>1</iPower>
  <UnitMeshGroups>
     <iGroupSize>3</iGroupSize>
     <fMaxSpeed>1.75</fMaxSpeed>
     <fPadTime>1</fPadTime>
     <iMeleeWaveSize>3</iMeleeWaveSize>
     <iRangedWaveSize>0</iRangedWaveSize>
     <UnitMeshGroup>
        <iRequired>3</iRequired>
        <EarlyArtDefineTag>ART_DEF_UNIT_LION</EarlyArtDefineTag>
     </UnitMeshGroup>
  </UnitMeshGroups>
  <FormationType>FORMATION_TYPE_ANIMAL</FormationType>
  <HotKey/>
  <bAltDown>0</bAltDown>
  <bShiftDown>0</bShiftDown>
  <bCtrlDown>0</bCtrlDown>
  <iHotKeyPriority>0</iHotKeyPriority>
  <FreePromotions/>
  <LeaderPromotion>NONE</LeaderPromotion>
  <iLeaderExperience>0</iLeaderExperience>
</UnitInfo>