Starrynite120
Prince
- Joined
- Jul 15, 2015
- Messages
- 472
As the title says, I'm trying to use PlayerAdoptPolicyBranch but its not working. I'm not sure why. This is what I've got for code, and I got no errors on Firetuner
I did have this working until I changed PlayerAdoptPolicy to PlayerAdoptPolicyBranch.
Code:
function OnPolicyAdopted (playerID, policyID)
local policyInfo = GameInfo.Policies["POLICY_PROSPERITY_1"]
local virtueID = policyInfo.ID
local Player = Players[playerID];
local City = Player:GetCapitalCity();
local bonus = (City:GetPopulation() + 2);
if (policyID == virtueID) then
City:SetPopulation(bonus);
end
end
GameEvents.PlayerAdoptPolicyBranch.Add(OnPolicyAdopted);
I did have this working until I changed PlayerAdoptPolicy to PlayerAdoptPolicyBranch.