Platyping's Python

BUG ads some sort of modular loading to the Civ4 Python, so that you don't have to fiddle around with the CvEventManager to merge things.
A tutorial can be found here. Not really difficult after you once understand it.
But don't let you put under pressure, I also normally don't provide separate BUG versions ;).

Adding a normal CvEventManager to BUG will cause under certain circumstances (...no real idea) problems with the Python, so it's not advisable.

At the versions: BUG is the core. BAT is an art extension (no additional programming), BULL is a dll extension (no real further Python programming AFAIK), everything else (e.g. Better BAT AI) are combinations out of the others.
Programmingwise you really just have to care about BUG.
 
Thanks The_J for the explanation.
Like Modular, it will be on my to-do list, but not priority list.
So far, I will still be making them based on raw BTS, but 1 day I will make a modular and/or BUG version for JUST the Megapack.
Don't expect me to make 60+ additional BUG versions of each wonder. :lol:

And like I said, making it modular doesn't make it easier for the common folks.
This is an example of what I meant.
Modders who know how to make/use modules, definitely know how to cut and paste the relevant parts themselves.
But common users with minimal mod knowledge have no ideas how to use modules at all.

Edit:
Enhanced Original Traits:
Fixed a bug for Protective Traits under def onCombatResults:
Changed UnitAITypes.UNITAI_NO_UNITAI to UnitAITypes.NO_UNITAI

Lotus Temple:
Added CommerceDoubleChange and CommerceChangeOwner tags in XML

Blessings of the Archangel:

Mont Saint-Michel
Spoiler :

MontSaint.jpg


The main code is basically Tsentom's Survival Promotion code.

This wonder grants a chance to revive dead troops in own cultural lands.
Without state religion, 10% chance to revive with 10% str
With state religion, 20% chance to revive with 20% str
Units are revived at wonder city.
Mechanical units are excluded. (Archangels resurrect people. They are not mechanics who repair machines:goodjob:)

Artwork by Hrochland


Efficient missionaries:

Famen Temple
Spoiler :

Civ4ScreenShot0017-2.jpg


Straightforward, do I need to explain?

Artwork by Hrochland


Unlimited Money:

Federal Reserve Bank
Spoiler :

Federal.jpg


National Wonder
Min Gold = 200

Min Gold is set before daily income added.

If you end the turn with gold more than min gold, then this wonder doesn't do anything.
Federal Reserve Banks are there to help during depression, not economic boost lalala

Artwork by stolenrays
 
Since about 95% of the Civ4 mods now contain BUG/WoC, how about a separate section for those?

I dont even know if any mods made now even have a CvEventManger anymore?

My mod... it is getting updated every month and still uses a CvEventManager. I've found a way not to cause incompatibilities when combined with BUG. I don't have any problems with python at all. And using the CvEventManager is much more simple than using the BUG system.

---

By the way: We need wonder movies for every of your wonder. I don't implement new wonders I don't have a movie for. And Alain's are gone cause of Megaupload.

Why don't you implement them yourself? Don't you use wonder movies at all?

And: The link to "mourndraken's" is a link to his profile, not to a thread.
 
My mod... it is getting updated every month and still uses a CvEventManager. I've found a way not to cause incompatibilities when combined with BUG. I don't have any problems with python at all. And using the CvEventManager is much more simple than using the BUG system.

---

By the way: We need wonder movies for every of your wonder. I don't implement new wonders I don't have a movie for. And Alain's are gone cause of Megaupload.

Why don't you implement them yourself? Don't you use wonder movies at all?

And: The link to "mourndraken's" is a link to his profile, not to a thread.

If your so good at python why not help us out at C2C then, that would be great.

And to keep things on topic, what movies do you'll need, i am trying to go strictly with Static LH and Wonders. I have stuff all the way back to 2006, but alot is on my other PC (that i dont even use anymore.)
 
1) I am not good at Arts :crazyeye: so I do what I can, and leave what I can't to the professionals.
2) Most of these wonders are taken from other mods which have the wonders in the first place. So i presume, they will have the movies themselves in their own mods if they need.
3) Arain has made a massive library of movies. Yeah, it was badly hit by Megaupload, but the good news is he has announced that he will be uploading to a new site :D
4) Some people just take the effects and transport to their own wonders anyway :mischief:
5) Yup, I know mourndraken's link is a link to his profile, not a thread. I asked him before whether he has a thread with a list of his movie works, but he said nope, he only uploaded them into the database, although he announced new works in the PIE mod thread.
Rather than providing a link to the database which has all other things, I guess linking it to his profile directly will be more appropriate.
6) Good news is, dacubz145 has also started a new Movie making career :D

