Platy's Peculiar Pleasant Posh Python

Code:
	def onNukeExplosion(self, argsList):
		'Nuke Explosion'
		pPlot, pNukeUnit = argsList
		
		iPlayer = pNukeUnit.getOwner()
		pPlayer = gc.getPlayer(iPlayer)

		if pNukeUnit.getUnitType() == gc.getInfoTypeForString('UNIT_TURN'):
			if pPlot.isCity():
				lMind = []
				iRange = pNukeUnit.nukerange()
				pCity = pPlot.getPlotCity()
				pPlayer.acquireCity(pCity, False, False)
				iX = pPlot.getX()
				iY = pPlot.getY()
				for iiX in range(iX - iRange, iX + iRange + 1):
					for iiY in range(iY - iRange, iY + iRange + 1):
						pPlotX = CyMap().plot(iiX,iiY)
						for e in xrange(pPlotX.getNumUnits()):
        						pUnitX = pPlotX.getUnit(e)
							if pUnitX.isNone(): continue
							lMind.append(pUnitX) 
						if pPlotX.getFeatureType() == gc.getInfoTypeForString('FEATURE_FALLOUT'):
							pPlotX.setFeatureType(-1, -1)

				for pUnitX in lMind:
					pNewUnit = pPlayer.initUnit(pUnitX.getUnitType(), pUnitX.getX(), pUnitX.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.NO_DIRECTION)
					pNewUnit.convert(pUnitX)
					pNewUnit.finishMoves()
 
Ultrapack

1) Fix unresponsive end turn button.

3) Default number of plot list buttons increased from 9 to 10.
It always irritate me to count in 9 for default 1024x768

1) I was wondering about that when testing your UI... :think:

3) You gave me ideas: I pushed the PlotListPlus/Minus buttons 68 pixels to the right (and 11 pixels above) and I got two plot list buttons more :)

I also moved the Trade Routes panel to the top right portion of the center/middle screen (and Sevo's additional data to the top left portion of the center/middle screen). It allowed me to have more space for the Building list, I always wanted that (I'm still on a y-resolution of 800)! It only works with x-resolutions 1280 and above tough and also probably because I set the CAMERA_CITY_ZOOM_IN_DISTANCE to 4200.

Edit: added a screenshot (resolution 1360 * 768)
 
Hi Platyping!
Your UI relooking is fantastic. I don't like all the modifications but it is a fresh and well thought UI. I would like to merge some ideas on the main A New Dawn mod but it's my first time UI time change.
The major problem is that we use BUG already.

Do you have any experience with such merging ?
 
You would have better luck asking someone else like Xyth from HR, DH from C2C. Merging is never my concern since I code what I need. The only imported code is unit upgrade chart in Pedia.
 
Thank you!
 
I would like to ask you, if I could ask for a little code. I need code for wonder what add unique improvement into fat cross city, where wonder builded. On the hill. Can you write it for me, please?
 
Actually, the old Macchu Picchu by GIR has been doing that, to peak rather than hills.

Anyway, it depends on what you want:
1) One improvement on random hill, or all hills
2) Does ownership of tile matter
3) What happens when wonder changes hands or destroyed
 
wow , thanks for the reply :)
1) One improvement on random hill
2) Does ownership of tile matter (Here I'm not sure what that means )
3) When city razed, improvement stay on the hill for next civ (player or AI)
 
Code:
	def onBuildingBuilt(self, argsList):
		'Building Completed'
		pCity, iBuildingType = argsList
		game = gc.getGame()
		if iBuildingType == gc.getInfoTypeForString("BUILDING_TSUKIJI"):
			lHills= []
			for i in xrange(21):
				pPlot = pCity.getCityIndexPlot(i)
				if pPlot.isNone(): continue
				if pPlot.getBonusType(-1) > -1: continue
				if pPlot.getTeam() != pCity.getTeam(): continue
				if pPlot.isHills():
					lHills.append(pPlot)
			if lHills:
				pSelectedPlot = lHills[CyGame().getSorenRandNum(len(lHills), "Freebie")]
				pSelectedPlot.setImprovementType(gc.getInfoTypeForString("IMPROVEMENT_TSUKIJI"))
 
