Civ IV traits in Civ V

So I don't need VALUES either? And I won't get errors in the database.log like "No such table: Leader_SharedTraits" if I don't have this mod enabled?

Whoops, my mistake! You need values; I've fixed it in the above.

You might've posted before I finished editing my post, but you need to create the table within your mod in the event that the table doesn't already exist to avoid those errors. SQLite doesn't have any means to check if the table exists, then only if it does it adds to it.
 
A thousand and seven thanks, my good sir. I'll test this out in the next update for die Schweiz...
My brain isn't operating very normally right now :crazyeye:
 
Also, can I ask what this is supposed to mean?
...Seeing as you're not going to be depending on the mod...
I mean, as with Decisions compatibility, I'm only going to want the change (leaders receiving civ4 traits) to take place if the Civ4 Leader Traits mod is active.
Wouldn't using CREATE TABLE IF NOT EXISTS make so that the change always takes place, because if this mod isn't active, it'll just add the necessary data itself?
 
You'll be referencing this mod, not adding a dependency to it. But if this mod isn't active, you'll get a database error because the Leader_SharedTrait table wouldn't otherwise exist. It won't have any functionality without this mod active, but by creating the table regardless, it'll prevent the database error.
 
What about this part of my original coding?
Code:
	UPDATE Leaders SET
		Description='TXT_KEY_LEADER_WILHELM_CIV4_TRAITS'
	WHERE Type = 'LEADER_WILHELM';
Can I similarly update the leader's text to include the two relevant icons :)c5strength: and :c5trade:)? As in, it only changes with this mod active?
 
What is the trouble with the Creative trait?

Oh, it's an inconsistancy I noticed during a quick test. Napoleon had 'Creative', and the trait is set in the XML to reduce policy costs by 10% (<PolicyCostModifier>-10</PolicyCostModifier>).

Yet in the test I ran, his first policy only cost 20 Culture, instead of 25 Culture. Almost like it doubled to -20%, for some reason.
 
What about this part of my original coding?
Code:
	UPDATE Leaders SET
		Description='TXT_KEY_LEADER_WILHELM_CIV4_TRAITS'
	WHERE Type = 'LEADER_WILHELM';
Can I similarly update the leader's text to include the two relevant icons :)c5strength: and :c5trade:)? As in, it only changes with this mod active?

Ah, well, in that case, you probably want to preclude the "CREATE TABLE IF NOT EXISTS" command, and include the above in the same file as the rest of the code, so that the whole file fails to load. It's a messy workaround, but the only way to make it work that I can think of right now.

Oh, it's an inconsistancy I noticed during a quick test. Napoleon had 'Creative', and the trait is set in the XML to reduce policy costs by 10% (<PolicyCostModifier>-10</PolicyCostModifier>).

Yet in the test I ran, his first policy only cost 20 Culture, instead of 25 Culture. Almost like it doubled to -20%, for some reason.

