Quick Modding Questions Thread

Discussion in 'Civ4 - Creation & Customization' started by kiwitt, Jan 27, 2010.

  1. R82

    R82 Chieftain

    Joined:
    Dec 20, 2019
    Messages:
    42
    Gender:
    Male
    Hi everyone,
    I just read up on the most basic stuff about simple text-only modding yesterday, and now I have a simple text-only custom Civ for standard BtS, with art (for now) taken from the game's standard Civs, consisting entirely of slightly modified versions of four XML files ( \Assets\XML\Civilizations\CIV4CivilizationInfos , \Assets\XML\Civilizations\CIV4LeaderHeadInfos , \Assets\XML\Text\CIV4GameText_Civilopedia_BTS , and \Assets\XML\Text\CIV4GameText_Objects_BTS ). Now, my first question is, which beginners' tutorial should I read to learn how to turn those four files with their directory structure into a very simple but still "proper" mod, which is recognized as such by the game and shows up in the BtS mod loading page?

    My second question is, if I'd decide to try to move beyong text-only modding, which is the best introductory tutorial on creating BtS flags?
     
  2. <Nexus>

    <Nexus> Traveler of the Multiverse

    Joined:
    Jan 23, 2014
    Messages:
    4,875
    Gender:
    Male
    Location:
    In a constant brainstorm...
    Is there a python modcomp that under certain circumstances (wonder, civic, etc) prevents your cities from culture flipping to another civ? I am almost sure I saw something like that somewhere :scared:
     
  3. R82

    R82 Chieftain

    Joined:
    Dec 20, 2019
    Messages:
    42
    Gender:
    Male
    OK, forget about my second question from my previous post. I read this tutorial

    https://forums.civfanatics.com/threads/how-to-create-flags-for-civ4-for-dummys.315966/

    and got to work. I ran into one small problem with my first flag, best explained by posting two small excerpts from a screenshot I took while playing with it:

    Civ4ScreenShot0000-crop3.jpg Civ4ScreenShot0000-crop4.jpg

    As you can see, the flag has two black bars on the sides. I did not intend for those bars to be there, I did nothing to put those bars there, and I don't understand why they're there.

    I've attached is a zip file with the .dds file for the flag, and the original GIMP .xcf file.
     

    Attached Files:

  4. R82

    R82 Chieftain

    Joined:
    Dec 20, 2019
    Messages:
    42
    Gender:
    Male
    Now I've discovered the .ini files for mods. Is there a good introductory guide to what the various values in them mean? Google didn't help me much.
     
  5. Vokarya

    Vokarya Deity

    Joined:
    Mar 25, 2011
    Messages:
    6,239
    I think if you set all the values to 0 except AllowPublicMaps and the last two, it won't hurt anything. Name should correspond to your mod's folder name and description can be anything. AllowPublicMaps should be 1 so you can use BTS existing PublicMaps.
     
    R82 likes this.
  6. Merkava120

    Merkava120 Oberleutnant

    Joined:
    Feb 2, 2013
    Messages:
    441
    Gender:
    Male
    Location:
    Socially distant
    Also if you ever download a mod that has an Assets/Modules folder you will need to make sure that modular loading is enabled in the ini. Otherwise, the mod stuff won't load, and speaking from experience, it's as confusing as jello.
     
    R82 likes this.
  7. Merkava120

    Merkava120 Oberleutnant

    Joined:
    Feb 2, 2013
    Messages:
    441
    Gender:
    Male
    Location:
    Socially distant
    I think this will help answer your first question: https://forums.civfanatics.com/threads/before-you-publish-or-download-a-mod-please-read.138043/
     
    R82 likes this.
  8. Merkava120

    Merkava120 Oberleutnant

    Joined:
    Feb 2, 2013
    Messages:
    441
    Gender:
    Male
    Location:
    Socially distant
    This gets close: https://forums.civfanatics.com/threads/platypings-python.450416/page-21#post-11312047 First one in the post. Platy also has a regular mod in the peculiar pleasant posh thread somewhere that prevents the inner 9x9 of any city from flipping.
     
    <Nexus> likes this.
  9. R82

    R82 Chieftain

    Joined:
    Dec 20, 2019
    Messages:
    42
    Gender:
    Male
    For the record, I've solved my flag problems now. Took some playing around with various files.
     

    Attached Files:

    DarkLunaPhantom, Merkava120 and lfgr like this.
  10. Leoreth

    Leoreth Vampire of the Blue Moon Moderator

    Joined:
    Aug 23, 2009
    Messages:
    35,782
    Gender:
    Male
    Location:
    Paris
    Is there a way to implement a diplomatic deal between two players in Python? For example, let's say I want to implement a peace treaty between two players for 10 turns. Also, what if I want it to be a unilateral peace treaty (i.e. only player A is unable to declare on B but not vice versa)?
     
  11. DarkLunaPhantom

    DarkLunaPhantom Prince Supporter

    Joined:
    Feb 4, 2013
    Messages:
    509
    Location:
    Croatia
    There already exist functions like CyPlayer::forcePeace that do exactly what you mention in your example.

    Unilateral peace treaties are possible, see CvPlayer::forcePeace here.
     
  12. Leoreth

    Leoreth Vampire of the Blue Moon Moderator

    Joined:
    Aug 23, 2009
    Messages:
    35,782
    Gender:
    Male
    Location:
    Paris
    Oh cool, thanks! I think that's exactly what I need.

    Just out of curiosity though, I guess that means there is no generic API to implement any kind of deal?
     
  13. DarkLunaPhantom

    DarkLunaPhantom Prince Supporter

    Joined:
    Feb 4, 2013
    Messages:
    509
    Location:
    Croatia
    I don't think that there is one. That's weird because I expected that things like that would be open to Python modding by default.
     
    Leoreth likes this.
  14. MatteM

    MatteM Warlord

    Joined:
    Sep 7, 2015
    Messages:
    278
    Gender:
    Male
    Location:
    Stockholm
    Hello, forgive my lack of knowledge however I rarely play the game as I only have time to mod it. A couple of questions on capturing cities and enemy units:

    * Can naval units capture enemy naval units?
    * Can naval units capture cities? I ask because as far as I could see in the xml, only the Gunship has <bNoCapture>1</bNoCapture>

    I am currently making war galleys and galleasses, and a large part of the tactic was boarding enemy vessels and capturing them. I would be cool if galleys could capture other galleys.

    If naval units can capture cities I would have to remove that possibility :)
     
  15. <Nexus>

    <Nexus> Traveler of the Multiverse

    Joined:
    Jan 23, 2014
    Messages:
    4,875
    Gender:
    Male
    Location:
    In a constant brainstorm...
    IIRC naval units can't capture cities and there is a modcomp (War prizes I think) that allows capturing naval units.
     
  16. Vokarya

    Vokarya Deity

    Joined:
    Mar 25, 2011
    Messages:
    6,239
    Naval units can't even attack cities. Of course you can bombard but that can't destroy units.

    You can set up naval units to be capturable by setting the <Capture> tag for the unit you want to make able to be captured (like the XML for Settler and how it turns into a Worker if captured) but it's all or nothing and only works on the last unit in a stack. If you want any variability in the capturing you will need something like War Prizes which has to be done at the Python or DLL level.
     
  17. LPlate2

    LPlate2 Warlord

    Joined:
    Dec 27, 2018
    Messages:
    243
    Where are widgets defined?
    Specifically, WIDGET_HELP_PRODUCTION and WIDGET_HELP_BUILDING
     
    Last edited: May 20, 2022
  18. MatteM

    MatteM Warlord

    Joined:
    Sep 7, 2015
    Messages:
    278
    Gender:
    Male
    Location:
    Stockholm
    Thanks! I'll have a look at the modcomp :)
     
  19. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    1,204
    Location:
    Germany
    Now that I see the edited second line of this question: Those enumerators are defined in CvEnums.h and exposed to Python through CyEnumsInterface.cpp. The associated behavior is implemented in CvDLLWidgetData. The EXE calls parseHelp when the player hovers over the widget, executeAction when the widget is left-clicked and executeAltAction when it is right-clicked. (Or, perhaps, for some widgets, the action and alt. action are triggered differently.)
    Code:
    // CvDLLWidgetData.h
    DllExport void parseHelp(CvWStringBuffer &szBuffer, CvWidgetDataStruct &widgetDataStruct);
    DllExport bool executeAction(CvWidgetDataStruct &widgetDataStruct);
    DllExport bool executeAltAction(CvWidgetDataStruct &widgetDataStruct);
     
    LPlate2 likes this.
  20. MatteM

    MatteM Warlord

    Joined:
    Sep 7, 2015
    Messages:
    278
    Gender:
    Male
    Location:
    Stockholm
    Map graphics issue

    Hi, I am modifying Genghis Kais giant earth map as a basis for my mod, however I am getting this graphical glitch specifically at the edge of the map, some sort of shadow effect:

    mapglitch.jpg

    Does anyone know what causes this? I have been working with the map in the excel map editor called Civ4 YAME

    I did try to search the forums but could identify any threads about it specifically unless I missed it somewhere.
     

Share This Page