Mod - Multiple Traits Problems

chiphead

Chieftain
Joined
Jul 27, 2007
Messages
56
I'm working on a mod (America All Uniques) that gives the American civilization all UAs/UBs/UUs, but I've run into a few problems getting all the traits to play nice.

I originally just added all other leaders' traits to Washington, and that gets most of them working right away. One that did not work at first was Carthage's free harbors -- I was able to get them working by using the previously-unused TRAIT_PHILOSOPHICAL trait and adding a FreeBuilding to it, as I explain on the How to get the free habor effects of Carthage? thread. This approach also worked to get the Huns' +1 production from pastures, by adding TRAIT_PHILOSOPHICAL to table Trait_ImprovementYieldChanges.

Once that was working, I tried to get the double resources from the Arabian and Russian UAs by adding TRAIT_PHILOSOPHICAL to table Trait_ResourceQuantityModifiers. The changes show up in the database (I'm checking with the SQLite Manager), but the resource quantities remain unchanged. The same happens with Russia's +1 production for strategic resources under table Trait_YieldChangesStrategicResources, TRAIT_PHILOSOPHICAL is on the table but there's no +1 production per resource. Any ideas?
 
Needle in a hay stack, post some code/logs dude :)

Edit: Have you checked to see if Cathrine's Strategic Riches trait is working?
 
Sure thing. I started with
Code:
<Traits>
	<Update>
		<Where Type="TRAIT_PHILOSOPHICAL"/>
		<Set>
			<GreatPeopleRateModifier>0</GreatPeopleRateModifier>
		</Set>
	</Update>
	<Update>
		<Where Type="TRAIT_PHILOSOPHICAL"/>
		<Set>
			<FreeBuilding>BUILDING_HARBOR</FreeBuilding>
		</Set>
	</Update>
</Traits>
<Trait_ImprovementYieldChanges>
	<Row>
		<TraitType>TRAIT_PHILOSOPHICAL</TraitType>
		<ImprovementType>IMPROVEMENT_PASTURE</ImprovementType>
		<YieldType>YIELD_PRODUCTION</YieldType>
		<Yield>1</Yield>
	</Row>
</Trait_ImprovementYieldChanges>

That all works. TRAIT_PHILOSOPHICAL is empty except for the GreatPeopleRateModifier that I remove, harbors work, pastures give +1 production.

So, by the same logic, I added

Code:
<Trait_ResourceQuantityModifiers>
	<Row>
		<TraitType>TRAIT_PHILOSOPHICAL</TraitType>
		<ResourceType>RESOURCE_HORSE</ResourceType>
		<ResourceQuantityModifier>100</ResourceQuantityModifier>
	</Row>
	<Row>
		<TraitType>TRAIT_PHILOSOPHICAL</TraitType>
		<ResourceType>RESOURCE_IRON</ResourceType>
		<ResourceQuantityModifier>100</ResourceQuantityModifier>
	</Row>
	<Row>
		<TraitType>TRAIT_PHILOSOPHICAL</TraitType>
		<ResourceType>RESOURCE_URANIUM</ResourceType>
		<ResourceQuantityModifier>100</ResourceQuantityModifier>
	</Row>
	<Row>
		<TraitType>TRAIT_PHILOSOPHICAL</TraitType>
		<ResourceType>RESOURCE_OIL</ResourceType>
		<ResourceQuantityModifier>100</ResourceQuantityModifier>
	</Row>
</Trait_ResourceQuantityModifiers>
<Trait_YieldChangesStrategicResources>
	<Row>
		<TraitType>TRAIT_PHILOSOPHICAL</TraitType>
		<YieldType>YIELD_PRODUCTION</YieldType>
		<Yield>1</Yield>
	</Row>
</Trait_YieldChangesStrategicResources>

Nothing doing.
 
And yes, both Catherine's and Suleiman's traits are working (for them) with the mod enabled.
 
Code looks good. In wondering if somthing in the dll is preventing it, some dll guru could probably tell you more, personaly I cant make head nor tales of the dll, yet(learning C++).

No errors in log?
 
Which log would that be? I'm quite new to Civ V modding and sometimes the amount of information out there can be a bit overwhelming.

I had a quick look at the DLL but it'll take some time to grasp everything that's going on.
Apparently there's some differences in the way Trait_ImprovementYieldChanges and Trait_YieldChangesStrategicResources are implemented that could account for one working and the other not, but it's pretty involved stuff. Any DLL gurus who can help?
 
Which log would that be? I'm quite new to Civ V modding and sometimes the amount of information out there can be a bit overwhelming.
In ...My Games\Sid Meiers Civilization V\ there is config.ini, open it up with notepad, at the top is debugging you want to turn on(set to 1) these options:-
  • EnableTuner = 1 (Allow the Firetuner to log to the game while its running)
  • EnableLuaDebugLibrary = 1 (I think this enables stack trace back of lua errors)
Then under Debug:
  • LoggingEnabled = 1 (Prints logs to the /Logs folser)
