Platyping's Python

Thanks, still havent found a suitable artwork for your seed vault :D
Any recommendations?
 
Hmm if all you want is extra movement points for the ships themselves, then you might as well just download magellan voyage and rename it as compass rose since that has what you wanted?

Ok, thanks for the suggestion, I will try to mix both.

PS: its not a question of what I want, it is a question of what makes sense.

Thanks :)
 
There, Swapped

Compass Rose
Spoiler :

Civ4ScreenShot0002-4.jpg


Artwork by Hrochland


Trafalgar Square
Spoiler :

Civ4ScreenShot0003-1.jpg


Artwork by asioasioasio


I did mention that I don't feel like redoing any wonders already did before by previous python makers. But just cannot find any other naval wonders, so temporarily use this Trafalgar Square:dunno:

P.S.
Both wonders make use of def onUnitMove, no guarantee on performance on big maps
 
There, Swapped

Compass Rose
Spoiler :

Civ4ScreenShot0002-4.jpg


Artwork by Hrochland


Trafalgar Square
Spoiler :

Civ4ScreenShot0003-1.jpg


Artwork by asioasioasio


I did mention that I don't feel like redoing any wonders already did before by previous python makers. But just cannot find any other naval wonders, so temporarily use this Trafalgar Square:dunno:

P.S.
Both wonders make use of def onUnitMove, no guarantee on performance on big maps

Many Thanks :)

About performance I did some refactoring, does this improve performance? (or is possible to do? since I cant test it now):

Code:
	def onUnitMove(self, argsList):
		'unit move'
		pPlot,pUnit,pOldPlot = argsList
		## New Var ##
		owner = pUnit.getOwner() 
		player = PyPlayer(owner)
		## New Var ##
		unitType = pUnit.getUnitType()
		unitInfo = PyInfo.UnitInfo(unitType)

## Compass Rose Start ##
		pPlayer = gc.getPlayer(owner) 
		if pPlot.isCity() and pUnit.getDomainType() == gc.getInfoTypeForString("DOMAIN_SEA"):
			if pPlayer.getBuildingClassCount(gc.getInfoTypeForString("BUILDINGCLASS_COMPASS_ROSE")) == true:
				obsoleteTech = gc.getBuildingInfo(gc.getInfoTypeForString("BUILDING_COMPASS_ROSE")).getObsoleteTech()
				if gc.getTeam(pPlayer.getTeam()).isHasTech(obsoleteTech) == false or obsoleteTech == -1:
						pUnit.changeMoves(-30)
## Compass Rose End ##
 
I not sure what you want, apparently you removed the check for terrain = coast.
As such, the above code will only activate when a naval unit move into a city thats all
 
I not sure what you want, apparently you removed the check for terrain = coast.
As such, the above code will only activate when a naval unit move into a city thats all

oops, my mistake, thanks for saying it :goodjob:

My idea is that if you test first the type of unit (or terrain) is more performant than asking if you have the wonder, since if it is a land unit or not in coast (in most cases is) test stops there.

I just did some more refactoring with this in mind:

Code:
'unit move'
		pPlot,pUnit,pOldPlot = argsList
		## New Var ##
		owner = pUnit.getOwner() 
		player = PyPlayer(owner)
		## New Var ##
		unitType = pUnit.getUnitType()
		unitInfo = PyInfo.UnitInfo(unitType)

