Craig_Sutter
Deity
If you are using this code, I have refined it a bit to start during the opening sequence... at follows:
And to give an existing religion to a city...
Hope this helps.
Code:
-- Find Paris player and found Christianity in their city, returning the city
function EstablishChristian()
if Game.GetElapsedGameTurns() == 0 then
function CreateChristianHolyCity(pCity, religion, pantheonBelief, founderBelief, followerBelief, followerBelief2, enhancerBelief)
local iPlayer = pCity:GetOwner()
local iReligion = GameInfoTypes[religion]
-- Optional extra beliefs
local iBelief4 = followerBelief2 and GameInfoTypes[followerBelief2] or -1
local iBelief5 = enhancerBelief and GameInfoTypes[enhancerBelief] or -1
Game.FoundPantheon(iPlayer, GameInfoTypes[pantheonBelief])
Game.FoundReligion(iPlayer, iReligion, nil, GameInfoTypes[founderBelief], GameInfoTypes[followerBelief], -1, -1, pCity)
Game.EnhanceReligion(iPlayer, iReligion, GameInfoTypes[followerBelief2], GameInfoTypes[enhancerBelief]);
end
function FoundChristianity()
for iPlayer=0, GameDefines.MAX_CIV_PLAYERS - 1 do
local pPlayer = Players[iPlayer]
if (pPlayer:IsEverAlive()) then
for pCity in pPlayer:Cities() do
-- City exists and has the proper name?
if pCity ~= nil and pCity:GetName() == "Paris" then
CreateChristianHolyCity(pCity, "RELIGION_CHRISTIANITY", "BELIEF_GOD_KING",
"BELIEF_PAPAL_PRIMACY", "BELIEF_CATHEDRALS", "BELIEF_MOSQUES", "BELIEF_RELIGIOUS_TEXTS");
print ("okay, Paris is the Catholic holy city")
return pCity
end
end
end
end
end
local pChristianPlot = FoundChristianity():Plot()
end
end
Events.SequenceGameInitComplete.Add(EstablishChristian)
And to give an existing religion to a city...
Code:
-- Enumerate Playable Civ Cities with Christianity
function FollowChristianityA()
if Game.GetElapsedGameTurns() == 0 then
for iPlayer=0, GameDefines.MAX_CIV_PLAYERS - 1 do
local pPlayer = Players[iPlayer];
if pPlayer:IsEverAlive() then
-- Enumerate cities
for pCity in pPlayer:Cities() do
-- City exists and has the proper name?
if pCity ~= nil and pCity:GetName() == "Aachen" then
pCity:ConvertPercentFollowers(2, -1, 75);
print(pCity:GetName(), "...is getting Christian followers...");
return pCity
end
end
end
end
end
end
Events.SequenceGameInitComplete.Add(FollowChristianityA)
Hope this helps.