I been trying to write this Lua code for my upcoming mod's UA, but as a person who doesn't understand Lua or programming, it's pretty confusing to do. And since there's two parts of this code, it makes even more confusing.
"For each City State are allied with, you get +2 Culture and +1 Happiness. During Golden Ages, City State influence does not degrade and you get +4% more culture for each City State you're allied with."
I've been using this code here from this thread, but I'm wondering if Lua objects like GetMinorCivCultureFriendshipBonus go here or somewhere else. How would I define the number of culture and happiness gained?
And for the second part of the code, I looked here for some help on Golden Ages and apparently the parameters for GoldenAgeStarted are unknown. Also, I guess for that part of the code, I would need a dummy policy to have zero degradation during Golden Ages.
"For each City State are allied with, you get +2 Culture and +1 Happiness. During Golden Ages, City State influence does not degrade and you get +4% more culture for each City State you're allied with."
I've been using this code here from this thread, but I'm wondering if Lua objects like GetMinorCivCultureFriendshipBonus go here or somewhere else. How would I define the number of culture and happiness gained?
Code:
function ExtraCultureAndHappinessPerCS(iPlayer)
CSAllyCount = 0;
local pPlayer = Players[iPlayer]
for i, player in pairs(Players) do
if player:IsAlive() then
if player:IsMinorCiv() then
if player:GetMinorCivFriendshipLevelWithMajor(iPlayer) == integer then
-- iPlayer is ID number of Major Civ your are checking. Integer, you have to check which number is Allied, because I've never used it (i assume it will be 2)
print(player:GetName())
CSAllyCount = CSAllyCount + 1;
And for the second part of the code, I looked here for some help on Golden Ages and apparently the parameters for GoldenAgeStarted are unknown. Also, I guess for that part of the code, I would need a dummy policy to have zero degradation during Golden Ages.