I'll definitely be open to any Lua method that is not too exotic to implement
It's not that hard to implement. Prof. Garfield may have made it even easier since OTR/Cold War in his template, but the basic idea is:
You put together the units that can use a carrier into a table:
Code:
-- AIRCRAFT CARRIER CODE
-- p.g. Indexed by unittype id. If entry is true, the unit can use the carrier. If missing or false, the unit can't.
-- Any carrier must also be in this list, with entry true
-- munitions also use carrier, to ensure carrier is not air stack protected by its cargo
local useCarrier = {}
useCarrier[object.uCarrier.id] = true
useCarrier[object.uMiG15.id] = true
useCarrier[object.uMiG19.id] = true
useCarrier[object.uMiG21.id] = true
useCarrier[object.uMiG23.id] = true
useCarrier[object.uMiG25.id] = true
In your unit activation events, you check and see if the activated air unit is or isn't in that table. If it is in that table, then you set the carrier unit in the game to have the "can carry air unit flag." If the aircraft is not in the table, you remove the "can carry air unit flag" from the carrier units. This effectively means that your aircraft unit won't "stop/land" when they go to a tile with a carrier as they normally do.
Code:
if useCarrier[unit.type.id] or unit.type.flags & 1<<12 == 1<<12 then
object.uCarrier.flags = specialNumbers.defaultCarrierFlags
else
object.uCarrier.flags = specialNumbers.doNotCarryCarrierFlags
end
(note that "object.uCarrier" is the carrier unit in this example.
With that being said, the AI is likely hopeless at using this, but then, they're pretty hopeless at carriers in the first place!
Edit: in the above code you'd also need to have a table with the actual flag codes.
Code:
local specialNumbers ={}
specialNumbers.defaultCarrierFlags = 128 -- carrier flags when the active unit can use the carrier
specialNumbers.doNotCarryCarrierFlags = 0 -- carrier flags for when unit activated can't be carried by carrier
Again, there may well be a different way to do it by now.