I want to share my code with community and i have one question.
This code correct work and allow you to only once choose your civic from one civicoption (You can only choose once your affinity, choose wise between Harmony, Purity and Supremacy).
Solved idea from
THIS post.
CvGameUtils.py:
Code:
def cannotDoCivic(self,argsList):
ePlayer = argsList[0]
eCivic = argsList[1]
pPlayer = gc.getPlayer(ePlayer)
if(pPlayer.isCivic(gc.getInfoTypeForString("CIVIC_HARMONY")) == true):
if(str(gc.getInfoTypeForString("CIVIC_NO_AFFINITY")) == str(eCivic) or str(gc.getInfoTypeForString("CIVIC_PURITY")) == str(eCivic) or str(gc.getInfoTypeForString("CIVIC_SUPREMACY")) == str(eCivic)):
return True
elif(pPlayer.isCivic(gc.getInfoTypeForString("CIVIC_PURITY")) == true):
if(str(gc.getInfoTypeForString("CIVIC_NO_AFFINITY")) == str(eCivic) or str(gc.getInfoTypeForString("CIVIC_HARMONY")) == str(eCivic) or str(gc.getInfoTypeForString("CIVIC_SUPREMACY")) == str(eCivic)):
return True
elif(pPlayer.isCivic(gc.getInfoTypeForString("CIVIC_SUPREMACY")) == true):
if(str(gc.getInfoTypeForString("CIVIC_NO_AFFINITY")) == str(eCivic) or str(gc.getInfoTypeForString("CIVIC_HARMONY")) == str(eCivic) or str(gc.getInfoTypeForString("CIVIC_PURITY")) == str(eCivic)):
return True
return False
This demand,
PythonCallbackDefines.py:
Code:
<Define>
<DefineName>USE_CANNOT_DO_CIVIC_CALLBACK</DefineName>
<iDefineIntVal>1</iDefineIntVal>
</Define>
QUESTIONS:
1) Where is event, function, method or whatever, which trigger when i switch to some civic ?
2) I want to change cityart when some player switch to some civic,
example:
ARABIA, (Saladin) have
ARTSTYLE_ARABIA,
if Saladin switch to CIVIC_HARMONY, i want to ARABIA have
ARTSTYLE_HARMONY,
if switch to CIVIC_PURITY it will have
ARTSTYLE_PURITY,
if switch to CIVIC_SUPREMACY it will have
ARTSTYLE_SUPREMACY.
here is some code improvisation / prototype but of course its not work and give a error (and if this code successful up and running, i want to put it in place from
question 1)):
Code:
def cannotDoCivic(self,argsList):
ePlayer = argsList[0]
eCivic = argsList[1]
pPlayer = gc.getPlayer(ePlayer)
if(pPlayer.isCivic(gc.getInfoTypeForString("CIVIC_HEREDITARY_RULE")) == true):
(loopCity, iter) = pPlayer.firstCity(false)
while(loopCity):
loopCity.setArtStyleType(0)
(loopCity, iter) = pPlayer.nextCity(iter, false)
Do i must change artstyle of every city from player in this case ARABIA (Saladin) or it only enough to change civilization artstyle in game.