Hi,
I'd suggested in http://forums.civfanatics.com/showpost.php?p=11785491&postcount=269, that it might make exploration more interesting if some explored tiles became obscured.
If you don't know how to make maps, you can't accurately record the information about the land you've previously explored.
I wasn't aware of this being done previously so I thought I'd try to do a quick python mod to see if a concept along these lines adds any enjoyment to the game. Unfortunately, my initial coding isn't working. It looks fine on the first turn
but crashes on the second
.
Does anyone have any ideas as to what is causing the crash or how I can fix it?
I'm doing the mod as a python module for RifE.
I'd suggested in http://forums.civfanatics.com/showpost.php?p=11785491&postcount=269, that it might make exploration more interesting if some explored tiles became obscured.
If you don't know how to make maps, you can't accurately record the information about the land you've previously explored.
I wasn't aware of this being done previously so I thought I'd try to do a quick python mod to see if a concept along these lines adds any enjoyment to the game. Unfortunately, my initial coding isn't working. It looks fine on the first turn


Code:
cf = CustomFunctions.CustomFunctions()
gc = CyGlobalContext()
localText = CyTranslator()
PyPlayer = PyHelpers.PyPlayer
PyInfo = PyHelpers.PyInfo
getInfoType = gc.getInfoTypeForString
getPlot = CyMap().plot
getPlayer = gc.getPlayer
iCart = gc.getInfoTypeForString('TECH_CARTOGRAPHY')
iElohim = gc.getInfoTypeForString('CIVILIZATION_ELOHIM')
def onBeginPlayerTurn(self, argsList):
'Called at the beginning of the end of each turn'
iGameTurn, iPlayer = argsList
pPlayer = gc.getPlayer(iPlayer)
py = PyPlayer(iPlayer)
ePlayer = getPlayer(iPlayer)
iTeam = pPlayer.getTeam()
if pPlayer.getCivilizationType() == iElohim:
iUniqueRem = 0
else:
iUniqueRem = 10
###
# Can they map where they have been?
if not pPlayer.isHasTech(iCart):
for iPlotIndex in range(CyMap().numPlots()):
pLoopPlot = CyMap().plotByIndex(iPlotIndex)
if pLoopPlot.isRevealed(iTeam, True):
if not pLoopPlot.isVisible(iTeam, True):
iRemember = 90
if pLoopPlot.getImprovementType() != -1 and (gc.getImprovementInfo(pLoopPlot.getImprovementType()).isUnique() == True) :
iRemember = iUniqueRem
iLostKnowledge = CyGame().getSorenRandNum(100, "Lost")
if iLostKnowledge < iRemember:
pLoopPlot.setRevealed(iTeam, False, False, iTeam)
pLoopPlot.updateVisibility()
Does anyone have any ideas as to what is causing the crash or how I can fix it?
I'm doing the mod as a python module for RifE.