Modmodding Q&A Thread

Leoreth

Blue Period
Moderator
Joined
Aug 23, 2009
Messages
37,059
Location
東京藝術大学
It seems people are more motivated to create DoC modmods right now, at least I've been getting more messages lately with questions about that. Which is great, but the PM/VM system is a bit impractical to use so I'd rather have a thread for it.

So I made one.

You can ask any question regarding DoC and RFC modding here and I try to answer them in a way that helps you. I'll mostly answer questions by saying "You need to go there and there and there to make that happen". I will not teach you how to code Python and C++, how object oriented programming works and how to compile a DLL, because there are already guides for this.

I also won't answer requests of "could you please do X for me". Most of the time doing it myself would be easier than explaining it, but I don't want to encourage people to rely on me to do their work for them.

If the question is related to a (Python) error you receive, I can usually only help when I know the exact content of the error message and the line it's referring to. So please make sure to have enabled Python exceptions and logging (see the main mod thread on how to do it) and share the error with me. Both are things you should have enabled by default when you're modding, anyway.

But feel free to ask if you have anything you want to change.
 
You're an awesome guy. I don't know what Python and C++ even are, though.

I'm currently trying to edit stability maps, but I just see a mess of numbers that I don't know what to do with. I also don't know where to find tCapitals or tBirth.
 
I'm currently trying to edit stability maps, but I just see a mess of numbers that I don't know what to do with. I also don't know where to find tCapitals or tBirth.

Those are found in Consts.py , located in \Assets\Python
 
I'm going to make a modmod that takes away everything Leoreth added
 
Those are found in Consts.py , located in \Assets\Python

Core areas are in python. Historical areas are in the CvRyes.cpp (tiles with value more than 90). Contested=Historical but foreign core. Credits to Leoreth.
 
You mean the name of your civ as it appears in the scoreboard?
 
Go to the DynamicNames.xml file for the civ you want changed, then edit it there.
 
You can ask any question regarding DoC and RFC modding here and I try to answer them in a way that helps you. I'll mostly answer questions by saying "You need to go there and there and there to make that happen". I will not teach you how to code Python and C++, how object oriented programming works and how to compile a DLL, because there are already guides for this.

Well, my question isn't about DoC, It's actually about SoI. But since you said RFC modding, I guess I can ask it.

How do I change the Byzantine trait to give +1 gold per city in addition to the already existing bonus of espionage points???


And is there a difference between C++ and DLL
 
I don't think my question is relayed to modding. Like, when I go to your details and type my own civ description, it doesn't change to that name. That's really what I want, nothing mod related.
 
Well, my question isn't about DoC, It's actually about SoI. But since you said RFC modding, I guess I can ask it.

How do I change the Byzantine trait to give +1 gold per city in addition to the already existing bonus of espionage points???
I'll try to answer SoI questions if they aren't too detailed. But what you want to do requires a DLL change.

And is there a difference between C++ and DLL
There is a difference, but it's more a technicality from an external perspective. C++ is a programming language. The C++ code is then compiled to create the DLL file. So both refer to the same part of the game if you want.

I don't think my question is relayed to modding. Like, when I go to your details and type my own civ description, it doesn't change to that name. That's really what I want, nothing mod related.
I think you can add your civ description that way, the problem is that the dynamic name script will change it again in a couple of turns. To avoid that, you have to add a line in DynamicCivs.py at the beginning of the checkName() method:
Code:
        def checkName(self, iPlayer, lPreviousOwners=[]):
	
		if utils.getHumanID() == iPlayer: return
        
                if iPlayer >= iNumPlayers: return
		
		if not gc.getPlayer(iPlayer).isAlive(): return
 
So I have made my scenario and done all of the things that you have told me to do when making a scenario. However, when I load it, on the choose civilization screen, it shows the starting times for the latest possible scenario for each civ (excluding 500AD:mad:) and then, right as the scenario is about to start, the following error occurs:

Code:
attribute error: 'module object' has no item tBabylon

Or something close to that.

Does anyone know what the problem is and how to fix it?
 
The error should tell you the offending line. I guess it's because you're using tBabylon before defining it first.
 
I think the problem is that it doesn't fetch the 500AD data properly from C++ or Python. I think that the Babylon listing is a result of that. The game crashes before I can see the line (if it even hypothetically gives the line) or any other error.
 
Could you please add some dummy building slots? As I noticed with my 2nd UB modcomp, you can't just add buildings. They will mess up with the embassy code if you dont change the DLL. So you can't add any building/wonder.

You can compare these slots with the already hidden buildings, like the Harappan Bath. They do exist in the game, but you can't use them. But they can be used with a little coding.

This makes it a lot easier for us to add new buildings/wonders. We only have to convert one of the dummy buildings to the new building. It will automatically match with the DLL, as the number of buildings won't change. (15 normal buildings + 10 dummy buildings is the same number of coded buildings as 16 buildings + 9 dummies)

For most of us I think 10 dummy slots would be enough. But I would be grateful if it could be the amount of 42. So my 2nd UB modcomp can make use of those slots. That means I don't need a new DLL everytime.


One thing I want to do is creating some kind of wonder module. But as no new buildings can be added, it's currently not really possible. If these dummy slots will be added, many can create there own wonder modules.
 
Top Bottom