Platy's Peculiar Pleasant Posh Python

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.
 
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: 87
@Zlako
It is no longer done that way.

@isenchine
The script data will break the maininterface
 
Platy, is it possible to code an object which would work as city, but can also move?
 
heya platy,

about uuuu:
1. the category "upgrade tree" in the pedia - shows the tech tree
2. there is no unit upgrade tree.



3. in previous versions of uuuu, you had in the pedia - "limited units" that was very good actually, good you bring that back? maybe a limited wonders/buildings while your at it?
 
1) There is a dropdown menu...

3) Use the sort function.
 
yup, thats what happens when i dont update it as often as i used too :)

thanks man.

once more thing,
can you adjust the manufacture resources to the current platypedia - i am unsuccessful in merging the pedia files from that mod comp to the current uuuu, its a key mod comp in my barsoom,
can you help?


and a question -
in the financial victory -
how do i change the amount of buildings (bank) required for the win? right now its 1.
 
Back
Top Bottom