Platyping's Python

Triumph
Spoiler :
Triumph.jpg


Firestorm
Spoiler :
Firestorm.jpg


2 simple ones.
Actually firestorm should be granted to siege, but... they cannot win a combat ...
P.S. Need another post between post 3 and 4 :D
 
P.S. Need another post between post 3 and 4 :D

Done :).
...but...um...the first page is freakin' unpleasant to load/navigate. I'd recommend creating new threads for the different things, so one for projects, traits, promotions, etc.
 
I think the AI Entity Wonder from your pack is bugged currently, in the way War Mechs are handled; it leads to barbarians being able to use war mechs from the very beginning of the game. This quickly leads to a bad situation. I think it may have something to do with the War Mech unit always being available, only grayed out without the Entity.
 
Did you name yourself AI Entity just for that post :p

Welcome to the forums [party]
 
AI Entity? No, I'm AL Entity, not a perfect machine built to rule over humans for their own benefit. No relation.

I really am enjoying the Wonder Packs though aside from that issue, with the additional projects being especially interesting since they are so different from wonders in the approach.

As long as I am pointing out bugs I've encountered, the Great Baths wonder seems bugged as well, with the model for the freshwater source it adds not being found by the game, leading to a bright pink dome in the city is built in. I went into world builder and erased the terrain feature it added and the dome vanished, so that's why I believe it is the cause.

And as long as I'm posting, may I ask if there is a simple way to run both the Promotions Mod and the Wonderpack at the same time? From what I've looked up about mods it won't be possible unless I merge the files by hand due to them modifying the same files.

EDIT: If the reason the War Mechs are appearing is what I suggested, then perhaps it could be worked around by making the Tech required to build the Entity also "Required" for War Mechs, so they don't show up as a grayed out option until then? Otherwise, perhaps script the AI Entity to just spawn a WarMech every so many turns rather than building them in cities. I think that would also eliminate them being built by Barbarians and even makes sense, since then it is the Entity building them, not the player.

I'm going to try and restart that game from 4000 and see if I still encounter the same issue. I ended up "Winning" the first time by building the Great Wall and just letting the War Mechs kill everyone else for me.
 
Thanks for feedback :D
1) AI Entity fixed, now the assault mechs require robotics as well.
2) Great Bath art path fixed.
3) Gigapack updated.

Regarding merging both Promopack and Wonderpack, at one point of time I will probably do that, but just the python file, since the only XML files in Promopack are PromotionInfos.xml and Text files, should not be an issue merging.

However, that will probably be after I am done with Gigapack first,
1) Last project should be Incense Route, although the effects are not done yet :D out of ideas
2) Guiness World Record remake, currently the only work left using onUnitCreated callback
3) Walls of Babylon, same reason, using onCannotMoveInto callback

Surprisingly you can actually play the wonderpacks with so many python codes added :D
Killing 2 callbacks may be better for overall performance.

After I am totally done with Gigapack, then it will be easier to merge, else if I make a change to AI Entity for instance, I have to update Gigapack codes, and the new merge codes as well.
The more copy and paste done, the more prone to errors.
 
Seeing that there are people who are playing Gigapack itself and wanted to merge promotions in, I decided to do them a favour.

Thunderous Terrific Titanic TeraPack

Features
Merged version of Gigapack, Traits and Promotions
I still call it a mod component rather than a mod pack, since you can add in the techs, buildings units, civs or sevopedia or blue marble if you like.
Too lazy to do those :D

Wonders and Projects
1) Amount cut by half or so from Gigapack
2) Callback required only ONE
3) Some effects of 2 different works are merged into one, so you don't really miss the fun
4) Caught and fix some bugs in Gigapack while doing this pack
5) Most National Wonders merged into a World Wonder, as there is a NW limit, so we don't wanna hurt the poor AI
6) Buttons of poor resolution remade

Traits
1) Only merged in the 11 BTS traits
2) Some traits remake using effects from the other traits

Promotions
1) Instant Heal, Mentor out
2) Some are adjusted to fit the other works better

Bug Fixes:
Ishtar Gate

Art Define for Movie typo

Gobeki Tepe
One python error

Gigapack
Ishtar Gate and Copernicus' Observatories are missing
Added compatibility between Great Mosque of Djenne and Famen Temple