## Compass Rose Start ##
		if(pUnit.getDomainType() == gc.getInfoTypeForString("DOMAIN_SEA") :
		if pPlot.isCity() or pPlot.getTerrainType() == gc.getInfoTypeForString("TERRAIN_COAST"):
			pPlayer = gc.getPlayer(owner) 
			if pPlayer.getBuildingClassCount(gc.getInfoTypeForString("BUILDINGCLASS_COMPASS_ROSE")) == true:
				obsoleteTech = gc.getBuildingInfo(gc.getInfoTypeForString("BUILDING_COMPASS_ROSE")).getObsoleteTech()
				if gc.getTeam(pPlayer.getTeam()).isHasTech(obsoleteTech) == false or obsoleteTech == -1:
						pUnit.changeMoves(-30)
 
I check the buildingclass first because as a world wonder, only 1 player will pass the first test.
Checking anything else such as unit domain = sea, will be true for much more cases.
Which means there will be more cases requiring the 2nd check
 
I check the buildingclass first because as a world wonder, only 1 player will pass the first test.

Ahh ok, I was trying to improve it but being a world wonder make it faster already.

Thanks :goodjob:
 
Azadi Tower
Spoiler :

Civ4ScreenShot0004-5.jpg


Another idea from ciV social policy
Don't ask me what has it gotta do with Electricity.
Ask Friraxis why there isn't any modern tech to dump all these modern wonders

Artwork by stolenrays


Edit:
Updated Megapack with new compass rose, trafalgar square, necromanteion and azadi tower
 
Espionage Version of SETI:

Alamut
Spoiler :

Alamut.jpg


50% Chance to perform 1 of those at random player every 10 turns.
Master/Vassal invalid choice
Affects All Cities of Victim
Culture Spread = GameTurn/3
Destroy Improvements only at adjacent tiles of Capital, 25% Chance

Didn't bother to do the last 2 missions, convert religion and convert civics
Artwork by walter Hawkwood
 
Thanks :D
Initially I set it as 25%, theoretically that means approximately every 40 turns it will happen once.
For Quick or Normal Speed games, 40 turns is quite a long time, especially when Quick is only around 330 turns. Between the time the wonder is built, and the time it obsoletes, I guess it will only trigger 5 times or so.

Of course, I can tune the "every 10 turns" to be based on game speed, but I guess improving it from 25% to 50% would make it more effective.

Afterall, out of the 10 missions, actually some are not that great anyway.
Steal Tech will do nothing, if the random player doesn't have a tech you need.
Spreading of culture is no big deal idea, the majority of the culture will still be theirs, what's the difference
Counter Espionage does nothing too, if the player is far far away, or worse on different continent
25% of Gold varies, if he has peanuts, you get peanuts.

The heavy consequences would be the anarchy and unhappy/unhealthy hits, production and courthouses I guess.
If the heavy ones are too OP, the effects can be tuned down, no problem :D
In a big game, this wouldn't be that OP since chances of it hitting the same player would be low, but for a small game, even if you got hit, I guess you can pray for the not so serious consequences lol
 
Code:
	def onCombatResult(self, argsList):
		'Combat Result'
		pWinner,pLoser = argsList
		playerX = PyPlayer(pWinner.getOwner())
		unitX = PyInfo.UnitInfo(pWinner.getUnitType())
		playerY = PyPlayer(pLoser.getOwner())
		unitY = PyInfo.UnitInfo(pLoser.getUnitType())

## Catacombs Start ##
		if pWinner.getUnitType() == gc.getInfoTypeForString("UNIT_BRANDEIRANTES"):
			if pLoser.getDomainType() == gc.getInfoTypeForString("DOMAIN_LAND") and pLoser.getUnitCombatType() != -1:
				pPlayer = gc.getPlayer(pWinner.getOwner())
				burialchance = CyGame().getSorenRandNum(100, "die together")
				if burialchance == 0:
					newUnit = pPlayer.initUnit(gc.getInfoTypeForString("UNIT_SETTLER"), pWinner.getX(), pWinner.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.NO_DIRECTION)
					newUnit.finishMoves()
				elif burialchance < 10:
					newUnit = pPlayer.initUnit(gc.getInfoTypeForString("UNIT_WORKER")), pWinner.getX(), pWinner.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.NO_DIRECTION)
					newUnit.finishMoves()
## Catacombs End ##

