Modding Civics: A Crash Course

@ ArbitraryGuy
"<BuildingHappinessChanges/>
Buildings make more happiness. I haven't experimented with unhappiness, but I'm interested to know if it'd work."

Negative happiness for buildings works fine, I use it extensively.
 
Anyone have any luck with negative hapiness for foreign religions?
A negative value there seems to result in a gigantic positive one instead ingame.

I also seem to have a problem with the game using other buildings than the one specified in the xml for giving extra happiness :( (for instance when I've entered a happiness boost for the Security Bureau it shows up ingame as the forbidden palace...

EDIT:

Found out about the strange building matches :)

<BuildingHappinessChanges>
<BuildingHappinessChange>
<BuildingType>BUILDING_PALACE</BuildingType>
<iHappinessChange>400</iHappinessChange>
</BuildingHappinessChange>
</BuildingHappinessChanges>

Should read "BUILDINGCLASS_" and not "BUILDING_" :)
 
Anyone have any luck with negative hapiness for foreign religions?
A negative value there seems to result in a gigantic positive one instead ingame.

This is a problem with the SDK. I think it's just a display error and doesn't actually affect the happiness of the city.
 
where are these located so they can be edited, or how do I create new "txt_key_civics" ?
TXT_KEY_CIVIC_DESPOTISM
TXT_KEY_CIVIC_DESPOTISM_PEDIA
TXT_KEY_CIVIC_DESPOTISM_STRATEGY
nvm I found them
 
If I make a change (just a small one, I gave 'simple economy' in final fronteir +1 trade route), will it automatically the text given on the civics menu?

And lo, it does :)
 
HEEEELPP
my xml files are okay, art section is okay too
but i'm having a big problem when its about the civics screen.
i want my civics screen to have 7 columns:
Head of State
Legal
Labor
Economy
Religion
Tendences
National

but when i load my mod only the 5 columns appear, and the additional civics are there(in the game), but they dont appear in the civics screen.

how to change the civics screen?????
 
<TradeYieldModifiers/>
I have played with this item a bit.
it works similarly to the regular yield modifier except on your trade routes
if you use 5 (5%) one any of the 3 catigorys then it will give you 1 more of that one for every 20 commerce gained by that citys trade networks.

If i set the hammer and food catigorys to 100 (100%) then i will get food and hammers at a 1 to 1 ratio with Commerce.

I hope i have explained this in a way that is understood.
 
A civic can change the <iHappiness> of one building.
Is it possible do the same whit <iMaintenanceModifier>?

I try:
<BuildingMaintenanceModifierChanges>
<BuildingMaintenanceModifierChange>
<BuildingType>BUILDINGCLASS_ELDERS_COUNSIL</BuildingType>
<iMaintenanceModifierChange>-25</iMaintenanceModifierChange>
</BuildingMaintenanceModifierChange>
</BuildingMaintenanceModifierChanges>

it doesn't work...
 
Why does the <iNonStateReligionHappiness>-1</iNonStateReligionHappiness> works in legal section but not in religion section ?

In all legal civics I input the -1 modifier, there be show "+1 unhappy :( per none state religion in city.
But in all religion civis there is show "+1239344....:) (happy) per religion in a city

???????????
So it seems the <iNonStateReligionHappiness> works only fpr legal civics, but why ?
hardcoded ?
 
HEEEELPP
my xml files are okay, art section is okay too
but i'm having a big problem when its about the civics screen.
i want my civics screen to have 7 columns:
Head of State
Legal
Labor
Economy
Religion
Tendences
National

but when i load my mod only the 5 columns appear, and the additional civics are there(in the game), but they dont appear in the civics screen.

how to change the civics screen?????
I would realy like to know this too.
Can anyone post a answer?
 
Same here, I want to know how to modify the civic screen so it can hold 6x6 civics and show the graphics properly.
Check my Rise of Mankind mod: it has currently 7 civic categories with 9 choices in each category all shown in one page. The file you need to check is CvCivicScreen.py (I think) located in the assets\python\screens -folder.
 
