Dale's Combat Mod+Air Combat Experience??

stolenrays

Deity
Joined
Aug 2, 2009
Messages
2,063
I am having trouble merging these two mods. All functions work except the Air Combat Experience Mod's (ACE) functions of:

1. Bomb Noman's land

Spoiler :
Code:
	// < Air Combat Experience Start >
	if (!isEnemy(pPlot->getTeam()) && !GC.getGameINLINE().isBombNoMansLand())
	{
		return false;
	}
	// < Air Combat Experience End   >
2. Bomb routes

Spoiler :
Code:
		// < Air Combat Experience Start >
		if(pTargetPlot->getImprovementType() != NO_IMPROVEMENT )
		{
			if (GC.getImprovementInfo(pTargetPlot->getImprovementType()).isPermanent())
			{
				return false;
			}

			if (GC.getImprovementInfo(pTargetPlot->getImprovementType()).getAirBombDefense() == -1)

			{
				return false;
			}
		}

		if(GC.getGameINLINE().isRouteDestructionThroughAirBombs())



		{
			if (pTargetPlot->getRouteType() != NO_ROUTE && GC.getRouteInfo(pTargetPlot->getRouteType()).getAirBombDefense() == -1)

			{
				return false;
			}
		}
		// < Air Combat Experience End   >

All ACE code parts are commented as Air Combat Experience. I've attached the cvunit.cpp file of my Mod that includes DCM and the standalone cvunit.cpp from ACE. I hope someone can help. I figure teh ACE code sections are just in the wrong place to be compatible with DCM.
 
Nothing big caught my eye but I didn't have time to take a closer look to the code. Can you tell what kind of trouble do you have? Does the game crash or do something else funny or what?

The game/mod works without crashes, but you cannot bomb no mans land or routes. So basically that part of the mod is not functioning and acts like vanilla BTS. Normally that part of the mod works, but since DCM's code modifies much of the same cope in the same cpp files, I do not know how to merge to the mod's cvunit.cpp file.
 
Hmmm, it indeed seems that there's something odd in that function. Do you have the original pure DCM's cvunit.cpp? I'd like to take a look at it too, if that's not too much of a trouble.

It is not any trouble since you are offering to help. :) I've attached two CvUnit.cpp files. On is the DCM3.19 file that I released. The other is the CvUnit.cpp file from RevDCM (This is what my release is derived from). I included the RevDCM file since I may have made an error in isolating the source code for DCM.
 
Ok, I changed a few things in the canAirBombAt and airBomb functions. I'm not 100% sure if it should fix your problem. I haven't tested the code so back up your mod. :)
Replace the two functions in your CvUnit.cpp file and test if it works. It's been like a year since I modded the Civ4 DLL so most likely it's not going to work, but could you tell me what kind of problems you have when using those edited functions?
 

Attachments

There was actually no change in the mod airbomb functions, but the .dll did compile with no errors. I received no errors in the game when using the airbomb missions. Thanks so much for your effort and assistance so far.
 
There was actually no change in the mod airbomb functions, but the .dll did compile with no errors. I received no errors in the game when using the airbomb missions. Thanks so much for your effort and assistance so far.

Let me clarify few things. What do you mean when you say "you cannot bomb no mans land or routes"? Does that mean the tile selection thingy is gray and it won't allow you to pick the tile which isn't owned by anyone? Or does it mean that when you bomb the tile nothing happens?
And then as a bonus question, does it matter if there is only improvement/improvement and road/only road on the tile? :)

PS. I'm sorry my help isn't helping at all. I'm just programming as hobby so I'm not an expert at it. :)
 
Your questions helped me find something out:

1. You can select the tile of improvments other than roads in no mans land and then successfully bomb/destroy them. It makes no difference if a route is also on the same tile or not. However, air units do not gain XP from their destruction.

2. You cannot select the tile of routes when alone to attempt the bombing mission. This includes no mans land and culture controled. The tile is greyed out whenhovering over it with the bombing mission selection icon.

So what you got working is to target and successfully bomb improvments(not routes) in no mans land without the accumulation of XP. :goodjob:
 
2. You cannot select the tile of routes when alone to attempt the bombing mission. This includes no mans land and culture controled. The tile is greyed out whenhovering over it with the bombing mission selection icon.
Oh, that was a stupid mistake I made. :blush: It should be fixed now.

1. ... However, air units do not gain XP from their destruction.

So what you got working is to target and successfully bomb improvments(not routes) in no mans land without the accumulation of XP. :goodjob:

So do air units gain xp from destroying improvements or not in that version?

The attached file should fix the route bombing. Again just replace the two functions.
 

Attachments

I didn't find any changes after merging the new file. Only Bombing improvements that are culture controled yield XP.

I played an older version of my mod in progress (before your fixes were merged) and found that you could successfully bomb and destroy improvments in no mans land, but not gain XP. I guess your coding changes are equivelant and the game stays functional so it is not necessarily a bad thing in the scheme of things.
 
So are you saying even in with the latest changes you can't bomb routes in no mans land? :confused: I was pretty sure this change in canAirBombAt would've fix that:
Code:
		if (pTargetPlot->getImprovementType() == NO_IMPROVEMENT [COLOR="Red"][B]&& pTargetPlot->getRouteType() == NO_ROUTE[/B][/COLOR])
		{
			return false;
		}
I honestly have no idea why air bombing improvements in no mans land gives no exp. The calculations shouldn't have nothing to do with the owner of the plot. :confused:
 
Back
Top Bottom