Modmodding Q&A Thread

I'm pretty sure adding them to the list of lSecondaryCivs in Consts.py will do the job. As new civs in that list do not have custom code to determine if they are enabled or not, they are enabled by default. You can disable them in the GameData Menu in the WB during the game.
 
How do I add new songs to the soundtrack of my SoI modmodmod?
I added the mp3 files in the Assets/Sounds/Soundtrack folder, but they're not playing.
You have to add new entries in AudioDefines.xml and Audio2DScripts.xml. The former is where you assign an XML entry to the music file, while the latter allows you to use those in-game. I've only added diplo music so far, though, so I'm not pretty sure how to add the soundtracks to the game. :)
 
Soundtracks need to be added to the era in which they should play.
 
This is not a technical question regarding modmodding, but I thought this is still the most related thread:

I'm currently a 3rd year CS major. While I'm not sure whether I can spend time on the mod soon, I would like to ask how can I help the development of the mod most effectively? (I think) I know C++ and Python quite well, but I don't have a modding experience on Civ4.
Probably modding a game is much different than what we do in the university, but I think I would be able to implement new functions or similar small scale programming things from time to time if you need.
 
Coordinating programming work usually leads to more overhead than just doing it on my own, and also I find the programming part the most enjoyable in developing this mod. Consider that I currently have to spend zero time explaining my goals to anyone etc.

But I think you're farther than I was academically when I started this mod. Just do what you want with Civ4 modding.
 
That was actually what I imagined too, I guess working on a project alone would be a relief for a senior programmer. Though I asked because I don't want to commit time on a full-scale mod myself, yet I wanted to help to an existing mod that I actively play/test by programming.
 
Well have you considered branching off a modmod from DoC? This is how I started this mod myself.
 
If I had some radical ideas about the mod in my mind I would consider it but I don't have any besides small fixes or the parts that you are already going to implement.
Though if I see branching as an option for myself, I might start thinking about some improvements.
 
If you see a place for small fixes, you can also implement them and make a pull request.
 
Not actually a modmodding related question but a general question about the AI in Civ4:
Does AI decide on things by simulating its outcomes, or it has separate AI components for different parts/actions of the game?

More exactly: when there's a new UP, wonder effect, or these type of "unique" efffects; can AI comprehend it or do you usually write a separate logic for it?

For example does AI calculates/understands that it should build Empire State wonder in a crowded and gold specialized city, to maximize its outcome, just after you added the wonder to the mod? Does Iran AI understands it's okay to settle around incense tiles even if there's no food available since it has Caravansarai UB.
Or say I made levees a classical age building with very low cost and now they give 10 :hammers: each tile, would settling behavior of the AI change?

Generally do you need to add specific logic conditions/components for each of these changed/added effects or Civ4 usually handles these decisions by simulating and comparing outcomes?
 
Okay, the simple answer is that the AI never simulates the outcome of its decisions. In general, most AI routines are based on some kind of predefined heuristic. This heuristic takes the current value into account, but it needs to be coded to be aware of what properties exist. For example, the civic AI considers the value of all civic effects from BtS based on what they are. So if you give a civic +10 commerce per Town it knows both that the civic is very valuable and knows that Towns are more valuable when it has the civic (because extra commerce for improvements is a concept that already existed in BtS and is already accounted for). This value however is never a simulation but more like an estimate that may or may not simplify the current situation and ignore certain aspects.

If I add a new property to a building (e.g. the Empire State Building effect does not exist in any way for any BtS building), the AI will not know it is there, and assign no value to the building. I will either have to add AI code to make it understand the effect, or apply a flat AI value to the building to give it some value.

So the general answer is that if I change a particular building, the AI will adjust its evaluation to the best of its ability (of course if the AI code was already bad that may or may not have the desired result). If I change what buildings can do overall, I need to teach the AI how to evaluate this new thing.
 
So I figured out that all the needed DLL files are in the DOC mod, so I've started modding. Only thing is I have no idea how to implement a new Maintanence type that is based on buildings that convert a portion of unhealth to it. I'm going to dive into the City code now to see if I can rig up some code for compiling ints of a specific variable type from all buildings present in a city with said type.
 
So is your question above answered? I think you should be fine by combining the above guide with the Makefile included in the mod.

I think it would be slightly easier to use negative gold instead of maintenance. You would only need to dig up the part of the code that translates negative health into negative food and change that into negative gold instead.
 
So is your question above answered? I think you should be fine by combining the above guide with the Makefile included in the mod.

I think it would be slightly easier to use negative gold instead of maintenance. You would only need to dig up the part of the code that translates negative health into negative food and change that into negative gold instead.

That would be easier. I think I'll do that, even if just while I'm learning the ins and outs of civ 4 modding.
 
I have a method that calculates how much gold to subtract, now I just need to find a place to call it to subtract the gold output.

EDIT: Been looking for where cities calculate the gold yield, but have yet to find it.
 
Last edited:
So I decided it may be a good idea to code in an actual IDE and not notepad++, but I can't find a download of VS2010 and 2017 tells me I have too many errors. What should I do?

EDIT: And immediately after posting I decided to make one last search and I found it.

Really?

EDIT2: And the download I found says they can't find any downloads for me, so I'm back at not having 2010
 
do you have any idea of why you are getting errors? Maybe you are trying to link files out of your current project.
Also iirc Visual Studio sometimes adds special headers to your files automatically, which causes errors when you try to compile/link elsewhere, maybe something simpler as Code::Blocks could solve your problem.
 
Back
Top Bottom