Update problems

PTM

Chieftain
Joined
Nov 9, 2005
Messages
93
Not sure why *none* this works:

Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by PTM on 9/29/2010 5:32:26 PM -->
<GameData>
	
	<!-- Farm: Requires flatlands. -->
	<Improvements>
		<Update>
			<Set FreshWaterMakesValid="false"/>
			<Set RequiresFlatlands="true"/>
			<Set RequiresFlatlandsOrFreshwater="false"/>
			<Where Type="IMPROVEMENT_FARM"/>	
		</Update>
	</Improvements>
	
	<!-- Farm: Tech-Fertilizer now grants riverside farms +1F. -->
	<Improvement_TechNoFreshWaterYieldChanges>
		<Delete ImprovementType="IMPROVEMENT_FARM"/>
	</Improvement_TechNoFreshWaterYieldChanges>
	<Improvement_TechYieldChanges>
		<Row>
			<ImprovementType>IMPROVEMENT_FARM</ImprovementType>
			<TechType>TECH_FERTILIZER</TechType>
			<YieldType>YIELD_FOOD</YieldType>
			<Yield>1</Yield>
		</Row>
	</Improvement_TechYieldChanges>
	<Language_en_US>
		<Update>
			<Set Text="Increases the [ICON_FOOD] Food from Farmed tiles, providing a massive boost to growth."/>
			<Where Tag="TXT_KEY_TECH_FERTILIZER_DESC"/>
		</Update>
	</Language_en_US>
	
	<!-- Mine: Tech-Steel now grants all mines +1H. -->
	<Improvement_TechYieldChanges>
		<Row>
			<ImprovementType>IMPROVEMENT_MINE</ImprovementType>
			<TechType>TECH_STEEL</TechType>
			<YieldType>YIELD_PRODUCTION</YieldType>
			<Yield>1</Yield>
		</Row>
	</Improvement_TechYieldChanges>
	
</GameData>

I have OnModActivated tags correctly entered, file is named Improvements.xml.

This works:

Code:
<GameData>
	
	<!-- Courthouse: Cost reduced to 100H from 200H. -->
	<Buildings>
		<Update>
			<Set Cost="100"/> 
			<Where Type="BUILDING_COURTHOUSE"/>
		</Update>
	</Buildings>
	
</GameData>

File is named Buildings.xml.
 
It's possibly because you may have intentionally or accidentally altered the original CIV5Improvements.xml file in your Civ5 install folder.

Try replacing it with my file, which is fresh from a fully updated install.
Keep in mind that if you have altered any other original files, you might have future problems with any mod trying to update them. I deleted my install and let Steam do it over again just to be sure, and now I'll never be opening them directly on Notepad++, will always be working from a copy even for just skimming the file.
 
Having modded several games in the past, including Civ4, I know not to touch the core files. To be sure, I replaced my CIV5Improvements.xml with the one you attached. Still doesn't work.
 
Hmm... I changed some code.

Original:
Code:
<Improvements>
		<Update>
			<Set FreshWaterMakesValid="false"/>
			<Set RequiresFlatlands="true"/>
			<Set RequiresFlatlandsOrFreshwater="false"/>
			<Where Type="IMPROVEMENT_FARM"/>	
		</Update>
	</Improvements>

New:
Code:
<Improvements>
		<Update>
			<Set RequiresFlatlands="true"/>
			<Where Type="IMPROVEMENT_FARM"/>	
		</Update>
	</Improvements>

This appears to have fixed things, so that all the changes in Improvements.xml are being properly applied. I will have to test to make sure gameplay is altered as I desire, but things look good now. Odd.
 
I read something in Kael's Modders Guide (see pg. 32) http://forums.civfanatics.com/showthread.php?t=385009 about how you need to update the database after you have updated your XML files. The XML files aren't actually game files, but they are used to update the sql database. You have to use the Actions tab in the mod buddy to update the database.
 
I read something in Kael's Modders Guide (see pg. 32) http://forums.civfanatics.com/showthread.php?t=385009 about how you need to update the database after you have updated your XML files. The XML files aren't actually game files, but they are used to update the sql database. You have to use the Actions tab in the mod buddy to update the database.

While you are correct, this is not the problem (which has been resolved). In the OP I noted that my OnModActivated (Database Updating) has been set up correctly.
 
While you are correct, this is not the problem (which has been resolved). In the OP I noted that my OnModActivated (Database Updating) has been set up correctly.

I didn't really see what have fixed your problem, was the fact that now there's only one Set on your update or any game logics conflict?
 
Hmm... I changed some code.

Original:
Code:
<Improvements>
		<Update>
			<Set FreshWaterMakesValid="false"/>
			<Set RequiresFlatlands="true"/>
			<Set RequiresFlatlandsOrFreshwater="false"/>
			<Where Type="IMPROVEMENT_FARM"/>	
		</Update>
	</Improvements>

New:
Code:
<Improvements>
		<Update>
			<Set RequiresFlatlands="true"/>
			<Where Type="IMPROVEMENT_FARM"/>	
		</Update>
	</Improvements>

This appears to have fixed things, so that all the changes in Improvements.xml are being properly applied. I will have to test to make sure gameplay is altered as I desire, but things look good now. Odd.

If you want original to work try:

Code:
<Improvements>
		<Update>
                        <Where Type="IMPROVEMENT_FARM"/>    
			<Set FreshWaterMakesValid="false" RequiresFlatlands="true" RequiresFlatlandsOrFreshwater="false"/>
		</Update>
	</Improvements>
 
If you want original to work try:

Code:
<Improvements>
		<Update>
                        <Where Type="IMPROVEMENT_FARM"/>    
			<Set FreshWaterMakesValid="false" RequiresFlatlands="true" RequiresFlatlandsOrFreshwater="false"/>
		</Update>
	</Improvements>

Kael's manual points out that works for the Where statement, but does it indeed work for Set as well? Is it tested?
 
By the way guys, you don't really need to use XML for these update statements. If you are familiar with actual SQL, you can create a text file with SQL statements and use that to change the database.
 
By the way guys, you don't really need to use XML for these update statements. If you are familiar with actual SQL, you can create a text file with SQL statements and use that to change the database.

I forget about this, I'll go for SQL then, less trial-and-error since SQL you can even test it on some sqlite admin before going ingame.

Is it tested?

He and vean said yes on his thread: http://forums.civfanatics.com/showthread.php?t=385817
 
Back
Top Bottom