View Full Version : [MODCOMP] Favorite Religion


TheLopez
Sep 28, 2006, 10:59 PM
Favorite Religion
By: TheLopez

Last Update: 11/08/06

Version: v0.2w
Patch Compatibility: Warlords v2.0.8.0
MP Compatible: ?
Download Mod v0.2w (http://forums.civfanatics.com/./downloads.php?do=file&id=2891&act=down)

Version: v0.2
Patch Compatibility: v1.61
MP Compatible: ?
Download Mod v0.2 (http://forums.civfanatics.com/./downloads.php?do=file&id=2890&act=down)

Description:
This mod provides the ability to make some leaders more historically accurate
by helping the AI to pick a particular leader's state religion. This way
Saladin can be hinted to pick Islam as his state religion and Christianity as
Isabella's state religion.


Installation Instructions:

1) Unzip this into the "civ4_install_folder\Mods\" folder.
2) Open the CivilizationIV.ini configuration file
3) Change the Mod line to read: Mod = Mods\Favorite Religion
4) Load the game.
5) Then play as normal.


-----Game Play-----

- Most leaders have been given a favorite religion, the are:
[TAB]Alexander: [NONE]
[TAB]Asoka: Buddhism
[TAB]Bismarck: Christianity
[TAB]Caesar: [NONE]
[TAB]Catherine: Christianity
[TAB]Cyrus: [NONE]
[TAB]Elizabeth I: Christianity
[TAB]FDR: Christianity
[TAB]Frederick II: Christianity
[TAB]Gandhi: Hinduism
[TAB]Genghis Khan: Taoism
[TAB]George Washington: Christianity
[TAB]Hatshepsut: [NONE]
[TAB]Huayna Capac: [NONE]
[TAB]Isabella: Christianity
[TAB]Ivan: Christianity
[TAB]Kublai Khan: Buddhism
[TAB]Louis XIV: Christianity
[TAB]Mansa Musa: Islam
[TAB]Mao Zedong: Buddhism
[TAB]Montezuma: [NONE]
[TAB]Napoleon: Christianity
[TAB]Qin Shi: Taoism
[TAB]Saladin: Islam
[TAB]Tokugawa: [NONE]
[TAB]Victoria: Christianity


-----Notes to Modmakers-----

If you want to use the Favorite Religion in your mod I have tried to make
things as easy as possible for you. In the XML files I have added
<!-- Favorite Religion Start --> and <!-- Favorite Religion End --> in all of
the places that I have made changes to the original files.

In the SDK files I have added // < Favorite Religion Start > and
// < Favorite Religion End > in all of the places that I have made changes to
the original files.

In the Python files I have added # < Favorite Religion Start > and
# < Favorite Religion End > in all of the places that I have made changes to
the original files.

In order to provide hints to the AI of what a leaders favorite religion is new
tags similar to the favorite civic tags have been added.

Last, several new methods have been exposed to the python layer in the
CvLeaderHeadInfo class in order to allow getting and setting the favorite
religion variables they are:
[TAB]int getFavoriteReligion()
[TAB]int getFavoriteReligionAttitudeChange()
[TAB]int getFavoriteReligionAttitudeDivisor()
[TAB]int getFavoriteReligionAttitudeChangeLimit()

[TAB]void setFavoriteReligion(int iNewValue)
[TAB]void setFavoriteReligionAttitudeChange(int iNewValue)
[TAB]void setFavoriteReligionAttitudeDivisor(int iNewValue)
[TAB]void setFavoriteReligionAttitudeChangeLimit(int iNewValue)

-----Version Information-----

-----v0.2------

- Added the missing text tags:
[TAB]TXT_KEY_MISC_ATTITUDE_FAVORITE_RELIGION
[TAB]TXT_KEY_DENIAL_FAVORITE_RELIGION
Reported by Mexico.

- Moved the favorite religion trade code from the AI_civicTrade method to the
AI_religionTrade method since it was in the wrong place. Reported by Mexico.

- Added the missing DENIAL_FAVORITE_RELIGION entry in the CIV4BasicInfos.xml
file. Reported by Mexico.


-----v0.1------

- Setup the Favorite Religion Mod infrastructure

