Modmodding Q&A Thread

More, but you can always compare existing leaders. It's not a direct dice roll, other factors like waiting time between previous contacts also influence AI behaviour.
 
These lines of code are erroring in QMC. They seem to also be in DOC.
Code:
            # remove floodplains in Transoxania
            for tuple in [(82, 47), (83, 46), (85, 49)]:
                x, y = tuple
                gc.getMap().plot(x, y).setFeatureType(-1, 0)

Code:
Traceback (most recent call last):
  File "BugEventManager", line 400, in _handleDefaultEvent
  File "CvRFCEventHandler", line 619, in onBeginGameTurn
  File "Resources", line 220, in checkTurn
 
Regarding MaxWar:

Spoiler :


<iMaxWarNearbyPowerRatio>120</iMaxWarNearbyPowerRatio>
<iMaxWarDistantPowerRatio>60</iMaxWarDistantPowerRatio>
<iMaxWarMinAdjacentLandPercent>2</iMaxWarMinAdjacentLandPercent>
<iLimitedWarRand>100</iLimitedWarRand>
<iLimitedWarPowerRatio>120</iLimitedWarPowerRatio>



What constitutes a nearby/distant civ? Is it distance to the nearest city or distance between capitals and what is the threshold for nearby/distant? What is the difference between total/limited war in game?
 
I'm not totally clear on how Dynamic names work, is "DynamicNames.xml" the template to follow for "DynamicNames_YourCiv.xml" when adding your own civ to the game. If so, how do you fill it out? I only ask because the other "DynamicNames_" files for other civs don't appear to follow this format... or I would just copy that format.

Spoiler :

<TEXT>
<Tag>TXT_KEY_PEOPLES_OF</Tag>
<English>Peoples of %s1</English>
<French>Peoples of %s1</French>
<German>Peoples of %s1</German>
<Italian>Peoples of %s1</Italian>
<Spanish>Peoples of %s1</Spanish>
</TEXT>
<TEXT>
<Tag>TXT_KEY_PEOPLES_ADJECTIVE</Tag>
<English>%s2 Peoples</English>
<French>%s2 Peoples</French>
<German>%s2 Peoples</German>
<Italian>%s2 Peoples</Italian>
<Spanish>%s2 Peoples</Spanish>
</TEXT>
<TEXT>
<Tag>TXT_KEY_EMPIRE_OF</Tag>
<English>Empire of %s1</English>
<French>Empire of %s1</French>
<German>Empire of %s1</German>
<Italian>Empire of %s1</Italian>
<Spanish>Esmpire of %s1</Spanish>
</TEXT>
 
Editing the XML files alone won't do anything, the actual logic for assigning dynamic names is in Assets/Python/DynamicCivs.py. DynamicNames.xml is not a template but the source for generic text keys that do not belong to any particular civ (as you can see).
 
Editing the XML files alone won't do anything, the actual logic for assigning dynamic names is in Assets/Python/DynamicCivs.py. DynamicNames.xml is not a template but the source for generic text keys that do not belong to any particular civ (as you can see).
Not exactly my question but I think I figured it out anyway. I'm taking this step-by-step so I'm not that far yet.

Another question, for the scenario files the "Guide to adding a civ" says:

Spoiler :

If your scenario has independents and barbarians present at the beginning of the game (anything except 3000 BC), you must find all their unit (BeginUnit/EndUnit) and city (BeginCity/EndCity) entries and increment their UnitOwner/CityOwner values by one. This is because your new player has invariably been inserted before the independents and barbarians, which means their ID has increased by one, which you now have to account for. The same goes for the PlayerXXCulture=Y entries for cities, where you have to increment XX by one.


Is it just barbarians and independents or (say my civ is team 32) do I need to increment all of the UnitOwner/CityOwner values for teams 32-49? Also, do I need to increment the "TeamReveal" values as well?
 
Yes. This guide was written before the 1700 AD scenario existed and all player cities were flipped, so there were only minors in the file.
 
There is a python script for notepad++ which automatically increases all affected numbers and you only need to add the BeginPlayer and BeginTeam. IIRC it is somewhere in this thread.

Credits to @1SDAN . He created the initial script. I made some small updates to it. (So it does updates the TeamReveal too as well as some other minir updates.)

Thinking of it, I will make another update that will include an additional BeginTeam entry and the BeginPlayer entry. Then you only need to fill in the data of BeginPlayer.
 
I should probably include it into the mod itself to make it easier to find.
 
So am I to take this to mean there is a very useful tool for what I'm doing but no one knows where it is? I guess I'll keep plugging away then.
 
The point of this thread is to share expertise with people who don't have it, and I think we're all equally capable of searching this thread for a Notepad++ script ;)
 
The point of this thread is to share expertise with people who don't have it, and I think we're all equally capable of searching this thread for a Notepad++ script ;)
Yes, and I very much appreciate the support. That said, I think my and others' prior knowledge is sometimes overestimated when asking questions. For example, I'm not even sure how the infrastructure of this forum works tbh. Am I to take this to mean there is a way to quickly search the thread for a Notepad++ script, or are you just implying that I am equally capable to trudge through page by page until I stumble upon this particular post? If the former is true, I'd say that some (those who posted/read the post) are more qualified to search for it because they might have a better idea of what keywords were involved. If the latter is true, I would say some (those who posted/read the post) are more qualified to search for it as they might have a better idea of the general date of the post. Whereas me, who has never seen it could start from one of two places the first or last page... or perhaps the middle if I'm feeling whimsical.
 
The search field is on the top left, by default it searches the thread that is currently open, and you can filter by post author. Scanning all of merijn's or 1SDAN's posts for a post mentioning is not really a lot of work, and is exactly the same the thing I would have to do to answer your question.

Your post above really sounded like "if no one gives me what I need on a silver platter, I guess there is nothing I could do", which is not true.
 
Your post above really sounded like "if no one gives me what I need on a silver platter, I guess there is nothing I could do", which is not true.
Well, that really wasn't my intention, but not knowing how the search function worked, I thought it searched FOR threads not WITHIN threads it seemed to me that plugging away at the code (which I know how to search) was the logical way forward rather than blindly scanning the thread for something I could easily miss. Anyway, thanks again for the tips.

EDIT: If anyone is looking for it it's here: https://forums.civfanatics.com/threads/modmodding-q-a-thread.516755/page-86#post-15094572... That's the original, the updates are a few messages down.
 
Last edited:
Okay, so now for more dumb questions. I found the npp import script... how do I implement it? All I can find in notepad++ is "NppExport" under Plugins.

Code:
from Npp import *
import re

start = int(notepad.prompt(notepad, 'Number of the new civ', "")) - 1
end = 54

editor.beginUndoAction()
for i in range(start, end):
   ii = end + start - i
    editor.rereplace(r"(Owner=|Reveal=|Player|,|Team=|TeamID=)" + "(" + str(ii) + ")([^1234567890])", r"($1)" + str(ii+1) + "($3)")
editor.endUndoAction()
 
You have to install python plugins for Notepad++. It is easier to google if for yourself then me to explain it. Do note that it requires the 32-bit version of Notepad++, not the 64-bit version.
 
Believe me, acquiring the skill to locate readily available information on the internet will pay for itself quickly.
 
Believe me, acquiring the skill to locate readily available information on the internet will pay for itself quickly.
I understand that. My difficulty is not "not knowing what to do" but "not knowing what to look for". If this is a recipe, I'm still looking for the ingredients list and every resource I've found so far has clearly assumed I have this list and has launched into the steps.
 
Top Bottom