Quick Modding Questions Thread

The BFC (big fat criss) radius is 2 at by default. Am i correct in saying that this locked and not simple to modify?
 
Yes, correct. In particular, a bunch of helper arrays for looping over all workable tiles need to be expanded in order to increase the city radius: CvGlobals::init
Certainly can be done; Rise of Mankind does it, for example. And here's a smaller mod too.
 
Yes, correct. In particular, a bunch of helper arrays for looping over all workable tiles need to be expanded in order to increase the city radius: CvGlobals::init
Certainly can be done; Rise of Mankind does it, for example. And here's a smaller mod too.
I've tried the enhanced city mod linked above, its for 3.17 not 3.19 which complicates things.
 
Hello all,
.
If I am wanting to open the python console w cheat mode; I have changed the .ini bak file from cheat code = 0 to cheat code = chipotle ... but when I start a game and press shift ~ nothing occurs ... what am I doing wrong?
 
Thank you Nexus.
.
As I have previously stated, I am in the process of finishing scenarios to package w my mod to post online.
.
What I have first tried to do is take the Earth Map from the Earth1000AD scenario and cleared it of all civs and units and then saved just the map in my maps folder. Then, using wbs text, I have edited it to have 0-47 open civs [since my mod uses a 48 civ DLL].
.
When I go to load the map to build the scenario I get an assert fail. Is anyone able to tell me what this asset fails means:
.
Assert fail in CvGlobals.cpp
line: 3644
expression: style
Message: null info type string
.
Anyone able to help me determine what this assert fail means?
 
Last edited:
Hi Mr Smith,
.
I would love to but the one thing I've never done in modding is open the DLL file to view the source code. Can anyone help me with directions on how best to do that?
You can't just "open" it once it's compiled. Source is either released by the person who compiled the DLL or at best you can decompile it, but that won't help here.
 
You can't just "open" it once it's compiled. Source is either released by the person who compiled the DLL or at best you can decompile it, but that won't help here.

If you, or anyone, could point me to a best method to decompile my DLL that was made by Karadoc, I'd happily put in the work to do so. I have learned so much already about python and XML and I'd like to learn this as well
 
If you, or anyone, could point me to a best method to decompile my DLL that was made by Karadoc
I told you, it's not an option. That it was made by Karadoc is a good clue, you probably should've linked that.
C++:
int CvGlobals::getInfoTypeForString(const char* szType, bool hideAssert) const
    {
    FAssertMsg(szType, "null info type string");
    InfosMap::const_iterator it = m_infosMap.find(szType);
    if (it!=m_infosMap.end())
    {
        return it->second;
    }

    //if(!hideAssert)
    if (!hideAssert && !(strcmp(szType, "NONE")==0 || strcmp(szType, "")==0)) // K-Mod
    {
        CvString szError;
        szError.Format("info type %s not found, Current XML file is: %s", szType, GC.getCurrentXMLFile().GetCString());
        //FAssertMsg(strcmp(szType, "NONE")==0 || strcmp(szType, "")==0, szError.c_str());
        gDLL->logMsg("xml.log", szError);
    }

    return -1;
}
Third line, no idea what the error means, though.
 
I told you, it's not an option. That it was made by Karadoc is a good clue, you probably should've linked that.
C++:
int CvGlobals::getInfoTypeForString(const char* szType, bool hideAssert) const
    {
    FAssertMsg(szType, "null info type string");
    InfosMap::const_iterator it = m_infosMap.find(szType);
    if (it!=m_infosMap.end())
    {
        return it->second;
    }

    //if(!hideAssert)
    if (!hideAssert && !(strcmp(szType, "NONE")==0 || strcmp(szType, "")==0)) // K-Mod
    {
        CvString szError;
        szError.Format("info type %s not found, Current XML file is: %s", szType, GC.getCurrentXMLFile().GetCString());
        //FAssertMsg(strcmp(szType, "NONE")==0 || strcmp(szType, "")==0, szError.c_str());
        gDLL->logMsg("xml.log", szError);
    }

    return -1;
}
Third line, no idea what the error means, though.
Hah, I had forgotten this was available on here [it's been many years] and I was just in the process of coming here to post it when I saw that you had done so
 
getInfoTypeForString is supposed to map a <Type> string from XML - like "UNIT_AXEMAN" - to a DLL-internal ID. Usually gets called by Python code, for example here by the WBSave parser to look up "CIVIC_..." strings found in a WBSave file. Apart from civics, the parser looks up state religions and start eras. So maybe it's worth checking whether your WBSave assigns empty strings to any of those. Oh, but the parser also looks up lots of other type strings via findInfoTypeNum in CvUtil.py:
Spoiler :
Code:
def findInfoTypeNum(infoGetter, numInfos, typeStr):
	if (typeStr == 'NONE'):
		return -1
	idx = gc.getInfoTypeForString(typeStr)
	pyAssert(idx != -1, "Can't find type enum for type tag %s" %(typeStr,))
	return idx
So any line with ...Type=(nothing) could be responsible. Maybe the problem will become more apparent if you just ignore the failed assertion? Anything in PythonErr.log if you do so? It might also help to adopt this bugfix to the pyAssert function. That function is supposed to write a Python stacktrace to PythonErr.log when findInfoTypeNum fails, but it's incorrectly implemented and just silently ignores the failure instead. A more reliable way to get a Python exception would be to (temporarily) change getInfoTypeForString in the DLL so that it crashes the DLL rather than show a failed-assertion popup. But that will require recompilation of the DLL.
 
Okay, I can't find anyone who's asked this question that got a clear response. And I'm in disbelief that not a lot of people have asked, honestly. How can I randomize the city names for a civilization instead of founding them in a set order (as long as capital comes first), and also assign weights to city names so more popular places are more likely to be founded over smaller cities, but they still have a chance to be used?

This is in fact a mechanic in Realism Invictus, but it's nowhere else in other mods, and I'm genuinely wanting to bring it over.
 
Last edited:
Speaking from RI perspective, it is really involved in RI, and involves a lot of arcane stuff that I wouldn't even pretend to understand (wasn't coded by me, and the guy who did that doesn't seem to be around anymore).
 
Speaking from RI perspective, it is really involved in RI, and involves a lot of arcane stuff that I wouldn't even pretend to understand (wasn't coded by me, and the guy who did that doesn't seem to be around anymore).
Too bad. I was also interested 😒
 
Speaking from RI perspective, it is really involved in RI, and involves a lot of arcane stuff that I wouldn't even pretend to understand (wasn't coded by me, and the guy who did that doesn't seem to be around anymore).
Honestly, I don't think it's *that* complicated in my own opinion. Even to just at least randomize without weights. But I just know nothing about Python or C++.
 
Back
Top Bottom