1) First if statement checks if the winning unit is the UU
2) Next if statement checks if the defeated unit is a land unit and is not a non-combat unit like workers, settlers, missionaries, great people
The first part is so that if the UU walks into town and "defeats" a battleship or fighter, the code will not activate.
The 2nd part is so that if the defeated unit is non combat, it will not trigger either
3) Roll a dice from 0 to 99
4) If 0, spawn settler
5) 1 to 9, spawn worker

However, this is assuming that neither settler nor worker is another Brazil UU.
If it is, need extra codes
 
Edit:
Theory of Everything and Alamut
Replaced whole chunk of pTeam.setHasTech + show Tech Movies code with
Code:
pTeam.changeResearchProgress(iTechType, pTeam.getResearchCost(iTech) - pTeam.getResearchProgress(iTech), iPlayer)

Actually both codes are doing the same thing, adding the free tech to the player.
However, using setHasTech will not trigger whatever codes are in onTechAcquired section, so I rewrote this part for it to be compatible with other wonders using that section

Didn't expect Alamut to have so many downloads in few hours, so for the ease of those who have downloaded, just replace this part:
Code:
						elif Alamut == 2:
							for iTech in range(gc.getNumTechInfos()):
								if VictimTeam.isHasTech(iTech) and pTeam.isHasTech(iTech) == false:
									pTeam.changeResearchProgress(iTech, pTeam.getResearchCost(iTech) - pTeam.getResearchProgress(iTech), iPlayer)
									CyInterface().addMessage(iPlayer,true,15,CyTranslator().getText("TXT_ALAMUT_STEALTECH",(VictimCiv,)),'',0,'',-1,-1,-1,false,false)
									break

Updated Megapack with necessary changes, and added Alamut
 
CvEventManager
Just dump the whole Catacombs part under def onCombatResults like what I did.
Catacombs, burialchance and "die together" are just comments/name of variables.
They have no effect on the outcome, but you can rename them if you like

Set HidePythonExceptions to 0 when you are trying it out.
Didn't bother to test it, so just in case there is a typo error somewhere
 
Code:
## Catacombs Start ##
		if pWinner.getUnitType() == gc.getInfoTypeForString("UNIT_[COLOR="red"]MODERN_ARMOR[/COLOR]"):
			if pLoser.getDomainType() == gc.getInfoTypeForString("DOMAIN_LAND") and pLoser.getUnitCombatType() != -1:
				pPlayer = gc.getPlayer(pWinner.getOwner())
				burialchance = CyGame().getSorenRandNum([COLOR="Red"]10[/COLOR], "die together")
				if burialchance == 0:
					newUnit = pPlayer.initUnit(gc.getInfoTypeForString("UNIT_SETTLER"), pWinner.getX(), pWinner.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.NO_DIRECTION)
					newUnit.finishMoves()
					CyInterface().addMessage(pWinner.getOwner(),true,15,CyTranslator().getText("TXT_KEY_BRAZIL_BANDEIRANTE_SETTLER_CAPTURED",()),'',0,'',-1,-1,-1,false,false)
				elif burialchance < 10:
					newUnit = pPlayer.initUnit(gc.getInfoTypeForString("UNIT_WORKER"), pWinner.getX(), pWinner.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.NO_DIRECTION)
					newUnit.finishMoves()
					CyInterface().addMessage(pWinner.getOwner(),true,15,CyTranslator().getText("TXT_KEY_BRAZIL_BANDEIRANTE_WORKER_CAPTURED",()),'',0,'',-1,-1,-1,false,false)
## Catacombs End ##
Code:
	<TEXT>
		<Tag>TXT_KEY_BRAZIL_BANDEIRANTE_WORKER_CAPTURED</Tag>
		<English>[COLOR_GREEN]You have captured a Worker[COLOR_REVERT]</English>
		</TEXT>
	<TEXT>
		<Tag>TXT_KEY_BRAZIL_BANDEIRANTE_SETTLER_CAPTURED</Tag>
		<English>[COLOR_GREEN]You have captured a Settler[COLOR_REVERT]</English>
		</TEXT>

