Terrain Improvement Mod Problem

Roll

Chieftain
Joined
Jan 25, 2008
Messages
18
Hi,

While trying to add some new improvements to Fall from Heaven I ran into a slight problem. I successfully added the new improvements but they don't upgrade past the second level. The second level improvement doesn't upgrade to the third level while the third level tries to upgrade to itself in 0 turns. I've been staring at the code for awhile now and can't find what I'm doing wrong. The code can be found in the following spoilers.

Code for the second level improvement:
Spoiler :
Code:
         <ImprovementInfo>
            <Type>IMPROVEMENT_WORKSHOP2</Type>
            <Description>TXT_KEY_IMPROVEMENT_WORKSHOP2</Description>
            <Civilopedia></Civilopedia>
            <Help></Help>
            <ArtDefineTag>ART_DEF_IMPROVEMENT_WORKSHOP</ArtDefineTag>
            <YieldChanges>
                <iYieldChange>-1</iYieldChange>
                <iYieldChange>3</iYieldChange>
                <iYieldChange>0</iYieldChange>
            </YieldChanges>
            <bActsAsCity>0</bActsAsCity>
            <bHillsMakesValid>0</bHillsMakesValid>
            <bFreshWaterMakesValid>1</bFreshWaterMakesValid>
            <bRiverSideMakesValid>0</bRiverSideMakesValid>
            <bNoFreshWater>0</bNoFreshWater>
            <bRequiresFlatlands>1</bRequiresFlatlands>
            <bRequiresRiverSide>0</bRequiresRiverSide>
            <bRequiresIrrigation>0</bRequiresIrrigation>
            <bCarriesIrrigation>1</bCarriesIrrigation>
            <bRequiresFeature>0</bRequiresFeature>
            <bWater>0</bWater>
            <bGoody>0</bGoody>
            <bPermanent>0</bPermanent>
            <iAdvancedStartCost>-1</iAdvancedStartCost>
            <iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
            <iTilesPerGoody>0</iTilesPerGoody>
            <iGoodyRange>0</iGoodyRange>
            <iFeatureGrowth>0</iFeatureGrowth>
            <iUpgradeTime>45</iUpgradeTime>
            <iAirBombDefense>5</iAirBombDefense>
            <iDefenseModifier>0</iDefenseModifier>
            <iHappiness>0</iHappiness>
            <iPillageGold>10</iPillageGold>
            <bOutsideBorders>0</bOutsideBorders>
            <TerrainMakesValids>
                <TerrainMakesValid>
                    <TerrainType>TERRAIN_BROKEN_LANDS</TerrainType>
                    <bMakesValid>1</bMakesValid>
                </TerrainMakesValid>
                <TerrainMakesValid>
                    <TerrainType>TERRAIN_FIELDS_OF_PERDITION</TerrainType>
                    <bMakesValid>1</bMakesValid>
                </TerrainMakesValid>
                <TerrainMakesValid>
                    <TerrainType>TERRAIN_GRASS</TerrainType>
                    <bMakesValid>1</bMakesValid>
                </TerrainMakesValid>
                <TerrainMakesValid>
                    <TerrainType>TERRAIN_PLAINS</TerrainType>
                    <bMakesValid>1</bMakesValid>
                </TerrainMakesValid>
                <TerrainMakesValid>
                    <TerrainType>TERRAIN_TUNDRA</TerrainType>
                    <bMakesValid>1</bMakesValid>
                </TerrainMakesValid>
            </TerrainMakesValids>
            <FeatureMakesValids>
            </FeatureMakesValids>
            <ImprovementPillage>IMPROVEMENT_WORKSHOP</ImprovementPillage>
            <ImprovementUpgrade>IMPROVEMENT_WORKSHOP3</ImprovementUpgrade>
            <TechYieldChanges>
            </TechYieldChanges>
            <RouteYieldChanges>
            </RouteYieldChanges>
            <bGraphicalOnly>0</bGraphicalOnly>
            <bUnique>0</bUnique>
            <iAppearanceProbability>0</iAppearanceProbability>
            <iHealRateChange>0</iHealRateChange>
            <iRange>0</iRange>
            <iRangeDefenseModifier>0</iRangeDefenseModifier>
            <iVisibilityChange>0</iVisibilityChange>
            <BonusConvert>NONE</BonusConvert>
            <FeatureUpgrade>NONE</FeatureUpgrade>
            <SpawnUnitType>NONE</SpawnUnitType>
        </ImprovementInfo>

