:thinking emoji:
Chieftain
- Joined
- Apr 4, 2018
- Messages
- 4
I've been trying to give my custom civilization (the Selk'nam) a simple trait: Aesthetics is available from the Ancient era. To do this, I edited the trait from HoopThrower's Chile-Allende civilization (which makes all policy branches available from the ancient era) to just make Aesthetics available. However, despite fixing all the syntax errors, adding the file as a UIGameAddin and checking both the database.log and the lua.log, I can't seem to make it have any effect. Am I missing something, or is there something I need to fix?
Here's the code:
Build [/BUILD]
Any help would be much appreciated.
Here's the code:
Code:
include("Strict.lua")
local iSelknamCiv = GameInfoTypes.CIVILIZATION_SELKNAM
local tPolicyBranchEraConditions = {
[GameInfoTypes.POLICY_BRANCH_AESTHETICS] = { DefaultRequirement=GameInfoTypes.ERA_CLASSICAL, SelknamRequirement=GameInfoTypes.ERA_ANCIENT }
}
function SelknamPolicyBranchAffects(iPlayer, iPolicyBranch)
if tPolicyBranchEraConditions[iPolicyBranch] then
--print("SelknamPolicyBranchAffects fired for values iPlayer " .. iPlayer .. ", iPolicyBranch " .. iPolicyBranch)
local pPlayer = Players[iPlayer]
local iCurrentEra = pPlayer:GetCurrentEra()
if pPlayer:GetCivilizationType() == iSelknamCiv then
return (iCurrentEra >= tPolicyBranchEraConditions[iPolicyBranch]["SelknamRequirement"])
else
return (iCurrentEra >= tPolicyBranchEraConditions[iPolicyBranch]["DefaultRequirement"])
end
end
return true
end
GameEvents.PlayerCanAdoptPolicyBranch.Add(SelknamPolicyBranchAffects)
print(" lua loaded to the end")
Build [/BUILD]
Any help would be much appreciated.