[MODCOMP] Route Pillage Mod

ebo said:
Thank you for this mod it is great. I could not get the aircraft bomb mission to work. Is there something else I need to do besides extracting the zip file to the mods folder. The pillage function for land units worked great.
You don't need to do anything special with aircraft, you can just target routes now.

ebo said:
I also wanted to use this mod with your air force mod, but the both have a CvGameCoreDLL.dll, I don't have access to a compiler. Is there any other options?
Not really, you will need to merge them together.
 
Can you point me to any guides that could guide you through doing that.

I want to do the same in merging two different cvgamecoredll.dll's
 
Lopez,

I was working on updating my project to Warlords 2.08, and during the compiling process, I ran into this problem: (see red text)

Code:
Project   : CvGameCoreDLL
Compiler  : Microsoft Visual C++ Toolkit 2003 (called directly)
Directory : D:\Games\Sid Meier's Civilization IV\Warlords\CvGameCoreDLL\
--------------------------------------------------------------------------------
Switching to target: Final Release
CvCityAI.cpp
CvDLLButtonPopup.cpp
CvDLLEntity.cpp
CvDLLPython.cpp
CvDLLWidgetData.cpp
CvDeal.cpp
CvDiploParameters.cpp
CvFractal.cpp
CvGame.cpp
CvGameAI.cpp
CvGameCoreDLL.cpp
CvGameCoreUtils.cpp
CvGameTextMgr.cpp
CvGlobals.cpp
CvHallOfFameInfo.cpp
CvInfoWater.cpp
CvInfos.cpp
CvInitCore.cpp
CvMap.cpp
CvMapGenerator.cpp
CvPlayer.cpp
CvPlayer.cpp(6203) : warning C4244: '=' : conversion from 'float' to 'int', possible loss of data
CvPlayerAI.cpp
CvPlot.cpp
CvPlotGroup.cpp
CvPopupInfo.cpp
CvPopupReturn.cpp
CvRandom.cpp
CvReplayInfo.cpp
CvReplayMessage.cpp
CvSelectionGroup.cpp
CvSelectionGroupAI.cpp
CvStructs.cpp
CvTalkingHeadMessage.cpp
CvTeam.cpp
CvTeamAI.cpp
CvUnit.cpp
[COLOR="Red"]CvUnit.cpp(4258) : error C2664: 'CvDLLEntityIFaceBase::AddMission' : cannot convert parameter 1 from 'CvMissionDefinition' to 'const CvMissionDefinition *'
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called[/COLOR]
CvUnit.cpp(10970) : error C2664: 'CvDLLEntityIFaceBase::AddMission' : cannot convert parameter 1 from 'CvMissionDefinition' to 'const CvMissionDefinition *'
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
CvUnit.cpp(11195) : error C2664: 'CvDLLEntityIFaceBase::AddMission' : cannot convert parameter 1 from 'CvBattleDefinition' to 'const CvMissionDefinition *'
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
CvUnit.cpp(11495) : error C2664: 'CvDLLEntityIFaceBase::AddMission' : cannot convert parameter 1 from 'CvMissionDefinition' to 'const CvMissionDefinition *'
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
CvUnit.cpp(11543) : error C2664: 'CvDLLEntityIFaceBase::AddMission' : cannot convert parameter 1 from 'CvAirMissionDefinition' to 'const CvMissionDefinition *'
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
CvUnit.cpp(11578) : error C2664: 'CvDLLEntityIFaceBase::AddMission' : cannot convert parameter 1 from 'CvAirMissionDefinition' to 'const CvMissionDefinition *'
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Process terminated with status 1 (8 minutes, 38 seconds)
6 errors, 1 warnings


This is the piece of code it is refering to: (see red text)

