Yield Changes

Ghostcom

Chieftain
Joined
Jan 11, 2011
Messages
4
Hi Civvies!
Can you help please.

I have some XML experience, but my first attempt at modding the Techs has failed.

I have noticed that mines have the same production yield from the stone age to the modern time and I felt it needed a tweak, with a +1 Production yield once you research Steel, to simulate the industrialised mining equipment/boring machines etc.

I have found the relevant section of code - blast left my USB at home
anyways it starts <TechYieldIMprovements> or some such.

I copied the Tech Yield improvements for Biology and pasted it into the appropriate section for Mines, and changed the TECH name to TECH_STEEL, with a +1 production instead of food.

When I loaded Civ 4 (no patches as I run Windows 7) it crashed on parsing the XML's complaining it was expecting a TechRouteYield improvement instead?

I've double checked my modding and it seems to be correct at first glance.

What am I missing?
Can anyone help?

Cheers
 
The order inside the XML is important. Make sure the tags you placed are in the same order as in other tags.
And try posting the relevant section of the XML.
 
it should look something like this :

Spoiler :
Code:
			<ImprovementUpgrade/>
			<TechYieldChanges>
				<TechYieldChange>
					<PrereqTech>TECH_STEEL</PrereqTech>
					<TechYields>
						<iYield>0</iYield>
						<iYield>1</iYield>
						<iYield>0</iYield>
					</TechYields>
				</TechYieldChange>
			</TechYieldChanges>
			<RouteYieldChanges>
				<RouteYieldChange>
					<RouteType>ROUTE_RAILROAD</RouteType>
					<RouteYields>
						<iYield>0</iYield>
						<iYield>1</iYield>
						<iYield>0</iYield>
					</RouteYields>
				</RouteYieldChange>
			</RouteYieldChanges>
 
Yup
That's exactly what I did only the system bombed out when I ran the game.

When it started to parse the XML's it came up with an error along the lines of

CIVImprovementsinfo was expecting a RouteYield change

I'll try again and take a copy of the before and after section of the XML.

I have just spotted one thing that might be the cause...

Techs with no yield improvements have the code line

Code:
			<TechYieldChanges/>
With the hyphen at the end

whereas this gets replaced with

Code:
			<TechYieldChanges>
				<TechYieldChange>
					<PrereqTech>TECH_BIOLOGY</PrereqTech>
					<TechYields>
						<iYield>1</iYield>
						<iYield>0</iYield>
						<iYield>0</iYield>
					</TechYields>
				</TechYieldChange>
			</TechYieldChanges>

I note the lack of forward slash at the end of the first line - so I'll double check that one and see if i can't get it right.

You really have to have 20/20 vision when modding.....
 
Code:
<TechYieldChanges/>
means that the tag is empty. It's perfectly valid. When there's data in it you don't need the ending slash.
It is the equivalent of:
Code:
<TechYieldChanges>
</TechYieldChanges>
 
You can install the patch on Win7, I did. And almost all mods these days require the patch.
 
Back
Top Bottom