There are lots of other options, but these are the main 3, the rest are down to you.

Apparently there's some differences in the way Trait_ImprovementYieldChanges and Trait_YieldChangesStrategicResources are implemented that could account for one working and the other not, but it's pretty involved stuff. Any DLL gurus who can help?
Yeah I saw that too, just couldnt grasp what was what.
 
For Trait_YieldChangesStrategicResources and Trait_ResourceQuantityModifiers the problem is the opposite of FreeBuilding. Every trait will (re)set them meaning only the last read trait (that the player has) will apply.
 
That sounds like a lead, snarko. I'll test them with TRAIT_BONUS_AGAINST_TECH which shows as the last trait on SQLite manager. Supposing that does work, how would I go about adding a new trait to make sure it's at the end of the Traits table?
 
snarko, good sir, you are a gentleman and a scholar. Works beautifully if I add them to the last trait. I think I'll create a new America-specific trait, add it at the end, and move this stuff there. Thank you very much for your help!
 
I'm in very difficulty with Modbuddy e CIV 5, on any try to change trait doesn't works.

I want add to Ramsses II, more bonus on building production.

I've tried with this (prod. for all):
Code:
<Defines>
		<Update>
			<Set Value="150"/>
			<Where Type="BUILDING_PRODUCTION_PERCENT"/>
		</Update>
	</Defines>

or

Code:
	<Traits>
		<Row>
			<Type>TRAIT_BUILDER</Type>
			<Description>TXT_KEY_BUILDER</Description>
			<ShortDescription>TXT_KEY_TRAIT_BUILDER_SHORT</ShortDescription>
			<CapitalBuildingModifier>75</CapitalBuildingModifier>
			<CityUnhappinessModifier>100</CityUnhappinessModifier>
			<PopulationUnhappinessModifier>-75</PopulationUnhappinessModifier>
			<MaxGlobalBuildingProductionModifier>50</MaxGlobalBuildingProductionModifier>
			<MaxTeamBuildingProductionModifier>50</MaxTeamBuildingProductionModifier>
			<MaxPlayerBuildingProductionModifier>50</MaxPlayerBuildingProductionModifier>
			<WonderProductionModifier>50</WonderProductionModifier>
		</Row>
	</Traits>

	<Leader_Traits>
		<Row>
			<LeaderType>LEADER_RAMESSES</LeaderType>
			<TraitType>TRAIT_BUILDER</TraitType>
		</Row>
	</Leader_Traits>


or

Code:
	<Leader_Traits>
		<Row>
			<LeaderType>LEADER_RAMESSES</LeaderType>
			<TraitType>TRAIT_BOOM</TraitType>
		</Row>
	</Leader_Traits>
	<Traits>
		<Row>
			<Type>TRAIT_BOOM</Type>
			<Description>TXT_KEY_TRAIT_INDUSTRIOUS</Description>
			<ShortDescription>TXT_KEY_TRAIT_INDUSTRIOUS_SHORT</ShortDescription>
			<MaxGlobalBuildingProductionModifier>350</MaxGlobalBuildingProductionModifier>
			<MaxTeamBuildingProductionModifier>350</MaxTeamBuildingProductionModifier>
			<MaxPlayerBuildingProductionModifier>350</MaxPlayerBuildingProductionModifier>
		</Row>
	</Traits>

No one works... :cry::cry::cry::cry::cry:
Can anyone help me?
 
If that is your whole code, you are missing <GameData> at the top(Very first line) and <\GameData>(Very Bottom Line)
 
Do you have <GameData> as the first tag and </GameData> as the last?

Have you set OnModActivated UpdateDatabase for your XML files?

Have you turned on logging in the ini file and if so do the logs give you any errors?
 
Thanks.
<GameData></GameData> There already, I forgot to include it in the code, but there is. Same for OnModActivated - UpdateDatabase for XML file.

Removing some tweaks, seems work. I've also changed from "row" to "upgrade" the Leader Traits section:
Code:
	<Leader_Traits>
		<Update>
			<Set TraitType="TRAIT_BOOM"/>
			<Where LeaderType="LEADER_RAMESSES"/>
		</Update>
	</Leader_Traits>
	<Traits>
		<Row>
			<Type>TRAIT_BOOM</Type>
			<Description>TXT_KEY_TRAIT_WONDER_BUILDER</Description>
			<ShortDescription>TXT_KEY_TRAIT_WONDER_BUILDER_SHORT</ShortDescription>
			<WonderProductionModifier>200</WonderProductionModifier>
			<CityUnhappinessModifier>50</CityUnhappinessModifier>
			<PopulationUnhappinessModifier>-85</PopulationUnhappinessModifier>
			<TradeRouteChange>1</TradeRouteChange>
		</Row>
	</Traits>


Now I'll try to activate log for check why I can't speed-up production.
 
