--This function gets called approximately when the player immediately starts the game.
--It takes advantage of the capital being founded on the initial turn to allow setting up
--the civ when a city exists. Certain things like spawning explorers and other units will
--occur after this method.
function LGF_InitialTurn(player, x, y)
local pPlayer = Players[player]
if pPlayer == nil then
return
end
--civilisationID is the modded sponsor's ID declared elsewhere in the code
if pPlayer:GetCivilizationType() == civilisationID then
local pCapital = pPlayer:GetCapitalCity()
if pCapital == nil then
return
end
if pCapital:GetX() == x and pCapital:GetY() == y then
--Call functions you want called on the initial turn only
LGF_AwardAffinityTechProgress(player)
end
end
end
--This function iterates through the table entries of Technology_Affinities
--and awards each technology in it a set percentage bonus of progress
function LGF_AwardAffinityTechProgress(player)
local pPlayer = Players[player]
local pTeam = Teams[pPlayer:GetTeam()]
local teamTechs = pTeam:GetTeamTechs()
local percent = 25 --Use your percentage value here
for affinityTech in GameInfo.Technology_Affinities() do
local techType = affinityTech.TechType
local tech = GameInfo.Technologies[techType]
teamTechs:ChangeResearchProgressPercent(tech.ID, percent, player);
end
end
GameEvents.PlayerCityFounded.Add(LGF_InitialTurn)