- Added the <iFavoriteReligionAttitudeChange>,
<iFavoriteReligionAttitudeDivisor>, <iFavoriteReligionAttitudeChangeLimit> and
<FavoriteReligion> tags including the underlying code support in the SDK.

- Exposed several methods to the python layer through the SDK to allow setting
the new favorite religion variables.

- Updated the CvPediaLeader.py file to display leaders favorite religions.


-----===Credits & Thanks===-----

- Exavier
[TAB]Composite Mod - readme.txt format

- GraveEatr
[TAB]For inspiring me to develop this mod.
[TAB]

Jeckel
Sep 28, 2006, 11:09 PM
This is Da Bomb! Great props to you TheLopez and to GraveEatr for inspiring it. :thanx:

This will give so much more functionality to religion mods. :D

Ket
Sep 29, 2006, 02:12 AM
WONDERFUL, its one of the things I was looking for in the composite!!!!
The Inquisitor that the AI uses is the other...

Thank you!

Grave
Sep 29, 2006, 05:13 AM
This is going to be one of those "must have" mods, especially for those running mods that alter Religion.

I'd like to thank TheLopez for running with this idea and making it become a reality. Without him this couldn't of been possible. :goodjob:


Downloading now!

Ket
Sep 29, 2006, 08:34 AM
Can we get some hard info on what these will do

<iFavoriteReligionAttitudeChange>0</iFavoriteReligionAttitudeChange>
<iFavoriteReligionAttitudeDivisor>0</iFavoriteReligionAttitudeDivisor> <iFavoriteReligionAttitudeChangeLimit>0</iFavoriteReligionAttitudeChangeLimit>

I've also started an initiative to get the civ gold leaders mapped out...

Right now we have a master Warlords version with Shinto and Zoroastrianism plus the civs of Portugal, Israel, Cherokee, mapped out and we're discussing it over in my XL thread if you want to pop in.

The Civ Gold thread is in the Civ Gold Forum... I need to wait till Sunday to get a master list of leaders.

Houman
Sep 29, 2006, 10:47 AM
Thank you Lopez for youe efforts.

Epicurist
Sep 29, 2006, 11:32 AM
Outstanding!

TheLopez
Sep 29, 2006, 12:44 PM
FYI: I just posted a new version of the Warlords version that contained some issues.

Wyz_sub10
Sep 30, 2006, 07:35 PM
We'll definitely do a CIV Gold add-on for this.

Houman
Oct 07, 2006, 07:23 AM
Lopez,

May you please elaborate what

<iFavoriteReligionAttitudeChange>1</iFavoriteReligionAttitudeChange>
<iFavoriteReligionAttitudeDivisor>10</iFavoriteReligionAttitudeDivisor>
<iFavoriteReligionAttitudeChangeLimit>1</iFavoriteReligionAttitudeChangeLimit>

means? :D

P.S. The warlords version is lacking <FavoriteReligion>NONE</FavoriteReligion> for Alexander.

Many thanks
Houman

Mattastic
Oct 07, 2006, 02:30 PM
Ah, you are a wonderful person! I was just thinking Civ4 needed this (after the fiftieth game where more than half the AI leaders are Buddhists or Hindus just because they researched it before anything else). Great job!

*downloads*

Snerk
Oct 10, 2006, 05:26 PM
Brilliant! I remember i posted a request for excatly this some time ago. Nice to see someone made it.

Black Rose
Oct 15, 2006, 03:36 AM
Fantastic work! I've felt (since the beginning) that this was at least one of the biggest flaws of the game. And I've wondered if I should get into modmaking in order to change the way religions work -this is by far a great step in the right direction. I can only say thank you.

This mod does not alter the effects of having one's favorite religion, does it? I was wondering if it would be possible to give a bonus for having one's favorite religion, such as +1 gold for each city with the favorite religion present if it is the state religion, or +1 culture, or just improved religious civic yields? (Theocracy = +3 xp on units, Organized religion = +30%-35% faster building construction, Pacifism = 125% or 150% great people increase, etc.)

Just enthusiastic about your mod here...

TheLopez
Oct 15, 2006, 01:59 PM
Hmmm... that is a very interesting idea... Aussie_Lurker, what do you think? I ask aL because he is putting together a very good mod that expands the capabilities of civics.

