Ok... question in title...
I wanted to add progress towards X Great Person for a city-state that is both an ally and follows the religion of a player. BUT the lua code doesn't seem to work, as the CS never gets the unit... I know the conditions are functional because of a print thing, but I can't check to see the City View and see if it has progress because not even spies can do that with CS (for some reason). I also tried adding a dummy building to them, that granted the GP points, it doesn't seem to work either.
Any ideas?
I wanted to add progress towards X Great Person for a city-state that is both an ally and follows the religion of a player. BUT the lua code doesn't seem to work, as the CS never gets the unit... I know the conditions are functional because of a print thing, but I can't check to see the City View and see if it has progress because not even spies can do that with CS (for some reason). I also tried adding a dummy building to them, that granted the GP points, it doesn't seem to work either.
Code:
local tSpecialist = GameInfo.Specialists.SPECIALIST_MUSICIAN.ID;
local tBonus = 6000;
function TiwanakuInfluence(iPlayer)
local pPlayer = Players[iPlayer];
if pPlayer:IsAlive() then
for _, tPlayer in pairs(Players) do
if (tPlayer:GetCivilizationType() == GameInfoTypes["CIVILIZATION_TIWANAKU"]) then
if (tPlayer:HasCreatedReligion()) then
local eReligion = tPlayer:GetReligionCreatedByPlayer();
if (pPlayer:GetMinorCivFriendshipLevelWithMajor(tPlayer:GetID()) == 2) then
for tCity in pPlayer:Cities() do
if (tCity:GetReligiousMajority() == eReligion) then
tCity:ChangeSpecialistGreatPersonProgressTimes100(tSpecialist, tBonus)
print ("It works?!");
end
end
end
end
end
end
end
end
Any ideas?