Unit domains in Civilization 4..

Serga

Civilized maniak
Joined
Dec 5, 2005
Messages
73
Is it possible to create MOD for Civilization 4, in that we could use a multiple domain units?

Ex.: Helicopters, that can enter sea squares.

What we need to do that?
Is it enough to change Python code or we have to replace game core?
 
Serga said:
Is it possible to create MOD for Civilization 4, in that we could use a multiple domain units?

Ex.: Helicopters, that can enter sea squares.

What we need to do that?
Is it enough to change Python code or we have to replace game core?

I have been trying to figure out a way to do this for a while, to no avail.

I believe we will have to wait for the SDK to do this, and maybe not even then.

I think we could do it in XML, but we need a wa tto create new tags for the XML. Then we could simply add another domain and, viola. Hopefully, when the SDK arrives, we will be able to add new tags.
 
I think we need to override some methods of the CyGroup class. Not sure if we could do it ever...
 
We can add new tags now, you just need to modify the schema file to allow it. I had a 'race' tag in all my untis for a while (elf/dwarf/etc). The problem wasn't being able to add the tag, but the fact that the code doesn't do anything with it.
 
CIV4BasicInfos.xml said:
<DomainInfos>
<DomainInfo>
<Type>DOMAIN_SEA</Type>
<Description>TXT_KEY_DOMAIN_SEA</Description>
</DomainInfo>
<DomainInfo>
<Type>DOMAIN_AIR</Type>
<Description>TXT_KEY_DOMAIN_AIR</Description>
</DomainInfo>
<DomainInfo>
<Type>DOMAIN_LAND</Type>
<Description>TXT_KEY_DOMAIN_LAND</Description>
</DomainInfo>
<DomainInfo>
<Type>DOMAIN_IMMOBILE</Type>
<Description>TXT_KEY_DOMAIN_IMMOBILE</Description>
</DomainInfo>
</DomainInfos>
Those are the 4 types of domains in Civ4. You would want to change the domain for the helicopter to AIR , most likely , to allow it to do what you want.

The definitions for these domains must be in Python , so if you'de like to make a new domain then you'de most likely have to look there.

In order to change the domain of an existing unit, you'de need to make the necessary change in the correct file. I've done it for you:

CIV4UnitInfos.xml said:
<UnitInfo>
<Class>UNITCLASS_GUNSHIP</Class>
<Type>UNIT_GUNSHIP</Type>
<UniqueNames/>
<Special>NONE</Special>
<Capture>NONE</Capture>
<Combat>UNITCOMBAT_HELICOPTER</Combat>
<Domain>DOMAIN_AIR</Domain>
<DefaultUnitAI>UNITAI_ATTACK</DefaultUnitAI>
<Invisible>NONE</Invisible>
<SeeInvisible>NONE</SeeInvisible>
<Description>TXT_KEY_UNIT_GUNSHIP</Description>
<Civilopedia>TXT_KEY_UNIT_GUNSHIP_PEDIA</Civilopedia>
<Strategy>TXT_KEY_UNIT_GUNSHIP_STRATEGY</Strategy>
<Advisor>ADVISOR_MILITARY</Advisor>
<bAnimal>0</bAnimal>
<bFood>0</bFood>
<bNoBadGoodies>0</bNoBadGoodies>
<bOnlyDefensive>0</bOnlyDefensive>
<bNoCapture>1</bNoCapture>
<bRivalTerritory>0</bRivalTerritory>
<bMilitaryHappiness>0</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>1</bNoDefensiveBonus>
<bIgnoreBuildingDefense>1</bIgnoreBuildingDefense>
<bCanMoveImpassable>0</bCanMoveImpassable>
<bFlatMovementCost>1</bFlatMovementCost>
<bIgnoreTerrainCost>0</bIgnoreTerrainCost>
<bNukeImmune>0</bNukeImmune>
<bPrereqBonuses>0</bPrereqBonuses>
<bPrereqReligion>0</bPrereqReligion>
<bMechanized>1</bMechanized>
<UnitClassUpgrades/>
<UnitAIs>
<UnitAI>
<UnitAIType>UNITAI_ATTACK</UnitAIType>
<bUnitAI>1</bUnitAI>
</UnitAI>
<UnitAI>
<UnitAIType>UNITAI_PILLAGE</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>TECH_ROCKETRY</PrereqTech>
<TechTypes>
<PrereqTech>TECH_FLIGHT</PrereqTech>
<PrereqTech>NONE</PrereqTech>
<PrereqTech>NONE</PrereqTech>
</TechTypes>
<BonusType>BONUS_OIL</BonusType>
<PrereqBonuses/>
<ProductionTraits/>
<Flavors/>
<iAIWeight>0</iAIWeight>
<iCost>160</iCost>
<iHurryCostModifier>0</iHurryCostModifier>
<iMinAreaSize>-1</iMinAreaSize>
<iMoves>4</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>20</iCombat>
<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>25</iWithdrawalProb>
<iCollateralDamage>0</iCollateralDamage>
<iCollateralDamageLimit>0</iCollateralDamageLimit>
<iCollateralDamageMaxUnits>0</iCollateralDamageMaxUnits>
<iCityAttack>0</iCityAttack>
<iCityDefense>0</iCityDefense>
<iAnimalCombat>0</iAnimalCombat>
<iHillsDefense>0</iHillsDefense>
<TerrainNatives/>
<FeatureNatives/>
<TerrainDefenses/>
<FeatureDefenses/>
<UnitClassAttackMods/>
<UnitClassDefenseMods/>
<UnitCombatMods>
<UnitCombatMod>
<UnitCombatType>UNITCOMBAT_ARMOR</UnitCombatType>
<iUnitCombatMod>100</iUnitCombatMod>
</UnitCombatMod>
</UnitCombatMods>
<DomainMods/>
<BonusProductionModifiers/>
<iBombRate>0</iBombRate>
<iBombardRate>0</iBombardRate>
<SpecialCargo>NONE</SpecialCargo>
<DomainCargo>NONE</DomainCargo>
<iCargo>0</iCargo>
<iConscription>0</iConscription>
<iCultureGarrison>10</iCultureGarrison>
<iExtraCost>0</iExtraCost>
<iAsset>5</iAsset>
<iPower>20</iPower>
<UnitMeshGroups>
<iGroupSize>1</iGroupSize>
<fMaxSpeed>1.75</fMaxSpeed>
<iMeleeWaveSize>1</iMeleeWaveSize>
<iRangedWaveSize>1</iRangedWaveSize>
<UnitMeshGroup>
<iRequired>1</iRequired>
<EarlyArtDefineTag>ART_DEF_UNIT_GUNSHIP</EarlyArtDefineTag>
</UnitMeshGroup>
</UnitMeshGroups>
<Button>,Art/Interface/Buttons/Units/Gunship.dds,Art/Interface/Buttons/Unit_Resource_Atlas.dds,5,10</Button>
<HotKey/>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<FreePromotions/>
</UnitInfo>
I hope this helps.
 
that won't work (at least i am pretty sure). I gave a unit AIR domain before and it ended up acting like a fighter with a recon and rebase mission options. It seems that those 4 are hard coded with special features we can't get at right now.
 
Yea , I was thinking that AFTER I posted ... I didn't test out my theory , just assumed. It must be something in Python then ....
 
that would be my guess but I can't read python well enough to attempt to edit it. I know that ICBMs have the same problems... after going through every XML file i end up with 2 referrences to something that is either in a python file or hard coded and seems to controls range, damage, and fireing issues (not able to bomb yourself). And I seriously want to change those if i could get at them :P
 
Back
Top Bottom