Modmodding Q&A Thread

Then I don't know.
 
Then I don't know.
Here's the Unit's XML just in case

Code:
        <UnitInfo>
            <Class>UNITCLASS_PIRATE</Class>
            <Type>UNIT_PIRATE</Type>
            <Combat>UNITCOMBAT_NAVAL</Combat>
            <Domain>DOMAIN_SEA</Domain>
            <DefaultUnitAI>UNITAI_PIRATE_SEA</DefaultUnitAI>
            <Description>TXT_KEY_UNIT_PIRATE</Description>
            <Civilopedia>TXT_KEY_UNIT_PRIVATEER_PEDIA</Civilopedia>
            <Strategy>TXT_KEY_UNIT_PRIVATEER_STRATEGY</Strategy>
            <Help>TXT_KEY_UNIT_PIRATE_HELP</Help>
            <Advisor>ADVISOR_MILITARY</Advisor>
            <bMilitaryProduction>1</bMilitaryProduction>
            <bPillage>1</bPillage>
            <bMechanized>1</bMechanized>
            <bRenderBelowWater>1</bRenderBelowWater>
            <bHiddenNationality>1</bHiddenNationality>
            <bAlwaysHostile>1</bAlwaysHostile>
            <iWithdrawalProb>50</iWithdrawalProb>
            <UnitClassUpgrades>
                <UnitClassUpgrade>
                    <UnitClassUpgradeType>UNITCLASS_CORSAIR</UnitClassUpgradeType>
                    <bUnitClassUpgrade>1</bUnitClassUpgrade>
                </UnitClassUpgrade>
            </UnitClassUpgrades>
            <UnitAIs>
                <UnitAI>
                    <UnitAIType>UNITAI_PIRATE_SEA</UnitAIType>
                    <bUnitAI>1</bUnitAI>
                </UnitAI>
            </UnitAIs>
            <NotUnitAIs>
                <UnitAI>
                    <UnitAIType>UNITAI_ATTACK_SEA</UnitAIType>
                    <bUnitAI>1</bUnitAI>
                </UnitAI>
                <UnitAI>
                    <UnitAIType>UNITAI_ESCORT_SEA</UnitAIType>
                    <bUnitAI>1</bUnitAI>
                </UnitAI>
                <UnitAI>
                    <UnitAIType>UNITAI_RESERVE_SEA</UnitAIType>
                    <bUnitAI>1</bUnitAI>
                </UnitAI>
            </NotUnitAIs>
            <PrereqTech>TECH_CONTRACT</PrereqTech>
            <TechTypes>
                <PrereqTech>TECH_SHIPBUILDING</PrereqTech>
            </TechTypes>
            <iCost>40</iCost>
            <iAdvancedStartCost>100</iAdvancedStartCost>
            <iMinAreaSize>20</iMinAreaSize>
            <iMoves>3</iMoves>
            <iNukeRange>-1</iNukeRange>
            <TerrainImpassables>
                <TerrainImpassable>
                    <TerrainType>TERRAIN_OCEAN</TerrainType>
                    <bTerrainImpassable>1</bTerrainImpassable>
                </TerrainImpassable>
            </TerrainImpassables>
            <FeatureImpassables>
                <FeatureImpassable>
                    <FeatureType>FEATURE_CAPE</FeatureType>
                    <bFeatureImpassable>1</bFeatureImpassable>
                </FeatureImpassable>
            </FeatureImpassables>
            <FeaturePassableTechs>
                <FeaturePassableTech>
                    <FeatureType>FEATURE_CAPE</FeatureType>
                    <PassableTech>TECH_COMPASS</PassableTech>
                </FeaturePassableTech>
            </FeaturePassableTechs>
            <iCombat>3</iCombat>
            <iCombatLimit>100</iCombatLimit>
            <iXPValueAttack>4</iXPValueAttack>
            <iXPValueDefense>2</iXPValueDefense>
            <UnitClassAttackMods>
                <UnitClassAttackMod>
                    <UnitClassType>UNITCLASS_GALLEY</UnitClassType>
                    <iUnitClassMod>50</iUnitClassMod>
                </UnitClassAttackMod>
                <UnitClassAttackMod>
                    <UnitClassType>UNITCLASS_COG</UnitClassType>
                    <iUnitClassMod>50</iUnitClassMod>
                </UnitClassAttackMod>
                <UnitClassAttackMod>
                    <UnitClassType>UNITCLASS_GALLEON</UnitClassType>
                    <iUnitClassMod>50</iUnitClassMod>
                </UnitClassAttackMod>
                <UnitClassAttackMod>
                    <UnitClassType>UNITCLASS_OCEAN_LINER</UnitClassType>
                    <iUnitClassMod>50</iUnitClassMod>
                </UnitClassAttackMod>
                <UnitClassAttackMod>
                    <UnitClassType>UNITCLASS_TRANSPORT</UnitClassType>
                    <iUnitClassMod>50</iUnitClassMod>
                </UnitClassAttackMod>
            </UnitClassAttackMods>
            <UnitClassDefenseMods>
                <UnitClassDefenseMod>
                    <UnitClassType>UNITCLASS_GALLEY</UnitClassType>
                    <iUnitClassMod>50</iUnitClassMod>
                </UnitClassDefenseMod>
                <UnitClassDefenseMod>
                    <UnitClassType>UNITCLASS_COG</UnitClassType>
                    <iUnitClassMod>50</iUnitClassMod>
                </UnitClassDefenseMod>
                <UnitClassDefenseMod>
                    <UnitClassType>UNITCLASS_GALLEON</UnitClassType>
                    <iUnitClassMod>50</iUnitClassMod>
                </UnitClassDefenseMod>
                <UnitClassDefenseMod>
                    <UnitClassType>UNITCLASS_OCEAN_LINER</UnitClassType>
                    <iUnitClassMod>50</iUnitClassMod>
                </UnitClassDefenseMod>
                <UnitClassDefenseMod>
                    <UnitClassType>UNITCLASS_TRANSPORT</UnitClassType>
                    <iUnitClassMod>50</iUnitClassMod>
                </UnitClassDefenseMod>
            </UnitClassDefenseMods>
            <iAsset>1</iAsset>
            <iPower>4</iPower>
            <UnitMeshGroups>
                <iGroupSize>1</iGroupSize>
                <fMaxSpeed>2.25</fMaxSpeed>
                <fPadTime>1</fPadTime>
                <iMeleeWaveSize>1</iMeleeWaveSize>
                <iRangedWaveSize>1</iRangedWaveSize>
                <UnitMeshGroup>
                    <iRequired>1</iRequired>
                    <EarlyArtDefineTag>ART_DEF_UNIT_PRIVATEER</EarlyArtDefineTag>
                </UnitMeshGroup>
            </UnitMeshGroups>
            <FormationType>FORMATION_TYPE_MACHINE</FormationType>
            <FreePromotions>
                <FreePromotion>
                    <PromotionType>PROMOTION_SENTRY</PromotionType>
                    <bFreePromotion>1</bFreePromotion>
                </FreePromotion>
            </FreePromotions>
        </UnitInfo>

