Adding a trait?

billia

Chieftain
Joined
Feb 16, 2013
Messages
28
Soooo, I made a new civilization and everything is working great with it. The mod adds Ukraine as a playable civ for Vanilla Civ V. Since Ukraine is a huge supplier of food for the world, I wanted to add a trait that would reflect this. Is there a way that I could change the yield from this civs farms? Like as a trait...? (I'm using modbuddy and XML)

I always struggle with adding new traits. Any help is appreciated! :)
 
Sorry for the double post, but I managed to scrounge this up by looking through the Schema. Is this going to do what I am trying to accomplish?

Code:
<GameData>
	<Traits>
		<Row>
			<Type>TRAIT_WORLD_BREADBASKET</Type>
			<Description>TXT_KEY_TRAIT_WORLD_BREADBASKET</Description>
			<ShortDescription>TXT_KEY_TRAIT_WORLD_BREADBASKET_SHORT</ShortDescription>
			<ImprovementType>FARM</ImprovementType>
			<YieldType>FOOD</YieldType>
			<Yield>3</Yield>
		</Row>
	</Traits>
</GameData>
 
<GameData>
<Traits>
<Row>
<Type>TRAIT_WORLD_BREADBASKET</Type>
<Description>TXT_KEY_TRAIT_WORLD_BREADBASKET</Description>
<ShortDescription>TXT_KEY_TRAIT_WORLD_BREADBASKET_SHORT</ShortDescription>
</Row>
</Traits>
<Trait_ImprovementYieldChanges>
<Row>
<TraitType>TRAIT_WORLD_BREADBASKET</TraitType>
<ImprovementType>IMPROVEMENT_FARM</ImprovementType>
<YieldType>YIELD_FOOD</YieldType>
<Yield>3</Yield>
</Row>
</Trait_ImprovementYieldChanges>
</GameData>
 
Not sure, haven't tested it, but if I were to guess the code would probably go something more like this:
Code:
<GameData>
	<Traits>
		<Row>
			<Type>TRAIT_WORLD_BREADBASKET</Type>
			<Description>TXT_KEY_TRAIT_WORLD_BREADBASKET</Description>
			<ShortDescription>TXT_KEY_TRAIT_WORLD_BREADBASKET_SHORT</ShortDescription>
		</Row>
	</Traits>-<Traits_Improvement_Yields>
		<Row>
			<TraitType>TRAIT_WORLD_BREADBASKET</TraitType>
			<ImprovementType>IMPROVEMENT_FARM</ImprovementType>
			<YieldType>YIELD_FOOD</YieldType>
			<Yield>3</Yield>
		</Row>
	</Traits_Improvement_Yields>
</Gamedata>
What I know for sure is that you can't just say any of these:
Code:
<ImprovementType>FARM</ImprovementType>
<YieldType>FOOD</YieldType>
<Yield>3</Yield>
They would have to be:
Code:
<ImprovementType>[B][COLOR="Blue"]IMPROVEMENT_[/COLOR][/B]FARM</ImprovementType>
<YieldType>[B][COLOR="blue"]YIELD_[/COLOR][/B]FOOD</YieldType>
<Yield>3</Yield>
 
Well, I ended up having in the xml as this:
Code:
<GameData>
	<Traits>
		<Row>
			<Type>TRAIT_WORLD_BREADBASKET</Type>
			<Description>TXT_KEY_TRAIT_WORLD_BREADBASKET</Description>
			<ShortDescription>TXT_KEY_TRAIT_WORLD_BREADBASKET_SHORT</ShortDescription>
		</Row>
	</Traits>
         <Trait_Improvement_Yields>
		<Row>
			<TraitType>TRAIT_WORLD_BREADBASKET</TraitType>
			<ImprovementType>IMPROVEMENT_FARM</ImprovementType>
			<YieldType>YIELD_FOOD</YieldType>
			<Yield>3</Yield>
		</Row>
	</Trait_Improvement_Yields>
</Gamedata>

However, when I tried testing it the game, the farms were still only yielding what they would without the intended effect. IS it something I've misspelled? Or is it something much more complicated that I'm missing.
 
Yeah... It shows up in game and everything, it just doesn't take effect, lol.

EDIT: I've discovered the issue. I wasn't capitalizing something correctly. It seems to be working now.

Here's the final coding:

Code:
<GameData>
	<Traits>
		<Row>
			<Type>TRAIT_WORLD_BREADBASKET</Type>
			<Description>TXT_KEY_TRAIT_WORLD_BREADBASKET</Description>
			<ShortDescription>TXT_KEY_TRAIT_WORLD_BREADBASKET_SHORT</ShortDescription>
		</Row>
	</Traits>
	<Trait_ImprovementYieldChanges>
		<Row>
			<TraitType>TRAIT_WORLD_BREADBASKET</TraitType>
			<ImprovementType>IMPROVEMENT_FARM</ImprovementType>
			<YieldType>YIELD_FOOD</YieldType>
			<YIELD>3</YIELD>
		</Row>
	</Trait_ImprovementYieldChanges>
</GameData>
 
Back
Top Bottom