Platy's Peculiar Pleasant Posh Python

Ultrapack TechTree

1) Vertical Spacing between Panels now scale with Resolution.
This means for high resolution, the panels will be spaced further apart vertically such that they fill up the whole screen, rather than squeezed at the top portion only.

A minimum of 10 is set for the vertical spacing, such that it is not too tight for low Resolutions.

2) Reworked the arrow placement codes, for the above, and to ensure that certain arrows are no longer placed directly at tip of the panel boxes.
Eg, Priesthood to Writing

Applied to Pedia as well
 
hey there platy,

how are you friend?


suggestion for a mod:

limit units per tile -
a python code that wil limit units per tile - with the ability for a modder/player
to define how much units can be placed - 1-10 - 100....
maybe even set a limit for each unit class.

how does that sound?

my thoughts are on a limit of 5-10 units.
the ai can handle 5-10 units per tile i guess. can be fun.
 
Adding such a limit is easy as pie.
But no AI has ever been taught how to handle XUPT.
Nope, never, forever.

Even Civ V is forever screwed with dumb AI.
 
Movement Limit

1) Fix a bug where it is checking plots (x, x) instead of (x, y)

2) Added PythonCallbackDefines file which was somehow missing....

3) Units spawned from Goodies will teleport to nearest city if they are not movable.
 
The problem is that the ai never really knows about it, if the ai neveer gets to 10-15 units, then there isn't much point having a limit that high, but if it does there can be problems. One of the big ones is cities, if you have 10 units in a city and you build one more, what happens?

Karadoc made good compromise with his 'disorganised' demotion, that is applied to every unit in a large stack giving it -10% strength. Making giant sacks less effective, but not in a way that causes big problems.
 
Fix some issues with advisor pop ups for feats for units
 
Hi Platy,

I am wondering if you could do me a favour and show me how to modify this bit of code:

Spoiler :
Code:
iBtnWidth = 16
				iX = xResolution 
				iY = yResolution - iBtnWidth * 7
				lAdvisorIcons = ["[ICON_STRENGTH]", "[ICON_RELIGION]", "[ICON_GOLD]", "[ICON_RESEARCH]", "[ICON_CULTURE]", "[ICON_FOOD]"]
				for i in xrange(6):
					sText = CyTranslator().getText(lAdvisorIcons[i], ())
					if self.lAdvisors[i]:
						sText = CyTranslator().getText("[COLOR_RED]", ()) + " X" + "</color>"
					screen.setText("AdvisorFilter" + str(i), "Background", "<font=2>" + sText + "</font>", CvUtil.FONT_LEFT_JUSTIFY, iX - 350, iY, -0.1, FontTypes.TITLE_FONT, WidgetTypes.WIDGET_PYTHON, 7001, i) ##advisor filter position ##
					iY += iBtnWidth

				[COLOR="Red"]sText = " P"[/COLOR]
				if self.bPrereq:
					sText = CyTranslator().getText("[COLOR_RED]", ()) + " X" + "</color>"
				screen.setText("PrereqFilter", "Background", "<font=2>" + sText + "</font>", CvUtil.FONT_LEFT_JUSTIFY, iX, iY, -0.1, FontTypes.TITLE_FONT, WidgetTypes.WIDGET_PYTHON, 7001, -1)
				
				iX = iMultiListXL
				iMaxButtons = iWidth / iBtnWidth
				if (self.iCombatLayer + 1) * iMaxButtons < (gc.getNumUnitCombatInfos() + 1):
					screen.setButtonGFC("CombatLayerPlus", "", "", xResolution - iMultiListXR, iY, iBtnWidth, iBtnWidth, WidgetTypes.WIDGET_GENERAL, 1, -1, ButtonStyles.BUTTON_STYLE_ARROW_RIGHT)
				if self.iCombatLayer > 0:
					screen.setButtonGFC("CombatLayerMinus", "", "", iX - iBtnWidth, iY, iBtnWidth, iBtnWidth, WidgetTypes.WIDGET_GENERAL, 1, -1, ButtonStyles.BUTTON_STYLE_ARROW_LEFT)
				iStart = self.iCombatLayer * iMaxButtons

To use a button image instead of a P

Basically for some reason it does not appear in my mod, and I have no idea why..

All of the other filter icons appear just fine, but the P is missing...

So I am wondering, if I change it to something similiar to the advisor and combat filter icons, if that will somehow fix the issue.. (As in perhaps it is some issue with fonts or whatever)

I tried to wrap my head around this sections and see if I could replicate it, but I just do not have a firm enough grasp of how it is all fitting together..

If you could provide me with a code snippet, that would be great, or any thoughts you may have on why you think this one icon could maybe disappear, it would be much appreciated.

