Platyping's Python

Hi platyping,

in the BuildingInfos.xml of Chrysler Building you wrote:

Code:
<Flavors>
	<Flavor>
		<FlavorType>FLAVOR_ECONOMY</FlavorType>
		<iFlavor>10</iFlavor>
	</Flavor>
</Flavors>

Shouldn´t that be FLAVOR_PRODUCTION since there´s no FLAVOR_ECONOMY in the GlobalTypes.xml?
 
Perhaps you could help me with another problem.

For some components I want to add I´ve to change the SDK too.:rolleyes:

I started for the beginning with compiling the dll again without any changes and surprisingly I had noch compiling errors.;)

But when I start the debug-dll I get some errors. most of them I could erase, but there is one left, which I couldn´t erase until now (see attachments for error message and the refering file/line).

It seems to have to do with the defining of the ## Platyping Global Constants ## because the error message comes for every type of specialist in the same order as in the CvEventManager.py:
Code:
## Platyping Global Constants ##
s_Priest = gc.getInfoTypeForString("SPECIALIST_PRIEST")
s_Scientist = gc.getInfoTypeForString("SPECIALIST_SCIENTIST")
s_Engineer = gc.getInfoTypeForString("SPECIALIST_ENGINEER")
s_Spy = gc.getInfoTypeForString("SPECIALIST_SPY")
s_Artist = gc.getInfoTypeForString("SPECIALIST_ARTIST")
s_Merchant = gc.getInfoTypeForString("SPECIALIST_MERCHANT")
s_Citizen = gc.getInfoTypeForString("SPECIALIST_CITIZEN")
## Platyping Global Constants ##

Do you have any hint what causes the problem? Thanks again.
 

Attachments

  • Fehler1.jpg
    Fehler1.jpg
    29.4 KB · Views: 54
  • Debug1.jpg
    Debug1.jpg
    261.1 KB · Views: 53
Never bother with the dll so cant be bothered to explore.
But if the global constants are causing problems for you, just remove them and replace every single code using these variables with the full gc.getInfo... line instead
 
Something simple to post the following changes again :D
Tower of Babel
Spoiler :
Civ4ScreenShot0013-9.jpg

Award Series for Wonders
Actually, abit skeptical about adding this, since it is debatable whether it is a real building or not.

Artwork by Hrochland


Bug Fix:
Central Bank, Chrysler Building, Petronas Towers
Replaced all Flavour XML tags using FLAVOR_ECONOMY to FLAVOR_GOLD


Python Codes Changes:
Replaced all "Free Wonder" codes using setNumRealBuilding to this new style which I trial and error successfully :D

Code:
pCity.pushOrder(OrderTypes.ORDER_CONSTRUCT, gc.getInfoTypeForString("BUILDING_TOWER_OF_BABEL") , -1, false, false, false, true)
pCity.popOrder(0, true, false)

The difference between the 2 is that setNumRealBuilding adds the building to the city directly but does not trigger onBuildingCodes.
Thus, things like movie codes etc have to be added after the setNumRealBuilding line to be triggered "manually".
Also, using the new style of codes, since onBuildingCodes are triggered, it will be compatible with other works like Azadi Tower which adds free Artist to cities with World Wonders, whereas the previous style will not trigger.

Affected Wonders:
Channel Tunnel, Heroes' Square, Laxminarayan Temple, Osaka Science Museum, Padrao, Summer Palace, Ferrari World, Semperoper, Olympics, Crystal Palace, World Financial Center


Megapack:
Added a text file "Paste Movie Pack Here"

Gigapack:
Added a text file "Paste Megapack Module Folder Here"

Both packs updated
 
Isnt four much? I would say like 2 since I mean it is an ancient wonder. Unless you are playing duel its not even guarenteed that a city would have 4 wonders at the end of a game, expecially in the early game. Then again thinking about it, in your modpack there are much more wonders. I would suggest 2 being the norm for the solo item but in the modpack it get switched to 4
 
2 is too easy, usually I will finish stonehenge and oracle in the same city, since chances are there will be 1 city which has high production which is most likely your capital anyway.
Also, looking at others like Great Wall and Great Lighthouse which are pretty cheap, which is why I decided to put it at 4.

The GP bonus will be nerfed, most likely I let it give 2 free workers instead on top of the 1 specialist.
Thus, granting it free with just 2 wonders is too much, and... 2 is too easy to achieve to be part of the award series.

Anyway, there isn't any record when exactly it was built, or even if it existed.
It should still look ok if it was built in the classical era, since classical era by CIV standard is still in the 1000+ BC
 
Unless you are playing on an easy level though, lighthouse, wall, stonehenge and oracle will 99.99% not be built in the same city. either way i think it would make sence that it should be different between it alone and it in the mod since I mean wonders are easier to come upon in your mod - but I won't be using it so wont nag to much :p
 