Hi, platyping. Ihave test finished. I would like to ask you, if you can make one editation into code for me. Code unfortunatelly placed improvement into city, because city is on hill :(
Is possible add into code Improvement_xyz it is not possible to build in city
and
can not be built on the hill where it is another improvement

If is it possible, can you edit code for me, please?
 
Hi, platyping. Ihave test finished. I would like to ask you, if you can make one editation into code for me. Code unfortunatelly placed improvement into city, because city is on hill :(
Is possible add into code Improvement_xyz it is not possible to build in city
and
can not be built on the hill where it is another improvement

If is it possible, can you edit code for me, please?

I would suggest the following
Code:
	def onBuildingBuilt(self, argsList):
		'Building Completed'
		pCity, iBuildingType = argsList
		game = gc.getGame()
		if iBuildingType == gc.getInfoTypeForString("BUILDING_TSUKIJI"):
			lHills= []
			for i in xrange(21):
				pPlot = pCity.getCityIndexPlot(i)
				if pPlot.isNone(): continue
				if pPlot.getBonusType(-1) > -1: continue
				if pPlot.getTeam() != pCity.getTeam(): continue
[B]				if pPlot.isCity(): continue
				if pPlot.getImprovementType(-1) > -1: continue
[/B]				if pPlot.isHills():
					lHills.append(pPlot)
			if lHills:
				pSelectedPlot = lHills[CyGame().getSorenRandNum(len(lHills), "Freebie")]
				pSelectedPlot.setImprovementType(gc.getInfoTypeForString("IMPROVEMENT_TSUKIJI"))

Although I am not totally sure about the getImprovementType because 0 means land worked, 1 means sea worked and 2 means city ruins. So
Code:
				if pPlot.getImprovementType(-1) > [B]2[/B]: continue
if you don't mind city ruins being replaced.
 
Code:
	def onBuildingBuilt(self, argsList):
		'Building Completed'
		pCity, iBuildingType = argsList
		game = gc.getGame()
		if iBuildingType == gc.getInfoTypeForString("BUILDING_TSUKIJI"):
			lHills= []
			for i in xrange(21):
				pPlot = pCity.getCityIndexPlot(i)
				if pPlot.isNone(): continue
				if pPlot.getBonusType(-1) > -1: continue
				if pPlot.getTeam() != pCity.getTeam(): continue
				[B]if pPlot.isCity(): continue
				iImprovement = pPlot.getImprovementType()
				if iImprovement > -1 and gc.getImprovementInfo(iImprovement).isPermanent(): continue[/B]
				if pPlot.isHills():
					lHills.append(pPlot)
			if lHills:
				pSelectedPlot = lHills[CyGame().getSorenRandNum(len(lHills), "Freebie")]
				pSelectedPlot.setImprovementType(gc.getInfoTypeForString("IMPROVEMENT_TSUKIJI"))

I wouldn't bother to check for whether there is just an improvement, since chances are by the time a wonder is built, hills would have mines or windmills, then 99% nothing will happen.
 
Hi Platy--
I'd love to integrate your Senile Soldier code with the stipulation that the button only becomes available when units are in cities that have Barracks (and Ikhandas). I wouldn't know what to put in for that or where to put it. Is that a fairly simple bit of code that you can show us?
Thanks!
 
Just add a if check somewhere suitable.
If there are only 2 of those buildings, hardcore method will do.

if pCity.getNumActiveBuilding(gc.getInfoTypeForString("BUILDING_XXX")) + pCity.getNumActiveBuilding(gc.getInfoTypeForString("BUILDING_YYY")) > 0:

Else, it will be more troublesome.
 
Back
Top Bottom