Platy's Peculiar Pleasant Posh Python

about the faith mod you made a long time ago, i was tinkering with it and wondering if it could be made so that the priest specialist counted towards faith, because as it is the largest empire will always have the most faith because they can build the most buildings, but i feel as though a small specialized civilization (like the vatican in real life) would have more. So i was wondering if it is possible to make specialists count?
 
@lib
Regarding 1st question, check what is in that line, since I have no idea what else you merged.
Regarding all others, when you have merged the UI properly, then try merging those one by one.
No point trying to merge 100 mods when the main one isn't done.

@Faith
Naturally, it can be done, just need some codes on city do turn, to count the specialists.
Which is something similar to what developing traits do.
 
I have merged the UI properly. Well, I only had your UI python in there, with a kmod .dll.

Religion Error code, it's all your UI code or vanilla as far as I can tell.
Spoiler :

CvMianinterface line 1846:
Spoiler :
Code:
## Religions and Corporations ##
				nColumns = min(10, gc.getNumReligionInfos(), gc.getNumCorporationInfos())
				screen.addTableControlGFC("ReligionsCorps", nColumns, xResolution - 252, 42, 250, 50, False, False, 0, 0, TableStyles.TABLE_STYLE_EMPTY)
				for i in xrange(nColumns):				
					screen.setTableColumnHeader("ReligionsCorps", i, "", 250/nColumns)

				iCount = 0
				for i in xrange(gc.getNumReligionInfos()):
					if pHeadSelectedCity.isHasReligion(i):
[COLOR="Red"]						iColumn = iCount % nColumns[/COLOR]
						if iColumn == 0:
							iRow = screen.appendTableRow("ReligionsCorps")
						sText = u"%c" %(gc.getReligionInfo(i).getChar())
						if pHeadSelectedCity.isHolyCityByType(i):
							sText = u"%c" %(gc.getReligionInfo(i).getHolyCityChar())
						screen.setTableText("ReligionsCorps", iColumn, iRow, "<font=4>" + sText + "</font>","", WidgetTypes.WIDGET_HELP_RELIGION_CITY, i, -1, CvUtil.FONT_CENTER_JUSTIFY)
						iCount += 1

				iCount = 0
				for i in xrange(gc.getNumCorporationInfos()):
					if pHeadSelectedCity.isHasCorporation(i):
						iColumn = iCount % nColumns
						if iColumn == 0:
							iRow = screen.appendTableRow("ReligionsCorps")
						sText = u"%c" %(gc.getCorporationInfo(i).getChar())
						if pHeadSelectedCity.isHeadquartersByType(i):
							sText = u"%c" %(gc.getCorporationInfo(i).getHeadquarterChar())
						screen.setTableText("ReligionsCorps", iColumn, iRow, "<font=4>" + sText + "</font>","", WidgetTypes.WIDGET_HELP_CORPORATION_CITY, i, -1, CvUtil.FONT_CENTER_JUSTIFY)
						iCount += 1
## Religions and Corporations ##

Line 564:
Spoiler :
Code:
			# Selection Data Dirty Bit
[COLOR="Red"]			self.updateCityScreen()[/COLOR]
			CyInterface().setDirty(InterfaceDirtyBits.Domestic_Advisor_DIRTY_BIT, True)
			CyInterface().setDirty(InterfaceDirtyBits.CityScreen_DIRTY_BIT, False)

CvScreensInterface Line 480:
Spoiler :
Code:
	# Main Interface Screen
	if ( argsList[0] == MAIN_INTERFACE ):
		[COLOR="Red"]mainInterface.redraw()[/COLOR]
	elif ( argsList[0] == TECH_CHOOSER ):
		techChooser.updateTechRecords(true)

As for the other questions, the main interface is done (apart from this religion issue which is putting the error in your UI code), the other questions are how to merge code that you wrote on old or vanilla pedia code, with your latest UI code, because they have been majorly altered. In the MR case, the code section you used in the bonus file does not even seem to exist in your platypedia code
 
Ah, that one is easy to fix.
It will be 0 if either the mod has no religions or no corporations.
 
aha, that explains it, I just checked the corporations file and there are none, so I guess the birth of the religion starts the check, then there is no corps which throws it for a loop.

I'll make a dummy corp and that should solve it for now. I temporarily fixed it by disabling the religion being founded by a tech.

