My Trait isn't working (Check my code?)

varus

Prince
Joined
Nov 3, 2005
Messages
130
I have a perfectly good working Civ right now, but when I try to create my own trait the whole civ won't load.

I can change the leader trait from any of the default traits to the next, but something is fail about trying to make my own. This is true even when I simply try to duplicate a trait that does exist.

Here's my Traits.xml code:

Code:
<GameData>
	<Traits>
		<Row>
			<Type>TRAIT_TRAIT_POWER_WISDOM_COURAGE</Type>
			<Description>TXT_KEY_TRAIT_PWC</Description>
			<ShortDescription>TXT_KEY_TRAIT_PWC_SHORT</ShortDescription>
		</Row>
		<Row>
			<Type>TRAIT_TRAIT_POWER_WISDOM_COURAGE</Type>
			<GreatGeneralRateModifier>100</GreatGeneralRateModifier>
			<GreatGeneralExtraBonus>20</GreatGeneralExtraBonus>
		</Row>
	</Traits>  
</GameData>

And my Leader code:
Code:
	<Leader_Traits>
		<Row>
			<LeaderType>LEADER_HYRULE_KING</LeaderType>
			<TraitType>TRAIT_TRAIT_POWER_WISDOM_COURAGE</TraitType>
		</Row>
	</Leader_Traits>

Notice that I'm only trying to copy the Art of War trait. My goal at this point is to get it working, then I will modify the values later.

Thanks anyone!
 
Why do you split the code at the top?

Code:
<Traits>
		<Row>
			<Type>TRAIT_TRAIT_POWER_WISDOM_COURAGE</Type>
			<Description>TXT_KEY_TRAIT_PWC</Description>
			<ShortDescription>TXT_KEY_TRAIT_PWC_SHORT</ShortDescription>
			<GreatGeneralRateModifier>100</GreatGeneralRateModifier>
			<GreatGeneralExtraBonus>20</GreatGeneralExtraBonus>
		</Row>
	</Traits>

That should work fine, I hope. If not, there's something else wrong.
 
Why do you split the code at the top?

Code:
<Traits>
		<Row>
			<Type>TRAIT_TRAIT_POWER_WISDOM_COURAGE</Type>
			<Description>TXT_KEY_TRAIT_PWC</Description>
			<ShortDescription>TXT_KEY_TRAIT_PWC_SHORT</ShortDescription>
			<GreatGeneralRateModifier>100</GreatGeneralRateModifier>
			<GreatGeneralExtraBonus>20</GreatGeneralExtraBonus>
		</Row>
	</Traits>

That should work fine, I hope. If not, there's something else wrong.



Indeed, there is something else wrong. My first attempt was just like yours, I decided to split the code when it didn't work the first time.

Curiously, I found that I can make a "blank" trait if I limit elements to just the two text descriptions and no actual characteristics. This works, the trait has descriptions but no effect.

Something is wrong with the way I am adding the characteristics. I'll tinker with it more when I get home tonight.
 
Another thing you could do is just give...uh...Hyrule the Art of War trait. Makes it easier and not much really required!
 
I think you forgot to add this to texts:
Code:
<GameData>
	<Language_en_US>
		<Row Tag="TXT_KEY_TRAIT_NOMAD_POWER">
			<Text>Mounted units are better at sieging cities and ignore terrain movement cost.</Text>
		</Row>
		<Row Tag="TXT_KEY_TRAIT_NOMAD_POWER_SHORT">
			<Text>Nomad Power</Text>
		</Row>
	</Language_en_US>
</GameData>
It is just example from my modification
 
If texts weren't there, they wouldn't cause the civ to not load. It would just say..."TXT_KEY_..." but still work.

Is this file part of a larger one? If so, split them up into different XMLs. This will help isolate the problem. (if one part of the document doesn't work and causes it to fail, nothing else will load)
 
Code:
<GameData>
	<Traits>
		<Row>
			<Type>TRAIT_TRIFORCE</Type>
			<Description>TXT_KEY_TRAIT_TRIFORCE</Description>
			<ShortDescription>TXT_KEY_TRAIT_TRIFORCE_SHORT</ShortDescription>
			<GreatGeneralExtraBonus>10</GreatGeneralExtraBonus>
			<CityStateFriendshipModifier>25</CityStateFriendshipModifier>
			<GreatScientistRateModifier>15</GreatScientistRateModifier>
		</Row>
	</Traits>
</GameData>

That worked. Thanks guy!
 
Back
Top Bottom