Modmodding Q&A Thread

But didn't you successfully compile the BtS DLL for your mod component?
 
But didn't you successfully compile the BtS DLL for your mod component?

Yes, I am specifically talking about DoC's DLL now.
 
Yes, I am specifically talking about DoC's DLL now.
What's the difference? Just copy the project and use DoC's sources.

Where is the trigger for the Roman and Greek conquerors? I can find the function in UniquePower.py, but I can't find a trigger.
It's in AIWars.checkTurn().
 
It's in AIWars.checkTurn().

So if I understand the code correctly, both functions in UniquePowers.py aren't used, instead all is done in AIWars.py?
 
Correct.
 
How come there's two Makefiles in the source code? One .project, the other without file type.
 
The one without type is the actual makefile, I think the project one is for supplying further custom variables. This is Nightingale's makefile by the way, if you want to look up the documentation on it.
 
What's the difference? Just copy the project and use DoC's sources.

Tried that with the following result:

Code:
1>------ Build started: Project: CvGameCoreDLL, Configuration: Debug Win32 ------
1>Performing Makefile project actions
1>makefile(218) : fatal error U1050: Target "" not supported. Supported targets: Debug Release Assert Profile
1>Stop.
1>Project : error PRJ0019: A tool returned an error code from "Performing Makefile project actions"
1>Build log was saved at "file://c:\Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\RFC Dawn of :) :) :) :):) :) :) :):) :) :) :):) :) :) :) Visual Studio\CvGameCoreDLL\Debug\BuildLog.htm"
1>CvGameCoreDLL - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I'm using your makefile, after editing the toolkit, SDK and game paths of course.
 
So did you read the error message? You need to select a target.
 
But I didn't change that line, it's exactly the same as in DoC. What target would I have to select anyway?
 
You have to select the target in Visual Studio. If the makefile is properly imported there should be a dropdown menu. You want release for best performance.
 
You have to select the target in Visual Studio. If the makefile is properly imported there should be a dropdown menu. You want release for best performance.

If it's the dropdown menu I circled in the attached screenshot then it has been selected all along, and neither Release nor Debug seems to work.
 

Attachments

  • sorcery.png
    sorcery.png
    242 KB · Views: 84
Looks like the Makefile targets aren't properly imported into VS, but without having the program to check I can't say how to do it.
 
Where did you get that makefile from anyway, or did you write it yourself?
 
After some failed attempts with editing your makefile I started from scratch, using Asaf's files as base, including his makefile with the obligatory path edits. After compiling an unmodded BtS DLL that way without incident I copied and pasted over the DoC source (everything ending with .cpp, .inl and .h) files, but whenever I try compiling now I get this error:

Code:
1>CvPlot.obj : error LNK2019: unresolved external symbol _GetProcessMemoryInfo@12 referenced in function "bool __cdecl NeedToFreeMemory(void)" (?NeedToFreeMemory@@YA_NXZ)
1>Release\CvGameCoreDLL.dll : fatal error LNK1120: 1 unresolved externals
1>NMAKE : warning U4010: 'Release\CvGameCoreDLL.dll' : build failed; /K specified, continuing ...
1>NMAKE : warning U4011: 'Release' : not all dependents available; target not built
1>Project : error PRJ0019: A tool returned an error code from "Performing Makefile project actions"

The good news is that this is at the very end of a long log of stuff apparently working okay after it compiled for a few minutes, while with my previous issue it didn't even start compiling in the first place.
 
Are there any DLL effects depending on the relative positions of buildings in the XML, like with the relative positions of civics? I just noticed that my inclusion of the City Hall building wrecked havoc on some Python related stuff because I forgot about Consts, and figured I might as well make sure about the DLL too while I'm fixing that.

Edit: Just noticed this in Consts above the buildings block: "update Persian UHV every time this is changed", I suspect this is because the game needs to know which of the buildings count as "wonders" and "shrines" exactly, and "iBeginWonders = iGreatSphinx # different from DLL constant because that includes national wonders" makes me believe that at least some of that is handled in the DLL, and that apparently everything starting from iGreatSphinx is treated as a wonder by the game at least as far as Python is concerned. Sooooo now I am a bit confused, is there actually any way of adding a generic building without adjusting the DLL or messing up something in the background?
 
Where did you get that makefile from anyway, or did you write it yourself?
It's Nightingale's makefile.

Are there any DLL effects depending on the relative positions of buildings in the XML, like with the relative positions of civics? I just noticed that my inclusion of the City Hall building wrecked havoc on some Python related stuff because I forgot about Consts, and figured I might as well make sure about the DLL too while I'm fixing that.

Edit: Just noticed this in Consts above the buildings block: "update Persian UHV every time this is changed", I suspect this is because the game needs to know which of the buildings count as "wonders" and "shrines" exactly, and "iBeginWonders = iGreatSphinx # different from DLL constant because that includes national wonders" makes me believe that at least some of that is handled in the DLL, and that apparently everything starting from iGreatSphinx is treated as a wonder by the game at least as far as Python is concerned. Sooooo now I am a bit confused, is there actually any way of adding a generic building without adjusting the DLL or messing up something in the background?
The short answer is no, buildings are referenced by position in the XML file in the DLL.
 
There is also getInfoTypeForString, but that is not very efficient. Buildings aren't likely to change very often.
 
Back
Top Bottom