Trait that modifies terrain yield?

HowAreYou

Chieftain
Joined
Aug 20, 2012
Messages
14
So I'm making a mod. Kinda looked over the trait table and saw an unused attribute for terrain type, so decided to try it out. Turns out either it doesn't work, or I'm doing something wrong. What I'm trying to do is modify it so the leader with this trait increases the yield for mountain (which is currently nothing) to +1 faith and +1 food. Here's what I have right now. Help?

Spoiler :
Code:
<Table name="Trait_TerrainsYieldChange">
		<Column name="TraitType" type="text" reference="Traits(Type)"/>
		<Column name="TerrainType" type="text"/>
		<Column name="YieldType" type="text" reference="Yields(Type)"/>
		<Column name="Yield" type="integer"/>
	</Table>

	<Trait_TerrainsYieldChange>
		<Row>
			<TraitType>TRAIT_THIS_IS_THE_PLACE</TraitType>
			<TerrainType>TERRAIN_MOUNTAIN</TerrainType>
			<YieldType>YIELD_FAITH</YieldType>
			<Yield>1</Yield>
		</Row>
		<Row>
			<TraitType>TRAIT_THIS_IS_THE_PLACE</TraitType>
			<TerrainType>TERRAIN_MOUNTAIN</TerrainType>
			<YieldType>YIELD_FOOD</YieldType>
			<Yield>1</Yield>
		</Row>
	</Trait_TerrainsYieldChange>

edit: While we're here, the second part of this trait was going to enable the ability to purchase Settlers with faith. Any ideas for tackling that?
 
I'm pretty sure mountains are unworkable, because they are set to "impassable". You'd have to find a way to get around that before you could even work mountains.

Also, I've tried modifying TERRAIN_MOUNTAIN but it never has an effect in game. It's kind of frustrating.

Also II, you could try creating a dummy UU that is basically a settler but with a Faith Cost, and give it to your civ, although that may cause problems. You can also try making a dummy invisible unresearchable tech that unlocks Settlers that can be bought with faith, and then removing settlers from that specific civ, and giving that tech to your civ only.
 
I don't think "impassable" is the problem since the unique features are also impassible, but workable. However, there could be something hard-coded about mountains.

You need to break this problem down into three steps:
  1. Did my change actually get added to the game DB? (search SQLite Manager Mozilla on these forums)
  2. Does the Trait_TerrainsYieldChange work? (try it for some other terrain type)
  3. If yes for #2, does it work for mountains?

You could skip #1 but then you will never really know the answer to #2 if it is "no" (but you may find out if it is "yes").

Please let us know what you find -- I'd like to know.
 
Ice is also impassable, and has no yields because of that (there is nothing in the XML that would make it have different yields that the water tiles below it), so it seems everything that is impassable is also unworkable, except natural wonders.

Also, mountains are not a terrain. The "mountains terrain" is a fake thing, used only in the civilopedia, so I'm pretty sure you won't achieve any gameplay effects by referring to "TERRAIN_MOUNTAIN" (or "TERRAIN_HILL").
 
  1. Does the Trait_TerrainsYieldChange work? (try it for some other terrain type)
  2. If yes for #2, does it work for mountains?

I just changed it to plains, and no noticable change has been added. I'm wondering if there is a special thing you have to do to add new table items and stuff like that. I imagine I'm doing something horribly wrong.

I did notice that there's something along the lines of "Graphic Only" that would imply that Mountains are only there for decoration.

Code:
<GraphicalOnly>true</GraphicalOnly>
That's in the game's default code.
 
Other than things I wrote in my previous post, you can't just create a new table and assume it will have any effect in the game. There is no table called Trait_TerrainsYieldChange in the game, you can add it to the database but it will have no effect. In some cases you can program the effects of a new table (or a new column in an existing table) using Lua, but in this case it doesn't seem to be possible (but I'm not sure, there are better Lua experts than me, one of them even posted in this thread :)). In case of "normal" terrains you can achieve the effect of a trait changing the yields by giving the civ a free building, which changes yields from a specific terrain, but in case of mountains I can't think of any way to make it work.
 
That's a real shame. Kinda counting on that working. If anyone has a solution to this problem, I'd love to hear it.

Good news though, the Settler through Faith works. Thanks to Trystero for that.
 
Back
Top Bottom