[MODCOMP] Doviello Icehouse

Whereabouts is it placed? In CannotBuild()? If so, I'm not really sure how it can be causing a problem as all it does is check a set of conditions and returns True/False (doesn't change the gamestate itself).
It's part of the cannotConstruct() function, does that make that much of a difference? We get the error as soon as it is possible to build the structure (i.e. get the tech that allows it). I've included the version of CvGameUtils.py that I am using.
 

Attachments

  • CvGameUtils.rar
    4.3 KB · Views: 64
It's part of the cannotConstruct() function, does that make that much of a difference? We get the error as soon as it is possible to build the structure (i.e. get the tech that allows it). I've included the version of CvGameUtils.py that I am using.


Not sure how this would cause an OoS, but it's worth trying anyway (and needs to be done to avoid possible problems elsewhere)

Code:
	### find taiga within the city radius controlled by your team ###
	pPlayer = gc.getPlayer(pCity.plot().getOwner())
	iPID = pPlayer.getID()
	iTID = pPlayer.getTeam()
	iX = pCity.getX()
	iY = pCity.getY()
	for iXLoop in range(iX - 2, iX + 3, 1):
		for iYLoop in range(iY - 2, iY + 3, 1):
			pPlot = CyMap().plot(iXLoop, iYLoop)
			[b][color=red]if pPlot.isNone() == False:[/color][/b]	
				if ( pPlot.isPlayerCityRadius(iPID)==true ):
					if ( pPlot.getTeam()==iTID ):
						if ( pPlot.getTerrainType() == gc.getInfoTypeForString('TERRAIN_TUNDRA')  ):
							return False

This will deal with the cases that pPlot is "off the map"/null.

===

The other thing worth trying is to remove each of the last 3 if conditions in turn (The Tundra Check - which should be fine, then the Team Check - more likely, then the PlayerCityRadius check - again, possible) to see which is causing the OoS.

It's an odd one though, as I've never come across an OoS caused by anything that doesn't alter the gamestate directly.
 
After further testing, I've confirmed that you are right. The problem arises when the building is actually built. It would seem that because I forgot to set the AdvancedStartCost to -1, the AI was building it. :p

Pesky AI's :)

Good luck with the rest of this - I'll keep an eye out for the release - sounds interesting :)
 
Well, that's the thing. I have only figured out that building it causes the OOS, not how to prevent it. From my understanding, OOS's like this are usually caused in Python, and seeing how my python skills are lackluster, I really don't know how to fix it.

If both players have the same Python and DLL, I'm struggling to see how it can cause an OoS. If one player didn't have the DLL, it almost certainly would (likewise if both didn't have the python) - but in that case it likely wouldn't allow you to start a game either.
 
Top Bottom