First mod, attached!

Vexing_Shusher

Chieftain
Joined
Mar 12, 2015
Messages
3
Hi guys! First time modder here. I'm banging my head against a wall because I can't figure out why my mod doesn't impact the game. With this one I'm trying a different approach then I normally use, I decided to just replace Alexanders Leader Trait with the one I want my new leader to use rather than make a whole new leader, but it still doesn't work. Mod attached.

Yes, I performed the action "OnModActivated - Update Database - AlexToAjani.xml" which is the only xml file in the mod.

Thanks in advance! Also, to get in the habit, Credit goes out to Luv2Build, Kael, Whoward69, and the whole modding community for just being inspirational. You guys are the bee's knees. :cool:

Moderator Action: Welcome to CivFanatics. Have moved your question to the main forum as that is where questions belong. Best of luck.
 

Attachments

  • AlexToAjani (v 2).zip
    1.2 KB · Views: 21
Except, Oops, you placed your thread in the tutorials instead of the main Creation and Customization forum, where all help requests, general modding questions go. No biggie, I'll ping a moderator to move the thread

---------------------------------------------------------------------
[edit]

From the Database.log when error logging is enabled:
Code:
[59776.734] table Traits has no column named [COLOR="Red"]TraitType[/COLOR]
[59776.734] In Query - insert into Traits('TraitType', 'Description', 'ShortDescription', 'LevelExperienceModifier', 'GreatPeopleRateModifier', 'GreatGeneralRateModifier', 'AngerFreeIntrusionOfCityStates') values (?, ?, ?, ?, ?, ?, ?);
[59776.734] In XMLSerializer while updating table Traits from file AlexToAjani.xml.
Your Code:
Code:
	<Traits>
		<Row>
			<[COLOR="Red"]TraitType[/COLOR]>TRAIT_MENTOR_TO_HEROES</[COLOR="red"]TraitType[/COLOR]>
			<Description>TXT_KEY_TRAIT_MENTOR_TO_HEROES</Description>
			<ShortDescription>TXT_KEY_TRAIT_MENTOR_TO_HEROES_SHORT</ShortDescription>
			<LevelExperienceModifier>-25</LevelExperienceModifier>
			<GreatPeopleRateModifier>10</GreatPeopleRateModifier>
			<GreatGeneralRateModifier>10</GreatGeneralRateModifier>
			<AngerFreeIntrusionOfCityStates>1</AngerFreeIntrusionOfCityStates>
		</Row>
	</Traits>
<Traits> requires <Type>, as in this:
Code:
<Type>TRAIT_ART_OF_WAR</Type>
The error is causing the discard of the entire file.

However, this:
Code:
	<Leader_Traits>
		<Row>
			<LeaderType>LEADER_ALEXANDER</LeaderType>
			<TraitType>TRAIT_MENTOR_TO_HEROES</TraitType>
		</Row>
	</Leader_Traits>
will merely add another Trait to Alexander, and will not replace his usual trait, so the civilization selection screen and the DOM screen will still show the "Hellenic League" text.

You would want the following to re-direct Alexander to use your new trait instead of his usual one:
Code:
	<Leader_Traits>
		<Update>
			<Where LeaderType="LEADER_ALEXANDER" />
			<Set TraitType="TRAIT_MENTOR_TO_HEROES" />
		</Update>
	</Leader_Traits>

[second edit]: ninja'd :)
 
I even read your tutorial on Common Modder Mistakes and still made one of the mistakes you warned about. My bad. Thanks for being cool about it and helping me out despite that.

Credit goes out to LeeS for having a homies back and making sure he posts in the right forum. :p
 
By using <Row> you're giving Alex TWO leader traits, not replacing the one he already has, so you'll need to use <Update>

Code:
<Leader_Traits>
  <Update>
    <Where LeaderType="LEADER_ALEXANDER"/>
    <Set TraitType="TRAIT_MENTOR_TO_HEROES"/>
  </Update>
</Leader_Traits>
(Note, not tested, but that should be what's needed)
 
*Forehead slap*

Thank you so much! I'll test that out and report back.

Edit: VICTORY IS MINE!!! It works! Thank you guys so much! I will now start making my own leader and it will be Double awesome.

THANK YOU!
 
Top Bottom