It is jsut a pain cause this was the filter option that my mod REALLY Needed!! and it is the only one that doesn't work! :D (I have such good luck...)

EDIT: In more recent versions have you changed the prereq filter to a different Icon? A star?
 
It takes you less time to download the latest version compared to waiting for my reply.
P has been replaced with a star.
 
Platy, I'm trying to help "poor" Lib with his CvMainInterface... :rolleyes:

In your Platy UI, is it possible that you are missing a line which goes like:
Code:
if self.bPrereq and not pHeadSelectedCity.canConstruct(eLoopBuilding, False, False, False): continue
?

One is at line 1149 I believe (if I did not change things above), in the updateSelectionButtons section. It is after an if statement:
Code:
if isLimitedWonderClass(i):
(which by the way I don't find in the API!)

Above, you are checking for the contrary (normal buildings) and that line is not there.

If I add it, it seems to work also for normal buildings.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Another thing is a bit weird. Above, in the same section, there is a
Code:
		# All of the hides...	
		self.setMinimapButtonVisibility(False)

		[COLOR="Red"]screen.hideList( 0 )[/COLOR]

When clicking the Star button, in Lib's mod, the code in red throws a runtime error and blocks the game. If I comment the line out, everything seem to work fine. Do you have any idea of what would be the collateral damages afterwards?... :nuke:
 
1) Frankly speaking, don't really understand what you asking, since the line is there in the latest version. You may want to quote a chunk of codes rather than a line...

2) API is not complete.

3) Actually, I do believe the whole chunk of hidelist codes are useless crap left in BTS, which I can't be bothered to remove.

Ultrapack update:
Removed all hide list codes in CvMainInterface. Crap from BTS
 
I downloaded the latest version yesterday or the day before. What I mean is that it looks like that line should be there twice, once for buildings, once for wonders.

Something like this:
Spoiler :
Code:
				for i in xrange (gc.getNumBuildingClassInfos()):
					if not isLimitedWonderClass(i):
						eLoopBuilding = gc.getCivilizationInfo(pHeadSelectedCity.getCivilizationType()).getCivilizationBuildings(i)
						if pHeadSelectedCity.canConstruct(eLoopBuilding, False, True, False):
	## Advisor Filter ##
							Info = gc.getBuildingInfo(eLoopBuilding)
							iAdvisor = Info.getAdvisorType()
							if iAdvisor > -1 and iAdvisor < len(self.lAdvisors):
								if self.lAdvisors[iAdvisor]: continue
	## Advisor Filter ##
	## Prereq Filter ## [COLOR="DeepSkyBlue"]Added isenchine[/COLOR]
							if self.bPrereq and not pHeadSelectedCity.canConstruct(eLoopBuilding, False, False, False): continue
	## Prereq Filter ## [COLOR="deepskyblue"]Added isenchine[/COLOR]
							screen.appendMultiListButton( "BottomButtonContainer", Info.getButton(), iRow, WidgetTypes.WIDGET_CONSTRUCT, i, -1, False )
							if not pHeadSelectedCity.canConstruct(eLoopBuilding, False, False, False):
								screen.disableMultiListButton( "BottomButtonContainer", iRow, iCount, Info.getButton() )
							iCount += 1
				if PlatyOptions.bBuildList:
					screen.appendMultiListButton("BottomButtonContainer", CyArtFileMgr().getInterfaceArtInfo("INTERFACE_BUILD_WONDER").getPath(), iRow, WidgetTypes.WIDGET_GENERAL, -1, -1, False)
					screen.disableMultiListButton("BottomButtonContainer", iRow, iCount, CyArtFileMgr().getInterfaceArtInfo("INTERFACE_BUILD_WONDER").getPath())
					iCount += 1
				else:
					if iCount > 0:
						iRow += 1
						iCount = 0
				for i in xrange(gc.getNumBuildingClassInfos()):
					if isLimitedWonderClass(i):
						eLoopBuilding = gc.getCivilizationInfo(pHeadSelectedCity.getCivilizationType()).getCivilizationBuildings(i)
						if pHeadSelectedCity.canConstruct(eLoopBuilding, False, True, False):
	## Advisor Filter ##
							Info = gc.getBuildingInfo(eLoopBuilding)
							iAdvisor = Info.getAdvisorType()
							if iAdvisor > -1 and iAdvisor < len(self.lAdvisors):
								if self.lAdvisors[iAdvisor]: continue
	## Advisor Filter ##
	## Prereq Filter ##
							if self.bPrereq and not pHeadSelectedCity.canConstruct(eLoopBuilding, False, False, False): continue
	## Prereq Filter ##
 
Agreed. Reuploaded with missing prereq filter for non wonders.
 
Thank you for helping the poor lost souls of the wasteland... :)
 
Back
Top Bottom