Prevent landing of allied aircraft on carriers
-
Is there a way to prevent Allied air units from landing on your owned carriers? I.e. only aircraft controlled by you can land on your carriers?
I couldn't find it in the properties nor in the relationshipAttachments. Also not in the unitAttachments.
-
I thought there was a property for it. @wc_sumpton or Roger might know. @TheDog might as well
-
@VictoryFirst
I dont think there is.But this is related,
<property name="Allied Air Independent" value="false" editable="false">needs to false, or not listed in the xml.
-
@thedog Yeah according to POS2 that means allied air units on a carrier cannot attack when it's the carrier owner's turn. But it doesn't disallow air units to be on a friendly carrier.
No big deal, I solved my problem via another way. But thanks anyway!
-
So ... what you'd do ?

-
@beelee In A&A North Africa, aircraft can escort convoy zones, so they can stay in sea zones from the end of your turn to the start of your next turn, similar to Original Pacific. This was difficult to implement as you want your aircraft to be killed in any of YOUR phases if you don't land them, except in the Assign Convoy Escorts phase, which functions as a NCM phase. You can't do this by only setting removeAirThatCanNotLand to false and using placeNoAirCheck because then the aircraft will not be killed by the engine at all. If you set it to true in every phase except Assign Convoy Escorts, then the aircraft will be removed on other player's turns.
So initially to solve this I thought of invisible carrier units. I had conditions and triggers that placed a carrier at the end of that power's Assign Convoy Escorts phase in every sea zone containing aircraft owned by you. At the start of their next Advance Convoy phase, in which you need to land your planes on the water, all carriers are removed.
I tested it a bit and it worked very well. The aircraft were removed when it's YOUR turn but not on other player's turns.
However I forgot about the possibility of one player moving his aircraft to a sea zone, then in that same round another friendly power moving his aircraft to the sea zone. Now, two carrier units are added, one for the first player and one for the second player. The first player's carrier is removed at the start of his next turn. However, because of the second carrier, the aircraft of the first player are able to land and will not get killed. Even though they should. And the carrier of the second player is necessary because if it wasn't there, his aircraft would die along with the aircraft of the first player.
That's why I asked the above question. If I could prevent air units from using allied carriers, that would solve this problem.
Fortunately, there was another (much better) way to solve this problem. I was reading through POS2 and came across this:
carrierCost values: the space this unit takes up when sitting on a carrier. if set to 0 then air units can even land on sea zones without a carrier being present (think sea planes)I knew what carrierCost was and what it did but once I read this line I learned something I didn't know before. Setting carrierCost to 0 allows a plane to stay at sea without an aircraft. Excellent feature, exactly what I needed!
Now what I have are triggers that change the aircraft's carrierCost from 1 to 0 and vice versa. Normally, aircraft have a carrierCost of 1 and can't remain at sea. At the start of the Assign Convoy Escorts phase, the aircraft YOU own have their carrierCost set to 0. This allows them to stay at sea. Once it your turn again, at the start of the Advance Convoys phase, your aircraft's carrierCost is set to 1 again, meaning the engine will show you a warning if you keep your fighters on the water. For this to work I did need to create separate air units for every power (G-fighter, G-bomber, I-fighter, I-bomber, etc.). But that's a small concession compared to the work that's now not needed. The carrier unit code can be deleted, and now there is also no need to set all aircraft to kamikaze (with the original code, this was necessary because you otherwise weren't able to use your full movement to reach a sea zone because the carrier is added at the end of the movement phase).