I am looking at the lua console at FireTuner.
local player = Players[playerId] -- as usual in an event handler
print(GameInfoTypes["CIVILIZATION_MY_SPONSOR"]) -- outputs 15
print(player:GetCivilizationType()) -- also outputs 15.
print(tostring(GameInfoTypes["CIVILIZATION_MY_SPONSOR"] == player:GetCivlizationType())) -- outputs false. Doesn't make sense.
But (player:GetCivilizationType() == GameInfoTypes["CIVILIZATION_MY_SPONSOR"]) evaluates to false? Why? Why is 15 not equal to 15?
What I want to do in a lua "event handler" is to check whether the current player's civilization is of a particular faction. If that's true, then I'll award that player something. What am I doing wrong?
local player = Players[playerId] -- as usual in an event handler
print(GameInfoTypes["CIVILIZATION_MY_SPONSOR"]) -- outputs 15
print(player:GetCivilizationType()) -- also outputs 15.
print(tostring(GameInfoTypes["CIVILIZATION_MY_SPONSOR"] == player:GetCivlizationType())) -- outputs false. Doesn't make sense.
But (player:GetCivilizationType() == GameInfoTypes["CIVILIZATION_MY_SPONSOR"]) evaluates to false? Why? Why is 15 not equal to 15?
What I want to do in a lua "event handler" is to check whether the current player's civilization is of a particular faction. If that's true, then I'll award that player something. What am I doing wrong?