About founding religion

Dertuek

Chieftain
Joined
Aug 5, 2008
Messages
55
Location
France
Hello,

I had a problem today with religion.

The situation:
As roman player, I found roman religion in Lugdunum. Due to CvEventManager, the holy city is immediatly moved to my capital, Roma. (I don't know why this feature exists but why not).
Because I can't convert to roman religion before the beginning of my turn, Roma gets 2 :mad: due to non state religion and becomes unhappy. The "emigrant spawn" is triggered, I lose 2 pop in Roma, its culture shrinks and my capital is cut off from the rest of my empire. WTF, I had no time to convert.

I don't know if it can be considered as a bug but I angrily modified the program :o

In file PAE_City.py, in function doEmigrantSpawn, I added (not the first/last lines):
Code:
    iCityUnhappy = pCity.unhappyLevel(0) - pCity.happyLevel()
    
    # Unhappiness per non state religion
    iHappNonState = pPlayer.getNonStateReligionHappiness()
    if iHappNonState < 0:
        iStateReligion = pPlayer.getStateReligion()
        iCurrentTurn = gc.getGame().getElapsedGameTurns()
        for iRel in range(gc.getNumReligionInfos()):
            if pCity.isHasReligion(iRel):
                if gc.getGame().getReligionGameTurnFounded(iRel) == iCurrentTurn and \
                   iRel != iStateReligion and \
                   pPlayer.hasHolyCity(iRel):
                    # The player just has founded the religion and had no time to convert to it
                    #  => Don't count the malus just this turn
                    iCityUnhappy += iHappNonState

    iCityUnhealthy = pCity.badHealth(False) - pCity.goodHealth()

I doesn't count the happiness malus the turn the religion is founded (for the "emigrant spawn" event only).

Question about the transfer feature in CvEventManager / onReligionFounded.

1/ Religion is removed from the holy city (city 1)
2/ The capital becomes the new holy city
3/ Religion is given back to city 1

Why give back the religion after removed it? I don't understand. The previous holy city must keep the religion or not?
 
:) that was unlucky... but ok, I will implement your code here, because why not! And again thank you for the codings, it saves me so much time instead of just talking about ...

onReligionFounded:
I still let the religion in the city of BTS founding because
1) the BTS feature and text notifying: everybody would look at the city and wonder why there is no founded religion
2) why not: there it was founded but the center of the religion has to be the capital due to the government. so people in the origin city still believe in that new religion.
 
I agree it was total bad luck, especially my capital isolated from the empire ... and for a long time. I lost a lot of culture compared to my neighbour.
 
Top Bottom