A question of possibility.

Russypoo

Chieftain
Joined
Jun 16, 2020
Messages
9
I like playing Civ and the mods I currently use allow me to play the games I enjoy playing. There is just one problem the AI while able to fight me to a stand still or even kill me at times just starts to fizzle out around turn 300 and just falls further and further behind. Is there a way to unlock the entire rationalism tree at a certain turn for all AI players. I avoid rationalism to give them a better chance and that makes them competitive longer but they are unable to keep pace eventually. Upping the difficulty just makes then more overpowered at the start where I lose games. I want to help their late game. I don’t even know if something like this is possible I’ve been looking for a mod to do something like this but I’ve come up empty.
 
Untested, try

Code:
local iGrantTurn = 300

local freeBranches = {GameInfoTypes.POLICY_BRANCH_RATIONALISM}
local freePolicies = {GameInfoTypes.POLICY_SECULARISM, GameInfoTypes.POLICY_HUMANISM, GameInfoTypes.POLICY_FREE_THOUGHT, GameInfoTypes.POLICY_SOVEREIGNTY, GameInfoTypes.POLICY_SCIENTIFIC_REVOLUTION}

function OnPlayerDoTurn(iPlayer)
  if (Game.GetGameTurn() == iGrantTurn) then
    local pPlayer = Players[iPlayer]
   
    if (pPlayer:IsAlive() and pPlayer:IsMajorCiv() and not pPlayer:IsHuman()) then
      for _, branch in ipairs(freeBranches) do   
        if (not pPlayer:IsPolicyBranchUnlocked(branch) then
          pPlayer:SetPolicyBranchUnlocked(branch, true)
        end
      end

      for _, policy in ipairs(freePolicies) do   
        if (not pPlayer:HasPolicy(policy)) then
          pPlayer:SetHasPolicy(policy, true)
        end
      end
    end
  end
end
GameEvents.PlayerDoTurn.Add(OnPlayerDoTurn)

You can put the code in the "My - Changes" mod (see link in my sig)
 
Code:
if (not pPlayer:IsPolicyBranchUnlocked(branch) then
Needs to be
Code:
if (not pPlayer:IsPolicyBranchUnlocked(branch)) then
There was a missing closer ")" to match up to the opening "(" before "not".

Would the code not also need the NumFreePolicies gimick/method as well ? My memory is murky on whether or not that hackaround is needed for AI players in order to not bork their social policy costs.
 
Last edited:
Last edited:
Top Bottom