Platy's Peculiar Pleasant Posh Python

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... :)
 
Tech Advisor

Fix a bug where UB and UU data are stored over games, resulting in wrong data displayed.
 
Great People Mod V2



Well, the mod that displays a picture of the GP when a GP is born.
Screen adjusted such that the picture just display a portrait of the GP.

A quote section on the top if you bother to find quotes from the GP.
A pedia section at the bottom for you to display some info about the GP.

Because the quote and pedia are extracted from XML text files, it makes editing easier and translation possible.
 
Nice!

Do you think you could do something similiar with the event box?

Make it bigger, centred, picture, etc.

I have seen other mods do it, in part or full, but i have never seen it as a modcomp, so having one that plugs straight into platy UI would be great! :D

As events are going to become a big part of my mod, it would be nice to have them use a bit more screen for text etc.
 
Ultrapack

Fullscreen Movies made optional via Platy Options, for the sake of low end computers.
 
Hey Platy :D
I dont remember if I asked before (sorry if already have), but what about a Culturally Linked Start gameoption, where instead of presets, its based on <ArtStyleType>, as all mods have them and it would make perfectly sense that the artstyles are somewhat geographically connected.
It shouldn't (imho) be a very complex setup with landmass calculations or North/South/East/West placements, but instead just cluster similar artstyle-civs together'ish. I think a lot of mods would use this component, if it was made accessible. :D

(I have no idea how Civs are being placed at map, so please forgive my ignorance if its impossible ;))
 
Hey Platy, this may or may nor be an issue you are aware of:
Spoiler :

I got this python error:

ValueError: too many values to unpack

File "CvEventMAnager", line 832, in onCorporationFounded

File "PlatyUIUtils", line 660, in onCorporationSpread

File "BugEventManager",line 359, in _handleDefaultEvent


Line 660 in PlatyUIUtils.py calls the incorrect method and should be changed from

def onCorporationSpread(self, argsList):
if CyGame().GetWorldBuilderMode() and not CvPlatyBuilderScreen.bPython: return
self.eventManager.onCorporationFounded(argsList) # Change this line

to

def onCorporationSpread(self, argsList):
if CyGame().GetWorldBuilderMode() and not CvPlatyBuilderScreen.bPython: return
self.eventManager.onCorporationSpread(argsList) # To this

 
Not sure what you talking about.
When in the world did I have such a file PlatyUIUtils.py...

@Vincent
CLS is already made by somebody I believe.
 
When in the world did I have such a file PlatyUIUtils.py

I'm sure you aren't that interested, but just in case you were slightly curious... this was a copy/paste error I put in when I converted your mod to fit into the BUG event handling mechanism used in another mod. I spotted the error and put the resolution in our bug tracking system for completeness.
 
Yup, not really interested :D
Can't remember when was the last time I played a Civ Game, not to say a mod...
Still good to inform others who like to mix bits and pieces from different mod comps though.
 
Im having problems with the Partisans mod. If I try the standalone it somewhat works (tried with a 21 size city, but only 3 partisans came out.
When I merged it with PlatyUI nothing happens.

I'm almost sure I merged it correctly (?)

CVEventManager.py
Code:
## Partisans ##
import Partisans
## Partisans ##

gc = CyGlobalContext()
localText = CyTranslator()

Code:
	def onCityRazed(self, argsList):
		'City Razed'
		city, iPlayer = argsList
		iOwner = city.findHighestCulture()
## Partisans ##		
#		# Partisans!
#		if city.getPopulation > 1 and iOwner != -1 and iPlayer != -1:
#			owner = gc.getPlayer(iOwner)
#			if not owner.isBarbarian() and owner.getNumCities() > 0:
#				if gc.getTeam(owner.getTeam()).isAtWar(gc.getPlayer(iPlayer).getTeam()):
#					if gc.getNumEventTriggerInfos() > 0: # prevents mods that don't have events from getting an error
#						iEvent = CvUtil.findInfoTypeNum(gc.getEventTriggerInfo, gc.getNumEventTriggerInfos(),'EVENTTRIGGER_PARTISANS')
#						if iEvent != -1 and gc.getGame().isEventActive(iEvent) and owner.getEventTriggerWeight(iEvent) < 0:
#							triggerData = owner.initTriggeredData(iEvent, true, -1, city.getX(), city.getY(), iPlayer, city.getID(), -1, -1, -1, -1)
## Partisans ##			
		CvUtil.pyPrint("City Razed Event: %s" %(city.getName(),))
	
	def onCityAcquired(self, argsList):
	## Platy Builder ##
		if CyGame().GetWorldBuilderMode() and not CvPlatyBuilderScreen.bPython: return
	## Platy Builder ##
		'City Acquired'
		iPreviousOwner,iNewOwner,pCity,bConquest,bTrade = argsList
## Partisans ##
		if bConquest:
			Partisans.Partisans().checkPartisans(iPreviousOwner,iNewOwner,pCity)
## Partisans ##
		CvUtil.pyPrint('City Acquired Event: %s' %(pCity.getName()))
	
	def onCityAcquiredAndKept(self, argsList):
		'City Acquired and Kept'

Any ideas?

ps. It would be cool if a razed city produced more partisans than just a captured one imho.
 
Top Bottom