Pillaging Road/Railroad

Gorgo

Chieftain
Joined
Jul 15, 2003
Messages
27
Location
Kent, UK
Hi - a long time irritation of mine is that you can't pillage road or railroad within your own borders.

I am seriously OCD about this and hate any un-used forest being railroaded unless absolutely necessary.

I am completely new to modding, but I am hoping there's a super-easy solution to this by changing a value in a file somewhere.

Am I guilty of wishful thinking?

Any help gratefully accepted...!
 
Can anyone help at all? Or am I in the wrong place?
 
It's in the DLL code, which is C++.
You can change it, but you'll need to compile the DLL later.

EDIT: I compiled a DLL with the change for you.
(It is based on BTS 3.19)

Either create a mod and place the attached DLL in its assets folder, or replace the game's original DLL (which has the same name), but create a backup of the original DLL first!

(Or maybe place it in the Custom Assets folder)

I did not test it, so let me know if it works properly.

If anyone's interested, here's the code change:
Spoiler :

In CvUnit:: pillage(). I added the bolded part.
Code:
	if (pPlot->isOwned())
	{
		// we should not be calling this without declaring war first, so do not declare war here
		if (!isEnemy(pPlot->getTeam(), pPlot))
		{
			if ((pPlot->getImprovementType() == NO_IMPROVEMENT[B] && !pPlot->isRoute()[/B]) || (pPlot->getOwnerINLINE() != getOwnerINLINE()))
			{
				return false;
			}
		}
	}
 

Attachments

Thank you so much! This is truly appreciated - I will try this when I get home and report the results.

You have my gratitude, thank you again.
 
Hmm - I uploaded this into the custom assets folder (the root of the folder) and it didn't appear to work with an already-saved game.
I couldn't find an equivalent file with the same name anywhere to "overwrite" elsewhere.

Am I doing something wrong, or will this only work with new games?

Sorry if this is obvious - I am a complete noob with these things.
 
I don't know if the DLL can be loaded from custom assets (anyone?), but you can replace the one in your <BTS installation>/Assets folder.
If you place it in a mod, the game won't let you load an existing saved game (the saved game holds the mod that was used), but if you place it in the game's assets folder, it should work.
Again, don't forget to backup the original DLL.
 
Back
Top Bottom