Code:
// < Grave's ModComp Route Pillage Start >
bool CvUnit::pillageRoute()
{
	CvPlot* pPlot;
	CvWString szBuffer;


	if (!canPillageRoute(plot()))
	{
		return false;
	}

	pPlot = plot();

	if (pPlot->isRoute())
	{
		pPlot->setRouteType(NO_ROUTE); // XXX downgrade rail???
	}

	changeMoves(GC.getMOVE_DENOMINATOR());

	if (pPlot->isActiveVisible(false))
	{
		// Pillage entity mission
		CvMissionDefinition kDefiniton;
		kDefiniton.setMissionTime(GC.getMissionInfo(MISSION_PILLAGE_ROUTE).getTime() * gDLL->getSecsPerTurn());
		kDefiniton.setMissionType(MISSION_PILLAGE_ROUTE);
		kDefiniton.setPlot(pPlot);
		kDefiniton.setUnit(BATTLE_UNIT_ATTACKER, this);
		kDefiniton.setUnit(BATTLE_UNIT_DEFENDER, NULL);
[COLOR="Red"]		gDLL->getEntityIFace()->AddMission(kDefiniton);[/COLOR]
	}

	return true;
}
// < Grave's ModComp Route Pillage End   >

Do you know how I could fix this? :confused:

If you need more info, let me know what I can provide.
 
GraveEatr said:
Lopez,

I was working on updating my project to Warlords 2.08, and during the compiling process, I ran into this problem: (see red text)

Code:
Project   : CvGameCoreDLL
Compiler  : Microsoft Visual C++ Toolkit 2003 (called directly)
Directory : D:\Games\Sid Meier's Civilization IV\Warlords\CvGameCoreDLL\
--------------------------------------------------------------------------------
Switching to target: Final Release
CvCityAI.cpp
CvDLLButtonPopup.cpp
CvDLLEntity.cpp
CvDLLPython.cpp
CvDLLWidgetData.cpp
CvDeal.cpp
CvDiploParameters.cpp
CvFractal.cpp
CvGame.cpp
CvGameAI.cpp
CvGameCoreDLL.cpp
CvGameCoreUtils.cpp
CvGameTextMgr.cpp
CvGlobals.cpp
CvHallOfFameInfo.cpp
CvInfoWater.cpp
CvInfos.cpp
CvInitCore.cpp
CvMap.cpp
CvMapGenerator.cpp
CvPlayer.cpp
CvPlayer.cpp(6203) : warning C4244: '=' : conversion from 'float' to 'int', possible loss of data
CvPlayerAI.cpp
CvPlot.cpp
CvPlotGroup.cpp
CvPopupInfo.cpp
CvPopupReturn.cpp
CvRandom.cpp
CvReplayInfo.cpp
CvReplayMessage.cpp
CvSelectionGroup.cpp
CvSelectionGroupAI.cpp
CvStructs.cpp
CvTalkingHeadMessage.cpp
CvTeam.cpp
CvTeamAI.cpp
CvUnit.cpp
[COLOR="Red"]CvUnit.cpp(4258) : error C2664: 'CvDLLEntityIFaceBase::AddMission' : cannot convert parameter 1 from 'CvMissionDefinition' to 'const CvMissionDefinition *'
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called[/COLOR]
CvUnit.cpp(10970) : error C2664: 'CvDLLEntityIFaceBase::AddMission' : cannot convert parameter 1 from 'CvMissionDefinition' to 'const CvMissionDefinition *'
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
CvUnit.cpp(11195) : error C2664: 'CvDLLEntityIFaceBase::AddMission' : cannot convert parameter 1 from 'CvBattleDefinition' to 'const CvMissionDefinition *'
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
CvUnit.cpp(11495) : error C2664: 'CvDLLEntityIFaceBase::AddMission' : cannot convert parameter 1 from 'CvMissionDefinition' to 'const CvMissionDefinition *'
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
CvUnit.cpp(11543) : error C2664: 'CvDLLEntityIFaceBase::AddMission' : cannot convert parameter 1 from 'CvAirMissionDefinition' to 'const CvMissionDefinition *'
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
CvUnit.cpp(11578) : error C2664: 'CvDLLEntityIFaceBase::AddMission' : cannot convert parameter 1 from 'CvAirMissionDefinition' to 'const CvMissionDefinition *'
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Process terminated with status 1 (8 minutes, 38 seconds)
6 errors, 1 warnings