@Jamie
I tried shifting Natural Wonders from being a project to activate at game start.
All works well, except I notice a problem.
When you start a game normally, NWs are placed happily.
If you regenerate map, all are gone and none will be placed again.
Should be a problem for your mod as well, so I shift it back to be a project
 
I just saw the Unstoppable and Regeneration promotions, and wondered how OP they'd be put together.
 
Yeah, I thought of that as well.

Few ways to go about it:

1) Check unstoppable before regeneration, just a rearrangement of codes.
2) Increase unstoppable to simply 100% rather than > 90%. If you can reach 100% after regen, you were at 85% anyway.
3) Reduce unstoppable to 0.5 Movement. At most let you whack twice.

This one should be at the other thread :D
 
The Last Project

Curse of the Pharaoh
Spoiler :
CurseofPharaoh.jpg

Curse2.jpg


Oh well, nothing much I can do regarding Incense or Tea Route to make it "interesting" project that is not simply, give gold, give culture, plant bonus blah blah blah.

Since I been doing promotions lately, why not a demotion :D

When Rivals build their units, there is a chance to get this "free promotion".
Ancient: 5/6
Classical: 4/6
Medieval: 3/6
Renaissance: 2/6
Industrial: 1/6
Modern and Future: No more superstitions :D

But don't fret if your units are cursed with this "promotion".
When they grow stronger, they are relieved of it.

Naturally, this means the original Curse Promotion will get a new name and button when merged in Terapack


Thirty Six Strategems:
Effects: Grants a Promotion that lasts for one battle to new units built
New Effects: Only for Non mechanical Units
Reason: onCombatResults only triggered for Land and Sea Battles.
Granting to Siege will never remove the promotion, since Siege will just withdraw, unless on Defense.
Granting to Air will never trigger it, lasting forever.
Make things simple, only non mechanical units, since all are land and none is Siege.

Terapack:
Fixed an error with Venetian Arsenal new code.
Used back old code, without exp loss

All packs updated and "Closed"
There shouldn't be further updates to Megapack and Gigapack, unless bugs appear.
Lazy to remake some others that are the only ones left requiring specific callbacks.
For light version, just use Terapack.

Started on 1st Jan 2012.
Ended on 10th Dec 2012.
Retired from Wonders and Projects :D
 
Looks nice!
But what happened with the Tea Horse Road? :mischief:
 
Got dumped into the Recycle Bin along the way :D

Although I won't be making new ones, currently I am doing research on events.
It can be an improvement to some existing works.

For instance, Bolshoi when built, makes all Theatres provide +2 Culture.
Currently, it is coded such that when Bolshoi is created, a loop is done through all the cities to achieve the effect, plus extra codes for new cities built or accquired.
Of course, when Bolshoi is razed or changes hands, further codes have to be triggered.

I am looking into when Bolshoi is built, triggered an event with only one outcome that does the +2 Culture to All Theatres. So far it is quite simple and works well.
Bolshoi Built => Triggers Bolshoi Event => Adds Culture to Theatres (Existing and Future ones in Existing and Future Cities)
All settled with one line of code.
However, when Bolshoi Razed or Conquered, Triggers Bolshoi Gone Event => Removes Culture to Theatre, + Triggers Bolshoi Event for new owner => Adds Culture to Theatres for new owner

Overall, it seems doable and works pretty decent for me, plus the possiblitiy of using other event benefits as wonder benefits, such as inflation adjustments.

Only issue I have with it is the event pop up. Is there any way of applying the event and its benefits without the pop up window?

Also, I assume there will not be any issue with AI, since there is only one possible outcome?
 
Results of my Experiments

Bolshoi
Spoiler :
Bolshoi-1.jpg


Original Codes
Spoiler :
Code:
	def onBuildingBuilt(self, argsList):
		'Building Completed'
		pCity, iBuildingType = argsList
		game = gc.getGame()
## Bolshoi Start ##
		if iBuildingType == gc.getInfoTypeForString("BUILDING_BOLSHOI"):
			pPlayer = gc.getPlayer(pCity.getOwner())
			(loopCity, iter) = pPlayer.firstCity(false)
			while(loopCity):
				loopCity.setBuildingCommerceChange (gc.getInfoTypeForString("BUILDINGCLASS_THEATRE"), 2, 2)
				(loopCity, iter) = pPlayer.nextCity(iter, false)
