Louis's Python and SDK

Louis the XIV

Sun King
Joined
Jun 23, 2020
Messages
837
Location
Court of Versailles
Hi everyone! Python and C++ has always been a fascination to me, when I found out it can be used in Civ 4 I immediately tried to learn them, python first. Well I'm still learning from great python modders like platyping and The_J but I managed my way to create a few python effects using some other modcomps as a base and a few C++ DLL's that might come in useful. So here I will post all my python and SDK mod components. There is one picture for every modcomp here but there are also more pictures in the download links.
P.S. All my wonders have movies as well:thumbsup:! Also credits are in the download link!
Special thanks to @Zeta Nexus because of all his awesome wonder movies! By the way my SDK is below!

Valhalla
Effect: Adds the Valhalla promotion that reborns Naval and Melee units that died in battle to your capital from Asgard.
Requirements: Compass and a city at the coast.
Obsolete: Astronomy
Info: 350:hammers:, 8:culture:, 2:gp: Great Prophet.
Spoiler Picture :
Civ4ScreenShot0001.JPG

valhalla.JPG


Fushimi Inari
Effect: Inari God of Rice will destroy your enemies Rice supply over time, enemies can no longer pillage farms in your borders.
Requirements: Civil Service and Rice
Obsolete: Biology
Info: 500:hammers:, 10:culture:, 2:gp: Great Prophet.
Spoiler Picture :


Cathedral of Seville
Modular. Because the Cathedral of Seville is the largest Gothic styled Cathedral in the World I made it Huge so in the Civilopedia all you will see is a window!
Effect: Effect: Attracts Saints in cities that have a Great Prophet as a Specialist; +2:gp: Great Prophet, can turn 3 citizens into Priest, and 14:culture:.
Because the Cathedral of Seville is the Largest Catholic Gothic Building in the world I made its size Huge! So in the Civilopedia all you will see is one of the windows.
Requirement: Replaceable Parts and Divine Right, a Christian Cathedral
Info: 650:hammers:
Obsolete: None
Saint: the Saint is a World Unit that uses the Charlemagne Relic art. Currently all it does is spread every religion in the game in any city you want, not only your own but also your enemies. If that religion wasn't founded yet then it will be founded in the city you spread it to.
This weekend will be released the final version 2.0 of this wonder that adds the Believer of God promotion witch will have an Awesome:wow: effect! I already have a couple of ideas in mind but please feel free to suggest in this thread.
Spoiler Picture :
Civil.JPG


Healer Curse Promotion
Effect:

Whenever a Unit with this Promotion enters a city that city will get +1:health:.
But when the Unit with the Healer Curse promotion leaves the city, the citizens get mad and the city will get 1:mad:!
Both of these are permanent!
All Python changes are marked with #Healer Curse Start
Spoiler Picture :
Civ4ScreenShot0000.JPG


First Christian Church
This is a project by the way.
Effect: When completed the current state religion of the player will move its Holy City to the players capital, even if the Holy City is in an enemies city. So if you don't have a state religion or you have the holy city already then it is pretty much useless.
Requirements: Requires Theology
Credits:
platyping for the button
Spoiler Picture :
Civ4ScreenShot0005.JPG


The Flavian Amphitheater
Effect:
1:) and 3:culture: for every Culture Level in the city
Requirements:
Techs: Construction and Drama; Building: Colosseum;
Info:
Cost: 350:hammers:; 2:gp: Great Artist
Spoiler Picture :
Colosseum.JPG


Trajan's Column
Effect:
Units build in a city that have a Great Engineer Specialist start with the Shock promotion.
Requirements:
Techs: Iron Working and Metal Casting
Info:
Cost: Cost: 300:hammers:; 25% Great General Emergence inside cultural borders; 2:gp: Great Engineer.
Spoiler Picture :
Trajans Column.JPG
 
Last edited:
Louis's SDK!
Here I will upload my DLL's or SDK components.

200 Civs DLL
Yep, 200 civs.
No crashes as far as I know but it takes 4-6 min to load.
Do not play with more civs then you have in the mod!
Spoiler Picture :
Civ4ScreenShot0001.JPG


Vassals can have more masters
Pretty crashy but other wise works fine. Vassals can have more then one master. I think the limit is infinity.
Spoiler Picture :
many vassal masters.JPG


Human Vassals
Humans can now be vassals of the AI without having to go into WB.
Also has some crashes but other wise works fine.
Spoiler Picture :
human vassal.JPG
 
Last edited:
Would you happen to have a WB save for the 200 civs dll that I could see? I'm trying to modify one and there's an error somewhere and it'd be really helpful. Thanks!
 
