Ryan F. Mercer
Whys
Goal:
I want players to select an unfounded religion after researching monument (fka: obelisk) before proceeding to monastery.
Implementation:
Ideally, I'd like to use the "choose religion" popup, but don't know how to modify it. So I created a tech for each religion with the idea of setting obelisk as the OrPreReq for each religion tech, then monastery with each religion tech as an OrPreReq. ie: monument tech => 7 religion techs => monastery tech. Turns out the game can't handle that many OrPreReqs on the monastery tech, so I removed all OrPreReqs and am doing it by modifying the "cannotResearch" python def to selectively disable and enable as needed.
I've written the code to only allow players to research one religion tech until they have all been founded, at which point, players can go straight from the obelisk tech to the monastery tech. I clear the research queue when a player is researching a religion tech that gets founded by another player.
Example:
Step 1 - can research obelisk; can not research any religion tech; can not research monastery.
Step 2 - researched obelisk; can research any unfounded religion tech; can not research any founded religion tech; can not research monastery. OR... researched obelisk; all religions founded; can not research any religion tech; can research monastery.
Step 3 - researched obelisk; researched one religion tech; can not research any other religion tech; can research monastery.
Working:
All disable and enable functionality.
Problem:
Shortly after two religions have been founded, the screen display becomes micro-jittery. A couple turns later, major pauses in interface and mouse control, followed by hard drive grinding and eventual lockup of the operating system. Upon reboot, bios and boot drive warnings. Upon second reboot, boots to the desktop.
Code:
I want players to select an unfounded religion after researching monument (fka: obelisk) before proceeding to monastery.
Implementation:
Ideally, I'd like to use the "choose religion" popup, but don't know how to modify it. So I created a tech for each religion with the idea of setting obelisk as the OrPreReq for each religion tech, then monastery with each religion tech as an OrPreReq. ie: monument tech => 7 religion techs => monastery tech. Turns out the game can't handle that many OrPreReqs on the monastery tech, so I removed all OrPreReqs and am doing it by modifying the "cannotResearch" python def to selectively disable and enable as needed.
I've written the code to only allow players to research one religion tech until they have all been founded, at which point, players can go straight from the obelisk tech to the monastery tech. I clear the research queue when a player is researching a religion tech that gets founded by another player.
Example:
Step 1 - can research obelisk; can not research any religion tech; can not research monastery.
Step 2 - researched obelisk; can research any unfounded religion tech; can not research any founded religion tech; can not research monastery. OR... researched obelisk; all religions founded; can not research any religion tech; can research monastery.
Step 3 - researched obelisk; researched one religion tech; can not research any other religion tech; can research monastery.
Working:
All disable and enable functionality.
Problem:
Shortly after two religions have been founded, the screen display becomes micro-jittery. A couple turns later, major pauses in interface and mouse control, followed by hard drive grinding and eventual lockup of the operating system. Upon reboot, bios and boot drive warnings. Upon second reboot, boots to the desktop.
Code:
Code:
def cannotResearch(self,argsList):
ePlayer = argsList[0]
eTech = argsList[1]
bTrade = argsList[2]
pPlayer = gc.getPlayer( ePlayer )
pTeam = gc.getTeam( pPlayer.getTeam() )
bHasObelisk = pTeam.isHasTech( gc.getInfoTypeForString('TECH_OBELISK'))
bHasBuddhism = pTeam.isHasTech( gc.getInfoTypeForString('TECH_BUDDHISM'))
bHasHinduism = pTeam.isHasTech( gc.getInfoTypeForString('TECH_HINDUISM'))
bHasJudaism = pTeam.isHasTech( gc.getInfoTypeForString('TECH_JUDAISM'))
bHasConfucianism = pTeam.isHasTech( gc.getInfoTypeForString('TECH_CONFUCIANISM'))
bHasToaism = pTeam.isHasTech( gc.getInfoTypeForString('TECH_TAOISM'))
bHasChristianity = pTeam.isHasTech( gc.getInfoTypeForString('TECH_CHRISTIANITY'))
bHasIslam = pTeam.isHasTech( gc.getInfoTypeForString('TECH_ISLAM'))
bReligious = False
if(bHasBuddhism or bHasHinduism or bHasJudaism or bHasConfucianism or bHasToaism or bHasChristianity or bHasIslam):
bReligious = True
bBuddhism = gc.getGame().isReligionFounded( gc.getInfoTypeForString('RELIGION_BUDDHISM'))
bHinduism = gc.getGame().isReligionFounded( gc.getInfoTypeForString('RELIGION_HINDUISM'))
bJudaism = gc.getGame().isReligionFounded( gc.getInfoTypeForString('RELIGION_JUDAISM'))
bConfucianism = gc.getGame().isReligionFounded( gc.getInfoTypeForString('RELIGION_CONFUCIANISM'))
bToaism = gc.getGame().isReligionFounded( gc.getInfoTypeForString('RELIGION_TAOISM'))
bChristianity = gc.getGame().isReligionFounded( gc.getInfoTypeForString('RELIGION_CHRISTIANITY'))
bIslam = gc.getGame().isReligionFounded( gc.getInfoTypeForString('RELIGION_ISLAM'))
bFaithFull = False
if(bBuddhism and bHinduism and bJudaism and bConfucianism and bToaism and bChristianity and bIslam):
bFaithFull = True
if(bBuddhism and pPlayer.isResearchingTech( gc.getInfoTypeForString('TECH_BUDDHISM'))):
pPlayer.clearResearchQueue()
if(bHinduism and pPlayer.isResearchingTech( gc.getInfoTypeForString('TECH_HINDUISM'))):
pPlayer.clearResearchQueue()
if(bJudaism and pPlayer.isResearchingTech( gc.getInfoTypeForString('TECH_JUDAISM'))):
pPlayer.clearResearchQueue()
if(bConfucianism and pPlayer.isResearchingTech( gc.getInfoTypeForString('TECH_CONFUCIANISM'))):
pPlayer.clearResearchQueue()
if(bToaism and pPlayer.isResearchingTech( gc.getInfoTypeForString('TECH_TAOISM'))):
pPlayer.clearResearchQueue()
if(bChristianity and pPlayer.isResearchingTech( gc.getInfoTypeForString('TECH_CHRISTIANITY'))):
pPlayer.clearResearchQueue()
if(bIslam and pPlayer.isResearchingTech( gc.getInfoTypeForString('TECH_ISLAM'))):
pPlayer.clearResearchQueue()
if(eTech == gc.getInfoTypeForString('TECH_BUDDHISM')):
if(not bHasObelisk or bReligious):
return True
else:
return bBuddhism
if(eTech == gc.getInfoTypeForString('TECH_HINDUISM')):
if(not bHasObelisk or bReligious):
return True
else:
return bHinduism
if(eTech == gc.getInfoTypeForString('TECH_JUDAISM')):
if(not bHasObelisk or bReligious):
return True
else:
return bJudaism
if(eTech == gc.getInfoTypeForString('TECH_CONFUCIANISM')):
if(not bHasObelisk or bReligious):
return True
else:
return bConfucianism
if(eTech == gc.getInfoTypeForString('TECH_TAOISM')):
if(not bHasObelisk or bReligious):
return True
else:
return bToaism
if(eTech == gc.getInfoTypeForString('TECH_CHRISTIANITY')):
if(not bHasObelisk or bReligious):
return True
else:
return bChristianity
if(eTech == gc.getInfoTypeForString('TECH_ISLAM')):
if(not bHasObelisk or bReligious):
return True
else:
return bIslam
if(eTech == gc.getInfoTypeForString('TECH_MONASTERY')):
if(not bReligious and not bFaithFull):
return True
return False