Modmodding Q&A Thread

Neither. "is" means that it is the same object instance, which is not always the case for instances representing the same player. "==" is not defined for CyPlayer instances so it falls back to "is" as well.

To answer the question: kTriggeredData.ePlayer already is the player ID you are looking for, there is no need to go from there to CyPlayer first and then back to the player ID. But more generally, you can always get the player ID with CyPlayer.getID.
 
To answer the question: kTriggeredData.ePlayer already is the player ID you are looking for, there is no need to go from there to CyPlayer first and then back to the player ID. But more generally, you can always get the player ID with CyPlayer.getID.

Ah, of course! That was pretty silly of me. Thanks, Leoreth! :)

player.getID() should do the job.

In the case that I actually do need to go from CyPlayer to player ID, I thank you!
 
Will this period condition work?

Code:
    if iEngland in [iCiv, iOwnerCiv]:
        #if England retains New York and Boston after American Revolution, New England is assigned to Canada
        if city.at(30,48) and city.at(31,50) and (year() < year(1800) and year() != year (1802)):
            setPeriod(iCanada, iPeriodCanadaExpanded)
        else:
            setPeriod(iCanada, -1)
 
What event are you handling here?
 
This might be the wrong thread, but I was messing with the Settlermaps file and I foolishly didn't make a backup. Is there a place I could download the correct settlermap file?
 
If you are using git, you can use that to revert your changes.

If you used the installer, use the link below to get to the online repository with the file set to the state used in version 1.16.3. You can navigate to the settlermaps in there.
https://github.com/dguenms/Dawn-of-Civilization/tree/v1.16.3
 
How tough is it to change the spawn date of a civ? I mean, one thing is just changing the spawn year, but obviously starting techs and so on would have to be adjusted as well. I'd really love to spawn the Dutch earlier, but even just the basic thing (I thought) of another spawn year - and all other things being the same - I could'nt get to work. After changing the spawn year in the files I now get a "you have been defeated" popup when loading the map as them. Anyone has experience with this, who might be able to help?

Do note, I am one step above complete moron when it comes to modding and changing files :shifty:
 
IIRC you must also edit the "lCivOrder" list in consts.py. The civs are ordered chronologically in this list. Make sure that this list matches the new Dutch spawn year. It is the first list in consts.py, so it should be easy to find.

It is possible that some more changes are required though. It has been a while since I changed some civ spawning.
 
Can somebody help me with adding new Great People names? I tried by going in to the Python folder file for Great Peoples and I successfully added some Canadian Great People that seemed to pop up with no unwanted side effects. However, once I added more for the French I started getting this error message while playing. Anyone who can help me? I'm playing 1.16.3.
 

Attachments

  • 2022-01-17.png
    2022-01-17.png
    3.6 MB · Views: 55
Looks like you a using a special character (probably a vowel with accent) in the name without marking it as unicode:
Code:
u"Pierre Abélard"
Notice the leading "u".
 
I'm trying to add/change a special power to the existing game: I'm trying to make it so that Tibet is allowed to build farms on Tundra (it makes sense in the context of the other changes!). How would I go about doing this?
 
Are you ready to edit and recompile the DLL? Because that would be necessary.
 
Hi. Is there an updated DoC-specific guide for setting up the CvGameCoreDLL project and compiling the DLL? My current setup doesn't work anymore for some unknown reason. I have Visual Studio C++ 2022 installed alongside Visual Studio C++ 2010. This worked in the past, but suddenly not anymore.
 
My guide for base BtS should be applicable for DoC as well. You can just use the DoC source code in place of the BtS sources. The Makefile is the same in both cases.

That said, I haven't tried it for VS2022, but as long as VS2010 is present I think you should be able to build it.
 
For some unknown reason, I can't open the project or solution file on VS 2010 anymore, claiming that it can't find .NET Framework 4.0. When I try to download and install, my system says that it already has a newer version.
Spoiler :
upload_2022-4-11_18-3-57.png


In the past I could work on the DLL and compile without problems on VS 2019 as long as I had VS 2010 also installed and the lib paths in the makefile were valid. But now, all I get are these errors:
Spoiler :
upload_2022-4-11_18-6-17.png


Not sure if it was upgrading from 2019 to 2022 that wrecked my setup or there's another underlying problem I do not know yet.
 
Where are you seeing these errors considering the IDE is not letting you open the project file? The project file is just IDE specific metadata, so maybe it helps to delete it, import the source files as a new project again, and go on from there. You may have to manually restore some configuration for the Makefile, I suggest following the steps in Nightinggale's makefile thread if that is the case.
 
Where are you seeing these errors considering the IDE is not letting you open the project file? The project file is just IDE specific metadata, so maybe it helps to delete it, import the source files as a new project again, and go on from there. You may have to manually restore some configuration for the Makefile, I suggest following the steps in Nightinggale's makefile thread if that is the case.

The errors on the second screenshot are if I open the project on VS 2022. The first screenshot that's looking for .NET Framework 4.0 is if I open it on VS 2010. I tried to delete the .vs folder and reopen it, but to no avail. Does it matter that I'm also on Windows 11?
 
Oh, I see. Yeah, it's to be expected to run into issues like that with VS 2010, your project probably isn't compatible with it if it has been created by a later version.

I can only say that VS 2019 works in Windows 11 for me. Since you are using a VS 2019 project file for VS 2022, maybe some required settings got lost in the transition? Again, if there is anything wrong it's probably how the Makefile is configured.
 
Oh, wait. Are you using VS 2019 for DoC development, Leo? If I understood you correctly, the CvGameCoreDLL project currently on the remote branches is a VS 2019 project file I used to use VS 2019 too, but the techy boy that I am upgraded to VS 2022 a few months back. I guess it's time to revert to VS 2019?

About the makefile, it was the same modified version of the makefile I've had for years. Only updated the TOOLKIT and PSDK variables to align with the Civ4SDK I installed from the forums, but largely unchanged apart from that.
 
Top Bottom