[BNW] How to add traits to an existing civilization?

LordGolbez

Chieftain
Joined
Jul 11, 2018
Messages
5
Hello, this is my first time modding Civ 5 and have a basic understanding of ModBuddy and figured I would start with something I felt as basic and have read the guides for it but still having issues so figured I would come to the community.

Basically, I am trying to add all of the traits for other leaders to an existing Civilization, in this case it's India, and set up an XML file and added the traits but once I have it activated in game none of the traits work and need help understanding what I am doing incorrectly.
 
Final fantasy 4, nice =) anyway need to see what you wrote to see whats wrong. as a side note and recently new modder myself, i find SQL a lot easier to mod with than XML, easier to read and understand when just beginning.

also, you can check yourself what's wrong looking at the database log file, a nice tutorial about using it here - https://forums.civfanatics.com/threads/how-to-enable-logging.487482/

without that link, i'd have posted on this forum a million times trying to find out what i did wrong.
 
Yeah it's my favorite Final Fantasy. Thank you for the reply. I just started using SQL and it's helping to understand the tables and I went in and enabled the logging function. One question I have about using SQL is I am using Kael's Modding guide and says not to mod in SQL but to mod in XML instead.
 
This is a copy of the XML that I am working with. If any can help to further guide me in the correct direction I would greatly appreciate it.
 

Attachments

  • Traits.xml
    17.9 KB · Views: 173
I dunno why he said that, I find it a lot easier and forgiving. Uhmmm I dunno lol it kinda looks OK to me but i've barely done anything with xml. Definitely a problem tho cause when i copied your files to my working mod i got a bunch of errors in my database log starting with

Code:
[285762.000] Database::XMLSerializer (Code.xml): <Update> element requires a child <Set> element.


so some syntax issue going on there with the Update statements.

I can tell you in SQL its easy peasy and clean to see though, for example updating the plotbuycostmodifier would just be

Code:
UPDATE Traits
SET PlotBuyCostModifier = '-50'
WHERE Type = 'TRAIT_POPULATION_GROWTH';

or for the multiple entry tables like

Code:
INSERT INTO Trait_FreePromotionUnitCombats
   (TraitType, UnitCombatType, PromotionType)
VALUES
   ('TRAIT_LAND_TRADE_GOLD', 'UNITCOMBAT_MELEE', 'PROMOTION_ARABIAD'),
   ('TRAIT_LAND_TRADE_GOLD', 'UNITCOMBAT_ARCHER', 'PROMOTION_ARABIAD'),
   ('TRAIT_LAND_TRADE_GOLD', 'UNITCOMBAT_RECON', 'PROMOTION_ARABIAD');

Can literally copy paste those formats and just replace the relevant words for whatever youre editing
 
Last edited:
SQL will give you just as cryptic errors, without all the Firaxis examples of what to copy/paste.

The error in the XML is being caused by

Code:
<Update>
   <FreeUnit>UNITCLASS_SCIENTIST</FreeUnit>
   <FreeUnitPrereqTech>TECH_WRITING</FreeUnitPrereqTech>
</Update>
 
SQL will give you just as cryptic errors, without all the Firaxis examples of what to copy/paste.

The error in the XML is being caused by

Code:
<Update>
   <FreeUnit>UNITCLASS_SCIENTIST</FreeUnit>
   <FreeUnitPrereqTech>TECH_WRITING</FreeUnitPrereqTech>
</Update>

good catch! and it is an update statement without a Set so it was cryptic but still accurate lol. even when theyre cryptic still usually useful to let me know what the problem is, even if it doesnt help me find where the problem is.
 
Actually I didn't recognize it at first now I see it. It's really an awesome picture. Those are all good but 4 is top for me because it was my first and I end up looking though Rose tinted glasses so to speak.
 
Top Bottom