Platy's Peculiar Pleasant Posh Python

Tech Advisor

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

GreatPeopleMod0000_zps973a776c.jpg


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.
 
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 :
u3f3lZ6.jpg
 
Ultrapack

1024 x 768
Spoiler :
1024x7680000_zps7a764c2b.jpg


1366 x 768
Spoiler :
1366x7680000_zps87fc88c4.jpg


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)
 
Back
Top Bottom