Formulapower
Warlord
- Joined
- Nov 5, 2007
- Messages
- 148
I am new to Lua and I need some help getting specific civs to start with a specific religion for my medieval mod. Does anyone have some code I can look at to figure this our...like I said lua is not what I do so I need as much help as possible.
Here is how far I have gotten but I can't get it to work in the game
Here is how far I have gotten but I can't get it to work in the game
Spoiler :
function SetupReligions()
local ePlayer;
local eReligion;
local eBelief1;
local eBelief2;
local eBelief3;
local eBelief4;
local eBelief5;
local capital;
local iCrusadePlayer;
local pCrusadePlot;
-- First pass to set religions
for iPlayer = 4, do
local pPlayer = Players[iPlayer];
if (pPlayer:IsAlive()) then
local civType = pPlayer:GetCivilizationType();
capital = pPlayer:GetCapitalCity();
if (capital ~= nil) then
if (civType == GameInfo.Civilizations["CIVILIZATION_EGYPT"].ID) then
eReligion = GameInfoTypes["RELIGION_CHRISTIANITY"];
eBelief1 = GameInfoTypes["BELIEF_PAPAL_PRIMACY"];
eBelief2 = GameInfoTypes["BELIEF_HOLY_WARRIORS"];
eBelief3 = GameInfoTypes["BELIEF_CATHEDRALS"];
eBelief4 = GameInfoTypes["BELIEF_INDULGENCES"];
eBelief5 = GameInfoTypes["BELIEF_HOLY_ORDER"];
Game.FoundPantheon(iPlayer, eBelief1);
Game.FoundReligion(iPlayer, eReligion, nil, eBelief2, eBelief3, -1, -1, capital);
Game.EnhanceReligion(iPlayer, eReligion, eBelief4, eBelief5);
iCrusadePlayer = iPlayer;
pCrusadePlot = capital
lot();
end
end
end
end
end
local ePlayer;
local eReligion;
local eBelief1;
local eBelief2;
local eBelief3;
local eBelief4;
local eBelief5;
local capital;
local iCrusadePlayer;
local pCrusadePlot;
-- First pass to set religions
for iPlayer = 4, do
local pPlayer = Players[iPlayer];
if (pPlayer:IsAlive()) then
local civType = pPlayer:GetCivilizationType();
capital = pPlayer:GetCapitalCity();
if (capital ~= nil) then
if (civType == GameInfo.Civilizations["CIVILIZATION_EGYPT"].ID) then
eReligion = GameInfoTypes["RELIGION_CHRISTIANITY"];
eBelief1 = GameInfoTypes["BELIEF_PAPAL_PRIMACY"];
eBelief2 = GameInfoTypes["BELIEF_HOLY_WARRIORS"];
eBelief3 = GameInfoTypes["BELIEF_CATHEDRALS"];
eBelief4 = GameInfoTypes["BELIEF_INDULGENCES"];
eBelief5 = GameInfoTypes["BELIEF_HOLY_ORDER"];
Game.FoundPantheon(iPlayer, eBelief1);
Game.FoundReligion(iPlayer, eReligion, nil, eBelief2, eBelief3, -1, -1, capital);
Game.EnhanceReligion(iPlayer, eReligion, eBelief4, eBelief5);
iCrusadePlayer = iPlayer;
pCrusadePlot = capital

end
end
end
end
end