## Bolshoi End ##

	def onCityBuilt(self, argsList):
		'City Built'
		city = argsList[0]
## Bolshoi Start ##
		pPlayer = gc.getPlayer(city.getOwner())		
		if pPlayer.getBuildingClassCount(gc.getInfoTypeForString("BUILDINGCLASS_BOLSHOI")) == 1:
			city.setBuildingCommerceChange (gc.getInfoTypeForString("BUILDINGCLASS_THEATRE"), 2, 2)
## Bolshoi End ##

	def onCityRazed(self, argsList):
		'City Razed'
		city, iPlayer = argsList
		iOwner = city.findHighestCulture()
## Bolshoi Start ##
		if city.getNumActiveBuilding(gc.getInfoTypeForString("BUILDING_BOLSHOI")):
			pPlayer = gc.getPlayer(iPlayer)
			(loopCity, iter) = pPlayer.firstCity(false)
			while(loopCity):
				loopCity.setBuildingCommerceChange(gc.getInfoTypeForString("BUILDINGCLASS_THEATRE"), 2, 0)
				(loopCity, iter) = pPlayer.nextCity(iter, false)
## Bolshoi End ##

	def onCityAcquired(self, argsList):
		'City Acquired'
		iPreviousOwner,iNewOwner,pCity,bConquest,bTrade = argsList
		CvUtil.pyPrint('City Acquired Event: %s' %(pCity.getName()))	
## Bolshoi Start ##
		pPlayer = gc.getPlayer(iPreviousOwner)
		pPlayer2 = gc.getPlayer(iNewOwner)
		if pCity.getNumActiveBuilding(gc.getInfoTypeForString("BUILDING_BOLSHOI")):
			(loopCity, iter) = pPlayer.firstCity(false)
			while(loopCity):
				loopCity.setBuildingCommerceChange (gc.getInfoTypeForString("BUILDINGCLASS_THEATRE"), 2, 0)
				(loopCity, iter) = pPlayer.nextCity(iter, false)
			(loopCity, iter) = pPlayer2.firstCity(false)
			while(loopCity):
				loopCity.setBuildingCommerceChange (gc.getInfoTypeForString("BUILDINGCLASS_THEATRE"), 2, 2)
				(loopCity, iter) = pPlayer2.nextCity(iter, false)
		else:
			pCity.setBuildingCommerceChange (gc.getInfoTypeForString("BUILDINGCLASS_THEATRE"), 2, 0)
			if pPlayer2.getBuildingClassCount(gc.getInfoTypeForString("BUILDINGCLASS_BOLSHOI")) == 1:
				pCity.setBuildingCommerceChange (bc_theatre, 2, 2)		
## Bolshoi End ##

The original codes consist of 5 parts:
1) When Bolshoi built, a loop is done through all cities to apply the Theatre Boost
2) When new cities built, check if player has Bolshoi, if so apply the boost
3) When Bolshoi razed, loop through all cities again to remove the boost
4) When Bolshoi changed hands, loop through all cities of previous player to remove the boost, then loop through all cities of cities to apply the boost
5) When normal cities changed hands, check if previous or new player has Bolshoi

New Codes
Spoiler :
Code:
	def onBuildingBuilt(self, argsList):
		'Building Completed'
		pCity, iBuildingType = argsList
		game = gc.getGame()
## Bolshoi Start ##
		if iBuildingType == gc.getInfoTypeForString("BUILDING_BOLSHOI"):
			iPlayer = pCity.getOwner()
			pPlayer = gc.getPlayer(iPlayer)
			iEvent = CvUtil.findInfoTypeNum(gc.getEventTriggerInfo, gc.getNumEventTriggerInfos(),'EVENTTRIGGER_BOLSHOI')
			triggerData = pPlayer.initTriggeredData(iEvent, true, -1, pCity.getX(), pCity.getY(), iPlayer, pCity.getID(), -1, -1, -1, -1)
## Bolshoi End ##

	def onCityRazed(self, argsList):
		'City Razed'
		city, iPlayer = argsList
		iOwner = city.findHighestCulture()
