Modmodding Q&A Thread

Its says that pdb is not loaded and is instructing me to change existing pdb and binary search paths. What should I do?
Does that happen every time? Or only with that specific crash?

Visual studio express wont open the DLL file in the assets folder. I feel very lost as the moment!
View attachment 495386
What did you do to make VS open that file? In your previous error message it tries to look into the CvGameCoreDLL directory, which does not even exist in your mod. Have you successfully changed the lookup path?
 
How would I go about making a UU that grants culture on enemy kills?

Also editing the settler maps and war maps seems a little daunting, is using the notepad the correct method?
 
Does that happen every time? Or only with that specific crash?


What did you do to make VS open that file? In your previous error message it tries to look into the CvGameCoreDLL directory, which does not even exist in your mod. Have you successfully changed the lookup path?

No I just tried to manually open the file using VS.
How do I change the lookup file?
 
This specific crash.
Strange. The pdb file is deleted when the attached process dies, so maybe the error message is a consequence of that, i.e. before the debugger can retrieve the stacktrace the process is already gone and has taken the pdb file with it.

(You might have more luck by posting this in the general C&C subforum, I am by no means an expert in the C++ runtime. Maybe someone like Nightinggale knows more.)

How would I go about making a UU that grants culture on enemy kills?
I would recommend Python. In CvRFCEventHandler.py there is an onCombatResult() method that is called every time combat ends. You have access to the winning and losing unit there. Everything else depends on the details of what you are planning. For example, which city does it grant culture to? How much culture is it? And so on.

Also editing the settler maps and war maps seems a little daunting, is using the notepad the correct method?
Use Notepad++ to edit them. To make editing the maps themselves easier, you can copy them into a spreadsheet editor like LibreOffice Calc or MS Excel and then copy them back into the file, it will preserve the formatting.
 
No I just tried to manually open the file using VS.
How do I change the lookup file?
Why do you want to do that? It's a binary file, so not human readable.
 
Well when you put it like that it does seem foolish! I'm just trying to work out how to get VS to successfully compile my dll files (so far all I get is failed messages)!
 
That's fine. Did you already manage to open all the source files (i.e. everything in the CvGameCoreDLL directory) in VS, by opening the CvGameCoreDLL.sln file?
 
I don't seem to have a CvGameCoreDLL.sln.
upload_2018-5-12_12-39-15.png
 
That's the type Microsoft Visual Studio Solution.
 
Okay I can run that file using VS.
When I run debug>build I get that error message shown earlier which ends "Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped."
When I do debug>start debugging I get this:
upload_2018-5-12_13-23-30.png

If I select yes I get this:
upload_2018-5-12_13-24-12.png

If I select yes again I get:
upload_2018-5-12_13-24-50.png
 
Start debugging does not work with Civ4, if you want to debug you build the debug DLL, launch the game normally, and use debug > attach to process to attach Visual Studio to the game.

In any case, you should first take care of the build in the first place. The error message shown indicates that the path to the C++ SDK installed on your system is not correct. Open the Makefile in CvGameCoreDLL, it will have two paths under TOOLKIT and PSDK. If those are wrong, you can overwrite them in Makefile.settings to the correct values.
 
Cool thanks. I think the problem was I was using the CMC as my base, and that used a different path. I changed the path and successfully ran a build. Is there anything else I need to do for the dll other than running a build in VS?
 
Do you get a new DLL out of it? If so you're done.
 
Well I think I got an updated CvGameCoreDLL sdf file. I ran my mod and the dll and python loaded successfully. The XML didn't, but you can't have everything I guess!
 
Check if you've got a new Assets/CvGameCoreDLL.dll file.
 
Its been modified as of today, so I guess I am all set. :)
 
Okay I have now finished the steps needed to add a civilization to my mod. However when I load the mod, I get a couple of error messages before it crashes.
The error messages are:

Assert Failed
File: .\.\CvGlobals.cpp
Line: 3354
Expression: strcmp(szType, "NONE")==0 || strcmp(szType, "")==0
Message: type FLAVOR_CIVICS not found

Assert Failed
File: .\.\CvArtFileMgr.cpp
Line: 174
Expression: false
Message: get##name##ArtInfo: ART_DEF_UNIT_CAMP was not found

Line 3354 is "FAssertMsg(strcmp(szType, "NONE")==0 || strcmp(szType, "")==0, CvString::format("type %s not found", szType).c_str());"
I have no idea why that one is playing up, as I have made no changes to it.

Line 174 points to "ART_INFO_DEFN(Unit);"
However I made no changes to the units as the civilization I added into the mod was preexisting in Civ 4.
 
It's possible that those are issues with whatever mod you are based on.
 
The Turks are having trouble with Persian Crossbowmen in CMC. By the time the Turks spawn the Persian Crosbowmen already have some really good promotions. I'd like to give Oghuz the ability to ignore enemy promotions while attacking, where is strength from promotions calculated?

EDIT: Found it!
 
Back
Top Bottom