Platyping's Python

Thanks alot. Since I benefit alot from works of past modders, I hope these comments will benefit others who wish to mod their own wonders.

Art define tags for most of them, I just trial and error to get them to look decent size enough, with acceptable positioning. Because I have absolutely no idea what the L_System is about, except L_System_Coast is used for coastal buildings...
 
Helsinki :goodjob:. May I assume if I e.g. capture an enemy capital, and no other cities around, that the wonder will give me directly a FC?


Lsystem: Not really sure either, but IIRC the numbers are refering to the size of the occupied tiles, so LSYSTEM_4x4 for big stuff, 1x1 for tiny stuff.
 
er, not sure what u mean, what is a FC?

The wonder only converts tiles in its city radius, doesn't affect other cities.
Thus, I set it as a National Wonder and add the limitations, so that AI doesnt build it far from borders

Edit:
I think u meant if it is build in an enemy capital, the amount of converted culture will be too huge?
Good point, I can add a limit based on game speed
 
FC = fat cross.

And what I meant: If you capture a city which is totally surrounded by enemy culture (e.g. a capital in the middle of other enemy cities), will this directly give me access to all tiles? Sounds like yes. Would be extremly powerful in such cases, where you're directly combating your enemies culture.
 
Yes in a sense, that is how the culture bomb works in Civ V so trying to do the same.

However, u r right that it might be overpowered, especially if the city is legendary status, u get a free legendary city.

Thus, I will implement a limit check:
A) Limit it based on game speed, probably 50% of Influential. Anything below, fully convert, anything above, convert up to the limit.
B) Limit it based on percentage. 51%, u get the culture for that turn. If it is a border city, the culture can continue to grow, and probably increase and u keep the tile. Else, if it is a surrounded newly conquered city, the tile will be lost in a few turns.

Edit:
By the way, while I was exploring the ArtDefineTag, it seems that the actual size of the building in the game itself is determined by the <fScale>. <fInterfaceScale> Determine the size in the Civilopedia based on the actual size in game. The L_System only affects the positioning I think, changing it sometimes place it at far corners, sometimes stuck in the middle etc
 
By the way, while I was exploring the ArtDefineTag, it seems that the actual size of the building in the game itself is determined by the <fScale>. <fInterfaceScale> Determine the size in the Civilopedia based on the actual size in game. The L_System only affects the positioning I think, changing it sometimes place it at far corners, sometimes stuck in the middle etc

LSystem controls how much space a building needs in the city on the map. 1x1 means that the building only needs a small square and can be easily interspersed among the standard city buildings, 4x4 means the building needs a huge area and will most likely be placed on the outskirts of the city. Buildings with a named LSystem (like LSYSTEM_MARKET) mean that there are several entries in Civ4CityLSystem.xml that define individual ?x? sizes depending on which model is used (allowing cultural variation).

<fScale> determines the size of the building relative to it's defined LSystem area (so a scale of 2.0 for a building will appear to be a different sizes on 2x2 compared to 3x3). <fInterfaceScale> scales the model again to appear in the pedia and city build panel. This is applied in addition to <fScale>. I find a <fInterfaceScale> of 0.5 works well enough for most buildings.

So there's a kind of hierarchy: Choose the LSystem size you want first, then the scale to suit, and then finally the interface scale.
 
Thanks Xyth for explaining about the L_System. Art is definitely not my forte...

Helsinki has been toned down to convert 33% of foreign culture. This way, if total foreign culture below 75%, the tile will be yours. Anything above, you still have to work harder. At least it won't turn the tides immediately in a war, since this isn't meant to be a war wonder.

Simple wonder for today:

Women's Suffrage
Spoiler :



Suffer less with it, suffer more without it.


Another simple one:

Arc de Triomphe
Spoiler :



15% for Normal Leaders.
40% for Charismatic Leaders (Not 25% + (15% of 75%) )


By the way, how do I edit the title of the thread, I guess more appropiate to call it "Python Wonders" or something now
 
Hi, platyping. I add your Magallan variant into my mod. All is functional but game sand me one message.

After click game continue. I don´t know Only if this message (a little error) you can tune by some way.

Otherwise, your minimod very good and leave it in my main mode :)
thanks
 
Hi Hrochland, thanks for trying the mods and greatly appreciate your feedback.

I didn't get the error when testing the wonder, but I did get a similar error with SETI when testing the "alien abduction" system.

The error is due to a "getNumUnits()" which is meant to get the total number of units of the player.
Then something is done to each unit using a loop.

I am not sure why, but once a blue moon the unit from the loop returns an invalid unit, which means that the following commands for the particular unit will not work.
For Magellan's case, it would be checking for cargo space, and adding cargo space.

Thus, I added a check for invalid unit in SETI, and the problem is gone.

I hope this solution will work for Magellan as well. Attached is the python file, just replace it to the old one and see if the error still occurs. If it is fixed, I will add this code to all other wonders using the same style of code.

Edit: Arc De Triomph and Magellan in download links have been updated
 