Yup, 2 is easy, 4 is hard to achieve since there are only 6 wonders in ancient era.
I was thinking either 3 or 4, 5 is too much.
Since classical era is still in the 1000+ BCs, if you include those as well, actually 4 is achieveable.
After all, if it is too easy, then it will not be considered as an award.

So far, Louvre museum is the only one where solo benefits and pack benefits are different.
You are right, this one should have higher requirements in pack as well, but I think most people download them and add selective ones to their own mod anyway, so not a big deal.
 
Russo-Chinese Bank
Spoiler :
Civ4ScreenShot0014-8.jpg

National Wonder

Since we have Interest Rate (E-Bank), Taxation (Adam Smith), Insurance (National Insurance), let's do something for Exchange Rate.

Exchanges a portion of your gold with a portion of gold of each other player.
Since exchange rate varies for different countries, the % paid by rivals vary randomly.
The unlucky one will pay up to 90% :D

Since AI does not understand python, I set it that it will only exchange when it is profitable, else an AI with 1 million gold will suffer for building this.

Set it as NW so that you can take revenge

Artwork by dacubz145
 
All text quite boring :D
The_J was doing quite a number of requests for dacubz though
 
At least project has a button and movie :D

Text for projects are mainly just the civilopedia which I just copied and paste from wikipedia.
Whereas for events, most likely still have to type a story of some sort, will kill too much brain cells
 
Oh yeah, before I forgot :D

A good reason is because of choice.
Same issue as civics and promotions.
By now, most of us know that AI understand nothing about python.
AI view python benefits as absolutely no benefit.

Thus, for things which have choices, like civics, AI will not be able to make smart decisions.
Between 2 python civics, AI will just weight them based on their XML stuff such as maintenance and choose the better one, while totally ignoring the python part.

Similarly for promotion, say one which grants the player 10,000 gold with every combat victory.
Sounds good, but when compared to Combat I, AI will just see it as 10% Combat Strength VS nothing, and obviously choose Combat I. Of course, codes can be added to affect AI decisions, so that AI will choose the new promotion under certain conditions, but what we think may be good conditions, may not always be the "good" conditions to select those promotions.

Traits on the other hand, are permanent, so AI does not have to crack their heads and think which traits to choose. Of course, since they don't understand python, they may not be able to fully maximise the benefits of the python traits by doing certain things more often.

Wonders and Projects are OK as well, since the worst part is just that you wasted hammers building something you don't really need. But I will not make something like you can either build A or B, since AI does not know that once it builds A, it can no longer build B, and end up choosing the wrong building.

Events however, fall into both categories.
There are some events where there is only one outcome for you to click and choose.
But most events do have more than one outcome, so these will be unfair to the AI.
Example:
1) Pay 100 Gold and Start a Golden Age for 10 turns.
2) Pay 200 Gold and Start a Golden Age for 30 turns.
3) Do nothing.

If the gold part is XML, and the Golden Age part is python, humans will tend to choose choice 2.
As for AI, they view it as Pay Gold and get nothing, or do nothing.
So obviously, they choose to do nothing.
Codes can be added so that if they have gold, AI will choose 2 as well, but what if AI has intended other usage of that gold, like rush a wonder?
 
At least project has a button and movie :D

Text for projects are mainly just the civilopedia which I just copied and paste from wikipedia.
Whereas for events, most likely still have to type a story of some sort, will kill too much brain cells

Sad to hear this :( but I'm sure you're able to make awesome Python-events/quests and kill off a lot of your braincells in the process :p

We'll have to wait when you run out of wonders and projects :lol:
 
Meteora
Spoiler :
Civ4ScreenShot0016-8.jpg

Well, since monasteries obsolete at Scientific Method, naturally this has to obsolete as well.

Artwork by Hrochland


Tower of Babel
Removed Great People Bonus
Grants 3 Free Workers instead
Requires 3 World Wonders instead of 4.
Requires 5 World Wonders in Gigapack.
Spoiler :
Civ4ScreenShot0017-5.jpg
 
Hi Platyping,

I´ve a question belonging to the Code of Machu Picchu in the function onBuildingBuilt in CvEventManager.py.

Code:
## Machu Picchu Start ##
		if iBuildingType == gc.getInfoTypeForString("BUILDING_MACHU_PICCHU"):
			for i in range(21):
				pPlot = pCity.getCityIndexPlot(i)
				if pPlot.isPeak():
					[COLOR="Red"]pPeakPlot[/COLOR].setImprovementType(gc.getInfoTypeForString("IMPROVEMENT_MACHU_PICCHU"))

pPeakPlot is not defined in the CvEventManager.py. Shouldn´t it be pPlot instead of pPeakplot?
 
Back
Top Bottom