Tsentom1 Python Wonders

I hate to triple post here, but I think it is better to keep a bunch of different code in different posts just to avoid confusion. Anyway, I'm an idiot because I missed two other sections of code. So I'm going to put them in, but I wanted to see what needs to be removed to fit with my other code (i.e. so there is no vassal requirement). So here is the first section I missed:

Code:
	def onBeginPlayerTurn(self, argsList):
		'Called at the beginning of a players turn'
		iGameTurn, iPlayer = argsList

## Topkapi Palace Start ##

		pPlayer = gc.getPlayer(iPlayer)
		iTeam = pPlayer.getTeam()
		pTeam = gc.getTeam(iTeam)

		b_Flavian = gc.getInfoTypeForString("BUILDING_FLAVIAN")
		obsoleteTech = gc.getBuildingInfo(b_Topkapi).getObsoleteTech()

		if ( gc.getTeam(pPlayer.getTeam()).isHasTech(obsoleteTech) == false or obsoleteTech == -1 ):
			for iCity in range(pPlayer.getNumCities()):
				ppCity = pPlayer.getCity(iCity)
				if ppCity.getNumActiveBuilding(b_Flavian) == true:

					for iPlayer in range(gc.getMAX_PLAYERS()):
						ppPlayer = gc.getPlayer(iPlayer)
						if ( (ppPlayer.isAlive()==true) and (ppPlayer.isBarbarian()==false) ):
							if ( gc.getTeam(ppPlayer.getTeam()).isVassal(iTeam) == true ):

								iGold = ppPlayer.getGold( )
								if ppPlayer.getGold( ) >= 5000:
									ppPlayer.changeGold( 50 )
								if ppPlayer.getGold( ) < 5000:
									if ppPlayer.getGold( ) >= 100:
										ppPlayer.changeGold( iGold//50 )
									else:
										ppPlayer.changeGold( 2 )

								ppPlayer.changeCombatExperience( +1 )
	
## Topkapi Palace End ##

Okay, the second part is a bit confusing because I have a section similar in my code already. Here is the Topkapi code:

Code:
## Topkapi Palace Start ##

	def getRandomNumber(self, int):
		return CyGame().getSorenRandNum(int, "Gods")

## Topkapi Palace End ##

And here is what I have in mine, which has the same "def" part, but a different return:

Code:
	def getRandomNumber(self, int):
		return gc.getGame().getSorenRandNum(int, "Next War")

So yeah, a little help here; how do I "merge" these last two codes. Hopefully this should make it all work... right?
 
Aaaaah. No! Don't believe any of the error screens you are showing us. You should really show us the python error screens which are UNDER your error screens. The "NAME" which is mentioned in the error screen must be where you put in the code. This has nothing do to with diplomacy or the BUG mod.
 
You do not need to merge them. One is enough. It just tells you, that you can use

"getRandomNumber(X)" instead of "CyGame().getSorenRandNum(X, "ANYTHING HERE")"

it's shorter. that's all.
 
Aaaaah. No! Don't believe any of the error screens you are showing us. You should really show us the python error screens which are UNDER your error screens. The "NAME" which is mentioned in the error screen must be where you put in the code. This has nothing do to with diplomacy or the BUG mod.

I don't understand, I did that alraedy. Here are all of the pop-ups, the first one and the two underneath.

attachment.php

And the other code I posted is for strengthening vassals, so we can simply ignore that. So I don't know what to do.
 
LOL.

Alright, I just want to point out to both of you (NSG, and Cybah) that both of the things you just asked me for have already been posted here:

.....

Unfortunately I still got these pop-ups at around turn two or three:

attachment.php

So I'm not sure what the problem coudl really be at this point. But judging by the pop up it appears that line 239 seems to be at issue. Line 239, however, has nothing to do with this code (but didn't cause any issues until this code was used). So I might need some help on this. Here is the surrounding code with line 239 hilighted:

Code:
	def onCityDoTurn(self, argsList):
		'City Production'
		pCity = argsList[0]
		iPlayer = argsList[1]
		###from here
		[COLOR="Red"]pPlayer = gc.getPlayer(iPlayer)[/COLOR]
		if not pPlayer.isCivic(gc.getInfoTypeForString("CIVIC_SLAVERY")):
			iSlaveSpecialist = gc.getInfoTypeForString("SPECIALIST_SLAVE")
			iSlaveSpecialistInCity = pCity.getSpecialistCount(iSlaveSpecialist)
			pCity.alterSpecialistCount(iSlaveSpecialist,-iSlaveSpecialistInCity)
				###to here
		
