Can Canyons Be Modded To Produce Yields?

Matress_of_evil

Chieftain
Joined
Nov 15, 2005
Messages
90
Location
South Wales
Hi, I'd like Canyons to produce some yield (eg. 1 Science), so they aren't just "dead space" around my cities. I've searched the Steam Workshop and the Downloads here, but there's no mention of a mod that does this (and I can't find any hint that anyone has asked this on the forums before via the search either). So i'm trying to make one myself instead. I'm not having any luck though. I've tried writing several different iterations of xml code, but nothing seems to work. Anyone have any ideas? I'm starting to wonder if this is something that has been hard-coded.

My current code:
Spoiler :
This one doesn't throw up any errors in Database.log - but Canyons still don't produce any yields.
Code:
	<Resource_YieldChanges>
			<Update>
				<Set Yield="1"/>
				<Where TerrainType="TERRAIN_CANYON> YieldType="YIELD_SCIENCE"/>
			</Update>
	</Resource_YieldChanges>
And others that i've tried:
Spoiler :
This one results in an error in Database.log
Spoiler :
[118126.281] table Resource_YieldChanges has no column named TerrainType
[118126.281] In Query - insert into Resource_YieldChanges('TerrainType', 'YieldType', 'Yield') values (?, ?, ?);
[118126.281] In XMLSerializer while updating table Resource_YieldChanges from file XML/CivBETerrains_Updates.xml.
Code:
	<Resource_YieldChanges>
		<Row>
			<TerrainType>TERRAIN_CANYON</TerrainType>
			<YieldType>YIELD_SCIENCE</YieldType>
			<Yield>1</Yield>
		</Row>
	</Resource_YieldChanges>
Spoiler :
And another Database.log error.
Spoiler :
[118681.645] Database::XMLSerializer (XML/CivBETerrains_Updates.xml): <Update> element requires a child <Set> element.
<Resource_YieldChanges>
Code:
	<Resource_YieldChanges>
		<Update>
		<Row>
			<TerrainType>TERRAIN_CANYON</TerrainType>
			<YieldType>YIELD_SCIENCE</YieldType>
			<Yield>1</Yield>
		</Row>
		</Update>
	</Resource_YieldChanges>
 
1 and 3 have incorrect syntax:
#1. You have a > in place of a "
#3. It's either <Update> or <Row> (i.e., insert a new row), not both.

#1 would only work if that yield was already there, and you were changing its value to 1.

Either way, you're operating on the wrong table.
You want:
Code:
    <Terrain_Yields>
        <Row>
            <TerrainType>TERRAIN_CANYON</TerrainType>
            <YieldType>YIELD_SCIENCE</YieldType>
            <Yield>1</Yield>
        </Row>
    </Terrain_Yields>
 
Thanks for that. I don't know how to write .xml code, I just copy-and-paste from existing files and bodge around until something works lol.

...Unfortunately, your code doesn't work either. I get no errors messages in Database.log, but the Canyons still don't produce anything. Any other ideas?
 
Canyon is a plot type not a terrain type.

PlotTypes.PLOT_CANYON

There should be a plot types XML table, no?

Alternatively, this is simple enough in Lua though you'll need to find a reliable point to hook into at the start of the game and that (preferably) only runs once.
 
No, there is no <Plots> table (it is missing from CivV as well) and subsequently there are no "plot yields" tables either.

Assuming the C++ yield code is similar to CivV you'll need to create a new Feature, place it on every canyon, and then add yields to the new feature. There is a CivV civilization (Tibet?) that does something very similar to generate yields from mountains
 
Thanks guys, but I have no idea how to create/mod .lua files. I guess this is something i'll have to give up on. Hopefully i've seeded the idea for someone else to make it though lol.
 
No, there is no <Plots> table (it is missing from CivV as well) and subsequently there are no "plot yields" tables either.

Assuming the C++ yield code is similar to CivV you'll need to create a new Feature, place it on every canyon, and then add yields to the new feature. There is a CivV civilization (Tibet?) that does something very similar to generate yields from mountains

Why go through all the trouble of making a feature? If you're already implementing Lua to find the canyon plots why wouldn't you just use Game.SetPlotExtraYield().

I'll see if I can put together a simple resource that allows altering plot yields over the weekend.
 
Why go through all the trouble of making a feature?

The original CivV mod only added yields to mountains owned by cities of a specific civ.

If it's a blanket "add to every canyon", either method will work just as well.
 
Back
Top Bottom