EDIT: Could it have something to do with the fact that Piracy is normally something that occurs later in the game? Leader Flavors, oddities in the DLL AI, etc?
 
Not that I know about, but I never did anything with this part of the game.
 
No, I have a pirate ship in the ancient era, and AIs always make use of it. I don't know why yours doesn't work - this is my pirate ship's code (I added my own custom flavours, but I did that long after adding this unit, so ignore the FLAVOR_PIRATE):
Code:
<UnitInfo>
            <Class>UNITCLASS_PIRATE</Class>
            <Type>UNIT_PIRATE</Type>
            <UniqueNames/>
            <Special>NONE</Special>
            <Capture>NONE</Capture>
            <Combat>UNITCOMBAT_NAVAL</Combat>
            <Domain>DOMAIN_SEA</Domain>
            <DefaultUnitAI>UNITAI_PIRATE_SEA</DefaultUnitAI>
            <Invisible>NONE</Invisible>
            <SeeInvisible>NONE</SeeInvisible>
            <Description>TXT_KEY_UNIT_PIRATE</Description>
            <Civilopedia>TXT_KEY_UNIT_PIRATE_PEDIA</Civilopedia>
            <Strategy>TXT_KEY_UNIT_PIRATE_STRATEGY</Strategy>
            <Advisor>ADVISOR_MILITARY</Advisor>
            <bAnimal>0</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>1</bMilitaryProduction>
            <bPillage>1</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>0</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>1</bMechanized>
            <bRenderBelowWater>1</bRenderBelowWater>
            <bSuicide>0</bSuicide>
            <bHiddenNationality>1</bHiddenNationality>
            <bAlwaysHostile>1</bAlwaysHostile>
            <UnitClassUpgrades>
                <UnitClassUpgrade>
                    <UnitClassUpgradeType>UNITCLASS_PRIVATEER</UnitClassUpgradeType>
                    <bUnitClassUpgrade>1</bUnitClassUpgrade>
                </UnitClassUpgrade>
            </UnitClassUpgrades>
            <UnitClassTargets/>
            <UnitCombatTargets/>
            <UnitClassDefenders/>
            <UnitCombatDefenders/>
            <FlankingStrikes/>
            <UnitAIs>
                <UnitAI>
                    <UnitAIType>UNITAI_PIRATE_SEA</UnitAIType>
                    <bUnitAI>1</bUnitAI>
                </UnitAI>
            </UnitAIs>
            <NotUnitAIs>
                <UnitAI>
                    <UnitAIType>UNITAI_ESCORT_SEA</UnitAIType>
                    <bUnitAI>1</bUnitAI>
                </UnitAI>
                <UnitAI>
                    <UnitAIType>UNITAI_RESERVE_SEA</UnitAIType>
                    <bUnitAI>1</bUnitAI>
                </UnitAI>
                <UnitAI>
                    <UnitAIType>UNITAI_ATTACK_SEA</UnitAIType>
                    <bUnitAI>1</bUnitAI>
                </UnitAI>
            </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>TECH_IRON_WORKING</PrereqTech>
            <TechTypes>
                <PrereqTech>TECH_SAILING</PrereqTech>
                <PrereqTech>NONE</PrereqTech>
                <PrereqTech>NONE</PrereqTech>
            </TechTypes>
            <BonusType>NONE</BonusType>
            <PrereqBonuses/>
            <ProductionTraits/>
            <Flavors>
                <Flavor>
                    <FlavorType>FLAVOR_PIRATE</FlavorType>
                    <iFlavor>1</iFlavor>
                </Flavor>
            </Flavors>
            <iAIWeight>0</iAIWeight>
            <iCost>80</iCost>
            <iHurryCostModifier>0</iHurryCostModifier>
            <iAdvancedStartCost>100</iAdvancedStartCost>
            <iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
            <iMinAreaSize>20</iMinAreaSize>
            <iMoves>3</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>
                <TerrainImpassable>
                    <TerrainType>TERRAIN_OCEAN</TerrainType>
                    <bTerrainImpassable>1</bTerrainImpassable>
                </TerrainImpassable>
            </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>10</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/>
            <TerrainAttacks/>
            <TerrainDefenses>
                <TerrainDefense>
                    <TerrainType>TERRAIN_COAST</TerrainType>
                    <iTerrainDefense>10</iTerrainDefense>
                </TerrainDefense>              
            </TerrainDefenses>
            <FeatureAttacks/>
            <FeatureDefenses/>
            <UnitClassAttackMods>
                <UnitClassAttackMod>
                    <UnitClassType>UNITCLASS_GALLEY</UnitClassType>
                    <iUnitClassMod>100</iUnitClassMod>
                </UnitClassAttackMod>
            </UnitClassAttackMods>
            <UnitClassDefenseMods>
                <UnitClassDefenseMod>
                    <UnitClassType>UNITCLASS_GALLEY</UnitClassType>
                    <iUnitClassMod>100</iUnitClassMod>
                </UnitClassDefenseMod>
            </UnitClassDefenseMods>
            <UnitCombatMods/>
            <UnitCombatCollateralImmunes/>
            <DomainMods/>
            <BonusProductionModifiers/>
            <iBombRate>0</iBombRate>
            <iBombardRate>0</iBombardRate>
            <SpecialCargo>NONE</SpecialCargo>
            <DomainCargo>DOMAIN_LAND</DomainCargo>
            <iCargo>0</iCargo>
            <iConscription>0</iConscription>
            <iCultureGarrison>0</iCultureGarrison>
            <iExtraCost>0</iExtraCost>
            <iAsset>3</iAsset>
            <iPower>6</iPower>
            <UnitMeshGroups>
                <iGroupSize>1</iGroupSize>
                <fMaxSpeed>2.25</fMaxSpeed>
                <fPadTime>1</fPadTime>
                <iMeleeWaveSize>1</iMeleeWaveSize>
                <iRangedWaveSize>1</iRangedWaveSize>
                <UnitMeshGroup>
                    <iRequired>1</iRequired>
                    <EarlyArtDefineTag>ART_DEF_UNIT_PIRATE</EarlyArtDefineTag>
                </UnitMeshGroup>
            </UnitMeshGroups>
            <FormationType>FORMATION_TYPE_MACHINE</FormationType>
            <HotKey/>
            <bAltDown>0</bAltDown>
            <bShiftDown>0</bShiftDown>
            <bCtrlDown>0</bCtrlDown>
            <iHotKeyPriority>0</iHotKeyPriority>
            <FreePromotions>
                <FreePromotion>
                    <PromotionType>PROMOTION_NAVALSENTRY</PromotionType>
                    <bFreePromotion>1</bFreePromotion>
                </FreePromotion>
            </FreePromotions>
            <LeaderPromotion>NONE</LeaderPromotion>
            <iLeaderExperience>0</iLeaderExperience>
        </UnitInfo>
 