# no anger defying UN resolutions start #
		iGovernmentCivicOption = CvUtil.findInfoTypeNum(gc.getCivicOptionInfo,gc.getNumCivicOptionInfos(),'CIVICOPTION_GOVERNMENT')
		iPoliceState = CvUtil.findInfoTypeNum(gc.getCivicInfo,gc.getNumCivicInfos(),'CIVIC_POLICE_STATE')
		pPlayer = gc.getPlayer(iPlayer)
		iGovernmentCivic = pPlayer.getCivics(iGovernmentCivicOption)

		if (iGovernmentCivic == iPoliceState):
			pCity.changeDefyResolutionAngerTimer(pCity.getDefyResolutionAngerTimer())
# no anger defying UN resolutions end #

Do you guys see anything?
 
You mean the "bug" error screen is the last? It looks like there is another screen behind that screen.

Anyway, try this instead of your highlighted line:

PHP:
		pPlayer = gc.getPlayer(pCity.getOwner())
 
You mean the "bug" error screen is the last? It looks like there is another screen behind that screen.

Anyway, try this instead of your highlighted line:

PHP:
		pPlayer = gc.getPlayer(pCity.getOwner())

Thanks, I'll try that out. :goodjob:

Oh, the screen behind the BUG screen just says "Traceback error, most recent call last" or something like that, so I didn't bother posting it.
 
This error really confuses me :confused:.
There is just nothing wrong :confused:.

Damn, if The_J can't see it I don't know what to do then.

It does not mean anything ;). In fact, i'm a terrible coder, you just can't see it ;).
 
Hm. I've read everything and quit puzzled.
I have the Eden Project and it works fine : video and all.
But the Copernicus, Sphinx, the Greath Bath of Mahenjo-Daro and Cheomseongdae movies don&#8217;t work. They are work great ingame but the movies won&#8217;t show up at all.
Any idea ?
 
Golden Dawn download link is still borked. Just a heads up. Thank you for the shiny wonders.
 
Does anyone else have the problem with the Public Works wonder where Infrastructure can always be built by anyone at any time?

You should have fixed it in the meanwhile. If not, just my 2 cent: I guess you did not update PythonCallbackDefines.xml - or CvGameUtils.py.
 
Hi!

I hope some Python-knowing people can help me. I would like to see a message each time KingRichards grants a Crusader. Something like: "A new Crusader has joined your cause.".

Unfortuneately, I have no idea how to do this. So please help.:help:

Chamaedrys
 
If you look through the python files of this mod, you'll see multiple times this line here:
PHP:
pNewUnit = pPlayer.initUnit( u_crusader, iX, iY, UnitAITypes.UNITAI_ATTACK_CITY, DirectionTypes.NO_DIRECTION )

Add directly in the line afterwards:
PHP:
CyInterface().addMessage(iPlayer,False,15,CyTranslator().getText("TXT_KEY_YOUR_NEW_PERSONAL_TEXT",()),'',0,gc.getUnitInfo(u_crusader).getButton (),ColorTypes(44), iX, iY, True,True)

Attention: This line needs exactly the same amount of white spaces like the line before.
Don't put them in by hand, copy the whitespaces from the line before! Might sound strange, but this is needed.
Please activate the python exceptions in your BtS .ini to see, if your modifications work or not.
And don't forget to create and change TXT_KEY_YOUR_NEW_PERSONAL_TEXT ;).
 
I have converted some of of Tsentom1's Ishtar gate to be BUG/WoC compatible. This makes it "easier" to add the RevDCM based mods.

Instillation
Spoiler :
Instillation is not straight forward. You will need to edit two XML files.

In the Assets/Modules folder edit MLF_CIV4ModularLoadingControls.xml to add in
Code:
				<Module>
					<Directory>tsentom1_python_wonders</Directory>
					<bLoad>1</bLoad>
				</Module>

In the Assets/Config folder edit init.xml to add in
Code:
	<load mod="Ishtar"/>

before the </bug> line at the end.

There may be problems with the schemas so copy the ones from your mod if you need to.

Ishtar Gate

The Great Bath of Mohenjo-daro

While doing this one I noticed a bug where it would forget that you had built the wonder if you saved the game and loaded later. So I fixed it but there is still one problem that I noticed.
 
Thanks for this, I used it in my mod!
 
I just don't get it. I installed the Sphinx in my new mode, but didn't install the python file, and it still works... WHY ? what is the python file there for ?
 
Back
Top Bottom