Movies are nice, but I rather not embarrass myself by making what I am obviously bad at. :rolleyes:
 
Nah... I don't say you should make the wonder movies. I just asked myself why you don't implement the movies from other people if you are using them yourself. Or don't you play with your wonders? ;)

3) nice!

-----

@strategyonly: "I don't have any problems with python" = "My mod does not have any problems with python"... I'm not so good at python, but for exactly that reason I wanted to keep the CvEventmanager.py. C2C is nice, but I have my own mod with my own ideas. Don't want to mix them with other ideas I don't like. So you have static wonder movies for nearly every wonder? Hm... Will tell you, when I need one.
 
Ah I see, misunderstanding :D

I used to add the movie files to my initial works, but found out that the movie file takes up 95% of the whole wonder file size. Currently, with the exception of SETI which has unit arts, the rest of them are less than 200 KB in size. In fact, projects which don't even have building arts, are not even 30 KB.

Adding a movie file which is usually 3MB~10MB will largely increase the file size. Thus, I remove them from the file to make it easier for people with low internet speed to access them easily.
The Megapack especially will increase from the current 4MB to 100+ MB .

Also, since the movies are definitely not my works, I was thinking providing a link to them, rather than adding to my own files would provide more exposure to the hard work of the movie makers. Although I can make a notice in the credits section, I believe there will still be people who download and use without reading the credits.
 
If 1 is nice, make it 3:

Venetian Arsenal
Spoiler :

Venetian.jpg


National Wonder
Mass Production:
Every naval combat unit produced, you get 2 extra with experience split equally, rounded down.
Workboats not counted.

Modders:
I used a check on combat class type == Naval rather than domain type, so that 1 check is enough to ensure that they are ships and workboats are excluded.
If your mod has various combat class type for naval units, you may wish to use domain check instead, and up to you if you want to exclude workboats.

Artwork by Walter Hawkwood


Edit:
Springfield Armory:
Removed first few lines which defined unused variables
 
I see. But good to know that you have the wonder movies if alain fails to reupload. ;)

Venetian Arsenal might be imbalanced... :D
 
@Cybah haha I know, that's why I set it as a National Wonder, so everyone gets one of this.
If 2 extra copies is too much, can reduce to just 1 extra copy

@The_J Hehe, sometimes simple is nice. Never manage to fix that capture worker stuff, so change it to just missionaries.

Edit:
Megapack:

Fixed a typo in def onCombatResult:
pPlayer2 = gc.getPlayer(iPlayer2) instead of pPlayer2 = gc.getPlayer(iPlayer)

Updated Megapack with Saint Michel, Federal, Famen and Venetian
 
Version 1.3

XML Changes

1) Added Max Start Era Tags for various Wonders:
Spoiler :

Cyrus Classical
Nazca Classical
Zizkov Modern
Newton Renaissance
Abu Simbel Classical
Pergamon Ancient

2) Changed PreReq Techs for various Wonders:
Spoiler :

Apadana Obsolete with Constitution
Arc de Triomph Military Science
Knossos Labyrinth Construction
Catacombs Philosophy, Cost 500
Taipei, WTC, Empire Composites
Torre Chemistry, Cost 900
Springfield Assembly Line

Now only Mass Media has overflowing icons :D

3) Nazca Lines strategy section rewrote, looks better.

Python Changes

1) Added Max Start Era for various Projects:
Spoiler :

Dissolution of Monasteries Renaissance
Silk Road Medieval
Magellan Medieval


2) Magellan Project:
Can only be built in Coastal City

3) Nazca Lines:
Add a 9th option, +4 Commerce

4) Venetian Arsenal:
Nerfed. Experience Split among 3 units.
Thus, instead of getting 1 Battleship with 15 EXP, you will get 3 Battleships with 5 EXP each.

