sman1975
Emperor
Hello,
About finished with my 100 Years War mod. Trying to create a religion with a civ that has 7 cities, all population = 1. After much research, I've combined some scripts I found that seems like it should work:
The script executes, and all the print statements show up in the Lua.log file. Only problem is it doesn't seem to work. The cities change to that civ's pantheon belief and the lightening bolt is visible on the city banner on the map. Unfortunately, none of the cities show any indication the "ConvertPercentFollowers" command worked. I've tried the AdoptReligionFully command, but noticed no different results.
How hard is it to create a civ, create a religion for that civ on turn zero, then convert all those cities to the state religion? What I'm I missing?
Thanks!!!
sman
About finished with my 100 Years War mod. Trying to create a religion with a civ that has 7 cities, all population = 1. After much research, I've combined some scripts I found that seems like it should work:
Code:
function FollowProtestantism()
if Game.GetElapsedGameTurns() == 0 then
print("Inside FollowProtestantism function...");
for iPlayer=0, GameDefines.MAX_CIV_PLAYERS - 1 do
local pPlayer = Players[iPlayer];
if pPlayer:IsEverAlive() then
print("Player: ", pPlayer:GetName() );
-- Enumerate cities
for pCity in pPlayer:Cities() do
-- City exists and has the proper name?
-- Convert followers: English Influence/Catholocism=2, French Influence/Orthodoxy=12, Templar Influence/Protestantism=13
if pCity ~= nil and pCity:GetName() == "Chalamera" then
pCity:ConvertPercentFollowers(13, -1, 100);
print(pCity:GetName(), "...is getting Templar followers...");
elseif pCity ~= nil and pCity:GetName() == "La Neuville" then
pCity:ConvertPercentFollowers(13, -1, 100);
print(pCity:GetName(), "...is getting Templar followers...");
elseif pCity ~= nil and pCity:GetName() == "Marmoutier" then
pCity:ConvertPercentFollowers(13, -1, 100);
print(pCity:GetName(), "...is getting Templar followers...");
elseif pCity ~= nil and pCity:GetName() == "Schopfheim" then
pCity:ConvertPercentFollowers(13, -1, 100);
print(pCity:GetName(), "...is getting Templar followers...");
elseif pCity ~= nil and pCity:GetName() == "Laon" then
pCity:ConvertPercentFollowers(13, -1, 100);
print(pCity:GetName(), "...is getting Templar followers...");
elseif pCity ~= nil and pCity:GetName() == "Temple Dinsley" then
pCity:ConvertPercentFollowers(13, -1, 100);
print(pCity:GetName(), "...is getting Templar followers...");
elseif pCity ~= nil and pCity:GetName() == "Horsteberg" then
pCity:ConvertPercentFollowers(13, -1, 100);
print(pCity:GetName(), "...is getting Templar followers...");
return pCity
end
end
end
end
end
end
Events.SequenceGameInitComplete.Add(FollowProtestantism)
The script executes, and all the print statements show up in the Lua.log file. Only problem is it doesn't seem to work. The cities change to that civ's pantheon belief and the lightening bolt is visible on the city banner on the map. Unfortunately, none of the cities show any indication the "ConvertPercentFollowers" command worked. I've tried the AdoptReligionFully command, but noticed no different results.
How hard is it to create a civ, create a religion for that civ on turn zero, then convert all those cities to the state religion? What I'm I missing?
Thanks!!!
sman