Why does the <iNonStateReligionHappiness>-1</iNonStateReligionHappiness> works in legal section but not in religion section ?

In all legal civics I input the -1 modifier, there be show "+1 unhappy :( per none state religion in city.
But in all religion civis there is show "+1239344....:) (happy) per religion in a city

???????????
So it seems the <iNonStateReligionHappiness> works only fpr legal civics, but why ?
hardcoded ?

I've experimented with this a bit, and though in the civics advisor screen it will show some crazy number if you put non state religion happiness to a negative number, it does work in the game. You will get an extra unhappy citizen in whatever city has a nonstate religion, and if you hover your mouse over the unhappiness face in the city screen, you'll see +1 :mad: with a text explaining he's unhappy because of "religious persecution" (or intolerance or something like that).
 
About the aiweight... I have added 2 new civics and greatly improved serfdom (2 new civics: Provincialities and Provincial Law. Both Code of Laws. Government and Legal respectively. -75 and -20% city maintenance cost respectively. A couple more features) and they often don't adopt universal suffrage or free speech - even if it's their favourite civic - and instead they stick with mine. Ai weight is 0. I think it's part of the AI itself - if it has maintenance costs, it adopts my 2 awesome civics, if it's unhappy and using my second civic, it builds courthouses, and if it needs commerce it used my improved serfdom. And, does anyone know if it's possible to add a tag under a legal civic option and make it require a Government civic? (For my civics described above, of course. You can't have a provincial court of law if you don't have provinces.)
 
Can't be done with XML, needs minimum python (better SDK).
Look at the profile of this guy, he has done a modcomp for this (needs another modcomp from him additionally and is not easy to install, but works then without many problems).
 
I have added a new civic option in the Civ4CivicOptions.xml file but the default is not being set for civs on starting a new game.

I populated it in the Civ4CivicInfos.xml file and all new civics appears fine in the Civopedia. I have also updated the CvCivicsScreen.py file and all the new civics show up nicely in that under the correct option heading.

I have updated the Civ4CivilizationInfos.xml file to add a new row to the <InitialCivics> node and ensured that there is no typo in there.
Code:
<InitialCivics>
	<CivicType>CIVIC_DESPOTISM</CivicType>
	<CivicType>CIVIC_BARBARISM</CivicType>
	<CivicType>CIVIC_TRIBALISM</CivicType>
	<CivicType>CIVIC_DECENTRALIZATION</CivicType>
	<CivicType>CIVIC_PAGANISM</CivicType>
	<CivicType>CIVIC_MILITIA</CivicType>
</InitialCivics>
When I start a new game however the new option is set by default to the Despotic civic.

I had a look in the SDK in enums.h in case there was a count in there, but there wasn't. I wouldn't have expected one given the presence of the Civ4CivicOptions.xml file, but thought it worth a look.

Any ideas how to resolve this?
 
Uh...what :confused:?
Screenshot please.

Not sure if adding the screenshots as an attachments is the easiest way of showing you, but here is what I mean...

The CivicNotSet is what I get on starting a new game.
If you look at the final option set (Military) the current civic icon shows it as Despotism (Fist), which is not even an available civic in the Military option set. The header of the dialog does show the the Citizen Army icon but does not have a Yellow border.

If I then select what is defined as the default civic in the Civ4CivilizationInfos.xml file I get the second screenshot CivicSelected, which shows that I need to undergo a revolution first.

I am wondering how to get the Citizen Army civic as the current military civic at the start of the game rather than the Despotism that appears to be being set now.

Hope that is a bit clearer
 

Attachments

  • CivicNotSet.JPG
    CivicNotSet.JPG
    67.8 KB · Views: 132
  • CivicSelected.JPG
    CivicSelected.JPG
    68 KB · Views: 135
Just wanted to see, if i really understand what you mean, because it didn't make any sense...and still doesn't.

What does happen, when you one time hit the end turn button? Is it then changed?

Do you use a premade map? Because the civics are also defined in there.
 
Back
Top Bottom