Code for the third level improvement:
Spoiler :
Code:
         <ImprovementInfo>
            <Type>IMPROVEMENT_WORKSHOP3</Type>
            <Description>TXT_KEY_IMPROVEMENT_WORKSHOP3</Description>
            <Civilopedia></Civilopedia>
            <Help></Help>
            <ArtDefineTag>ART_DEF_IMPROVEMENT_WORKSHOP</ArtDefineTag>
            <YieldChanges>
                <iYieldChange>-1</iYieldChange>
                <iYieldChange>4</iYieldChange>
                <iYieldChange>0</iYieldChange>
            </YieldChanges>
            <bActsAsCity>0</bActsAsCity>
            <bHillsMakesValid>0</bHillsMakesValid>
            <bFreshWaterMakesValid>1</bFreshWaterMakesValid>
            <bRiverSideMakesValid>0</bRiverSideMakesValid>
            <bNoFreshWater>0</bNoFreshWater>
            <bRequiresFlatlands>1</bRequiresFlatlands>
            <bRequiresRiverSide>0</bRequiresRiverSide>
            <bRequiresIrrigation>0</bRequiresIrrigation>
            <bCarriesIrrigation>1</bCarriesIrrigation>
            <bRequiresFeature>0</bRequiresFeature>
            <bWater>0</bWater>
            <bGoody>0</bGoody>
            <bPermanent>0</bPermanent>
            <iAdvancedStartCost>-1</iAdvancedStartCost>
            <iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
            <iTilesPerGoody>0</iTilesPerGoody>
            <iGoodyRange>0</iGoodyRange>
            <iFeatureGrowth>0</iFeatureGrowth>
            <iUpgradeTime>0</iUpgradeTime>
            <iAirBombDefense>5</iAirBombDefense>
            <iDefenseModifier>0</iDefenseModifier>
            <iHappiness>0</iHappiness>
            <iPillageGold>15</iPillageGold>
            <bOutsideBorders>0</bOutsideBorders>
            <TerrainMakesValids>
                <TerrainMakesValid>
                    <TerrainType>TERRAIN_BROKEN_LANDS</TerrainType>
                    <bMakesValid>1</bMakesValid>
                </TerrainMakesValid>
                <TerrainMakesValid>
                    <TerrainType>TERRAIN_FIELDS_OF_PERDITION</TerrainType>
                    <bMakesValid>1</bMakesValid>
                </TerrainMakesValid>
                <TerrainMakesValid>
                    <TerrainType>TERRAIN_GRASS</TerrainType>
                    <bMakesValid>1</bMakesValid>
                </TerrainMakesValid>
                <TerrainMakesValid>
                    <TerrainType>TERRAIN_PLAINS</TerrainType>
                    <bMakesValid>1</bMakesValid>
                </TerrainMakesValid>
                <TerrainMakesValid>
                    <TerrainType>TERRAIN_TUNDRA</TerrainType>
                    <bMakesValid>1</bMakesValid>
                </TerrainMakesValid>
            </TerrainMakesValids>
            <FeatureMakesValids>
            </FeatureMakesValids>
            <ImprovementPillage>IMPROVEMENT_WORKSHOP2</ImprovementPillage>
            <ImprovementUpgrade></ImprovementUpgrade>
            <TechYieldChanges>
            </TechYieldChanges>
            <RouteYieldChanges>
            </RouteYieldChanges>
            <bGraphicalOnly>0</bGraphicalOnly>
            <bUnique>0</bUnique>
            <iAppearanceProbability>0</iAppearanceProbability>
            <iHealRateChange>0</iHealRateChange>
            <iRange>0</iRange>
            <iRangeDefenseModifier>0</iRangeDefenseModifier>
            <iVisibilityChange>0</iVisibilityChange>
            <BonusConvert>NONE</BonusConvert>
            <FeatureUpgrade>NONE</FeatureUpgrade>
            <SpawnUnitType>NONE</SpawnUnitType>
        </ImprovementInfo>

I have a feeling it's something very simple to fix but for the life of me I can't figure it out. Any help would be greatly appreciated.

- Roll
 
No upgrade is listed. Change this and the upgrade will work.

<FeatureUpgrade>NONE</FeatureUpgrade>


Orion Veteran :cool:

Hi,

Thanks for the reply!

I believe that variable is to allow an improvement to upgrade to a feature. For instance, the 'smoke' improvement upgrades to the 'flames' feature. I've set the upgrade path in the <ImprovementUpgrade> variable to the next level of the improvement but it doesn't work.

- Roll
 
Hi,

Thanks for the reply!

I believe that variable is to allow an improvement to upgrade to a feature. For instance, the 'smoke' improvement upgrades to the 'flames' feature. I've set the upgrade path in the <ImprovementUpgrade> variable to the next level of the improvement but it doesn't work.

- Roll

There is no upgrade in the CIV4BuildingInfos.xml file like we have in the CIV4UnitInfos.xml file. I think the <ImprovementUpgrade> variable is the way to go but you will also need to modify the python code in the CvEventManager.py to execute the upgrade. I developed code to terraform terrain improvements -- really cool, but I still can't get the upgrade button to disappear after the upgrade is complete. A couple of hints were thrown my way, but the none disappearing button is still a problem. If you want to try it, Here is the code:

pPlot = CyMap().plot(iX,iY)

if(iImprovement == gc.getInfoTypeForString('IMPROVEMENT_BUILD_WORKSHOP3')):

pPlot.setImprovementType(gc.getInfoTypeForString('IMPROVEMENT_WORKSHOP'))

pPlot.setImprovementType(-1)

CyInterface().addMessage(CyGame().getActivePlayer(),True,25,'Your Workshop was Upgraded!','AS2D_DISCOVERBONUS',1,'Art/Interface/Buttons/BuildWorkshop.dds',ColorTypes(8),iX,iY,True, True).


This code is not perfected yet. Maybe we can help each other.

Check out Orion's Challenge v1.04
http://forums.civfanatics.com/./down...o=file&id=7913
 
Back
Top Bottom