I did the test with modern armor. Fat finger, got an extra ")" in previous code. :crazyeye:
To make it simple for you to test, I changed this red number to 10, so it will only roll a number from 0 to 9, so either settler or worker will always spawn. After you are done testing, set it back to 100
 
P.S.
Out of names soon :D if anyone still has anymore wonders they wanna see, tell me about it
Last few names I know of:
All the Religious wonders
Panthenon
Plato's Academy
Library of Ashurbanipal/Nineveh
Great Zimbawee
Itaipu Dam
Delta Works/ Zuiderzee Works
Panama Canal
Hoover Dam
International Space Station

I am using in my mod four of your amazing wonders (the portuguese ones) you enhanced:)

:goodjob:

For my mod, there is only one missing, I sent you a PM about it but now I have a slight idea how it can work. But I need help from people arround here since it is a diffrent kind of treaty.

What I am talking about is Treaty of Tordesilhas: http://en.wikipedia.org/wiki/Treaty_of_Tordesillas

Explaining it in simple words the treaty says that new world discovered is distributed in half (by a meridian) by/for two countries (in real case Portugal and Spain).

This was possible because Portugal and Spain have started exploring the seas earlier and then colonized America and Africa because natives were behind in some sort of technology.

My suggestion is that two civilizations that are ahead of all others, meaning that other civs dont have this techs (that main two have):
-Optics
-Theology
-Paper
-Civil Service
-Guilds

Also, main two have to choose theology religion as their main religion and have to be connected to water by at left or right side and have at least 3 cities or such.

The question is what to do when this happens? when they meet the other civ they automaically made vassal (but for a limitated time)? how to divide the new word in half?

This is an dificult one..
Any suggestions?

Thanks :)
 
Not sure how to do that, but treaty of madrid could be easily done, two civs, their one boarder city is changed civs, the loser of the city gains bonus for religion (since the pope suggested the idea of the treaties)
Althought doesn't show the colonization part, you really can't in civ, without moddinng it extremely

maybe for treaty of versialles, any unoppened island or main part of continent, one civ gets citys on that island/continent (or settlers w/ ships) and the other civ gets a different island/continent, either have it be buildable by 2 civs, which i dont think will work well, or have the computer automatically give it to the highest scored player and the builder (2nd highest if the highest is the builder)
 
There are too many issues involved to make that treaty.
For instance:

Dividing an area into 2 has been done by Gateway Arch, but that is still ok, because it is quite easy to determine which continent to divide into 2. For this case, how to determine where or what is considered a new world.

Being connected by water, simplest way will be min 1 coastal city. However, this is assuming that there is only 1 whole big ocean. Else, even if both have coastal cities, the water part in between may not be connected. And I don't see any possible way to check.

As for the treaty itself, obviously the builder should be one of the 2 players to split the world, unless it is an unbuildable project like pradrao or olympics which are triggered under certain circumstances. The first player can be easily tracked by who built it, but extra steps have to be done to keep track of the 2nd player.

Regards to dividing that new world, another question is how to divide? Randomly add cities throughout the continent and give half each? Firstly, there may already be cities built in the continent. Secondly, there is no way I can check each plot and see if it is a strategic plot to plant a city. As such, you will end up getting a continent with garbage location cities.

With so many issues, I doubt there is a need to consider the religion and vassal part.
Too many things to do, keep track, restrict etc that this treaty will not be that useful (due to restrictions) and efficient (too many codes will just lower performance too much for just a project)
 
Great Zimbawee
Spoiler :

Civ4ScreenShot0009-3.jpg


A) The city continues growing at the rate it is building normal units/buildings.
B) Different from the surplus stated when building settlers/workers
This is because A) takes into account unhappy citizens, whereas B) ignores unhappy citizens.
Thus, I chose to let it grow at rate A rather than B because B is much higher when there are alot of unhappy citizens.

Actually, this wonder is much more useful at an earlier era, but can't find a suitable wonder so here it is
 
Back
Top Bottom