What is a 'trait' in unit mod coding?

Joined
Jan 10, 2019
Messages
2,833
What exactly is a 'trait' in unit mod coding? Is it a mechanism to activate 'secondary unit class' assigned to a specific unit and why only UUs have 'traits' and not generic unit?
Is 'trait' can also be adapted to adjust unit attributes (combat strenghts for example) that requires a tech to be research or civics to be cultivated?

Code:
...
<Row UnitType="UNIT_GREEK_HOPLITE" Cost="65" Maintenance="1" BaseMoves="2" BaseSightRange="2" ZoneOfControl="true" Domain="DOMAIN_LAND"
Combat="25" FormationClass="FORMATION_CLASS_LAND_COMBAT" PromotionClass="PROMOTION_CLASS_ANTI_CAVALRY" AdvisorType="ADVISOR_CONQUEST"
Name="LOC_UNIT_GREEK_HOPLITE_NAME" Description="LOC_UNIT_GREEK_HOPLITE_DESCRIPTION" PurchaseYield="YIELD_GOLD" MandatoryObsoleteTech="TECH_METAL_CASTING"
TraitType="TRAIT_CIVILIZATION_UNIT_GREEK_HOPLITE" PrereqTech="TECH_BRONZE_WORKING"/>
...

an example of a unit that has 'trait'
 
Back
Top Bottom