5) Megapack:
i) Bug Fixed: Moved Olympics from EndPlayerTurn to EndGameTurn
ii) Bug Fixed: Channel Tunnel, iTeam defined
iii) Compatibility fix for these wonders thanks to this code:
Code:
pNewUnit.convert(pUnit)

This code converts pNewUnit to take all the pre-python properties of pUnit, including but not limited to level, experience, promotions, base strength, unit type, moves etc
However, python changes that affect the properties of the unit are not copied to pNewUnit.
A) Extra Strength from Springfield
B) Extra CargoSpace from Magellan

Thus, extra codes are added to the following wonders for them to work compatible with Springfield and /or Magellan

I) Venetian Arsenal:
Spoiler :


Note: Make sure Venetian's Code is pasted below ALL def onUnitBuilt codes to work correctly.
Code:
## Venetian Arsenal Start ##
		b_Venetian = gc.getInfoTypeForString("BUILDING_VENETIAN_ARSENAL")
		if city.getNumActiveBuilding(b_Venetian) == true:
			if unit.getUnitCombatType() == gc.getInfoTypeForString("UNITCOMBAT_NAVAL"):
				unit.setExperience(int(unit.getExperience() / 3), 999)
				pPlayer = gc.getPlayer(city.getOwner())
				for i in range ([COLOR="Red"]3[/COLOR]):
					pNewUnit = pPlayer.initUnit(unit.getUnitType(), city.getX(), city.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.NO_DIRECTION)
					[COLOR="Red"]pNewUnit.convert(unit)
					pNewUnit.setBaseCombatStr(unit.baseCombatStr())
					pNewUnit.changeCargoSpace(unit.cargoSpace() - pNewUnit.cargoSpace())[/COLOR]
## Venetian Arsenal End ##

II) Mont Saint-Michel
Spoiler :


Since Saint only affects living troops, don't have to consider Magellan's effects
Code:
## Saint Start ##
		bc_Saint = gc.getInfoTypeForString("BUILDINGCLASS_MONT_ST_MICHEL")
		if pPlayer2.getBuildingClassCount(bc_Saint) == 1:
			LoserInfo = gc.getUnitInfo(pLoser.getUnitType())
			if LoserInfo.isMechUnit() == false and pLoser.getUnitCombatType() != -1:
				if pPlot2.getOwner() == iPlayer2:
					revive = CyGame().getSorenRandNum(10, "revive")
					if pPlayer2.getStateReligion() > -1:
						revive = int(revive /2)
					if revive == 0:
						b_Saint = gc.getInfoTypeForString("BUILDING_MONT_ST_MICHEL")
						(loopCity, iter) = pPlayer2.firstCity(false)
						while(loopCity):
							if loopCity.getNumActiveBuilding(b_Saint) == true:
								pNewUnit = pPlayer2.initUnit(pLoser.getUnitType(), loopCity.getX(), loopCity.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.NO_DIRECTION )	
								pLoser.setDamage(90, -1)
								if pPlayer2.getStateReligion() > -1:
									pLoser.setDamage(80, -1)
								pNewUnit.convert(pLoser)
								[COLOR="red"]pNewUnit.setBaseCombatStr(pLoser.baseCombatStr())[/COLOR]								pNewUnit.finishMoves()
								CyInterface().addMessage(iPlayer2,true,20,CyTranslator().getText("TXT_REVIVE",(pLoser.getName(),)),'',0,'',-1,-1,-1, true,true)
								break
							(loopCity, iter) = pPlayer2.nextCity(iter, false)
## Saint End ##

III) Cloned Mammal
Spoiler :

Since Magellan is long obsolete, ignored
Code:
## First Cloned Mammal Start ##
		if iGameTurn % 5 ==0:
			if pTeam.getProjectCount(gc.getInfoTypeForString("PROJECT_DOLLY")) == 1:
				clone = CyGame().getSorenRandNum(pPlayer.getNumUnits(), "Clone")
				pUnit = pPlayer.getUnit(clone)
				if pUnit.isNone():
					CyInterface().addMessage(iPlayer,true,20,CyTranslator().getText("TXT_CLONE_FAIL",()),'',0,'',-1, -1, -1, true,true)
				else:
					iX = pUnit.getX()
					iY = pUnit.getY()
					u_type = pUnit.getUnitType()
					for i in range (2):
						pNewUnit = pPlayer.initUnit( u_type, iX, iY, UnitAITypes.NO_UNITAI, DirectionTypes.NO_DIRECTION )	
						pNewUnit.convert(pUnit)
						[COLOR="red"]pNewUnit.setBaseCombatStr(pUnit.baseCombatStr())[/COLOR]						pNewUnit.finishMoves()
					CyInterface().addMessage(iPlayer,true,20,CyTranslator().getText("TXT_CLONE",(pUnit.getName(),)),'',0, pUnit.getButton(),ColorTypes(11), iX, iY, true,true)