Perhaps you absentmindedly changed the the game speed/difficulty/map size (I don't remember which affects policy cost)?
 
Oh, it's an inconsistancy I noticed during a quick test. Napoleon had 'Creative', and the trait is set in the XML to reduce policy costs by 10% (<PolicyCostModifier>-10</PolicyCostModifier>).

Yet in the test I ran, his first policy only cost 20 Culture, instead of 25 Culture. Almost like it doubled to -20%, for some reason.
I wonder is the smallest usable whole number increment 5 instead of 1 ? For policy costs, I mean. To be honest I've never paid much attention whether or not the cost for the next policy is ever a number like 27 instead of always either 25 or 30 in such a case.
 
I wonder is the smallest usable whole number increment 5 instead of 1 ? For policy costs, I mean. To be honest I've never paid much attention whether or not the cost for the next policy is ever a number like 27 instead of always either 25 or 30 in such a case.

Well, I figured it out (Somewhat). I had lazily copy/pasted <PolicyCostModifier> from the Piety finisher. The Vanilla Piety finisher. Although the Action still exists on the Policy table, it is no longer used in BNW Policies. Maybe they broke the code for it a few expansions back. Anyway, here's the result of 5 policies with <PolicyCostModifier> set at -10:
________1St_2ND_3RD_4TH_5TH
Normal___25__45__90__160_245
Modded__20__30__50___95_150

Something is seriously wrong with this picture.
 
I have updated a couple of the traits.

:c5citystate: Imperialistic Now gives +4 :c5happy: per Great general. I haven't written a line to remove the happiness when the generals are consumed yet. Also, Cities now spawn workers when built. I think I'll have to add a counter and make it every other city because that is way too many workers.

:c5trade: Mercantile now adds +10% :c5food: and :c5production: to any city connection with the Capitol. I left the +2 :c5gold: per connection as incentive to build longer roads. Gold cost reductions for purchasing is removed.

I'll tackle Seafaring next, but this is enough for one day.

For testing purposes, Mercantile was given to Morocco and Imperialistic was given to greece.
 
I have totally remade :c5moves:Seafaring and :c5influence:Diplomatic.

Seafaring now gives a free work boat for every lighthouse you build and a free cargo ship and trade route if you build a harbor in the capital. Also added a 20% Production bonus when building naval vessels. My theory is that a seafaring player will always build their capital on the coast, and additional coastal cities will be placed preferably near sea resources. This results in a net saving of production time (A hammer saved is a hammer earned) and earlier exploitation of resource yields. The bonus trade route further gives the player a choice of extra gold, production or food. Naval vessel 20% production bonus is meant to coincide with the Seaport +15% bonus, making Seafaring leaders get vessels in 2/3 the time instead of 4/5.

Diplomatic now gives bonus influence from trade routes and tribute possibility. Becoming allies with a city state gives the city state a permanent bonus of +15 defense and +25% Food, Production, Gold and Science. My theory is that boosted city states will be much more helpful when they declare war with you, since they will be better off technologically, build buildings and units faster and have more gold to buy soldiers. Another benefit is the Food boost improves their population much faster, which increases the gold value of trade routes with them and improves their city defense strength. This trait would be especially helpful for Austria and Venice, since they can make allies, watch them grow very nicely, then take over the cities.

Sidenote: I had planned for the city states to lose their boost when their alliance shifts to another civ without the Diplomatic trait, but every change I tried in the Lua script resulted in their bonus disappearing once the player's turn was over. However, I don't think a permanent bonus is such a bad thing, it will prevent starvation.

Some of the other Traits recieved some quick fixes, such as making the protective bonus in friendly lands actually work and removing the bugged policy cost reduction from Creative. Also 86ed the free workers from Imperialistic, it was fun to make but ultimately a game breaker.

Now it is time to do a second pass of the original traits and tweak them to be more interesting or balanced. I plan on setting some of them closer to their original Civ IV versions (Aggressive gets free promotions instead of reduced XP cost, Charismatic receives reduced XP costs and bonus Happiness instead of reduced Unhappiness, etc.)

Any suggestions are welcome.
 
After this morning's update
Spoiler :

*Aggressive and Charismatic were redone to be closer to Civ IV
* Creative got a culture and tourism bonus for great works
*Inventive got a specialist science bonus
*Philosophical was returned to 100% GP generation
*Spiritual recieved a Faith bonus per city population
* All Traits now double production speed on 2 buildings or 1 building and +20% for units
I ran a firetuner test to see how the AI handles things. The results were very surprising.

Based on score, Carthage is the winner. Dido :c5moves::c5citystate: is 100 points in the lead thanks to her successful conquest of every German city except Berlin, and she took Memphis from Ramsses II. She is also #1 in wonders (8 in Carthage alone, not counting National Wonders!) and has spawned 5 Great Generals. This surprises me because this trait combination looked like the weakest. She only has 2 coastal cities so her grand total benefits have been 2 free workboats, 1 free cargo ship and trade route, and 2 extra great generals. She has built the same number of cities as every other civ, so the settler bonus went unused.

Second place made more sense: Maria I :c5science::c5food: of Portugal is ahead in research by a handful of techs. Her Luxury count and GPT are quite nice as well.

Pedro II:c5faith::c5greatperson: of Brazil is in third place. His playstyle has been enigmatic: the entire game he has launched a brutal war of attrition against his neighbor Boudicca. He is deep in the Honor tree and has only built 2 Wonders. In a normal game he always sits tight, builds wonders and missionary spams me. I don't know why he is being like this.

Boudicca:c5strength::c5faith: is doing well for herself. I normally discover Edinburgh in the late renaissance as a puppeted civ of someone who got tired of her antics. Bully.

Ramesses II:c5production::c5faith: is terrible. He has a net +85% production boost when building wonders (UA, Trait, Policy), and is still in 5th place for building them nonetheless.

Ghandi:c5strength::c5culture: Stinks out loud. He has an entire continent to himself and has managed to accomplish nothing besides 3rd to last place.

Nebuchadnezzar II:c5production::c5strength: Has done nothing. Only one city and nothing accomplished.

Bismark:c5greatperson::c5gold: is almost completely wiped out, as usual.

I had the personalities set at standard (Not Random), Raging barbarians OFF. Ended on turn 200.
 
I have evenly distributed all 14 traits amongst the 43 leaders. My main guide was what they originally had in Civ IV. For the new Civs, I relied mostly on what blended best with their flavor scores or unique abilities. I also followed community suggestions when I could, and I occasionally took some liberties based on my limited historical knowledge. Here is the current assignment list:

Code:
Ahmad al-Mansur - Diplomatic, Mercantile
Alexander - Aggressive, Charismatic
Ashurbanipal - Imperialistic, Inventive
Askia - Aggressive, Protective
Attila - Aggressive, Expansive
Augustus - Imperialistic, Industrious
Bismark - Aggressive, Philosophical
Boudicca - Protective, Spiritual
Casimir - Charismatic, Imperialistic
Catherine - Creative, Imperialistic
Darius -- Financial, Inventive
Dido -- Seafaring, Charismatic
Elizabeth - Mercantile, Seafaring
Enrico - Diplomatic, Protective
Gajah Mada - Expansive, Financial
Ghandi - Philosophical, Protective
Genghis -- Aggressive, Imperialistic
Gustav -- Diplomatic, Philosophical
Halie Selassie -- Charismatic, Spiritual
Harald Bluetooth -- Financial, Seafaring
Harun al-Rashid -- Inventive, Spiritual
Hiawatha -- Creative, Expansive
Isabella -- Expansive, Spiritual
Kamehameha -- Seafaring, Creative
Maria -- Mercantile, Financial
Maria Theresa -- Diplomatic, Inventive
Montezuma -- Aggressive, Spiritual
Napoleon -- Charismatic, Creative
Nebuchadnezzar -- Protective, Inventive
Oda Nobunaga -- Aggressive, Inventive
Pacal -- Industrious, Mercantile
Pachacuti -- Creative, Philosophical
Pedro II -- Philosophical, Spiritual
Pocatello -- Mercantile, Philosophical
Ramesses -- Industrious, Financial
Ramkhamhaeng -- Diplomatic, Financial
Sejong -- Industrious, Philosophical
Shaka -- Expansive, Protective
Suleiman -- Seafaring, Imperialistic
Theodora -- Creative, Spiritual
Washington -- Charismatic, Expansive
William -- Inventive, Mercantile
Wu Zetian -- Protective, Industrious

The traits are distributed so that some traits are used 7 times, most traits are used 6 times and a couple traits are used 5 times. A few civs receive abilities that sound contrary to their playstyle (I avoided Inventive with Korea, they are strong enough with Science. I avoided Aggressive with Shaka because it too closely resembles his UA.)

I now have one final issue to resolve: How to add an in game civilopedia page to explain these changes. I don't expect other users to be as intimately familiar with the traits as I am. Any pointers to a guide, tutorial, etc. would be much appreciated.
 
I have now added an in game help window, accessible from the drop down 'Additional information'. I like this placement because you can keep your Diplomacy drop down open as a reference for which symbols you are looking up.

I have noticed a new issue: Some leaders have such long names that you cannot see their trait symbols in the Diplomacy drop down (Specifically Nebuchadnezzar II and Rahmkhamhuang.) I'm not sure what, if anything, can be done about this. Also, it was formerly not a problem, so it is possible the issue only arises when playing DX9 instead of DX11.
 
I'm not sure if this is of any use to you, but it seems that some of the traits from Civ 4 are leftover in the files:

Code:
		<Row>
			<ID>0</ID>
			<Type>TRAIT_PHILOSOPHICAL</Type>
			<Description></Description>
			<ShortDescription></ShortDescription>
			<GreatPeopleRateModifier>100</GreatPeopleRateModifier>
		</Row>
		<Row>
			<Type>TRAIT_INDUSTRIOUS</Type>
			<Description></Description>
			<ShortDescription></ShortDescription>
			<MaxGlobalBuildingProductionModifier>50</MaxGlobalBuildingProductionModifier>
			<MaxTeamBuildingProductionModifier>50</MaxTeamBuildingProductionModifier>
			<MaxPlayerBuildingProductionModifier>50</MaxPlayerBuildingProductionModifier>
		</Row>
		<Row>
			<Type>TRAIT_CREATIVE</Type>
			<Description></Description>
			<ShortDescription></ShortDescription>
		</Row>
		<Row>
			<Type>TRAIT_FINANCIAL</Type>
			<Description></Description>
			<ShortDescription></ShortDescription>
		</Row>
		<Row>
			<Type>TRAIT_CHARISMATIC</Type>
			<Description></Description>
			<ShortDescription></ShortDescription>
			<LevelExperienceModifier>-25</LevelExperienceModifier>
		</Row>

I don't know if any of them do anything (Some of them obviously don't because of no tags), but at the very least could be useful to avoid conflicts if you're going for similar names
 