I'm trying to add a second UB to Japan but it's not working. The new UB shows up in the Civilopedia under the Unique Buildings category but isn't being recognized as a second UB for Japan; it just can't be built by anyone. I added an entry to CIV4BuildingInfos.xml which seems to be working fine, and I edited the entry for Japan in Civ4CivilizationInfos.xml to the following:

Code:
<Buildings>
               <Building>
                   <BuildingClassType>BUILDINGCLASS_FACTORY</BuildingClassType>
                   <BuildingType>BUILDING_JAPANESE_ZAIBATSU</BuildingType>
               </Building>
               <Building>
                   <BuildingClassType>BUILDINGCLASS_PAGAN_TEMPLE</BuildingClassType>
                   <BuildingType>BUILDING_JAPAN_JINJA</BuildingType>
               </Building>
           </Buildings>

And also added
Code:
iNumSecondUB = 1
(iJapanJinja) = range(iNumBuildingsPlague,iNumBuildingsPlague+iNumSecondUB)
to Consts.py, any effects of which I have not noticed.

What am I missing?
 
I'm trying to add a second UB to Japan but it's not working. The new UB shows up in the Civilopedia under the Unique Buildings category but isn't being recognized as a second UB for Japan; it just can't be built by anyone. I added an entry to CIV4BuildingInfos.xml which seems to be working fine, and I edited the entry for Japan in Civ4CivilizationInfos.xml to the following:

Code:
<Buildings>
               <Building>
                   <BuildingClassType>BUILDINGCLASS_FACTORY</BuildingClassType>
                   <BuildingType>BUILDING_JAPANESE_ZAIBATSU</BuildingType>
               </Building>
               <Building>
                   <BuildingClassType>BUILDINGCLASS_PAGAN_TEMPLE</BuildingClassType>
                   <BuildingType>BUILDING_JAPAN_JINJA</BuildingType>
               </Building>
           </Buildings>

And also added
Code:
iNumSecondUB = 1
(iJapanJinja) = range(iNumBuildingsPlague,iNumBuildingsPlague+iNumSecondUB)
to Consts.py, any effects of which I have not noticed.

What am I missing?
You're sure its name is not BUILDING_JAPANESE_JINJA or anything?
 
Buildinginfos:
Code:
<BuildingInfo>
            <BuildingClass>BUILDINGCLASS_PAGAN_TEMPLE</BuildingClass>
            <Type>BUILDING_JAPAN_JINJA</Type>
            <Description>TXT_KEY_BUILDING_JAPAN_JINJA</Description>
            <Civilopedia>TXT_KEY_BUILDING_JAPAN_JINJA_PEDIA</Civilopedia>
            <Strategy>TXT_KEY_BUILDING_JAPAN_JINJA_STRATEGY</Strategy>
            <Advisor>ADVISOR_CULTURE</Advisor>
            <ArtDefineTag>ART_DEF_BUILDING_JAPAN_JINJA</ArtDefineTag>
            <ObsoleteTech>NONE</ObsoleteTech>
            <PrereqTech>TECH_MYSTICISM</PrereqTech>
            <bNeverCapture>1</bNeverCapture>
            <bCenterInCity>1</bCenterInCity>
            <iCost>30</iCost>
            <iAdvancedStartCost>100</iAdvancedStartCost>
            <iMinAreaSize>-1</iMinAreaSize>
            <iHappiness>1</iHappiness>
            <iAsset>2</iAsset>
            <fVisibilityPriority>1.0</fVisibilityPriority>
            <SeaPlotYieldChanges>
                <iYield>0</iYield>
                <iYield>1</iYield>
            </SeaPlotYieldChanges>
            <ObsoleteSafeCommerceChanges>
                <iCommerce>0</iCommerce>
                <iCommerce>0</iCommerce>
                <iCommerce>1</iCommerce>
            </ObsoleteSafeCommerceChanges>
            <CommerceChangeDoubleTimes>
                <iCommerce>0</iCommerce>
                <iCommerce>0</iCommerce>
                <iCommerce>1000</iCommerce>
            </CommerceChangeDoubleTimes>
            <SpecialistCounts>
                <SpecialistCount>
                    <SpecialistType>SPECIALIST_PRIEST</SpecialistType>
                    <iSpecialistCount>1</iSpecialistCount>
                </SpecialistCount>
            </SpecialistCounts>
            <ConstructSound>AS2D_BUILD_OBELISK</ConstructSound>
            <Flavors>
                <Flavor>
                    <FlavorType>FLAVOR_CULTURE</FlavorType>
                    <iFlavor>10</iFlavor>
                </Flavor>
            </Flavors>
        </BuildingInfo>

