Found Religion

platyping

Sleeping Dragon
Joined
Oct 22, 2010
Messages
4,626
Location
Emerald Dreams
Code:
VOID foundReligion (ReligionType eReligion, ReligionType iSlotReligion, BOOL bAward)

Anyone has any idea what iSlotReligion refers to?

There is another way of founding religion via python
Code:
VOID setHolyCity (ReligionType eIndex, CyCity pNewValue, BOOL bAnnounce)

But there is a problem with both of them.
If I use CyGame().setHolyCity(iHindu, pCity, True/False) to set pCity as Holy City of Hinduism, it will set pCity as the Holy City no doubt.
True/False just decide whether it is announced to whole world.

Using, pPlayer.foundReligion(iHindu, iHindu, True/False) will just let pPlayer be the founder whereby the holy city is selected by the system itself.

However, if this is done before the Founding Tech was first discovered, the problem arises.
Using either method, Hindu will be founded and Holy City set.
However, when Polytheism is first discovered, you get a popup to found any religion not founded.
Thus, I am trying to see if there is a way to solve this, so I guessing iSlotReligion is meant to mean another thing?
 
When you have the game option to pick a religion activated, then the slot means the religion at which prereq tech you choose the religion and the religion is the religion you want to found.
Unfortunately the way this is coded in the DLL causes it to show the choose religion popup that is meant for that game option whenever a tech is researched that founds a religion but that religion is already founded, regardless if the game option is activated.

So I fear it is not possible to avoid that from Python if you keep the religion founding at tech in the XML.
 
Actually I developed 1 method to "evade" the problem.

1) Save the current researching tech and current era
2) Grant the religion founding tech to player thus founding the religion
3) Remove the religion tech
4) Shift the Holy City if necessary
5) Set the researching tech back to saved tech, this is in case the current researching tech is the founding tech itself.
6) Set the era back to saved era, in case the granted founding tech brings the player to new era.

I tried out this method and it works with 3 problems
1) Because granting this way by tech, the Holy City is chosen by system, so movie is displayed at system HC rather than the one intended.
Also, global message displayed will also use the system HC name.
2) The era movie will play if founding tech brings player to new era although later on era is set back to current one.
3) There may be other First Player Benefits given by the tech, although for BTS there isn't.

However, it does solve the problem of the choose religion popup since the tech is already researched before and thus no longer grant religion.

But since there are 3 problems with this method, this is why I was hoping for a more elegant way :D
 
I have recently narrowed the founding of a religion down to a couple of functions:

Code:
def doFoundReligionPopup(iPlayer):
	# Limited Religions
	# Displays the popup to pick a religion
	# Default religion is only a place holder. 
	iDefaultReligion = gc.getInfoTypeForString("RELIGION_JUDAISM")
	popupInfo = CyPopupInfo()
	popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_FOUND_RELIGION)
	popupInfo.setData1(iDefaultReligion)
	popupInfo.addPopup(iPlayer)

...or you can do it the traditional way:

Code:
pPlayer.foundReligion(iNewReligion, iSlot, True)
 
Top Bottom