Establishing a religion in turn zero, then ensuring all cities immediately convert - HOW????

sman1975

Emperor
Joined
Aug 27, 2016
Messages
1,375
Location
Dallas, TX
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:

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
 
Because same thing with IGE, you can't force cities to convert to the majority with only 1 follower since Lua can't overwrite any religious data. They'll immediately have a pantheon.. You can't force followers and the sad part is that you can't spawn missionaries(Unless you use the IGE workaround).
 
Thanks, Engineer - I think I understand that, at least concerning ConvertPercentFollowers. Does that same logic apply to AdoptReligionFully? From what I've seen of the results, it behaves exactly the same way. Wasn't sure if there were/are any tricks to force a civ to start off with all its cities following the state religion.
 
Back
Top Bottom