This is the piece of code it is refering to: (see red text)

Code:
// < Grave's ModComp Route Pillage Start >
bool CvUnit::pillageRoute()
{
	CvPlot* pPlot;
	CvWString szBuffer;


	if (!canPillageRoute(plot()))
	{
		return false;
	}

	pPlot = plot();

	if (pPlot->isRoute())
	{
		pPlot->setRouteType(NO_ROUTE); // XXX downgrade rail???
	}

	changeMoves(GC.getMOVE_DENOMINATOR());

	if (pPlot->isActiveVisible(false))
	{
		// Pillage entity mission
		CvMissionDefinition kDefiniton;
		kDefiniton.setMissionTime(GC.getMissionInfo(MISSION_PILLAGE_ROUTE).getTime() * gDLL->getSecsPerTurn());
		kDefiniton.setMissionType(MISSION_PILLAGE_ROUTE);
		kDefiniton.setPlot(pPlot);
		kDefiniton.setUnit(BATTLE_UNIT_ATTACKER, this);
		kDefiniton.setUnit(BATTLE_UNIT_DEFENDER, NULL);
[COLOR="Red"]		gDLL->getEntityIFace()->AddMission(kDefiniton);[/COLOR]
	}

	return true;
}
// < Grave's ModComp Route Pillage End   >

Do you know how I could fix this? :confused:

If you need more info, let me know what I can provide.

First of all what's up with this? -->
Code:
// < Grave's ModComp Route Pillage Start >


Second see the change I made to the line in red:
Code:
// < Route Pillage Start >
bool CvUnit::pillageRoute()
{
	CvPlot* pPlot;
	CvWString szBuffer;


	if (!canPillageRoute(plot()))
	{
		return false;
	}

	pPlot = plot();

	if (pPlot->isRoute())
	{
		pPlot->setRouteType(NO_ROUTE); // XXX downgrade rail???
	}

	changeMoves(GC.getMOVE_DENOMINATOR());

	if (pPlot->isActiveVisible(false))
	{
		// Pillage entity mission
		CvMissionDefinition kDefiniton;
		kDefiniton.setMissionTime(GC.getMissionInfo(MISSION_PILLAGE_ROUTE).getTime() * gDLL->getSecsPerTurn());
		kDefiniton.setMissionType(MISSION_PILLAGE_ROUTE);
		kDefiniton.setPlot(pPlot);
		kDefiniton.setUnit(BATTLE_UNIT_ATTACKER, this);
		kDefiniton.setUnit(BATTLE_UNIT_DEFENDER, NULL);
[COLOR="Red"]		gDLL->getEntityIFace()->AddMission(&kDefiniton);[/COLOR]
	}

	return true;
}
// < Route Pillage End   >

I found this out when I updated the Route Pillage Mod to be compatible with the Warlords v2.0.8 patch.
 
TheLopez said:
First of all what's up with this? -->
Code:
// < Grave's ModComp Route Pillage Start >


:lol:

No, I'm not taking credit for your work!!!! ;)

I added "Grave's ModComp" to the begenning and end of the code so that later on down the road, if somebody wants to search the C++ files for all the changes I made, they can just do a search on "Grave". Or if somebody wanted to just look up the Route Pillage Mod code, for example, they could just do a search on "Route Pillage".

I did that with every mod component I've integrated into my project. I thought it would be easier to do searches that way, that's all.


** EDIT **

Yep, that did the trick. Thank you, sir! :D
 
Updated Warlords version to be compatible with the v2.0.8.0 patch.
 
TheLopez said:
Updated Warlords version to be compatible with the v2.0.8.0 patch.

