Louis's Python and SDK

Discussion in 'Civ4 - Mod Components' started by Louis the XIV, Oct 28, 2020.

  1. Louis the XIV

    Louis the XIV Sun King

    Joined:
    Jun 23, 2020
    Messages:
    837
    Gender:
    Male
    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: Nov 11, 2020
  2. Louis the XIV

    Louis the XIV Sun King

    Joined:
    Jun 23, 2020
    Messages:
    837
    Gender:
    Male
    Location:
    Court of Versailles
    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: Oct 28, 2020
  3. Louis the XIV

    Louis the XIV Sun King

    Joined:
    Jun 23, 2020
    Messages:
    837
    Gender:
    Male
    Location:
    Court of Versailles
    reserved for second case of python
     
    Last edited: Oct 28, 2020
  4. Louis the XIV

    Louis the XIV Sun King

    Joined:
    Jun 23, 2020
    Messages:
    837
    Gender:
    Male
    Location:
    Court of Versailles
    reserved for second case of sdk
     
  5. Louis the XIV

    Louis the XIV Sun King

    Joined:
    Jun 23, 2020
    Messages:
    837
    Gender:
    Male
    Location:
    Court of Versailles
    Created a Cathedral of Seville wonder. Credits to @hrochland and @Zeta Nexus
    Will be updated this weekend!
     
  6. CMSBile

    CMSBile Chieftain

    Joined:
    May 22, 2018
    Messages:
    29
    Gender:
    Female
    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!
     
  7. Louis the XIV

    Louis the XIV Sun King

    Joined:
    Jun 23, 2020
    Messages:
    837
    Gender:
    Male
    Location:
    Court of Versailles
    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++?
     
  8. CMSBile

    CMSBile Chieftain

    Joined:
    May 22, 2018
    Messages:
    29
    Gender:
    Female
    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
     
  9. Louis the XIV

    Louis the XIV Sun King

    Joined:
    Jun 23, 2020
    Messages:
    837
    Gender:
    Male
    Location:
    Court of Versailles
    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
    =109StartingY=55
        StateReligion
    =RELIGION_CHRISTIANITY
        StartingEra
    =ERA_MEDIEVAL
        RandomStartLocation
    =false
        CivicOption
    =CIVICOPTION_GOVERNMENTCivic=CIVIC_HEREDITARY_RULE
        CivicOption
    =CIVICOPTION_LEGALCivic=CIVIC_BARBARISM
        CivicOption
    =CIVICOPTION_LABORCivic=CIVIC_SLAVERY
        CivicOption
    =CIVICOPTION_ECONOMYCivic=CIVIC_DECENTRALIZATION
        CivicOption
    =CIVICOPTION_RELIGIONCivic=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
    =56StartingY=45
        StateReligion
    =RELIGION_BUDDHISM
        StartingEra
    =ERA_CLASSICAL
        RandomStartLocation
    =false
        CivicOption
    =CIVICOPTION_GOVERNMENTCivic=CIVIC_HEREDITARY_RULE
        CivicOption
    =CIVICOPTION_LEGALCivic=CIVIC_BARBARISM
        CivicOption
    =CIVICOPTION_LABORCivic=CIVIC_SLAVERY
        CivicOption
    =CIVICOPTION_ECONOMYCivic=CIVIC_DECENTRALIZATION
        CivicOption
    =CIVICOPTION_RELIGIONCivic=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.
     
  10. CMSBile

    CMSBile Chieftain

    Joined:
    May 22, 2018
    Messages:
    29
    Gender:
    Female
    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.
     
  11. Louis the XIV

    Louis the XIV Sun King

    Joined:
    Jun 23, 2020
    Messages:
    837
    Gender:
    Male
    Location:
    Court of Versailles
    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.
     
  12. CMSBile

    CMSBile Chieftain

    Joined:
    May 22, 2018
    Messages:
    29
    Gender:
    Female
    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.
     
  13. Louis the XIV

    Louis the XIV Sun King

    Joined:
    Jun 23, 2020
    Messages:
    837
    Gender:
    Male
    Location:
    Court of Versailles
    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.
     
  14. CMSBile

    CMSBile Chieftain

    Joined:
    May 22, 2018
    Messages:
    29
    Gender:
    Female
    There's probably a tutorial somewhere, but I don't know where.
     
  15. Louis the XIV

    Louis the XIV Sun King

    Joined:
    Jun 23, 2020
    Messages:
    837
    Gender:
    Male
    Location:
    Court of Versailles
    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.
     
  16. Zeta Nexus

    Zeta Nexus Deity

    Joined:
    Jan 23, 2014
    Messages:
    4,459
    Gender:
    Male
    Location:
    In a constant brainstorm...
    Perhaps you could try a 100civs dll and see if it works with CivGold or not.
     
  17. Louis the XIV

    Louis the XIV Sun King

    Joined:
    Jun 23, 2020
    Messages:
    837
    Gender:
    Male
    Location:
    Court of Versailles
    There already is a 100 Civ DLL by Merkava. I asked him if he could please send the sources he changed so I could see if only the CvDefines.h had to be changed.
     
  18. Louis the XIV

    Louis the XIV Sun King

    Joined:
    Jun 23, 2020
    Messages:
    837
    Gender:
    Male
    Location:
    Court of Versailles
    Created my first promotion!
    Healer Curse!
     
  19. Louis the XIV

    Louis the XIV Sun King

    Joined:
    Jun 23, 2020
    Messages:
    837
    Gender:
    Male
    Location:
    Court of Versailles
  20. Zeta Nexus

    Zeta Nexus Deity

    Joined:
    Jan 23, 2014
    Messages:
    4,459
    Gender:
    Male
    Location:
    In a constant brainstorm...
    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:
     

Share This Page