## Bolshoi Start ##
		if city.getNumActiveBuilding(gc.getInfoTypeForString("BUILDING_BOLSHOI")):
			pPlayer = gc.getPlayer(iPlayer)
			iEvent2 = CvUtil.findInfoTypeNum(gc.getEventTriggerInfo, gc.getNumEventTriggerInfos(),'EVENTTRIGGER_BOLSHOI_GONE')
			triggerData = pPlayer.initTriggeredData(iEvent2, true, -1, city.getX(), city.getY(), iPlayer, city.getID(), -1, -1, -1, -1)
## Bolshoi End ##

	def onCityAcquired(self, argsList):
		'City Acquired'
		iPreviousOwner,iNewOwner,pCity,bConquest,bTrade = argsList
		CvUtil.pyPrint('City Acquired Event: %s' %(pCity.getName()))
	
## Bolshoi Start ##
		if pCity.getNumActiveBuilding(gc.getInfoTypeForString("BUILDING_BOLSHOI")):
			pPlayer = gc.getPlayer(iPreviousOwner)
			pPlayer2 = gc.getPlayer(iNewOwner)
			iEvent = CvUtil.findInfoTypeNum(gc.getEventTriggerInfo, gc.getNumEventTriggerInfos(),'EVENTTRIGGER_BOLSHOI')
			iEvent2 = CvUtil.findInfoTypeNum(gc.getEventTriggerInfo, gc.getNumEventTriggerInfos(),'EVENTTRIGGER_BOLSHOI_GONE')
			triggerData = pPlayer.initTriggeredData(iEvent2, true, -1, pCity.getX(), pCity.getY(), iPreviousOwner, pCity.getID(), -1, -1, -1, -1)
			triggerData = pPlayer2.initTriggeredData(iEvent, true, -1, pCity.getX(), pCity.getY(), iNewOwner, pCity.getID(), -1, -1, -1, -1)
## Bolshoi End ##

The new code consists of 3 parts:
1) When Bolshoi built, triggers event that applys the Theatre Boost
2) When Bolshoi razed, triggers event that removes the Theatre Boost
3) When Bolshoi changed hands, triggers event for old player to remove, and event for new player to apply.

It is quite clear that in terms of performance, new codes will be better because
1) No loop is done to apply Bolshoi effects. It is pretty much a one line code to simply trigger event
2) No code is done to take care of future new cities built or conquered

What I have tested:
Because each event only has one outcome, AI has no choice what to choose anyway, so the effects still apply to AI directly.

I let AI build Bolshoi, and check that the Theatres in all his cities get the boost.
Then I conquer Bolshoi and check that his boost is gone, while mine is applied.
Then I load game and conquer + raze Bolshoi, both sides no more effect.

Because of the way the code is written, even in games where Random Event is off, it will still trigger the event to apply the effects.
Triggering 2 or more events on the same turn works fine. For example, if I conquer a city with 3 of these event wonders, I will just get 3 events triggering one by one, to apply each effect. Thus, there won't be any compatibility issue in the packs.

Attached screenshots show what happens when you build/conquer Bolshoi, and what happens when you lost/raze Bolshoi.
There does not seem to be a way to remove this pop up else it will be perfect.
New Bolshoi files attached as well, for those who wanna try it out and see if there is any bugs to catch.

Conclusion:
1) Using this style of coding, performance will be boosted, especially in Gigapack and Terapack where I can eliminate many lines of codes, especially in onCityBuilt etc

2) Most works will end up having the same code, because they are all:
When Wonder Built, Trigger Wonder Event
It is just that the Wonder Event XML benefit tags that are different.

3) There can be new Wonders remake with new Event Benefits, such as -20% Inflation, Promotion to All Gunpower Units which will apply even for existing, newly built or newly drafted ones, without the need of too many codes.
 
1) CyGame().getSorenRandNum(5, "Platy Promotion")
The string inside has no meaning to my knowledge.
Just a string to remind you what it is trying to do.

2) I guess you are refering to Despair, since I changed its name as it conflicts with another new Promotion which suits the name "Curse" better.
It is boosted when you have Retribution on the same unit.
Despair and Retribution are complementary promotions.
Alone, they are not that great, together they make the unit a walking timebomb.