Not sure what you mean by the location? This is immediately beneath the entry for the Zaibatsu. Previously had it between Ziggurat and Edict. All of those work fine
 
I really messed up something bad. Now when the Arab UP activates it builds All Saints Church instead of an Islamic Mosque
 
Buildinginfos:
Code:
<BuildingInfo>
            <BuildingClass>BUILDINGCLASS_PAGAN_TEMPLE</BuildingClass>
            <Type>BUILDING_JAPAN_JINJA</Type>
            <Description>TXT_KEY_BUILDING_JAPAN_JINJA</Description>
            <Civilopedia>TXT_KEY_BUILDING_JAPAN_JINJA_PEDIA</Civilopedia>
            <Strategy>TXT_KEY_BUILDING_JAPAN_JINJA_STRATEGY</Strategy>
            <Advisor>ADVISOR_CULTURE</Advisor>
            <ArtDefineTag>ART_DEF_BUILDING_JAPAN_JINJA</ArtDefineTag>
            <ObsoleteTech>NONE</ObsoleteTech>
            <PrereqTech>TECH_MYSTICISM</PrereqTech>
            <bNeverCapture>1</bNeverCapture>
            <bCenterInCity>1</bCenterInCity>
            <iCost>30</iCost>
            <iAdvancedStartCost>100</iAdvancedStartCost>
            <iMinAreaSize>-1</iMinAreaSize>
            <iHappiness>1</iHappiness>
            <iAsset>2</iAsset>
            <fVisibilityPriority>1.0</fVisibilityPriority>
            <SeaPlotYieldChanges>
                <iYield>0</iYield>
                <iYield>1</iYield>
            </SeaPlotYieldChanges>
            <ObsoleteSafeCommerceChanges>
                <iCommerce>0</iCommerce>
                <iCommerce>0</iCommerce>
                <iCommerce>1</iCommerce>
            </ObsoleteSafeCommerceChanges>
            <CommerceChangeDoubleTimes>
                <iCommerce>0</iCommerce>
                <iCommerce>0</iCommerce>
                <iCommerce>1000</iCommerce>
            </CommerceChangeDoubleTimes>
            <SpecialistCounts>
                <SpecialistCount>
                    <SpecialistType>SPECIALIST_PRIEST</SpecialistType>
                    <iSpecialistCount>1</iSpecialistCount>
                </SpecialistCount>
            </SpecialistCounts>
            <ConstructSound>AS2D_BUILD_OBELISK</ConstructSound>
            <Flavors>
                <Flavor>
                    <FlavorType>FLAVOR_CULTURE</FlavorType>
                    <iFlavor>10</iFlavor>
                </Flavor>
            </Flavors>
        </BuildingInfo>