OK. Many thanks. Evening I leaving from Prague to 5 days. I hope that everything I make a try. Thanks for quick answer :)

Hroch
 
Conversion From Wonders to Projects
The links above are all for wonders. Some of you may prefer XXX to be in wonder form, while others feel it should be a project.

Differences
Spoiler :

A) Wonders can be rushed, using gold or whip
B) Industrious Trait bonus applies to wonders only.
C) When built, wonders stay in the city and can be captured and used by rivals. Projects are not within the city and stay with owner forever.
D) No building art for project in the map. Pro: Less things on the map, less lag. Con, no awesome graphics.
E) Building XML files have much more options to add various benefits such as culture, great person growth etc. Easy to add extra benefits.
F) Obsolete tech for wonders.
G) There is no AI_Weight, iAsset, Flavour etc tags for Projects, as such a Project with 200 lines of python codes will be seen as totally useless for an AI and won't build it even if it only cost 1 production.

The above mentioned differences can of course be modifed via python or SDK.


Python Codes to Convert
Spoiler :

For Wonders that give a one time "on built" effect, the codes should be in "def onBuildingBuilt".

Copy the whole chunk of codes there and paste under "def onProjectBuilt"
Convert the first line:
Code:
if iBuildingType == gc.getInfoTypeForString("BUILDING_HELSINKI"):
to
Code:
if iProjectType == gc.getInfoTypeForString("PROJECT_HELSINKI"):
This is assuming you have made the changes in the Building XML and Project XML files.

For all other types, there should be a check "If the player has building xxx and it is not obsolete"
Example: for Brandenburg, that would be under "def onUnitBuilt"
Code:
pPlayer = gc.getPlayer(city.getOwner())
b_Brandenburg = gc.getInfoTypeForString("BUILDING_BRANDENBURG_GATE")
bc_Brandenburg = gc.getInfoTypeForString("BUILDINGCLASS_BRANDENBURG_GATE")
obsoleteTech = gc.getBuildingInfo(b_Brandenburg).getObsoleteTech()

if ( gc.getTeam(pPlayer.getTeam()).isHasTech(obsoleteTech) == false or obsoleteTech == -1 ):
	if pPlayer.getBuildingClassCount(bc_Brandenburg) ==1:

Change to
Code:
pPlayer = gc.getPlayer(pCity.getOwner())
pTeam = gc.getTeam(pPlayer.getTeam())
if pTeam.getProjectCount(gc.getInfoTypeForString("PROJECT_BRANDENBURG_GATE")) == 1:

If you want the project to obsolete with Robotics Tech for instance,
Add additional lines with correct indention(number of "spaces" or "tabs"):
Code:
obsoleteTech = gc.getInfoTypeForString("TECH_ROBOTICS")
if gc.getTeam(pPlayer.getTeam()).isHasTech(obsoleteTech) == false:
This is because project doesn't have a Obsolete tag in XML files, so you have to type here manually.

Because of the difference in number of "If Else" Statements, take note of the indention of the whole chunk of codes below which determines the benefits of the wonder.

For conversion from project to wonder, just do the opposite


Thank you for this, too! I've been wondering how to do this for a while.
 
You are welcome, though you need to take note that AI will totally ignore the python benefits and won't build the project at all, unless you use some codes to force them to build
 
Thanks Hrochland for trying out. Code has been applied to Arc De Triomph as well. For those who have downloaded Arc De Triomph before and experience the same error, you can get the quick fix from the post above.

National Wonder:

Springfield Armory
Spoiler :



This changes the base strength of the unit itself. Modern Armor will become 44 instead of 40. Value is rounded down to nearest whole value, so Mech Infantry with 32 str will become 35 instead of 35.2. Thus, units less than 10 str won't get any benefits.

Artwork by Hrochland

 
Nice work!:goodjob: Used a couple in my mod, but the buttons didnt look good so i improved them, thought you might want them

Thanks alot for trying my wonders.
And thanks thanks thanks alot for the buttons. My art skills are very limited :D

Looking for a suitable model for Newton's University now
 
Newton's University
Spoiler :



Physics is an Industrial Era Tech, so by the time you built this wonder, you should have finished most Ancient, Classical and Medieval Techs. However, it is possible to tech directly to physics and skip alot of medieval and renaissance techs, so this wonder will still be beneficial.

I was thinking whether to apply the benefits to conquerer but on second thoughts, nope to avoid exploit. 2 players can just trade the newton's city and keep getting the 25% and 50% boost till both players have all techs from ancient to renaissance.

Thus, benefits only apply to builder once.

Oh yeah, artwork is from Hrochland again, didnt find any unique Newton model so grabbed one with same color as original Civ III button


Lotus and Springfield buttons have been updated with dacubz145's ones in download links
 
Slightly different though. Internet depends on your rivals. If they are lagging in tech, internet doesnt do you any benefit:D

Since Newton is so smart, he should know all vastly outdated era techs, and abit of some not so outdated techs :D
 
Top Bottom