Sid Meier's Civilization VI

Sid Meier's Civilization VI

Cheat Menu Panel (R&F - GS)
mikeInside 29 Nov, 2019 @ 5:53am
Example code for replenishing religious charges
Rather than trying to fix the error where a duplicated religious unit won't be able to spread religion, I instead worked out how to modify the restore unit movement button to also set the charges for a religious unit to 5.

Here's the modified function in Cheat_Menu_Panel_Script.lua
feel free to modify to suit your needs!

function UnitMovementChange(playerID, unitID) local pUnit = UnitManager.GetUnit(playerID, unitID) if (pUnit ~= nil) then UnitManager.RestoreMovement(pUnit); UnitManager.RestoreUnitAttacks(pUnit); local pReligion = pUnit:GetReligion(); if (pReligion ~= nil) then local iCharge = pReligion:GetSpreadCharges(); if (iCharge < 5 and iCharge > 0) then pReligion:ChangeSpreadCharges(5 - iCharge); end end end end