Found a tiny bug in CvUnit.cpp:

Code:
// < Route Pillage Start >
bool CvUnit::pillageRoute()
{
	CvPlot* pPlot;
	CvWString szBuffer;


	if (!canPillageRoute(plot()))
	{
		return false;
	}

	pPlot = plot();

	if (pPlot->isRoute())
	{
		pPlot->setRouteType(NO_ROUTE); // XXX downgrade rail???
	}

	changeMoves(GC.getMOVE_DENOMINATOR());

	if (pPlot->isActiveVisible(false))
	{
		// Pillage entity mission
		CvMissionDefinition kDefiniton;
		kDefiniton.setMissionTime(GC.getMissionInfo(MISSION_PILLAGE_ROUTE).getTime() * gDLL->getSecsPerTurn());
		kDefiniton.setMissionType(MISSION_PILLAGE_ROUTE);
		kDefiniton.setPlot(pPlot);
		kDefiniton.setUnit(BATTLE_UNIT_ATTACKER, this);
		kDefiniton.setUnit(BATTLE_UNIT_DEFENDER, NULL);
		[COLOR="Red"]gDLL->getEntityIFace()->AddMission(kDefiniton);[/COLOR]
	}

	return true;
}
// < Route Pillage End   >

When I went to recompile, this error came up:

Spoiler :

CvUnit.cpp(4290) : error C2664: 'CvDLLEntityIFaceBase::AddMission' : cannot convert parameter 1 from 'CvMissionDefinition' to 'const CvMissionDefinition *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Process terminated with status 1 (0 minutes, 8 seconds)


The original code for the red highlighted item was:

Code:
gDLL->getEntityIFace()->AddMission(&kDefiniton);

I switched back to the original code for that line, and it compiled correctly? Is this correct? :confused:
 
Thanks for catching that Grave, you are correct there is a missing &. I will update the mod when I get home tonight.
 
Updated to be compatible with BtS v3.19
 
I found no differences between the Warlords-version and the BTS-version. Is that right or am I missing something?

There are differences in the SDK files. Make sure to use the BtS flavor...
 
Double checked the SDK-files but again found no differences. :confused:
On the other hand it works correctly. :)

I just checked what I had locally on my system and what is uploaded and they warlords and BtS versions of the SDK files are completely different.
 
Is there any way to get a event message when you pillage the route? There doesn't seem to be one and when merging with the AIR Combat Experience MOD, the air route bombing message is no longer given.

Edit: I got it to work properly. What confused me was that the ACE Mod also has bmombing of routes enable, but alse adds expereince for it so you don't have to add another route bombing code block.
 
Hi,

I would like to merge this into my mod, which is based on Better BAT AI. Since there are many changes made in the SDK I took the source files of Better BAT AI and tried to merge and recompile it.

Unfortunatly the result is not working properly. The build was successful and the debug-dll shows now error but I have the following problems:

The Icon to destroy routes is shown all the time, although if there isn´t a route at the plot.
When I try to destroy a route, there is a animation for the unit but the route is still there.
Air Units have no new button.

I´ve merged both the xml and the SDK and I´ve checked it twice. I´m not sure if some change of Better BAT AI is the reason why route pillage is not working.

Since I don´t really have a clue about C++ it would be very nice, if someone could check the changed files which I´ve added. Thank you very much!
 

Attachments

I got it to work with land units now. I´m not sure why it didn´t work before. I´ve checked all files but didn´t change anything before I treid to recompile.

But I couldn´t get it to work for air units. Will there be the additional Icon for the mission too? Could you please give me a hint in which source file I should look since there is no additional Icon for Route Pillage for the air units.

Thank you!

Btw: I have the same problems when I just use your mod as a standalone. How should I use the air units to destroy routes?
 
Is it possible to add blockade trade route (1 tile range) to ground units?

Naval units have something like it.
 
Back
Top Bottom