@ Pouakai:

I saw those. I always end my new XML entries with _X just to make sure they don't conflict with either vanilla assets or modded assets. Kind of amusing that they seem to have started making leader traits, then later repurposed them as either policies or UAs, but for some reason never erased that particular chunk of dead code.
 
I have changed most of the traits in the latest update, to try and make them all more thematic.

Spoiler :
*Aggressive: no change. This is the versatile combat trait that allows you to field a cheaper army that starts out stronger.

*Charismatic: Removed the bonus production for land units and replaced bonus production for early happiness buildings. This trait is for maintaining high happiness and thus increased number of golden ages.

*Creative: Removed great Works bonuses and added a Culture per pop. I wanted Creative to be more versatile and this way it supports building tall as well as building wide. Creative should be viewed as getting more access to social policies and therefore more choice as to how your civilization operates.

*Diplomatic: no change. This trait is all about making potent city state allies and keeping them.

*Expansive: Removed the Worker tile improvement speed bonus and replaced it with bonus population for founded cities. Changed bonus production from Aquaducts to Forges. This trait is designed for building wide and fast, so starting with 2 pop that is fully fed should aid in that strategy.

*Financial: Name swapped with mercantile. Now gives +10% production and food in cities connected to the capital and +50% food and production from internal trade routes. Building production bonuses changed to Aquaducts and Stables. This trait is intended for growth. I chose stables because they are the most likely resource dependent building to be available in tall empires.

