Python Help for Carrier

BomberEscort

Don't be alarmed; this is a kindness
Supporter
Joined
Jul 28, 2003
Messages
1,139
Location
Kansas City
Is there a way to use Python to increase the Defense of a Carrier a fixed amount, preferably 10% of each Fighters strength onboard the Carrier. In my mod Fighters are 12 Str, Carriers are 18 w/6 Fighter holds. I am trying to get a 1.2 Str increase for the Carrier for each fighter on Board. This would symbolize the Carriers superiority over any other ship. The strength increase would work for both attack and defense. Can anyone help with this? Thanks in advance.
 
Not sure if you can do that, but maybe you could grant it a promotion when a fighter is stationed there, but again, not sure if there is a python event call to check if an aircraft is stationed on a unit or not.
 
You might want to try contacting the creator of RealFort. He uses a python script to give promotions to units that are sitting on a fort improvement. I dono how hard it would be to modify the target from fort to carrier but i am sure he could do it.
 
It should be easy enough to do. Basically what you need to add is an "onUnitMove" override that would give a promotion to the carrier any time a fighter moved on to it, and remove the promotion any time a fighter moved off.

Bh
 
One way to do it without having a lot of promotions clutter would be to provide the bonus only when 3 fighters are stationed there. So you'd have a (say) +200% bonus with three WWII-era figher bombers on board, and a +300% bonus with three jet fighters. This would bring the carrier up to 48 and 64 strength. It could stand up to at least one battleship, but two would likely take it down. Any more of an advantage would make an escort unneeded, though...and I'm pretty sure carriers always go around in a battlegroup for escort.
 
Thanks for the suggestions... I am very limited with Python though, anyone care to write something up??? :D
 
Dont take this personaly but I think the whole intention of this is misguided

This would symbolize the Carriers superiority over any other ship.

Carries are the supream Sea Based Battle platform because of their Aircraft incredible range and strike power. The game already lets you attack other ships at long range with the planes on the carrier. Apart from close range missle defences the carrier itself is totaly dependent on its escorts and aircraft to defend it from other vessels. The Carrier's only other defence is its high speed, this was originaly a nessesity for aircraft launching but it means that Aircraft Carriers cant be chased down by the slower heavily armored ships. The Carrier realy should have the "Defends only" tag like a Machine Gunner and be quite weak. If another ship or sub were able to penatrate into the heart of the fleet and directly engage the carriers it would be totaly outgunned. Look at the major battles of the Pacific, Carriers were crippled by a single hit from enemy dive bombers and sunk from only a handfull of such hits because their internal ordinace/fuel gets set off. Each such bomb would be comparativly less powerfull then a single Sub Torpedo or Broadside from a Battleship. Clearly any direct contact between the Carrier and a Sub or Battleship is going to end with a dead Carrier. I would go so far as to say even a single Destroyer would easily destroy a Carrier. I would say the Carriers strength score about equals a Frigate. This is why its critical to always protect the carriers with half dozen surface warships and several Subs. Thats just a reflection of the realities of modern warfare.

Now what I think would be clever, a Seach Plane with some rediculus huge Sight Radius (like around 8 ) but no attack so you can Base that on the Carrier and nothing could sneak up on you. You dont even need to fly Recon missions with it the Radius will do it all for you automaticaly.
 
Limited, or havn't started? :)

If you've done programming before it's actually pretty easy to pick up: look at the code Bhuric uses in the Real Fort mod and you can get an idea of how things work rather quickly. I learned this particular scripting language just looking at several mods out there and the API library posted online. Right now I'm involved in modding a particular aspect of the interface, or I'd look into this :)

The problem with carriers is that enemy ships can hide in ports and avoid attack. The AI isn't smart enough to launch an assault of (say) 7 battleships at once against a battlecarrier group, but if it did my assault groups would be very vulnerable since there's no oppertunity to hit them with the figher bombers on board. In real life you would be able to strike them before they reach your ships, but the oppertunity isn't really there in the game...
 
Maybe you can create an exclusive promotion for carriers, which gives 10% to strength for each fighter loaded in the carrier. It should be counted as any other offensive/defensive bônus.
 
I borrowed this code from 12Monkeys mod...

Code:
def onBeginGameTurn(self, argsList):
		'Called at the beginning of the end of each turn'
		iGameTurn = argsList[0]
		CvTopCivs.CvTopCivs().turnChecker(iGameTurn)
		## DAC -- Start
		if (pGroup.getActivityType() == ActivityTypes.ACTIVITY_INTERCEPT):
				# remove mission (this one shold be obsolete, but who knows ;)
				pGroup.popMission()
				pPlot = pGroup.plot()
				# add new mission -> fortify
				pGroup.pushMission(MissionTypes.MISSION_FORTIFY, 0, 0, 0, false, false, MissionAITypes.NO_MISSIONAI, pPlot, pLoopUnit)
				# add new mission -> air patrol
				pGroup.pushMission(MissionTypes.MISSION_AIRPATROL, 0, 0, 0, false, false, MissionAITypes.NO_MISSIONAI, pPlot, pLoopUnit)
				
		## DAC -- End

I figure this checks for the Intercept mission. What I want to do now is for each fighter on board add 10% of fighters strength to the carriers strength, and 20% of the Jet Fighters strength to the carriers strength. Can anyone help me finish this :D
 
The fighters can also be changed to become fighter bombers and thus can protect the carrier. At least in my game they can. ;)

So many things can be changed in the XML files to fit what most people want.:cool:
 
Back
Top Bottom