Quick Modding Questions Thread

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?
 
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:
 
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.
 

Attachments

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.
 
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.

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.
 
  • Like
Reactions: R82
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.
 
  • Like
Reactions: R82
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?

I think this will help answer your first question: https://forums.civfanatics.com/threads/before-you-publish-or-download-a-mod-please-read.138043/
 
  • Like
Reactions: R82
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)?
 
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.

There already exist functions like CyPlayer::forcePeace that do exactly what you mention in your example.

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)?

Unilateral peace treaties are possible, see CvPlayer::forcePeace here.
 
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?
 
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 :)
 
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.
 
Where are widgets defined?
Specifically, WIDGET_HELP_PRODUCTION and WIDGET_HELP_BUILDING
 
Last edited:
IIRC naval units can't capture cities and there is a modcomp (War prizes I think) that allows capturing naval units.

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.

Thanks! I'll have a look at the modcomp :)
 
Where are widgets defined?
Specifically, WIDGET_HELP_PRODUCTION and WIDGET_HELP_BUILDING
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);
 
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.
 
Back
Top Bottom