Mexico
Oct 16, 2006, 02:20 AM
in attitude panel, when you hover mouse over player, which have his favorite religion (and you have this religion adopted too), you can see : TXT_KEY_MISC_ATTITUDE_FAVORITE_RELIGION - this text is not defined in XML

Houman
Oct 16, 2006, 02:27 AM
Another small bug is that Alexander has no favorite religion tag defined. Usually there is a NONE there. But this is missing for Alexander.

Mexico
Oct 21, 2006, 03:24 PM
under some conditions, if you want trade with player, which founded nad adopt his favorite religion, you got CTD.

problem is in file CvDLLWidgetData.cpp, in fuction parseTradeItem :

at end of this, you can find:
setTradeItem(&item, ((TradeableItems)(widgetDataStruct.m_iData1)), widgetDataStruct.m_iData2);

eDenial = GET_PLAYER(eWhoFrom).getTradeDenial(eWhoTo, item);

if (eDenial != NO_DENIAL)
{
szTempBuffer.Format(L"%s: " SETCOLR L"%s" ENDCOLR, GET_PLAYER(eWhoDenies).getName(), TEXT_COLOR("COLOR_WARNING_TEXT"), GC.getDenialInfo(eDenial).getDescription());
szBuffer += (NEWLINE + szTempBuffer);
}

and when eDenial is DENIAL_FAVORITE_RELIGION, game crashed at GC.getDenialInfo(eDenial).getDescription() - there is missing denial info entry in CIV4BasicInfos.xml (and of course appropriate entry for TXT_KEY_DENIAL_FAVORITE_RELIGION)


and another question: why you test favorite religion in civic trading ? why not in religion part?

Nilmerf
Oct 27, 2006, 02:28 AM
Hey, I love the mod.. and have included it in my personal mod. I've also replaced Confucianism with Hellenism, so now everyone in the game has a favourite religion! I had to fudge on the Incas and Aztecs and give them Hinduism, but oh well. My question is.. is there a way to make the religious icon appear in the Civilopedia when looking at a leader? I've attached a picture of Asoka to highlight what I mean. It would be cool if a little Buddha was there.

TheLopez
Nov 02, 2006, 09:39 AM
Mexico - Thanks for both bug reports, I will fix the code in both the regular and warlords version. After that I will update the warlords code for the v2.0.8 patch.

Houman - Thanks for the bug report I will fix that for the next release.

Nilmerf - Why should the religion icon be next to the leader?

TheLopez
Nov 08, 2006, 08:52 AM
Updated both versions, the Warlords version is now compatible with the v2.0.8.0 patch!!!

SkippyT
Nov 13, 2006, 12:22 PM
My list would be this:
Alexander: [NONE]
Asoka: Buddhism
Bismarck: Christianity
Caesar: [NONE]
Catherine: Christianity
Cyrus: [NONE]
Elizabeth I: Christianity
FDR: Christianity
Frederick II: Christianity
Gandhi: Hinduism
Genghis Khan: [NONE]
George Washington: Christianity
Hatshepsut: [NONE]
Huayna Capac: [NONE]
Isabella: Christianity
Ivan: Christianity Who's Ivan??? Peter?
Kublai Khan: Buddhism
Louis XIV: Christianity
Mansa Musa: Islam
Mao Zedong: [NONE]
Montezuma: [NONE]
Napoleon: Christianity
Qin Shi: Confucianism
Saladin: Islam
Tokugawa: Buddhism
Victoria: Christianity

Changes:
Qin Shi Huang is Confucianist, because he was Confucian
Genghis Khan has [NONE], because he was pagan
Mao Zedong has [NONE], because communist China doesn't have a state religion
Tokugawa has Buddhism, because he was a Shinto Buddhist

edit: Looks good though ;)

Vaarna_Aarne
Nov 22, 2006, 08:09 AM
Well, the problem with Civ religions is history now.

No more Hindu Saladin smoking my arse.

cybrxkhan
Jan 18, 2007, 07:35 PM
Mao Zedong: Buddhism


:lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol:


:nono:

mao was a hardcore atheist... remember the cultural revolution? and the invasion of (buddhist) tibet?

