JFD
Kathigitarkh
At the moment I'm having some trouble retrieving the name of other civs. Whenever I meet another civ, it returns the active player's name - as in if I am playing as Harun al-Rashid and I meet Catherine, her name is given as Harun al-Rashid of Arabia.
Below is the code that I have. All of the functions within are working as intended, it's just that they're returning the value of the active player. I can't see what's wrong, but that doesn't mean it's not something simple.
Below is the code that I have. All of the functions within are working as intended, it's just that they're returning the value of the active player. I can't see what's wrong, but that doesn't mean it's not something simple.
Code:
function GetDiplomaticTitle()
for iPlayer=0, GameDefines.MAX_MAJOR_CIVS-1, 1 do
local iPlayer = Players[iPlayer]
if iPlayer:IsEverAlive() then
print(iPlayer:GetName())
local leaderName = iPlayer:GetName()
if not HasFormalGovernment() then
print("player has no formal government")
local ethnicGroup = GetEthnicGroup()
if HasEpithet() then
print("player has an epithet")
local epithet = GetEpithetTitle()
return Locale.ConvertTextKey("TXT_KEY_LEADER_EPITHET_OF_PEOPLE", leaderName, epithet, ethnicGroup)
else
print("player does not have an epithet")
return Locale.ConvertTextKey("TXT_KEY_LEADER_OF_PEOPLE", leaderName, ethnicGroup)
end
end
end
end
end