## First Cloned Mammal End ##
 
Wonderful City:

Windows of the World
Spoiler :

Civ4ScreenShot0000.jpg


Team Project

Actually, this is a 2004 Theme Park, so it shouldn't be placed at such an early tech. But because default BTS National Wonders are pretty early, if this project is placed too late, it is totally useless. Of course, if someone has a better wonder/project to replace it at earlier tech, that would be great.

Still using old AI build Project style, since no one has told me whether the new style is creating problems for them


Finger Licking Good:

Code of Hammurabi
Spoiler :

Civ4ScreenShot0014-5.jpg


Artwork taken from PIE mod
 
1) Modified Porcelain and Dissolution codes for efficiency.
2) Nerfed Cyrus Cylinder GG spawn rate
3) Added a python section for Louvre where new Ancient/Classical Wonders are built after Louvre built, because it seems possible in Advance Starts...
4) Updated Megapack with Windows of the World, Code of Hammurabi, Tomb of Cyrus


The Immortal King:

Tomb of Cyrus
Spoiler :

Civ4ScreenShot0203.jpg


Took the idea from Great General Spare Troops by Outitch and did some modifications.

Set it under def onUnitKilled instead to fix several issues:
1) Units with Leader Promotion are included similar to the original modcomp
2) GG Units walking alone are included
3) 1 and 2 that died for any other reasons including Flanking, Transports, Nukes, Events which are not in original modcomp

Modifications:
1) The GG that survived goes to the Wonder City instead as a GG Unit
2) The GG cannot move for 8 turns to prevent exploits
3) Add a display message

Artwork by stolenrays
 
In your projects Ivy Mike and NPT you use a python call back to require the Manhatten Project be built. Can't this be done using the PrereqProjects tag instead?
 
Good point, forgot that tag lol
Did that for Swords of Qadisiyah and conveniently forgot Projects can use XML tag lol

Thanks,
Database updated with appropriate changes for:
Ivy, NPT, Megapack
 
Chop 'em All

Temple at Uppsala
Spoiler :

TempleUppsala.jpg


Only Pillage Improvements in adjacent enemy tiles, not routes.
50% is for individual tile, not 50% All or None

Doesn't apply to air bombarbments or missiles



Heal 'em All

Academy of Gondishapur
Spoiler :

Civ4ScreenShot0000-5.jpg


Existing Units:
Medic II => Free Promotion of Choice
Medic I => Free Medic II

Thereafter:
Units which gain Medic I, gain free Medic II


Edit:
1) Added a Land Domain Check for unit performing pillage action for Uppsala
2) Changed Sun Tzu and Magellan from using for loop to while loop. Got rid of none unit check
 
1) Simplified Newton's Codes. Same Effects

2) Modified Area 51:
A) No longer leaks full espionage to Rival when Captured.
B) Upon captured, all players double espionage towards old owner and -50% towards new owner.

3) Modified NPT:
A) Now War Allies will NOT get angry for nuking plots belonging to common enemy.
B) No effects when nuke exploded in neutral plot


Bad for You = Good for Me:

Large Hadron Collider
Spoiler :

Civ4ScreenShot0001-4.jpg


Late Game Science Wonder
So what is the use since almost all techs are researched? :confused:
It affects repeating future techs as well. :goodjob:

Artwork by asioasioasio


Updated Megapack with Uppsala, Gondishapur and Hadron
 
Pretty sad to see a world wonder blow into pieces :D


And now we have the sun

Ericsson Globe
Spoiler :

Civ4ScreenShot0002.jpg


Not sure whether to use this name or the original name since the original one is more well known.

Artwork by Hrochland


I am pretty productive today :goodjob:
 
Back
Top Bottom