Platy's Peculiar Pleasant Posh Python

New Platy Helper Screen.
Only for "help text" in main map. Those hover text in pedia or city screen etc are widget texts.

Very helpful, thank you. Code already isolated and incorporated into my mod. :)
 
Found what appears to be a bug in the PlatyPediaSpecialist.py file.

When determining and building specialist commerce changes an undefined variable is being used. The text formatting line (line 115) uses j as the index of the commerce, when it is not defined. Looks like it should be using iCommerceType instead as in:
Spoiler :
Code:
MyFile=open("Assets/XML/Buildings/CIV4BuildingInfos.xml")
iType = -1
iCommerceType = -1
for sCurrent in MyFile.readlines():
	if "<Type>" in sCurrent:
		iType = gc.getInfoTypeForString(self.cutString(sCurrent))
		iCommerceType = -1
	if iType == -1: continue
	if "<SpecialistExtraCommerces>" in sCurrent:
		iCommerceType = 0
	if iCommerceType == -1: continue
	if "<iCommerce>" in sCurrent:
		iCommerceChange = int(self.cutString(sCurrent))
		if iCommerceChange != 0:
			[COLOR="Blue"]szSpecialText += u"\n%s%+d%c (%s %s)" % (CyTranslator().getText("[ICON_BULLET]", ()), iCommerceChange, gc.getCommerceInfo([/COLOR][COLOR="Red"][B]iCommerceType[/B][/COLOR][COLOR="Blue"]).getChar(), CyTranslator().getText("TXT_KEY_WITH", ()), gc.getBuildingInfo(iType).getDescription())[/COLOR]
		iCommerceType += 1
	elif "</SpecialistExtraCommerces>" in sCurrent:
		iCommerceType = -1
MyFile.close()
I have just downloaded the latest Platy UI file to check that this is still the case.
 
Thanks and fixed.
But actually, since you can mod dll, it is better to just expose that value to python.
For some reasons, Firaxis forgot to expose that one value from buildinginfos... which is why the brute force method is used here.
 
hey platy,

how are you?

long time ive been away.

great new stuff youve made.

quastion:

i wanna use the unique civ resource,
if i define a pre req tech for the civs unique res, it will only appear when the tech becomes available? meaning revealed to the city?

and what happens when you loose your capital? is the bonus relocates to the new capital?
 
As the description states:
The resource will spawn in a suitable plot in BFC of the capital if possible.
Else, it will be added directly to the city itself.


Since the resource is on the map itself, it can be pillaged, culture flipped whatever just like any other resources.
All it does is add it initially.
 
Mirror0000_zpsfb190f1d.jpg


New Helper, CTRL F5
1) Shows location of newly added XML tags to adjust easily
2) Catches duplicates
 
You define whatever files you want to add to the checklist.
 
Noticed what looks to be a minor issue in SpecialistTracker.py. You are using screen.getYResolution() when determining the table width, when I believe it should probably be screen.getXResolution() as in:
Code:
class SpecialistTracker:
		
	# Screen construction function
	def interfaceScreen(self):
		screen = CyGInterfaceScreen( "SpecialistTracker", CvScreenEnums.SPECIALIST_TRACKER)

		self.nTableWidth = min(gc.getNumSpecialistInfos() * 37 + 150, [COLOR="Blue"]screen.getXResolution()[/COLOR] - 40)
		self.nScreenWidth = self.nTableWidth + 40
		self.nScreenHeight = screen.getYResolution() - 250
		self.nTableHeight = self.nScreenHeight - 125
I only spotted it as I have duplicates of most specialists representing GPs caught by slavers so my total list of specialists is longer than usual and I use windowed mode with debug dlls so the Y resolution is relatively small.

I am in the process of rebuilding my kitchen sink mod from a base of BUG/BBAI to K-Mod and though I would switch out BUG for your UI as an experiment to try it out and I am mighty impressed. Nice clean interface with some nice enhancements, I especially like all the modding tools and the excellent new WorldBuilder ... invaluable for setting up test scenarios
 
Ultrapack

1) Replaced most Texts with default text found in vanilla BTS. So it reduces the number of new text tags and the vanilla ones come with translations. (Affects too many files)

2) Specialist Tracker, fixed bug above (Thanks)

3) Help Text screen, which was added recently, removed.
It is now simply displayed on the main screen itself, which you can refer to in event log.

HelpText_zpsbb1b3b20.jpg


4) Great General Tracker removed.
It is now displayed on main menu, with blinking buttons to locate them accurately.

GreatGenerals_zpsd8328d12.jpg


5) Removed Symbol Helper, seldom used

6) Shift helpers shortcut keys around.
Ctrl F1: Help Text
Ctrl F2: Great Generals
Ctrl F10: Mirror Image
Ctrl F11: XML Tags
Ctrl F12: TimeKeeper

F1 and F2 are used by players, while those nearer to F12 are only for modders.
 
One small enhancement that I always add to the standard WorldBuilder and think could be a useful addition to yours is to show the the current plot co-ords on mouseover. I use this a lot when debugging to determine which object is being processed by the DLL. Implementing it involves a simple addition to CvPlatyBuilderScreen:

Code:
	def mouseOverPlot (self, argsList):

		self.m_pCurrentPlot = CyInterface().getMouseOverPlot()
				
		[COLOR="Blue"]szText = "Plot: (%d, %d)" %(self.m_pCurrentPlot.getX(), self.m_pCurrentPlot.getY())
		screen = CyGInterfaceScreen( "WorldBuilderScreen", CvScreenEnums.WORLDBUILDER_SCREEN )
		screen.setLabel( "WBCoords", "Background", szText, CvUtil.FONT_CENTER_JUSTIFY, screen.getXResolution()/2, 6, -0.3, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )[/COLOR]
		if self.m_bReveal:
			if CyInterface().isLeftMouseDown():

Adding it would save me the effort of having to remember to keep putting it back in when I apply your latest versions as my old age tends to make me forgetful :old:
 
Ultrapack

ForeignAdvisor0000_zps0c2bdc8d.jpg


1) Revert Foreign Advisor Info Screen back to BTS style for bigger buttons.
Pros over BTS:
A) Trade Yield separated into different types if food or production are used.
B) Screen is scrollable horizontally as well as vertically, so no issue with more civics
C) Favourite Religion

2) World Builder
Added Plot Mouseover Text, with adjustments

P.S.
Neither WB nor Pedia will be updated for standalone, till I am satisfied with Text removals.

Reuploaded
 
Platypedia

1) Side Menu no longer refresh for every page jump, unless different category.
This means going from Walls to Barracks, only the info for barracks is updated, while the side menu with full building list remains stagnant.

2) Recoded Side Menu codes which resulted in extra blank line for certain sort methods.
 
Ultrapack Top Civs

TopCivs0001_zps18ec7972.jpg


Reuploaded to revert turn counter from 20 to 50 (testing purposes)
 
Great People Mod

Features:
Displays a picture of the respective Great People when he/she is born.
Original mod by Patricius

[...]

P.S.
I only bothered to define 6 Great Engineers for testing purposes.
Can't be bothered to do it for all 200+ GPs.
All the pics can be obtained from original mod provided by Roamty's BTS version though.... so whoever is bored can define all the Art Defines :D

"I'm bored ... I'm chairman of the bored ... " :sleep:

Here is the file with the 247 links to the BtS Great Persons art ... I checked every single path to make sure it would not bring crashes in game.

Some spies have just a generic Great Spy dds file, in particular the fake ones. The initial mod has more GP, I sticked to BtS ones.

I did it for me so I thought I might just as well share the file. Thanks for the coding!
 

Attachments

Back
Top Bottom