Modmodding Q&A Thread

No, the wonder limit was a necessary prereq for adding more wonders.
 
Yeah, why wouldn't they. I think they are overall reasonable for a single city. I meant that the current limit to how many effects you can stack in a city was a requirement for adding so many wonders in the first place.
 
A better solution is -1 (infinity), instead of 99 (finite, but exceedingly unlikely to ever be reached).
 
It doesn't really matter. If you follow the order of the text, compiling comes before python.
Do I need a particular program to compile the DLL? Just trying to figure if I'm searching in the right direction.
 
I'm sure everyone remembers this conversation with Mouthwash on page 12 well!



upload_2018-8-27_13-4-53.png


Unfortunately the solution to this issue was never included in the thread as far as I can see.
I am getting almost the same issue

File "CvWBInterface", line 47, in applyInitialItems
File "CvWBDesc", line 1624, in applyInitialItems
IndexError: list index out of range

RuntimeError: unidentifiable C++ exception
ERR: Python function onEvent failed, module CvEventInterface

Error developed while adding civs to RFC Greek World.
The interface error is referencing this:
"Search for a token of the form item=value in the list of toks, and return value, or -1 if not found"

The CVWBDesc is to do with getting team data.

Please forgive me for asking another RFC GW question, but my rationale is:
1. If I search for the error only the DOC thread comes up
2. There is no one to ask on RFC GW forum
3. I tried everything I could think of to fix it, changing python, dll, WB, reverting to previous versions but to no avail.
 
It is usually helpful to add logging output in CvWBDesc.py around where the error occurred, to see what it tried to read from the scenario file and put into the game. Most likely you made a change to either the scenario file or the XML files so that what is in the scenario file doesn't exist in the XML files, leading to the error.

Note: DoC includes its own CvWBDesc.py but RFCGW may not, in which case you can simply copy the one from BtS into the mod and then edit it.
 
It is usually helpful to add logging output in CvWBDesc.py around where the error occurred

How do you add the logging output to the file? My basic attempts to do this normally ended in syntax or indentation errors. :undecide:
 
Just use
Code:
print "This is a logging string"
Or for string formatting:
Code:
print "I am logging this number: %d, and this string: %s" % (iNumberToLog, sStringToLog)
It all ends up in PythonDbg.log.
 
Turns out I was missing a beginteam and endteam line in World Builder! :shake:
 
Regarding the following text in Barb.py, I had a few quick questions..
"if utils.isYearIn(300, 700):
self.checkSpawn(iBarbarian, iHorseArcher, 3 + iHandicap, (58, 50), (88, 53), self.spawnInvaders, iGameTurn, 3, 2, ["TXT_KEY_ADJECTIVE_HUNNIC"])"

'(58, 50), (88, 53)' Does this define where they spawn?

'iGameTurn, 3, 2' What does the 3 & 2 signify?

The Huns target Rome don't they? I don't see that in the code.

Thanks
 
If you examine it, you see that is the function self.checkSpawn(). To know what all the inputs mean, just search for the function. (Because it starts with self., it is in the same file) If you do this, you would find:
Code:
    def checkSpawn(self, iPlayer, iUnitType, iNumUnits, tTL, tBR, spawnFunction, iTurn, iPeriod, iRest, lAdj=[]):
        if len(lAdj) == 0:
            sAdj = ""
        else:
            sAdj = utils.getRandomEntry(lAdj)
 
        if iTurn % utils.getTurns(iPeriod) == iRest:
            spawnFunction(iPlayer, iUnitType, iNumUnits, tTL, tBR, sAdj)

You can determine the 3 and 2 are the iPeriod and iRest. By examining the code, you could determine this is the amount of turns between the spawn of each horde.

The tuples describe the bottom left and top right (erronously named tTL and tBR since vanilla RFC). These coordinates describe a square from which a random tile (which meets certain requiremens) is chosen the units will spawn on.

The barbarian spawn functions just spawn the barbarians. There is no code that forces the Huns to attack Rome. Although the spawnInvaders spawnfunction does set the AI to UNITAI_ATTACK, which makes the units more likely to attack. (Although it is not defined it should be Rome. But as Rome is usually the nearest target, it will be targeted)
 
Last edited:
Think of the period as the number of turns between spawns, and rest as the offset, so that not all spawns take place at the same multiples of turns.
 
So I just noticed that an error I made earlier this week in merging left QMC both without the improved civ switch popup and without the functionality of the old one (clicking yes acts just like clicking no)

As far as I can tell the changes within Leoreth's commit were carried over perfectly, but for some reason the problem persists. Could someone take a look and help me figure out what I did wrong?

EDIT: The merge error in particular is that I merged DOC into Varied America, thinking I was on QMC and upon realizing it, decided to merge Varied America into QMC thinking only the new changes would move over. Instead the entire history of QMC was rewritten such that it now thinks it's always been the Varied America branch, and I have a feeling that this change somehow borked the civ flip popup as it was working prior to updating.
 
Last edited:
Nevermind, apparently I merged correctly but didn't think to check if DOC implemented flipping to respawned civs. I just assumed it did and thought I committed useless again.
 
GitHub is now officially a part of Microsoft. I hope that will not make our lives harder!
 
Yeah, that's been some time in the making. Microsoft has committed to keeping Github unchanged but we know how these things go. However, git is not tied to Github, so if worst comes to worst we can migrate to another host.
 
What do the Normal and Broader Areas do and what kinds of map areas should be assigned to them?
 
How do I change a civ spawn date? I tried editing civ4civilizationinfos.xml and consts.py in the RFC DOC folder, but nothing happens once I load the game. The new starting year doesn't appear in the civilopedia or the scenario leader selection, and the civilization spawns at its usual date.
 
Top Bottom