I'm adding dynamic civ names into my mod. I managed to compile the DLL properly, but now I get a syntax error I can't fix. The line in red gives the syntax error when the game loads but for me it seems correct:
I've just started writing the python code so it might be kinda buggy.
I appreciate all help spotting the error.
Spoiler :
Code:
def newNameCiv(self, pPlayer):
curDesc = pPlayer.getCivilizationDescription(0)
curShort = pPlayer.getCivilizationShortDescription(0)
curAdj = pPlayer.getCivilizationAdjective(0)
newName = curDesc
newShort = curShort
newAdj = curAdj
stateReligion = pPlayer.getStateReligion()
if stateReligion == gc.getInfoTypeForString("RELIGION_COMMUNISM"):
if (localText.getText("TXT_KEY_DCN_RUSSIAN_MATCH", ()) in curAdj):
newName = "Soviet Union"
newShort = "Soviet Union"
newAdj = "Soviet"
sSocRep = localText.getText("TXT_KEY_DCN_SOC_REP", ())
sPeoplesRep = localText.getText("TXT_KEY_DCN_PEOPLES_REP", ())
[COLOR="Red"]elif (pPlayer.getCivics(gc.getInfoTypeForString("CIVICOPTION_LEGAL")) == gc.getInfoTypeForString("CIVIC_VASSALAGE")):[/COLOR]
if (50 > game.getSorenRandNum(100,'Bob')):
newName = sSocRep + curShort
else :
newName = sPeoplesRep + curShort
else:
newName = sPeoplesRep + curShort
elif stateReligion == gc.getInfoTypeForString("RELIGION_DEMOCRACY"):
if (pPlayer.getNumCities() == 1):
newName = curAdj + localText.getText("TXT_KEY_DCN_REPUBLIC_OF", ()) + CvUtil.convertToStr(pPlayer.getCapitalCity().getName())
elif (50 > game.getSorenRandNum(100,'Bob')):
newName = localText.getText("TXT_KEY_DCN_REPUBLIC", ())%(curAdj)
else:
newName = localText.getText("TXT_KEY_DCN_THE_REPUBLIC_OF", ()) + curShort
if (pPlayer.isCivic(gc.getInfoTypeForString("CIVIC_FREE_SPEACH")) and pPlayer.isCivic(gc.getInfoTypeForString("CIVIC_EMANCIPATION"))):
newName = localText.getText("TXT_KEY_DCN_FREE", ()) + ' ' + newName
return [newName, newShort, newAdj]
I appreciate all help spotting the error.