Platy's Peculiar Pleasant Posh Python

Looking at the codes, the population divider is 4, so a 21 size city should spawn 5.
It is however, modified by nationality percentage, so that may explain why it spawn only 3.

If partisans don't spawn after merging, it may be because of other reasons:
1) No valid plot to spawn, all occupied by enemy forces or hills etc
2) Nationality Percentage too low
3) City size too low
4) No conscript units available

So perhaps test around with different cities? Would be easy to add additional codes on razing though.
 
Hey platy,

Would you be interested in the challenge of making a civic 'net effect' screen. Basically something that shows all of the effects of your civic choices in one entry.

So for example if you have 1 civic that increase GP production by 50% and another choice that has -40%, the net effect screen would show you have an overall GP bonus of 10%.

and so on and so forth.

:D
 
Nope.
The effects of each civic is simply extracted from CyGameTextMgr in one chunk.
If you want a combined effects of all civics, you have to do calculations for every single effect and then display them line by line.

For mods with modified civics with extra XML tags, you then have to add in new codes yourself which is tedious.
 
Ultrapack

1) Fix unresponsive end turn button.

2) Bottom 3 panels of main interface now all scale together with resolution.
=> More space to display unit strength etc on bigger resolution
=> Bigger minimap

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

1) Fix unresponsive end turn button.

2) Bottom 3 panels of main interface now all scale together with resolution.
=> More space to display unit strength etc on bigger resolution
=> Bigger minimap

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

Thanks :goodjob:
Though shouldn't the 3 panels scale vertically as well? Mapsizes are usually around "1.6:1", so scaling it horizontal only just means having a lot of black space in the sides of mini-map.

And imho maybe even more importantly, add a switch-button, because I would love a big minimap sometimes, but most of the times (especially in cityscreen) it would be nicer to have the units/buildings/wonders construction overview (the middle pane, which is being severely shortened by the enlarged minimap.)


Oh, and what happened to my "Next <- -> previous unit buttons"?
Spoiler :
 
Ultrapack

1024 x 768
Spoiler :


1366 x 768
Spoiler :


Whole Main Interface Screen now scales horizontally with resolution.
Left and Right panels are limited to 400 pixels each. (Default in BTS is around 300)
Thus, at high resolutions, you get to see more stuff on these 2 panels, such as building names which used to be truncated, more specialist columns, more promotions on selected units.

Cap of 400 is to prevent them from growing excessively big, so the center portion will expand much more at X-Resolution > 1333.

@Vincent
You won't see those buttons without units.
 
Hi Platy, sorry because i write here, you know python very well, but i have some little problem i hope that you can help me with this.

This is code for Mind Control Nuke, this nuke take control over rival city when launched and exploded in rival city. This code works, but when nuke exploded, nuke damage rival units in city, and don't take control over all units in city (i want that take control, all rival units in city will became my, i tried but i fail, that irritate me), that mean that i have control over rival city and problem that is rival units, with which i am in war are in my city and i haven't control over them because i am not edit this code to do that. You can see this green text down in code, that is all which i try, i comment something, later remove comment and etc. Every or individual which i tried in this comments don't work, and cause to lose basic interface, mini map and etc and lose effect of this nuke. What to do and really sorry for this long text and for writing here...

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

		if iPlayer2 != -1:
			pPlayer2 = gc.getPlayer(iPlayer2)
			iTeam2 = pPlayer2.getTeam()
			pTeam2 = gc.getTeam(iTeam2)
.
.
.
		if (pNukeUnit is not None and pNukeUnit.getUnitType() == gc.getInfoTypeForString('UNIT_TURN')):
			if (pPlot.isCity()==true):
				iPlayer = pNukeUnit.getOwner()
				pPlayer = gc.getPlayer(iPlayer)
				pCity = pPlot.getPlotCity()
				pPlayer.acquireCity(pCity,false,false)
				iX = pPlot.getX()
				iY = pPlot.getY()
				for iiX in range(iX-1, iX+2, 1):
					for iiY in range(iY-1, iY+2, 1):
						numUnits = pPlot.getNumUnits()
						for e in xrange(numUnits,0,-1):
        						pUnit = pPlot.getUnit(e)
        						pUnit.kill(false, -1)  
								[COLOR="SeaGreen"]#start ZLATKO
								### CyUnit getUnit (INT iID)
								#pNewUnit = pPlayer.initUnit(pPlayer.getCapitalCity().getConscriptUnit(), pPlot.getX(), pPlot.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.NO_DIRECTION)
								#pNewUnit.finishMoves()
								#pUnit.kill(true, iPlayer2)
								#if(pUnit.isDead == false)
									#pUnit.setImmobileTimer(2)
									#pUnit.convert(pPlot.getUnit(e))
								#pUnit.setImmobileTimer(2)
								#end ZLATKO[/COLOR]
						pNukedPlot = CyMap().plot(iiX,iiY)
						if (pNukedPlot.getFeatureType() == gc.getInfoTypeForString('FEATURE_FALLOUT')):
							pNukedPlot.setFeatureType(-1, -1)
 
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"))
 
Top Bottom