The log don't show any error adding some tweaks, but still don't works!
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 11/23/2012 3:42:48 AM -->
<GameData>
	<Leader_Traits>
		<Update>
			<Set TraitType="TRAIT_BOOM"/>
			<Where LeaderType="LEADER_RAMESSES"/>
		</Update>
	</Leader_Traits>
	<Traits>
		<Row>
			<Type>TRAIT_BOOM</Type>
			<Description>TXT_KEY_TRAIT_WONDER_BUILDER</Description>
			<ShortDescription>TXT_KEY_TRAIT_WONDER_BUILDER_SHORT</ShortDescription>
			<WonderProductionModifier>200</WonderProductionModifier>
			<CityUnhappinessModifier>50</CityUnhappinessModifier>
			<PopulationUnhappinessModifier>-85</PopulationUnhappinessModifier>
			<TradeRouteChange>9</TradeRouteChange>

[I][B](this below is taken from industrous trait, it's disabled on game code?)[/B][/I]

			<MaxGlobalBuildingProductionModifier>500</MaxGlobalBuildingProductionModifier>
			<MaxTeamBuildingProductionModifier>500</MaxTeamBuildingProductionModifier>
			<MaxPlayerBuildingProductionModifier>500</MaxPlayerBuildingProductionModifier>
		</Row>
	</Traits>
	<Trait_YieldChanges>
		<Row>
[I][B](This +gold, seem works).[/I][/B]
			<TraitType>TRAIT_BOOM</TraitType>
			<YieldType>YIELD_GOLD</YieldType>
			<Yield>9</Yield>
		</Row>
	</Trait_YieldChanges>
	<Trait_YieldChangesStrategicResources>
		<Row>
[I][B](This +prod, don't works).[/I][/B]
			<TraitType>TRAIT_BOOM</TraitType>
			<YieldType>YIELD_PRODUCTION</YieldType>
			<Yield>9</Yield>
		</Row>
	</Trait_YieldChangesStrategicResources>
	
	<Trait_FreePromotionUnitCombats>
		<Row>
			<TraitType>TRAIT_BOOM</TraitType>
			<UnitCombatType>UNITCOMBAT_MELEE</UnitCombatType>
			<PromotionType>PROMOTION_SENTRY</PromotionType>
		</Row>
		<Row>
			<TraitType>TRAIT_BOOM</TraitType>
			<UnitCombatType>UNITCOMBAT_ARCHER</UnitCombatType>
			<PromotionType>PROMOTION_SENTRY</PromotionType>
		</Row>
		<Row>
			<TraitType>TRAIT_BOOM</TraitType>
			<UnitCombatType>UNITCOMBAT_RECON</UnitCombatType>
			<PromotionType>PROMOTION_SENTRY</PromotionType>
		</Row>
		<Row>
			<TraitType>TRAIT_BOOM</TraitType>
			<UnitCombatType>UNITCOMBAT_MOUNTED</UnitCombatType>
			<PromotionType>PROMOTION_SENTRY</PromotionType>
		</Row>
		<Row>
			<TraitType>TRAIT_BOOM</TraitType>
			<UnitCombatType>UNITCOMBAT_SIEGE</UnitCombatType>
			<PromotionType>PROMOTION_SENTRY</PromotionType>
		</Row>
		<Row>
			<TraitType>TRAIT_BOOM</TraitType>
			<UnitCombatType>UNITCOMBAT_GUN</UnitCombatType>
			<PromotionType>PROMOTION_SENTRY</PromotionType>
		</Row>
		<Row>
			<TraitType>TRAIT_BOOM</TraitType>
			<UnitCombatType>UNITCOMBAT_ARMOR</UnitCombatType>
			<PromotionType>PROMOTION_SENTRY</PromotionType>
		</Row>
	</Trait_FreePromotionUnitCombats>
(This seem works).
</GameData>
 
The version of augustus, seems works now (1/4 for building already present on capital city).

Code:
<GameData>
<Traits>
		<Row>
			<Type>TRAIT_BOOM</Type>
			<Description>TXT_KEY_TRAIT_WONDER_BUILDER</Description>
			<ShortDescription>TXT_KEY_TRAIT_WONDER_BUILDER_SHORT</ShortDescription>
			<WonderProductionModifier>100</WonderProductionModifier>
			<CityUnhappinessModifier>50</CityUnhappinessModifier>
			<PopulationUnhappinessModifier>-85</PopulationUnhappinessModifier>
			[B]<CapitalBuildingModifier>300</CapitalBuildingModifier>[/B]
		</Row>
	</Traits>
</GameData>

If I want leave defaults traits, and alters all global speed, how can I do then?

I've tried this, without success:
Code:
<GameData>
          <Defines>
		<Update>
			<Set Value="550"/>
			<Where Name="BUILDING_PRODUCTION_PERCENT"/>
		</Update>
		<Update>
			<Set Value="-2000"/>
			<Where Name="START_YEAR"/>
		</Update>
	</Defines>
</GameData>

I'll like to play a match with lower speed of time and research, but fast for production of building and unit, more realistic. How can I do it?
 
Top Bottom