TheMarshmallowBear
Benelovent Chieftain of the Ursu Kingdom
Helo, I have a relatively simple LUA script that works fine but it presents few problems.
THe script is as follows
This script works fine (there's 6 additional copies of this one for each religion)
The two issues are as follows :
1. All of the religions should have a "Bonus" belief, but I have no idea how to implement that into the religion (if it's possible). If not I know of a relatively simple workaround (move the Bonus belief and merge it with the Follower ones)
2. Because of the way religion works in my game, I have prevented any nation from founding Pantheons by increasing its cost to 1,000,000. However, because the script calls for founding an actual pantheon it means that any civ with a religion will recieve a deficit of -999,995 because of this. But when I tried to skip the Pantheon foudning and add a Pantheon belief when founding the religion it didn't work (even if its possible to do it in the game if you get a Prophet before a pantheon)
Anybody knows of any simple workarounds or changes I could do?
THe script is as follows
Code:
-- Find Berlin player and found Christianity in their city, returning the city
function EstablishCatholicism()
if Game.GetElapsedGameTurns() == 0 then
function CreateCatholicHolyCity(pCity, religion, pantheonBelief, founderBelief, followerBelief, followerBelief2, enhancerBelief)
local iPlayer = pCity:GetOwner()
local iReligion = GameInfoTypes[religion]
-- Optional extra beliefs
local iBelief4 = followerBelief2 and GameInfoTypes[followerBelief2] or -1
local iBelief5 = enhancerBelief and GameInfoTypes[enhancerBelief] or -1
Game.FoundPantheon(iPlayer, GameInfoTypes[pantheonBelief])
Game.FoundReligion(iPlayer, iReligion, nil, GameInfoTypes[founderBelief], GameInfoTypes[followerBelief], -1, -1, pCity)
Game.EnhanceReligion(iPlayer, iReligion, GameInfoTypes[followerBelief2], GameInfoTypes[enhancerBelief]);
end
function FoundCatholicism()
for iPlayer=0, GameDefines.MAX_CIV_PLAYERS - 1 do
local pPlayer = Players[iPlayer]
if (pPlayer:IsEverAlive()) then
for pCity in pPlayer:Cities() do
-- City exists and has the proper name?
if pCity ~= nil and pCity:GetName() == "Vatican City" then
CreateCatholicHolyCity(pCity, "RELIGION_CHRISTIANITY", "BELIEF_CATHOLIC_PANTHEON",
"BELIEF_CATHOLIC_FOUNDER", "BELIEF_CATHOLIC_FOLLOWER_1", "BELIEF_CATHOLIC_FOLLOWER_2", "BELIEF_CATHOLIC_ENHANCER");
print ("okay, Vatican is the Catholic holy city")
return pCity
end
end
end
end
end
local pCatholicPlot = FoundCatholicism():Plot()
end
end
Events.SequenceGameInitComplete.Add(EstablishCatholicism)
This script works fine (there's 6 additional copies of this one for each religion)
The two issues are as follows :
1. All of the religions should have a "Bonus" belief, but I have no idea how to implement that into the religion (if it's possible). If not I know of a relatively simple workaround (move the Bonus belief and merge it with the Follower ones)
2. Because of the way religion works in my game, I have prevented any nation from founding Pantheons by increasing its cost to 1,000,000. However, because the script calls for founding an actual pantheon it means that any civ with a religion will recieve a deficit of -999,995 because of this. But when I tried to skip the Pantheon foudning and add a Pantheon belief when founding the religion it didn't work (even if its possible to do it in the game if you get a Prophet before a pantheon)
Anybody knows of any simple workarounds or changes I could do?