Now I just need a solution for the pediabonus.py for equipment and Manufactured Resources if memory serves, everything else went in fine, it is just that one file because it is so heavily altered from the version you wrote it in.
 
Ultrapack

Fix bug with city screen for mods with no corps or no religions.
 
Didn't bother. Mouse spoilt, lazy to mod without it.
 
You have a Believer trait that puts the state religion and a free Temple of said religion inside each newly created city. I added that onto the Spiritual trait, but considering it feels like Creative+ (culture from the religion and the Temple), I decided to take out the free Temple and perhaps add some kind of super Missionary for Spiritual leaders (100% chance of spreading religion, can explore rival territory).

I have no idea how to do all that, but hey, neither did anyone else before he or she actually did something. Alas, even removing the free building doesn't work for me.

This is one of the two functions:
Code:
def onCityBuilt(self, argsList):
		'City Built'
		city = argsList[0]
###believer trait start part 1
		pPlayer = gc.getPlayer(city.getOwner())
		if pPlayer.hasTrait(gc.getInfoTypeForString("TRAIT_SPIRITUAL")):
                        iReligion = pPlayer.getStateReligion()
                        if  iReligion>-1:
                                city.setHasReligion(iReligion,True,True,True)
                                NumBuildings = gc.getNumBuildingInfos ()
                                for i in xrange(NumBuildings):
                                        MyBuilding = gc.getBuildingInfo(i)
                                        if MyBuilding.getPrereqReligion ()==iReligion:
                                                if MyBuilding.getSpecialBuildingType ()==gc.getInfoTypeForString("SPECIALBUILDING_TEMPLE"):
                                                        city.setNumRealBuilding(i,1)
                                                        break
                                        
###believer trait end part 1
		if (city.getOwner() == gc.getGame().getActivePlayer()):
			self.__eventEditCityNameBegin(city, False)	
		CvUtil.pyPrint('City Built Event: %s' %(city.getName()))
It seemed quite logical to simply remove the following part:
Code:
                                NumBuildings = gc.getNumBuildingInfos ()
                                for i in xrange(NumBuildings):
                                        MyBuilding = gc.getBuildingInfo(i)
                                        if MyBuilding.getPrereqReligion ()==iReligion:
                                                if MyBuilding.getSpecialBuildingType ()==gc.getInfoTypeForString("SPECIALBUILDING_TEMPLE"):
                                                        city.setNumRealBuilding(i,1)
But that also removes my interface in-game, so obviously I'm doing something wrong. However, I see no )'s that need to be closed, nor do I see any unfinished code, so to say, I see no 'end sign' that I have to add (I don't think it exists in Python anyway), and the 'break' works in your code so I don't see why it would suddenly be a problem. That's all I can think of.

Could you / someone tell me what I'm doing wrong, perhaps? Thanks in advance! :)
 
1) Activate python exceptions.
2) The purpose of the "break" is to break the building for loop when it locates the temple to be built.
Obviously it serves no purpose if you remove those lines before it, and it will cause problems.
 
Yep, removing the break worked. Thanks a lot for your fast responses! :)
 
Hi, Platy. I have some problems with developing trait merge. Is possible are here some script data? In last case I have problems too when two parts with script data.
 
understand. When I merged FAITH and Happy Golden Age ( Player Script Data ) you made special version with both...
Do you think you could do all three your mods compilate , please ? Faith, happy golden and developing trait?
 
Faith and Golden Age were written too long ago.
Would have to rewrite them in a simpler way before merging all 3.
In other words, not gonna happen in the near future.
 
I understand . I'm sorry that I can not use it now but I'll be patient . I look forward to the day when it will be finished . :)
 
Updated to Platypedia 2.16:
1) Equipments
2) Artifacts
3) Manufactured Resources
4) Great Works
5) Natural Wonders
6) Bad People
 
Hi, Platy. I have some problems with developing trait merge. Is possible are here some script data? In last case I have problems too when two parts with script data.

Yeah, it uses player script

Does he have two problems, one with the script data itself and one with the MainInterface?

I suspect it's not the script data that breaks the interface or is it?
 
Hi platy

I want to use from your Ultrapack, City Screen at number 8) Auto spacing of Religions and Corporations.
Please see red frame on image. Which file to open and which part of code i must copy for this ?
And i use BUG interface.
 

Attachments

  • relcorpscrcity.JPG
    relcorpscrcity.JPG
    92.5 KB · Views: 77
Top Bottom