Remove the Vassal Limit

Akbarthegreat

Angel of Junil
Joined
Sep 23, 2010
Messages
1,837
Location
Erebus
The file and section of code is given in this post, but I couldn't find out what part of the code to change. Can someone help? I want to make it unlimited.
EDIT-Due to me being lazy and looking at only half the thread before making a new one I didn't see this.
EDIT 2-
Code:
//Rhye - start [B](5 vassals cap if already the strongest; 6 vas+all cap)	[/B]
	int mastersVassals = 0;
	int mastersAllies = 0;
	int mastersPower = kMasterTeam.getPower(true);
	bool bStrongest = true;
	for (int iLoopTeam = 0; iLoopTeam < NUM_MAJOR_PLAYERS; iLoopTeam++)
	{
		CvTeam& kLoopTeam = GET_TEAM((TeamTypes)iLoopTeam);
		if (kLoopTeam.isAlive() && kLoopTeam.isVassal(eTeam) && iLoopTeam != getID())
			mastersVassals++;
		if (kLoopTeam.isAlive() && kLoopTeam.isDefensivePact((TeamTypes)eTeam) && iLoopTeam != getID())
			mastersAllies++;
		if (kLoopTeam.getPower(true) > mastersPower)
			bStrongest = false;
	}

	if (mastersVassals >= 5 && bStrongest)
		return DENIAL_POWER_YOU;	
	if (mastersVassals + mastersAllies >= 6)
		return DENIAL_POWER_YOU;
I tried changing 5 to 20 (notepad) but it didn't work.
Or does it apply only from new games?
Thanks.
 
You're editing the DLL sourcecode, changes there don't take effect until the DLL is recompiled. Here's a guide for that if you really want to go that far.
 
Don't change anything :mischief: There's no way around this, I'm afraid.
 
Okay then, for the sake of a new experience, I'll do it. Thanks for the info, BTW.
EDIT: Are you sure we need to change only one line of code? According to this post by Messageman, he changed the line and compiled it but it didn't work.
 
I don't know, I've never modified this part of the code. But from how I looks it should be okay.
 
Hey Leoreth, you know any other interesting stuff that could be changed (numbers, or short simple stuff basically) before I start compiling it?
:woohoo::woohoo::woohoo:
:band::dance:1000:dance::band:
:woohoo::woohoo::woohoo:
 
You can change anything.
 
I don't even know which VS version I'm using ... I guess it's still 2008. Could tell you when I'm at home. What exactly is it that you cannot open?
 
The cvgamecoredll.sln in DOC\CvgamecoreDLL in VS2008. It says "The selected file is a solution file, but was created by a newer version of this application and cannot be opened". Even if I want to compile only 1 file, I still have to do the whole thing, right?
 
Why would you want to open it? Are you using following the guide I linked to? If so, at which step are you?
 
Spoiler :
Step 6: Add the source files.
The source files are the files which contain the C++ code. These are the files with the .cpp, .h and .inl extensions.

I've prepared an archive of the BTS 3.19 source files, which you can extract (it also contains the CvGameCoreDLL folder). The source files should be in the same folder as the Makefile, .vcproj and .sln files.

Alternatively, you can take these files from your BTS install folder (in the CvGameCoreDLL folder): You should copy all the .cpp, .h, .inl, .rc files into CvGameCoreDLL (you'll only have 1 .rc file).
CvTextScreens.cpp is not used, so you can skip copying it.
Another change you need to make after you copy the files from the BTS folder is in the file CvGameTextMgr.cpp: comment out (add // to the beginning of the line) line 2085 (inside the function createTestFontString, the first line in the function which starts with szString.append), otherwise you might have problems compiling.

A 3rd option is that you don't want to base your code on BTS 3.19, but on another mod. Simply take the C++ source code files of this mod and copy them into the CvGameCoreDLL folder.
Note that some mods only publish the source files which they have changed, so you should probably first copy the BTS files to the CvGameCoreDLL folder, and override it with the mod's files.

Important: If you base your mod on another mod which has its own C++ source files - use the 3rd option.

And that's it. Everything should (hopefully) work now.

How to compile

Open Visual C++ 2008 which you've installed in step 1. In it, open (File->Open->Project/Solution) the CvGameCoreDLL.sln file inside the CvGameCoreDLL folder.
On the top of the window (below the menu) you will see a drop-down box with either 'Debug' or 'Release' in it. These are the two configurations in which you can compile.

After you've selected a configuration, Simply go to the 'Build' menu and choose 'Build Solution' (or press F7). This will start the compilation process. If there are modified source files, this will save them first.

If everything's OK, it will produce a CvGameCoreDLL.dll file in either the Debug or Release subfolder, and if you added it in the makefile - it will also be copied directly to your mod's folder.


I changed the path in the makefile I downloaded and put it in the DoC\CvGameCoreDLL folder. I didn't copy any source files since they were already there. Then I opened VS2008 and tried to open CvGameCoreDLL.sln that was already there in the folder(that was the one I had to use, right?), but then it showed the aforementioned error.
 
I'm using VS 2010, so maybe the .sln files are not compatible anymore. Maybe it's better to delete the file that's already there and use the one from BtS as the guide suggests.
 
It should work with the other one at least.
 
Top Bottom