Hello fellow modders! Could you help me to make a (multiple?) civic changer function that will activate during events. The objective is to implement events such as fascist coup/march on the capital (granting maybe a few free units).
In fact through this process I hope to make fascism a series of events more than a "technology", an idea that is questionnable at best (even if I will not remove it from the tech list).
In addition as I reread the xml structure of CIV4EventsTriggerInfos.xml, I realised there was no way for an event to select a city controled by an other that as an certrain amount of the culture's player, the objective here should be the creation of an Irrendentist event for the nationalistic states
My last attempt for a function to change the civic
The trigger for the irredentism event
In fact through this process I hope to make fascism a series of events more than a "technology", an idea that is questionnable at best (even if I will not remove it from the tech list).
In addition as I reread the xml structure of CIV4EventsTriggerInfos.xml, I realised there was no way for an event to select a city controled by an other that as an certrain amount of the culture's player, the objective here should be the creation of an Irrendentist event for the nationalistic states
My last attempt for a function to change the civic
Code:
def applyDictatorRise(argsList):
iEvent = argsList[1]
kTriggeredData = argsList[0]
trigger = gc.getEventTriggerInfo(kTriggeredData.eTrigger)
player = gc.getPlayer(kTriggeredData.ePlayer)
iCivicOption = CvUtil.findInfoTypeNum(gc.getCivicOptionInfo,gc.getNumCivicOptionInfos(),'CIVICOPTION_GOVERNMENT')
iCivic = CvUtil.findInfoTypeNum(gc.getCivicInfo,gc.getNumCivicInfos(),'CIVIC_POLICE_STATE')
for iPlayer:
gc.getPlayer(iPlayer).setCivics(iCivicOption, iCivic)
The trigger for the irredentism event
Code:
def canTriggerIrredentism(argsList):
pPlayer1 = gc.getPlayer
pPlayer2 = gc.getPlayer(iOwner)
iTeam1 = pPlayer1.getTeam()
iTeam2 = pPlayer2.getTeam()
owner = gc.getPlayer(iOwner)
pCity = argsList
if pCity.calculateTeamCulturePercent(iTeam1) > 20:
return true
return false