Would you happen to have a WB save for the 200 civs dll that I could see? I'm trying to modify one and there's an error somewhere and it'd be really helpful. Thanks!
I never actually tried the 200 Civ DLL because no mod ever got 200 Civs. The only mod that has over 100 Civs is CIV GOLD, and if you start a game with more civs then there are in the game it will crash.
About the error, is it using the 200 civ DLL? And what error does it give you python or C++?
 
So the mod is running the 200 civ DLL, although the map itself only has 39 civs. When I try to load it, I get this and the game closes. I don't know what error that is but there you are.
Spoiler :

upload_2020-10-31_10-56-45.png

 
So the mod is running the 200 civ DLL, although the map itself only has 39 civs. When I try to load it, I get this and the game closes. I don't know what error that is but there you are.
I think I might know the cause.
So go into the Map using Notepad or whatever text editor you have and check how many teams there are.
It should look like this:
PHP:
BeginTeam
TeamID=0
EndTeam
BeginTeam
TeamID=1
EndTeam
etc...
EndTeam
BeginPlayer
    Team=0
    LeaderType=LEADER_JUSTINIAN
    LeaderName=Justinian I
    CivDesc=Byzantine Empire
    FlagDecal=Art/Interface/TeamColor/FlagDECAL_Labarum.dds
    WhiteFlag=0
    CivType=CIVILIZATION_BYZANTIUM
    Color=PLAYERCOLOR_DARK_PURPLE
    ArtStyle=ARTSTYLE_GRECO_ROMAN
    PlayableCiv=1
    MinorNationStatus=0
    StartingGold=100
    StartingX=109, StartingY=55
    StateReligion=RELIGION_CHRISTIANITY
    StartingEra=ERA_MEDIEVAL
    RandomStartLocation=false
    CivicOption=CIVICOPTION_GOVERNMENT, Civic=CIVIC_HEREDITARY_RULE
    CivicOption=CIVICOPTION_LEGAL, Civic=CIVIC_BARBARISM
    CivicOption=CIVICOPTION_LABOR, Civic=CIVIC_SLAVERY
    CivicOption=CIVICOPTION_ECONOMY, Civic=CIVIC_DECENTRALIZATION
    CivicOption=CIVICOPTION_RELIGION, Civic=CIVIC_ORGANIZED_RELIGION
    Handicap=HANDICAP_EMPEROR
EndPlayer
BeginPlayer
    Team=1
    LeaderType=LEADER_DARIUS
    LeaderName=Khosrau II
    CivDesc=Sassanid Empire
    CivShortDesc=Sassanids
    CivAdjective=Sassanid
    FlagDecal=Art/Interface/TeamColor/FlagDECAL_Scimitar.dds
    WhiteFlag=0
    CivType=CIVILIZATION_PERSIA
    Color=PLAYERCOLOR_CYAN
    ArtStyle=ARTSTYLE_MIDDLE_EAST
    PlayableCiv=1
    MinorNationStatus=0
    StartingGold=100
    StartingX=56, StartingY=45
    StateReligion=RELIGION_BUDDHISM
    StartingEra=ERA_CLASSICAL
    RandomStartLocation=false
    CivicOption=CIVICOPTION_GOVERNMENT, Civic=CIVIC_HEREDITARY_RULE
    CivicOption=CIVICOPTION_LEGAL, Civic=CIVIC_BARBARISM
    CivicOption=CIVICOPTION_LABOR, Civic=CIVIC_SLAVERY
    CivicOption=CIVICOPTION_ECONOMY, Civic=CIVIC_DECENTRALIZATION
    CivicOption=CIVICOPTION_RELIGION, Civic=CIVIC_ORGANIZED_RELIGION
    Handicap=HANDICAP_EMPEROR
EndPlayer
If there are less teams then 200 you will get an error. If there are more teams then 200 you will get an error.
Either try adding 200 teams or play on a PY map like Pangea or Archipelago.
 
If there are less teams then 200 you will get an error. If there are more teams then 200 you will get an error.

That's what I have. I've got teams 0 through 199, so there shouldn't be a problem. As an example:

Spoiler :

BeginTeam
TeamID=38
Tech=TECH_MYSTICISM
Tech=TECH_THE_WHEEL
Tech=TECH_AGRICULTURE
Tech=TECH_MINING
ContactWithTeam=38
RevealMap=0
EndTeam
BeginTeam
TeamID=39
ContactWithTeam=39
RevealMap=0
EndTeam
BeginTeam
TeamID=40
ContactWithTeam=40
RevealMap=0
EndTeam
BeginTeam
TeamID=41
ContactWithTeam=41
RevealMap=0
EndTeam


and

Spoiler :