otherwise, everything else is great!

Dracleath
Jan 20, 2007, 08:04 PM
Too many christians by far, I think the distinction between "personal" christians and "activist" christians should be made. For example, Genghis Khan was technically a christian later in his life but I don't think he ever tried to convert anyone or let it affect the management of his empire, and it isn't something that's even well known today. To cut down on the christians and balance things a bit so we don't see every game ending with christianity dominating the war, I think someone should only have that as a favored religion if it was a major element in their government.

My list would be as follows (everything else the same as skippyT)

Elizabeth 1: christianity (she'll usually go over to free religion though IIRC)
Isabella: christianity
Louis XVI: Christianity
Peter: Christianity
Catherine: Christianity
Fredrick: Christianity


Napoleon: none (didn't care much about religion)
Victoria: none (ruled over plenty of hindus, jewish prime minister)
FDR: none (didn't care much about religion as relates to state policy)
George Washington: none (Deist IIRC)
Bismark: none (didn't care much about religion as relates to state policy)


So there you end up with a much more balanced setup and less railroading the game into being dominated by christians at the end.

Infantry#14
Jan 26, 2007, 02:46 PM
[QUOTE=SkippyT;4757873]My list would be this:
Alexander: [NONE]
Asoka: Buddhism
Bismarck: Christianity
Caesar: [NONE]
Catherine: Christianity
Cyrus: [NONE]
Elizabeth I: Christianity
FDR: Christianity
Frederick II: Christianity
Gandhi: Hinduism
Genghis Khan: [NONE]
George Washington: Christianity
Hatshepsut: [NONE]
Huayna Capac: [NONE]
Isabella: Christianity
Ivan: Christianity Who's Ivan??? Peter?
Kublai Khan: Buddhism
Louis XIV: Christianity
Mansa Musa: Islam
Mao Zedong: [NONE]
Montezuma: [NONE]
Napoleon: Christianity
Qin Shi: Confucianism
Saladin: Islam
Tokugawa: Buddhism
Victoria: Christianity

Changes:
Qin Shi Huang is Confucianist, because he was Confucian

Infantry#14
Jan 26, 2007, 02:47 PM
shoot, i meant to say is this
Actually, Qin Shi Huang was not a confucian, but a confucian hater. Historically, he burned all possible Confucian books and buried alive Confucian scholars. He is a hardcore Legalist who believes that all humans are innatedly evil and laws to suppress this evil.

Axel
Jul 09, 2007, 12:11 AM
hey all, I'm hoping someone can help me with a problem. I'm trying to add this favorite religion code to my mod and it's not quite working. I copied all the right lines to all the right files, but the civpedia leader screen isn't right. I merged the code with the improvements outside borders stuff, don't see why that would screw things up but my programming skills are crap so maybe someone can give me a clue. I've uploaded a screenshot. Thanks.

http://forums.civfanatics.com/uploads/12385/Civ4ScreenShot0000.JPG

Jeckel
Jul 12, 2007, 10:32 AM
Did you give your new leaders favorite religions in the leaderinfos file? If you did then I would recheck that you copied all the code in the appropriate python pedia file.

Axel
Jul 12, 2007, 11:07 PM
Did you give your new leaders favorite religions in the leaderinfos file? If you did then I would recheck that you copied all the code in the appropriate python pedia file.

I tried those things first. I also have SimCutie's Pedia stuff in there. Although different files were modified, I'm thinking the problem might be with SimCutie's modified files.

baal_isidro
Feb 05, 2008, 10:59 AM
Will there be a BTS update ? :king:

Thorn
Feb 05, 2008, 11:35 AM
:cry: Whatever happened to TheLopez? :cry:

Edward The Big
Feb 05, 2008, 11:55 AM
this is already available in BTS...so there would be no need for an update.

ijnavy
Feb 19, 2008, 08:40 PM
Can I make so that some leaders like more than one religion?

Vrenir
Feb 20, 2008, 07:07 AM
Except that the built-in BtS version only effects what religion the leader chooses with the Choose Religion option (at least that's my impression). In this modcomp, it also effected diplomacy and, more importantly, likelihood of conversion when the favored religion entered the leader's land.