Not sure what you mean by the location? This is immediately beneath the entry for the Zaibatsu. Previously had it between Ziggurat and Edict. All of those work fine

On what version are you working on? 1.14? The current version doesn't have the Mysticism tech anymore.

I mean with location where in the BuildingInfos you put the new building. At the bottom or between some buildings. It seems you placed it between some buildings.

Hint:
UB are placed after the building it replaces. So I would advise to move the XML entry back to old location between the Ziggurat and the Edict, instead of after the Zaibatsu.

I really messed up something bad. Now when the Arab UP activates it builds All Saints Church instead of an Islamic Mosque

I seems you messed up the consts. In the XML, you placed it somewhere in the middle, whereas in the consts, you added it to the bottom by the method you're using. The number in the Consts should match the location in the XML.

If you add a new buildings between some existing buildings, the method you used doesn't work. You have to add the new building in the "list" and increase iNumBuildings by 1.
 
Yes, it is 1.14. Moved the buildinginfos entry to between Edict and Ziggurat, added it to Consts.py at that location, increasing iNumBuildings by 1 (212->213). Arab UP now works correctly again but Japanese Jinja still not recognized as being any civ's UB
 
I'm trying to add a second UB for Japan. Discussed it here. Tl;dr it shows up in the Civilopedia with the correct effect, and is recognized as a unique building, but not as Japan's unique building, and cannot be built by any Civ. This is what's in CivilizationInfos.xml:
<Buildings>
<Building>
<BuildingClassType>BUILDINGCLASS_FACTORY</BuildingClassType>
<BuildingType>BUILDING_JAPANESE_ZAIBATSU</BuildingType>
</Building>
<Building>
<BuildingClassType>BUILDINGCLASS_PAGAN_TEMPLE</BuildingClassType>
<BuildingType>BUILDING_JAPAN_JINJA</BuildingType>
</Building>
</Buildings>
 
You know I didn't think of that. Doy, that was the reason and it works fine now. Don't I feel stupid. Thanks
 
Last edited:
I've been working on making building improvements in Rainforests not take extra time if the Rainforests aren't cut down in the process, but have had trouble figuring out a way to make Khmer's Farms not take twice the normal period of time. Anyone have any idea of how to implement this?
 
I've been working on making building improvements in Rainforests not take extra time if the Rainforests aren't cut down in the process, but have had trouble figuring out a way to make Khmer's Farms not take twice the normal period of time. Anyone have any idea of how to implement this?

Make the Khmer farms a unique improvement. You could grant a fake tech (coords -1, -1 and some other things like that, so it's not researchable) just to the Khmer, and then have that tech unlock Rainforest Farms.
 
Make the Khmer farms a unique improvement. You could grant a fake tech (coords -1, -1 and some other things like that, so it's not researchable) just to the Khmer, and then have that tech unlock Rainforest Farms.

I was thinking of just editing the code so that Khmer farms on Rainforest are built twice as fast as normal, though this is a nice backup. Does anyone know where improvement build time is calculated and/or incremented?
 
Top Bottom