BeginPlayer
Team=38
LeaderType=LEADER_SONGTSEN
LeaderName=Songtsen Gampo
CivDesc=Tibetan Empire
CivShortDesc=Tibet
CivAdjective=Tibetan
FlagDecal=Modules/Tibet/Art/Civilizations/TibetFlag.dds
WhiteFlag=0
CivType=CIVILIZATION_TIBET
Color=PLAYERCOLOR_BROWNISH_RED
ArtStyle=ARTSTYLE_ASIAN
PlayableCiv=1
MinorNationStatus=0
StartingGold=0
StartingX=95, StartingY=42
StateReligion=
StartingEra=ERA_ANCIENT
RandomStartLocation=false
CivicOption=CIVICOPTION_GOVERNMENT, Civic=CIVIC_DESPOTISM
CivicOption=CIVICOPTION_LEGAL, Civic=CIVIC_BARBARISM
CivicOption=CIVICOPTION_LABOR, Civic=CIVIC_TRIBALISM
CivicOption=CIVICOPTION_ECONOMY, Civic=CIVIC_DECENTRALIZATION
CivicOption=CIVICOPTION_RELIGION, Civic=CIVIC_PAGANISM
Handicap=HANDICAP_NOBLE
EndPlayer
BeginPlayer
Team=39
LeaderType=NONE
CivType=NONE
Color=NONE
ArtStyle=NONE
Handicap=HANDICAP_NOBLE
EndPlayer
BeginPlayer
Team=40
LeaderType=NONE
CivType=NONE
Color=NONE
ArtStyle=NONE
Handicap=HANDICAP_NOBLE
EndPlayer
BeginPlayer
Team=41
LeaderType=NONE
CivType=NONE
Color=NONE
ArtStyle=NONE
Handicap=HANDICAP_NOBLE
EndPlayer
BeginPlayer
Team=42
LeaderType=NONE
CivType=NONE
Color=NONE
ArtStyle=NONE
Handicap=HANDICAP_NOBLE
EndPlayer
BeginPlayer
Team=43
LeaderType=NONE
CivType=NONE
Color=NONE
ArtStyle=NONE
Handicap=HANDICAP_NOBLE
EndPlayer
BeginPlayer
Team=44
LeaderType=NONE
CivType=NONE
Color=NONE
ArtStyle=NONE
Handicap=HANDICAP_NOBLE
EndPlayer


I'll be honest, I'm kinda at a loss.
 
Then the problem is with the DLL. I won't lie, I'm not an expert and modding in SDK so it is probably my fault. I'll see if other people report bugs as well and if more people report them I'll ask a moderator to remove the resource or I'll just say a warning.
 
Then the problem is with the DLL. I won't lie, I'm not an expert and modding in SDK so it is probably my fault. I'll see if other people report bugs as well and if more people report them I'll ask a moderator to remove the resource or I'll just say a warning.

Dang, okay. Well, that's disappointing. Well, if you can fix it that'd be excellent but if you can't that's okay too. No pressure.
 
Dang, okay. Well, that's disappointing. Well, if you can fix it that'd be excellent but if you can't that's okay too. No pressure.
I just went into DLL modding, the only file I changed was in the CvDefines.h I changes the MAX_NUM_TEAMS (18) to MAX_NUM_TEAMS (200).
There might have been some other files to change as well probably.
 
I just went into DLL modding, the only file I changed was in the CvDefines.h I changes the MAX_NUM_TEAMS (18) to MAX_NUM_TEAMS (200).
There might have been some other files to change as well probably.

There's probably a tutorial somewhere, but I don't know where.
 
There's probably a tutorial somewhere, but I don't know where.
This kind of stuff is learned through experience.
There are of course many great guides on editing C++ and Python for civilization but there are so many things to do that there is not a tutorial for all of them.
I for example learned basic python for civ 4 with the help of spillsandstains and learned more advanced python by installing mostly platypings and The_J's python mod comps and looking through them. Also whenever I install something for Civ 4 I first have a good look at the python and see if I can understand.
 
Then the problem is with the DLL. I won't lie, I'm not an expert and modding in SDK so it is probably my fault. I'll see if other people report bugs as well and if more people report them I'll ask a moderator to remove the resource or I'll just say a warning.
Perhaps you could try a 100civs dll and see if it works with CivGold or not.
 
Effect: When completed the current state religion of the player will move its Holy City to the players capital, even if the Holy City is in an enemies city. So if you don't have a state religion or you have the holy city already then it is pretty much useless.
1) You should use the following tag to avoid wasting the wonder:
<bStateReligion>1</bStateReligion>
2) Moving the Holy City from its actual position to the capital is not a waste at all. Capitals often generate more money. So it can be a pretty powerful wonder.

Good job :thumbsup:
 
Top Bottom