Help! Problem with Goods Factories in RTW. Only I can build them..

The_Colonel

Chieftain
Joined
Jul 14, 2008
Messages
22
Location
Corona, CA., USA
AI Rivals in BTS RTW (Deanej's RTW patch for BTS 3.19) will not build Goods Factories in Custom RTW games unlike the scenario games. I'm posting the last few comments by Deanej and myself in the hope that someone can post a fix to this problem.

Its really frustrating not being able to play random maps in RTW(DCM) against the AI with custom units from WWII. I can build them but I end up the only one with an airforce, navy and unique tanks (I always play Germany). How boring is that.

The unique units from the WWII powers is the main reason Dales Combat mod and RTW is so great for me. I can't be the only one thats noticed this problem.

QUOTE:


The_Colonel
--------------------------------------------------------------------------------

Dean thank you so much. Everything works fine now (3.19 with RTW). You're the Man.


Just one final issue: I've been playing a custom game in RTW since I went to 3.19. I'm at 1915 (from the beginning year of 1900). Again I'm not seeing any rival activity with unique units or naval units. Like I said before this has never been a problem.
This is going to defeat the whole point of playing RTW unless I play a scenario like 1939. I just want a good custom game experience.

Whats the deal?

I've posted a seperate thread in forums and haven't had any responses except yours. Is this problem the first you've heard of it?


DEANEJ
Yes, and I think I know why: RTW was never made to be played on random maps! At one point it was made impossible to build the Goods Factory (to prevent colonial areas from being military production centers on the global map). Simply restoring this ability would probably help in your case.
__________________
-Released Mods: Convert Production to Espionage, FinalFronter Flat, Star Trek 2.0, The Road to War Ultimate Edition for BtS 3.19
-Mods in Development: Star Trek 3.0

Help out at the Modding Wiki!​
________________
The_Colonel

--------------------------------------------------------------------------------

Good then Dean -but I'm not a modder. How do I do this? I'm pretty analytical so if you include some clear instructions I can get it accomplish in the code -I think (I hope).

Or is there some other selection in the game options you're referring to?

_____________________
"The Weak Shall Perish"


Dec 29, 2009, 04:56 PM #83
deanej
Deity
I'm not sure. I would have thought this would have been done the simple way, in the XML, but that appears to not be the case. It's probably in the DLL somewhere.
__________________
-Released Mods: Convert Production to Espionage, FinalFronter Flat, Star Trek 2.0, The Road to War Ultimate Edition for BtS 3.19
-Mods in Development: Star Trek 3.0

Help out at the Modding Wiki!​
 
You could try changing the CIV4BuildingInfos.XML file for Building 24 "Good Factory"
Code:
		<BuildingInfo>
			<BuildingClass>BUILDINGCLASS_WW2_BUILD24</BuildingClass>
			<Type>BUILDING_WW2_BUILD24</Type>
			<SpecialBuildingType>NONE</SpecialBuildingType>
			<Description>TXT_KEY_BUILDING_WW2_BUILD24</Description>
			<Civilopedia>TXT_KEY_BUILDING_WW2_BUILD24_PEDIA</Civilopedia>
			<Strategy>TXT_KEY_BUILDING_WW2_BUILD24_STRATEGY</Strategy>
			<Advisor>ADVISOR_ECONOMY</Advisor>
			<ArtDefineTag>ART_DEF_BUILDING_FACTORY</ArtDefineTag>
			<MovieDefineTag>NONE</MovieDefineTag>
			<HolyCity>NONE</HolyCity>
			<ReligionType>NONE</ReligionType>
			<StateReligion>NONE</StateReligion>
			<bStateReligion>0</bStateReligion>
			<PrereqReligion>NONE</PrereqReligion>
			<PrereqCorporation>NONE</PrereqCorporation>
			<FoundsCorporation>NONE</FoundsCorporation>
			<GlobalReligionCommerce>NONE</GlobalReligionCommerce>
			<GlobalCorporationCommerce>NONE</GlobalCorporationCommerce>
			<VictoryPrereq>NONE</VictoryPrereq>
			<FreeStartEra>NONE</FreeStartEra>
			<MaxStartEra>NONE</MaxStartEra>
			<ObsoleteTech>NONE</ObsoleteTech>
			<PrereqTech>[b]TECH_WW2_INITIAL0[/b]</PrereqTech>
                                          . . .
to
Code:
                                          . . .			
			<PrereqTech>[b]TECH_WW2_TECH10[/b]</PrereqTech>
                                         . . .
Hopefully once you have researched Tech 10 (plastics) you could then build a "Goods Factory".

WARNING !!! Make a copy of the original file before editing it
 
I can build Goods Factories just fine. Its the AI that won't build them. How do I alter the code to correct that?
____________
"The Weak Shall Perish"
 
OK ... Try removing "Goods factory" (BUILDINGCLASS_WW2_BUILD24) from the list of Pre-requistes, in the building file mentioned above, by replacing it with NONE. The means the AI could be able to build the other buildings unrestricted, as well as the player.

see http://modiki.civfanatics.com/index.php/Civ4BuildingInfos for a detailed description.

The code will look like this

Code:
			<BuildingClassNeededs>
				<BuildingClassNeeded>
					<BuildingClassType>BUILDINGCLASS_WW2_BUILD24</BuildingClassType>
					<bNeededInCity>1</bNeededInCity>
				</BuildingClassNeeded>
			</BuildingClassNeededs>

to this
Code:
			<BuildingClassNeededs/>

When editting, do not forget to put the / after BuildingClassNeededs, otherwise the file will crash.

Also, I use Notepad++ for my editting of XML files.

NOTE: Once you start down this path of "modding" you don't stop :D
 
The last part of the Build24 section of the code differs from what you have:

<ObsoleteTech>NONE</ObsoleteTech>
<PrereqTech>NONE</PrereqTech>

The prereq is set to None already

The rest is identical to what you have.
 
You will you change it to
Code:
			<BuildingClassNeededs/>

Not how it is in the first code.
 
Change
<PrereqTech>NONE</PrereqTech>

To

<BuildingClassNeededs/>


And this is in the file CIV4BuildingInfos.xml for
<BuildingClass>BUILDINGCLASS_WW2_BUILD24</BuildingClass> in the RTW mod folder

Correct?

OR

Are you saying change
<PrereqTech>NONE</PrereqTech>

To

<BuildingClassNeededs>
<BuildingClassNeeded>
<BuildingClassType>BUILDINGCLASS_WW2_BUILD24</BuildingClassType>
<bNeededInCity>1</bNeededInCity>
</BuildingClassNeeded>
<BuildingClassNeededs/>


(I know the indents for syntax are wrong but is that the code?)

And, just out of curiosity, if there are currently no prerequisites on the Goods Factory why does the AI have a problem building it in RTW?
 
No do not do that !!! Ignore the PreReq section. You need to edit the <BuildingClassNeededs> section only.

Change the section that says


Code:
			<BuildingClassNeededs>
				<BuildingClassNeeded>
					<BuildingClassType>BUILDINGCLASS_WW2_BUILD24</BuildingClassType>
					<bNeededInCity>1</bNeededInCity>
				</BuildingClassNeeded>
			</BuildingClassNeededs>

to this
Code:
			<BuildingClassNeededs/>

NOTE To use the Code parameter in forums, simply place (without the spaces between the brackets and letters) [ c o d e ] at the start and [ / c o d e ] at the end of the section of text you want to format.
 
There are 2 exact occurences of the code you reference in the file "CIV4BuildingInfos.xml" {path "Buildings(C:\Program Files (x86)\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\The Road to War\Assets\XML)"} file (one near the top and one near the bottom of whats below):

Do I change both the way you describe or just one. And if only one then which one?

Code:
 <BuildingClassNeededs>
				<BuildingClassNeeded>
					<BuildingClassType>BUILDINGCLASS_WW2_BUILD24</BuildingClassType>
					<bNeededInCity>1</bNeededInCity>
				</BuildingClassNeeded>
			</BuildingClassNeededs>
			<SpecialistYieldChanges/>
			<BonusYieldModifiers/>
			<ImprovementFreeSpecialists/>
			<Flavors>
				<Flavor>
					<FlavorType>FLAVOR_PRODUCTION</FlavorType>
					<iFlavor>10</iFlavor>
				</Flavor>
			</Flavors>
			<HotKey/>
			<bAltDown>0</bAltDown>
			<bShiftDown>0</bShiftDown>
			<bCtrlDown>0</bCtrlDown>
			<iHotKeyPriority>0</iHotKeyPriority>
			<iDCMAirbombMission>3</iDCMAirbombMission>
		</BuildingInfo>
		<BuildingInfo>
			<BuildingClass>BUILDINGCLASS_WW2_BUILD23</BuildingClass>
			<Type>BUILDING_WW2_BUILD23</Type>
			<SpecialBuildingType>NONE</SpecialBuildingType>
			<Description>TXT_KEY_BUILDING_WW2_BUILD23</Description>
			<Civilopedia>TXT_KEY_BUILDING_WW2_BUILD23_PEDIA</Civilopedia>
			<Strategy>TXT_KEY_BUILDING_WW2_BUILD23_STRATEGY</Strategy>
			<Advisor>ADVISOR_ECONOMY</Advisor>
			<ArtDefineTag>ART_DEF_BUILDING_DRYDOCK</ArtDefineTag>
			<MovieDefineTag>NONE</MovieDefineTag>
			<HolyCity>NONE</HolyCity>
			<ReligionType>NONE</ReligionType>
			<StateReligion>NONE</StateReligion>
			<bStateReligion>0</bStateReligion>
			<PrereqReligion>NONE</PrereqReligion>
			<PrereqCorporation>NONE</PrereqCorporation>
			<FoundsCorporation>NONE</FoundsCorporation>
			<GlobalReligionCommerce>NONE</GlobalReligionCommerce>
			<GlobalCorporationCommerce>NONE</GlobalCorporationCommerce>
			<VictoryPrereq>NONE</VictoryPrereq>
			<FreeStartEra>NONE</FreeStartEra>
			<MaxStartEra>NONE</MaxStartEra>
			<ObsoleteTech>NONE</ObsoleteTech>
			<PrereqTech>NONE</PrereqTech>
			<TechTypes/>
			<Bonus>NONE</Bonus>
			<PrereqBonuses>
				<BonusType>BONUS_IRON</BonusType>
			</PrereqBonuses>
			<ProductionTraits>
				<ProductionTrait>
					<ProductionTraitType>TRAIT_ORGANIZED</ProductionTraitType>
					<iProductionTrait>100</iProductionTrait>
				</ProductionTrait>
			</ProductionTraits>
			<HappinessTraits/>
			<NoBonus>NONE</NoBonus>
			<PowerBonus>NONE</PowerBonus>
			<FreeBonus>NONE</FreeBonus>
			<iNumFreeBonuses>0</iNumFreeBonuses>
			<FreeBuilding>NONE</FreeBuilding>
			<FreePromotion>NONE</FreePromotion>
			<CivicOption>NONE</CivicOption>
			<GreatPeopleUnitClass>NONE</GreatPeopleUnitClass>
			<iGreatPeopleRateChange>0</iGreatPeopleRateChange>
			<iHurryAngerModifier>0</iHurryAngerModifier>
			<bBorderObstacle>0</bBorderObstacle>
			<bTeamShare>0</bTeamShare>
			<bWater>1</bWater>
			<bRiver>0</bRiver>
			<bPower>0</bPower>
			<bDirtyPower>0</bDirtyPower>
			<bAreaCleanPower>0</bAreaCleanPower>
			<DiploVoteType>NONE</DiploVoteType>
			<bForceTeamVoteEligible>0</bForceTeamVoteEligible>
			<bCapital>0</bCapital>
			<bGovernmentCenter>0</bGovernmentCenter>
			<bGoldenAge>0</bGoldenAge>
			<bAllowsNukes>0</bAllowsNukes>
			<bMapCentering>0</bMapCentering>
			<bNoUnhappiness>0</bNoUnhappiness>
			<bNoUnhealthyPopulation>0</bNoUnhealthyPopulation>
			<bBuildingOnlyHealthy>0</bBuildingOnlyHealthy>
			<bNeverCapture>0</bNeverCapture>
			<bNukeImmune>0</bNukeImmune>
			<bPrereqReligion>0</bPrereqReligion>
			<bCenterInCity>0</bCenterInCity>
			<iAIWeight>0</iAIWeight>
			<iCost>75</iCost>
			<iHurryCostModifier>0</iHurryCostModifier>
			<iAdvancedStartCost>-1</iAdvancedStartCost>
			<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
			<iMinAreaSize>-1</iMinAreaSize>
			<iConquestProb>66</iConquestProb>
			<iCitiesPrereq>0</iCitiesPrereq>
			<iTeamsPrereq>0</iTeamsPrereq>
			<iLevelPrereq>0</iLevelPrereq>
			<iMinLatitude>0</iMinLatitude>
			<iMaxLatitude>90</iMaxLatitude>
			<iGreatPeopleRateModifier>0</iGreatPeopleRateModifier>
			<iGreatGeneralRateModifier>0</iGreatGeneralRateModifier>
			<iDomesticGreatGeneralRateModifier>0</iDomesticGreatGeneralRateModifier>
			<iGlobalGreatPeopleRateModifier>0</iGlobalGreatPeopleRateModifier>
			<iAnarchyModifier>0</iAnarchyModifier>
			<iGoldenAgeModifier>0</iGoldenAgeModifier>
			<iGlobalHurryModifier>0</iGlobalHurryModifier>
			<iExperience>0</iExperience>
			<iGlobalExperience>0</iGlobalExperience>
			<iFoodKept>0</iFoodKept>
			<iAirlift>0</iAirlift>
			<iAirModifier>0</iAirModifier>
			<iAirUnitCapacity>0</iAirUnitCapacity>
			<iNukeModifier>0</iNukeModifier>
			<iNukeExplosionRand>0</iNukeExplosionRand>
			<iFreeSpecialist>0</iFreeSpecialist>
			<iAreaFreeSpecialist>0</iAreaFreeSpecialist>
			<iGlobalFreeSpecialist>0</iGlobalFreeSpecialist>
			<iMaintenanceModifier>0</iMaintenanceModifier>
			<iWarWearinessModifier>0</iWarWearinessModifier>
			<iGlobalWarWearinessModifier>0</iGlobalWarWearinessModifier>
			<iEnemyWarWearinessModifier>0</iEnemyWarWearinessModifier>
			<iHealRateChange>0</iHealRateChange>
			<iHealth>-1</iHealth>
			<iAreaHealth>0</iAreaHealth>
			<iGlobalHealth>0</iGlobalHealth>
			<iHappiness>0</iHappiness>
			<iAreaHappiness>0</iAreaHappiness>
			<iGlobalHappiness>0</iGlobalHappiness>
			<iStateReligionHappiness>0</iStateReligionHappiness>
			<iWorkerSpeedModifier>0</iWorkerSpeedModifier>
			<iMilitaryProductionModifier>0</iMilitaryProductionModifier>
			<iSpaceProductionModifier>0</iSpaceProductionModifier>
			<iGlobalSpaceProductionModifier>0</iGlobalSpaceProductionModifier>
			<iTradeRoutes>0</iTradeRoutes>
			<iCoastalTradeRoutes>0</iCoastalTradeRoutes>
			<iGlobalTradeRoutes>0</iGlobalTradeRoutes>
			<iTradeRouteModifier>0</iTradeRouteModifier>
			<iForeignTradeRouteModifier>0</iForeignTradeRouteModifier>
			<iGlobalPopulationChange>0</iGlobalPopulationChange>
			<iFreeTechs>0</iFreeTechs>
			<iDefense>0</iDefense>
			<iBombardDefense>0</iBombardDefense>
			<iAllCityDefense>0</iAllCityDefense>
			<iEspionageDefense>0</iEspionageDefense>
			<iAsset>12</iAsset>
			<iPower>4</iPower>
			<fVisibilityPriority>1.0</fVisibilityPriority>
			<SeaPlotYieldChanges/>
			<RiverPlotYieldChanges/>
			<GlobalSeaPlotYieldChanges/>
			<YieldChanges/>
			<YieldModifiers/>
			<PowerYieldModifiers/>
			<CommerceChanges/>
			<ObsoleteSafeCommerceChanges/>
			<CommerceChangeDoubleTimes/>
			<CommerceModifiers/>
			<GlobalCommerceModifiers/>
			<SpecialistExtraCommerces/>
			<StateReligionCommerces/>
			<CommerceHappinesses/>
			<ReligionChanges/>
			<SpecialistCounts>
				<SpecialistCount>
					<SpecialistType>SPECIALIST_ENGINEER</SpecialistType>
					<iSpecialistCount>2</iSpecialistCount>
				</SpecialistCount>
			</SpecialistCounts>
			<FreeSpecialistCounts/>
			<CommerceFlexibles/>
			<CommerceChangeOriginalOwners/>
			<ConstructSound>AS2D_BUILD_FACTORY</ConstructSound>
			<BonusHealthChanges/>
			<BonusHappinessChanges/>
			<BonusProductionModifiers/>
			<UnitCombatFreeExperiences/>
			<DomainFreeExperiences/>
			<DomainProductionModifiers/>
			<BuildingHappinessChanges/>
			<PrereqBuildingClasses/>
			<BuildingClassNeededs>
				<BuildingClassNeeded>
					<BuildingClassType>BUILDINGCLASS_WW2_BUILD24</BuildingClassType>
					<bNeededInCity>1</bNeededInCity>
				</BuildingClassNeeded>
			</BuildingClassNeededs>
			<SpecialistYieldChanges/>
			<BonusYieldModifiers/>
			<ImprovementFreeSpecialists/>
 
Try to look at each indent as a block of unique information.

In the BuildingInfos file you have now found each building is bounded by

Code:
<BuildingInfo>
...
</BuildingInfo>
Which defines what is required to make each building different work. In this case we are looking what building is required to allow the player or the AI to build it.

You need to look in each occurrence of these major blocks bounded by the "BuildingInfo" tags (that is the technical name, I believe) for the sequence I highlighted and change the section as I did before.

In the example you have shown you have part of Building 22 "Vehicle Factory" possibly?? and Building 23 "The Drydock". There may also be one for the "Aircraft Factory"

Hope that helps ?
 
I did just as you said. This is the error message I get when I tried to load RTW

.\FXml.cpp:133
Error Parsing Yield Changes XML file
File: XML\Buildings/Civ4Buildinginfos.xml
Reason: Element Content is invalid according to DTD/Schema

Expecting: {x-SchemaCiv4BuildingsSchema.xml} Specialist
Line 6035,27
<BuildingClassNeeded/>
 
Attach your file and I will look at it where you went wrong.

You may have the syntax wrong. You can not delete any elements. Each element is bounded by either
Code:
<ABC> 
...
</ABC>
or simply
Code:
<ABC/>

Please check.
 
There are six lines in your example of what to change. Which line do I change the way you indicate? Give me that and I'll change each occurence in that file.

I was deleting lines 2-6 and replacing the first line with your correction. So I was doing that wrong.

If it doesn't work I'll post the code I revised and you can tell me where the syntax went wrong.

Thanks. I really appreciate your help.
 
I see what you did.

If you see in my example I said to replace the 6 lines with just 1, i.e. replace lines 1-6 with 1, not 2-6.

Note: the replacement line is different to all the others. i.e. the " / " is in a different place.
 
:worship:It worked -outstanding!!!! :goodjob::worship:Thank you. You have restored my game to me.

I have one final question unless I've worn out my welcome:

I've started a new game in RTW. I thought it might be more realistic for the 3 factories to have Oil and not just Iron as a prerequisite. Goods factories still have Oil as a prereq. What would the code be for that? Or perhaps you could tell me which file to find it in.

If you reply I thank you in advance. If not -then I'm grateful for the help you have already given me.

And btw, I can see why modding is such a rewarding thing to learn. With your help I changed this great game to make it better. It felt great to finally see a rival with an IL-2 flying around their city. Soon I'll be invaded by sea and I couldn't be happier about it (LOL:lol:).

I think I'll try your Mod too. I read the thread about it and it sounds great. I think you just posted v.40. The whole idea of being able to use larger, organized formations like divisions, corps, armies and army groups with historically accurate commanding generals is really cool. I manually organize my army and navy like that with each unit representing a regiment, into infantry, panzer and SS divisions. Giving unique unit names (even if they are only regimental numbers and division numbers) gives the game new depth.

You've taken it to a whole other level. I'm going to try it.

Have a good one.

_____________________
"The Weak Shall Perish"
 
RE: Factories. Try to see the Iron as raw material to produce the vehicles and the requirement for oil is in the producing/maintaining the units.

You really should try my mod. 600+ people have already downloaded 0.3x, and it is a year in the making. I have significantly changed factories and units and what they require. e.g. basic units require Iron, later units require copper and even later require aluminium.

I am working on 0.4x (which will refine the Air and Sea Power) at the moment, albeit slowly because as a player I want to test it out thoroughly as well. And that includes removing some of the bugs out of 0.3x, like tech development. I am using Graphics produced by other Civfanatics to make it better.

NOTE: If you want to play my mod, you can not use Ultimate edition, it is not compatible.
 
Top Bottom