*Imperialistic: Removed the Settler training bonus, added bonus Happiness from courthouses. Changed bonus production to all land units (Melee, Siege, Helicopter, All of them.) This trait is designed for annexing cities so it made more sense to be able to train reinforcements faster.

*Industrious: Added +1 Production to specialists. I wanted this trait to have a benefit outside of wonder hogging.

*Inventive: no change

*Mercantile: name swapped with financial. Now increases the bonus gold yield from luxury resources to +2 upon researching Economics.

*Philosophical: Added Bonus Culture and Tourism to Great Works. Should you have this trait and not want to chase a cultural victory, the influx of extra artists, writers and musicians will help you generate culture for social policies.

*Protective: no change

*Seafaring: no change.

*Spiritual: no change.


I also changed some of the trait assignments. Elizabeth and William are Mercantile instead of Financial. Darius and Gaja Madi are Financial instead of mercantile. Harald is now Seafaring and Financial.
 
This mod is now available on the Steam Workshop.

I have also made one last change to which leaders have which traits:

Hiawatha: Diplomatic, Spiritual (Creative, Expansive cut)
I had forgotten what a beastly runaway civ the Iroquois are. They build a ton of cities, never seem to anger anyone, create a massive defensive army and amass a frightening amount of culture by end game. I have given them traits that will still benefit them, but without feeding the monster too much.

Pedro: Expansive, Creative
All of Brazil's Uniques do not show up until late game. These two traits are a very powerful combination in the early game.

Pachacuti: Creative, Industrious (Philosophical cut)
Inca likes to build wonders. Why not help them out?

Asshurbanipal: Imperialistic, Mercantile (Inventive cut)
Assyria's UA relies on them being slightly behind in technology.

Gajah Mada: Seafaring, Expansive (Financial cut)
The UA and AI flavors are heavily ocean biased, so seafaring instead of financial just made sense.

Haille Salassie: Charismatic, Philosophical (Spiritual cut)
Ethiopia's UA benefits most from building tall, which means lots of specialists. Plus the Stele already gives a huge boost to Faith.

I am very happy with the current assignments, because now every trait is used 6 times (Except Aggressive, used 7 times.) I am still interested in feedback about what trait assignments may make more sense or be better balanced. Especially Bismark and Harald.
 
Top Bottom