I added a new building to my game - a Lumber Factory, which is basically the next level up from Lumber Mill which provides a 50% production bonus just like a Cigar factory or a Textile Mill would.
If I start a new game, it seems to work fine. But when I try to load a saved game it crashes shortly after I choose my save game. There is some error message but the game quickly exits to desktop before I can read it. I also tried doing a PRINT SCREEN trying to catch the error but after 10 tries I keep missing it. If I move the files I changed then the save game loads fine - so it's definitely because of my changes.
I changed the following:
CIV4BuildingClassInfos.xml, adding:
CIV4BuildingInfos.xml, adding:
CIV4ArtDefines_Building.xml, adding:
(basically using same art as lumber mill)
And creating all the relevant TEXT entries in:
CIV4GameText_Colonization_Objects.xml
CIV4GameText_Colonization_Pedia.xml
CIV4GameText_Colonization_Strategy.xml
But something must be screwed up.
For one I noticed that if I start a new game and use the World Builder to add a Lumber Mill so that I can see my Lumber Factory option I noticed that while Lumber Mill's tooltip says it replaces the Carpenter's Shop it says the same thing for my Lumber Factory. I don't know where it would be specified but maybe this is the problem. It should say that my Lumber Factory would replace the Lumber Mill, not the Carpenters Shop.
Where is this specified?
Or is there any better way for me to debug this? I editted the ini file to turn on logging but all the extra logging does not seem to help. The only thing that even mentions an error is this entry in app.log:
[5928.375] ERR: Error during inflate
Any ideas?
If I start a new game, it seems to work fine. But when I try to load a saved game it crashes shortly after I choose my save game. There is some error message but the game quickly exits to desktop before I can read it. I also tried doing a PRINT SCREEN trying to catch the error but after 10 tries I keep missing it. If I move the files I changed then the save game loads fine - so it's definitely because of my changes.
I changed the following:
CIV4BuildingClassInfos.xml, adding:
Code:
<BuildingClassInfo>
<Type>BUILDINGCLASS_LUMBER_FACTORY</Type>
<Description>TXT_KEY_BUILDING_LUMBER_FACTORY</Description>
<DefaultBuilding>BUILDING_LUMBER_FACTORY</DefaultBuilding>
<VictoryThresholds/>
</BuildingClassInfo>
CIV4BuildingInfos.xml, adding:
Code:
<BuildingInfo>
<Type>BUILDING_LUMBER_FACTORY</Type>
<BuildingClass>BUILDINGCLASS_LUMBER_FACTORY</BuildingClass>
<SpecialBuildingType>SPECIALBUILDING_HAMMERS</SpecialBuildingType>
<iSpecialBuildingPriority>1</iSpecialBuildingPriority>
<Description>TXT_KEY_BUILDING_LUMBER_FACTORY</Description>
<Civilopedia>TXT_KEY_BUILDING_LUMBER_FACTORY_PEDIA</Civilopedia>
<Strategy>TXT_KEY_BUILDING_LUMBER_FACTORY_STRATEGY</Strategy>
<ArtDefineTag>ART_DEF_BUILDING_LUMBERFACTORY</ArtDefineTag>
<MovieDefineTag>NONE</MovieDefineTag>
<VictoryPrereq>NONE</VictoryPrereq>
<FreeStartEra>NONE</FreeStartEra>
<MaxStartEra>NONE</MaxStartEra>
<ProductionTraits/>
<FreePromotion>NONE</FreePromotion>
<bGraphicalOnly>0</bGraphicalOnly>
<bWorksWater>0</bWorksWater>
<bWater>0</bWater>
<bRiver>0</bRiver>
<bCapital>0</bCapital>
<bNeverCapture>0</bNeverCapture>
<bCenterInCity>0</bCenterInCity>
<iAIWeight>0</iAIWeight>
<YieldCosts>
<YieldCost>
<YieldType>YIELD_HAMMERS</YieldType>
<iCost>270</iCost>
</YieldCost>
<YieldCost>
<YieldType>YIELD_TOOLS</YieldType>
<iCost>120</iCost>
</YieldCost>
</YieldCosts>
<iHurryCostModifier>0</iHurryCostModifier>
<iAdvancedStartCost>-1</iAdvancedStartCost>
<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
<iProfessionOutput>6</iProfessionOutput>
<iMaxWorkers>3</iMaxWorkers>
<iMinAreaSize>-1</iMinAreaSize>
<iConquestProb>100</iConquestProb>
<iCitiesPrereq>0</iCitiesPrereq>
<iTeamsPrereq>0</iTeamsPrereq>
<iLevelPrereq>0</iLevelPrereq>
<iMinLatitude>0</iMinLatitude>
<iMaxLatitude>90</iMaxLatitude>
<iExperience>0</iExperience>
<iFoodKept>0</iFoodKept>
<iHealRateChange>0</iHealRateChange>
<iMilitaryProductionModifier>0</iMilitaryProductionModifier>
<iDefense>0</iDefense>
<iBombardDefense>0</iBombardDefense>
<iAsset>200</iAsset>
<iPower>0</iPower>
<iYieldStorage>0</iYieldStorage>
<iOverflowSellPercent>0</iOverflowSellPercent>
<fVisibilityPriority>1.0</fVisibilityPriority>
<SeaPlotYieldChanges/>
<RiverPlotYieldChanges/>
<YieldChanges/>
<YieldModifiers>
<YieldModifier>
<YieldType>YIELD_HAMMERS</YieldType>
<iModifier>50</iModifier>
</YieldModifier>
<YieldModifier>
<YieldType>YIELD_BELLS</YieldType>
<iModifier>25</iModifier>
</YieldModifier>
</YieldModifiers>
<ConstructSound/>
<UnitCombatFreeExperiences/>
<DomainFreeExperiences/>
<DomainProductionModifiers/>
<PrereqBuildingClasses/>
<BuildingClassNeededs>
<BuildingClassNeeded>
<BuildingClassType>BUILDINGCLASS_LUMBER_MILL</BuildingClassType>
<bNeededInCity>1</bNeededInCity>
</BuildingClassNeeded>
</BuildingClassNeededs>
<HotKey/>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
</BuildingInfo>
CIV4ArtDefines_Building.xml, adding:
Code:
<BuildingArtInfo>
<Type>ART_DEF_BUILDING_LUMBERFACTORY</Type>
<LSystem>LSYSTEM_2x2</LSystem>
<bAnimated>0</bAnimated>
<CityTexture>,Art/Interface/Screens/City_Management/city_buildings_altas.dds,2,3</CityTexture>
<CitySelectedTexture>,IS,FILLER,TEXT</CitySelectedTexture>
<fScale>1.2</fScale>
<fInterfaceScale>0.6</fInterfaceScale>
<NIF>Art/Structures/Buildings/Lumbermill/Lumbermill.nif</NIF>
<KFM/>
<Button>,Art/Interface/Buttons/Unit_Resource_Colonization_Atlas.dds,2,7</Button>
</BuildingArtInfo>
And creating all the relevant TEXT entries in:
CIV4GameText_Colonization_Objects.xml
CIV4GameText_Colonization_Pedia.xml
CIV4GameText_Colonization_Strategy.xml
But something must be screwed up.
For one I noticed that if I start a new game and use the World Builder to add a Lumber Mill so that I can see my Lumber Factory option I noticed that while Lumber Mill's tooltip says it replaces the Carpenter's Shop it says the same thing for my Lumber Factory. I don't know where it would be specified but maybe this is the problem. It should say that my Lumber Factory would replace the Lumber Mill, not the Carpenters Shop.
Where is this specified?
Or is there any better way for me to debug this? I editted the ini file to turn on logging but all the extra logging does not seem to help. The only thing that even mentions an error is this entry in app.log:
[5928.375] ERR: Error during inflate
Any ideas?