I'm currently in the process of programming a Civilization's UA where they are able to purchase Military Units with Faith at the beginning of the game. Pretty much it takes the Holy Warriors and Religious Fervor Beliefs and merges them into one. I tried to re-purpose an Lua code I've been using from a few of PHXHRC's mods to give the belief to the Civ in question, but it doesn't seem to work.
Here's the code in question:
It was perhaps naive of me to think that this code alone would be able to achieve the results I desired, but I just wanted to check and make sure.
Here's the code in question:
Code:
function FosterBeliefOpener(player)
print("Thanks to JFD for this script")
for playerID, player in pairs(Players) do
local player = Players[playerID];
if player:GetCivilizationType() == GameInfoTypes["CIVILIZATION_AMERICA"] then
if not player:HasBelief(GameInfoTypes["BELIEF_MADAME_FOSTER_UA"]) then
--player:SetBelief(GameInfoTypes["BELIEF_ANCESTOR_WORSHIP"], true)
player:SetNumFreeBeliefs(1)
player:SetNumFreeBeliefs(0)
player:SetHasBelief(GameInfoTypes["BELIEF_MADAME_FOSTER_UA"], true)
end
end
end
end
Events.SequenceGameInitComplete.Add(FosterBeliefOpener)