P.S.
Promotions go to the other thread. :D
This thread is too crowded.

Edits:
Library of Ashurbanipal: Codes simplified, effects same
 
Hi platyping,

I´ve tested the new code of Bolshoi Theatre with the event and it works fine. While I were testing, I thought of another thing. Normally the world wonders have effects on all the members of a team. I tested it on Bolshoi and the effects are only given to the player who has build it.

I have to test it, when <bTeam> in the EventTriggerInfos is 1 istead of 0. So probably the wonder effects are given to all the team members then.

Is it right that all the other python wonders have only effect on the player who build it or is the bonus given to all team members?
 
It depends on the python code used.

There are 2 situations where they will apply to all team members.
1) You see the word team itself in the python code.
Eg: pTeam.changeNukeInterception(XX), pTeam.changeExtraMoves(XXX), pTeam. changeResearchProgress(XXX)

2) You see loops through the players applying the same effect to all players of the same team.

All projects effects set to trigger for whole team.
Wonders... most of them i set it to trigger just for player, unless no choice.
To set it for the whole team, just take a look at how it is done for the projects and you will see :D
 
2 examples how to change from just player to whole team:

Code:
## Arc De Triomphe Start ##
		pPlayer = gc.getPlayer(iOwner)
		if pPlayer.getBuildingClassCount(gc.getInfoTypeForString("BUILDINGCLASS_ARC_DE_TRIOMPHE")) == 1:
			iModifier -=15
## Arc De Triomphe End ##

Code:
## Arc De Triomphe Start ##
		pPlayer = gc.getPlayer(iOwner)
		pTeam = gc.getTeam(pPlayer.getTeam())
		if pTeam.getBuildingClassCount(gc.getInfoTypeForString("BUILDINGCLASS_ARC_DE_TRIOMPHE")) == 1:
			iModifier -=15
## Arc De Triomphe End ##

Code:
	def onBuildingBuilt(self, argsList):
		'Building Completed'
		pCity, iBuildingType = argsList
		game = gc.getGame()
## Bell Rock Lighthouse Start ##
		if iBuildingType == gc.getInfoTypeForString("BUILDING_BELL_ROCK_LIGHTHOUSE"):
			pPlayer = gc.getPlayer(pCity.getOwner())
			iTeam = pPlayer.getTeam()
			(loopCity, iter) = pPlayer.firstCity(false)
			while(loopCity):
				if loopCity.isCoastal(10):
					for x in xrange (loopCity.getX() - 1, loopCity.getX() +2):
						for y in xrange (loopCity.getY() - 1, loopCity.getY() +2):
							pPlot = CyMap().plot(x,y)
							pPlot.changeVisibilityCount(iTeam, 1, 0)
				(loopCity, iter) = pPlayer.nextCity(iter, false)
## Bell Rock Lighthouse End ##

Code:
	def onBuildingBuilt(self, argsList):
		'Building Completed'
		pCity, iBuildingType = argsList
		game = gc.getGame()
## Bell Rock Lighthouse Start ##
		if iBuildingType == gc.getInfoTypeForString("BUILDING_BELL_ROCK_LIGHTHOUSE"):
			pPlayer = gc.getPlayer(pCity.getOwner())
			iTeam = pPlayer.getTeam()
			for iPlayerX in xrange(gc.getMAX_CIV_PLAYERS()):
				pPlayerX = gc.getPlayer(iPlayerX)
				if pPlayerX.isAlive() and pPlayerX.getTeam() == iTeam:
					(loopCity, iter) = pPlayerX.firstCity(false)
					while(loopCity):
						if loopCity.isCoastal(10):
							for x in xrange (loopCity.getX() - 1, loopCity.getX() +2):
								for y in xrange (loopCity.getY() - 1, loopCity.getY() +2):
									pPlot = CyMap().plot(x,y)
									pPlot.changeVisibilityCount(iTeam, 1, 0)
						(loopCity, iter) = pPlayerX.nextCity(iter, false)
## Bell Rock Lighthouse End ##

With these 2 examples, you can convert all the rest.
They either fall into category one or two.
Some of them simply don't make sense for whole team (those that affect just the wonder city)
 
Back
Top Bottom