• Civilization 7 has been announced. For more info please check the forum here .

changing unit names

davbenbak

Lackey
Joined
Jun 9, 2003
Messages
710
Location
Texas
I would like to think that it would be an easy thing to change a units name from say "Cavalry" to "Hussar" but something tells me it is more involved. I didn't see anything in the tutorials so could someone give me a quick walk through.
 
For all calvary, or on an individual basis? For all, you'd use XML and just edit the appropriate name field. For all of a single civ's cavalry, basically create a unique unit that's an exact copy of the standard cavalry but with the name changed. To do it on an individual basis, use the python function:

unit.setName( 'Hussar' )

Hope that helps.
 
In that case I'll look in the tutorials for how to create a unique units. Thanks.
 
OK. Here is an example. I would like to take the Chinese UU Chokonu and make it the UU for Rome which I have renamed "The Italian States" and rename it "Condottiere". I've already replaced the Pretorian under Rome in the civ info xml unit and unitclass line with the Chokohu. What's next? How many files will need to be renamed? Do any graphic files need renaming?
 
OK, i think i understand, lets start with the unitinfo:

Spoiler :
<UnitInfo>
<Class>UNITCLASS_CROSSBOWMAN</Class>
<Type>UNIT_CHOKONU</Type>
<UniqueNames/>
<Special>NONE</Special>
<Capture>NONE</Capture>
<Combat>UNITCOMBAT_ARCHER</Combat>
<Domain>DOMAIN_LAND</Domain>
<DefaultUnitAI>UNITAI_COUNTER</DefaultUnitAI>
<Invisible>NONE</Invisible>
<SeeInvisible>NONE</SeeInvisible>
<Description>Condottiere</Description>


<Civilopedia>TXT_KEY_UNIT_CROSSBOWMAN_PEDIA</Civilopedia>


<Strategy>TXT_KEY_UNIT_CROSSBOWMAN_STRATEGY</Strategy>
<Advisor>ADVISOR_MILITARY</Advisor>
<bAnimal>0</bAnimal>
<bFood>0</bFood>
<bNoBadGoodies>0</bNoBadGoodies>
<bOnlyDefensive>0</bOnlyDefensive>
<bNoCapture>0</bNoCapture>
<bRivalTerritory>0</bRivalTerritory>
<bMilitaryHappiness>1</bMilitaryHappiness>
<bMilitarySupport>1</bMilitarySupport>
<bMilitaryProduction>1</bMilitaryProduction>
<bPillage>1</bPillage>
<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>0</bNoDefensiveBonus>
<bIgnoreBuildingDefense>0</bIgnoreBuildingDefense>
<bCanMoveImpassable>0</bCanMoveImpassable>
<bFlatMovementCost>0</bFlatMovementCost>
<bIgnoreTerrainCost>0</bIgnoreTerrainCost>
<bNukeImmune>0</bNukeImmune>
<bPrereqBonuses>0</bPrereqBonuses>
<bPrereqReligion>0</bPrereqReligion>
<bMechanized>0</bMechanized>
<UnitClassUpgrades>
<UnitClassUpgrade>


<UnitClassUpgradeType>UNITCLASS_CROSSBOWMAN_II</UnitClassUpgradeType>


<bUnitClassUpgrade>1</bUnitClassUpgrade>
</UnitClassUpgrade>
</UnitClassUpgrades>
<UnitClassTargets/>
<UnitCombatTargets/>
<UnitClassDefenders/>
<UnitCombatDefenders/>
<UnitAIs>
<UnitAI>


<UnitAIType>UNITAI_ATTACK</UnitAIType>
<bUnitAI>1</bUnitAI>
</UnitAI>
<UnitAI>


<UnitAIType>UNITAI_RESERVE</UnitAIType>
<bUnitAI>1</bUnitAI>
</UnitAI>
<UnitAI>


<UnitAIType>UNITAI_COUNTER</UnitAIType>
<bUnitAI>1</bUnitAI>
</UnitAI>
<UnitAI>


<UnitAIType>UNITAI_CITY_COUNTER</UnitAIType>
<bUnitAI>1</bUnitAI>
</UnitAI>
</UnitAIs>
<NotUnitAIs/>
<Builds/>
<ReligionSpreads/>
<GreatPeoples/>
<Buildings/>
<ForceBuildings/>
<HolyCity>NONE</HolyCity>
<ReligionType>NONE</ReligionType>
<StateReligion>NONE</StateReligion>
<PrereqReligion>NONE</PrereqReligion>
<PrereqBuilding>NONE</PrereqBuilding>
<PrereqTech>MOD_TECH_MATHEMATICS</PrereqTech>
<TechTypes/>
<BonusType>BONUS_IRON</BonusType>
<PrereqBonuses/>
<ProductionTraits/>
<Flavors/>
<iAIWeight>0</iAIWeight>
<iCost>60</iCost>
<iHurryCostModifier>0</iHurryCostModifier>
<iMinAreaSize>-1</iMinAreaSize>
<iMoves>1</iMoves>
<iAirRange>0</iAirRange>
<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>
<TerrainImpassables/>
<FeatureImpassables/>
<iCombat>6</iCombat>
<iAirCombat>0</iAirCombat>
<iAirCombatLimit>0</iAirCombatLimit>
<iXPValueAttack>4</iXPValueAttack>
<iXPValueDefense>2</iXPValueDefense>
<iFirstStrikes>1</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/>
<FeatureNatives/>
<TerrainDefenses/>
<FeatureDefenses/>
<UnitClassAttackMods/>
<UnitClassDefenseMods/>
<UnitCombatMods>
<UnitCombatMod>


<UnitCombatType>UNITCOMBAT_MELEE</UnitCombatType>


<iUnitCombatMod>50</iUnitCombatMod>
</UnitCombatMod>
</UnitCombatMods>
<UnitCombatCollateralImmunes/>
<DomainMods/>
<BonusProductionModifiers/>
<iBombRate>0</iBombRate>
<iBombardRate>0</iBombardRate>
<SpecialCargo>NONE</SpecialCargo>
<DomainCargo>NONE</DomainCargo>
<iCargo>0</iCargo>
<iConscription>0</iConscription>
<iCultureGarrison>6</iCultureGarrison>
<iExtraCost>0</iExtraCost>
<iAsset>2</iAsset>
<iPower>4</iPower>
<UnitMeshGroups>
<iGroupSize>3</iGroupSize>
<fMaxSpeed>1.75</fMaxSpeed>
<iMeleeWaveSize>3</iMeleeWaveSize>
<iRangedWaveSize>3</iRangedWaveSize>
<UnitMeshGroup>
<iRequired>3</iRequired>


<EarlyArtDefineTag>ART_DEF_UNIT_CHINA_CHOKONU</EarlyArtDefineTag>
</UnitMeshGroup>
</UnitMeshGroups>


<Button>,Art/Interface/Buttons/Units/ChoKoNu.dds,Art/Interface/Buttons/Unit_Resource_Atl

as.dds,3,6</Button>
<HotKey/>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<FreePromotions/>
<LeaderPromotion>NONE</LeaderPromotion>
<iLeaderExperience>0</iLeaderExperience>
</UnitInfo>


Then Civ4CivilizationInfos: under your Rome (The Italian States) civ:

Spoiler :
<Unit>


<UnitClassType>UNITCLASS_CROSSBOWMAN</UnitClassType>


<UnitType>UNIT_CHOKONU</UnitType>
</Unit>


That should be all you need to do.;)
 
Top Bottom