God-Emperor
Deity
I have managed to get the AI to base a squadron on a starbase. I say "a squadron", because so far can verify only exactly one, but that is one more than it ever has before. I didn't even have to resort to finding a squadron and forcing it to be on the station (which I though I might need to do).
In this screenshot, you can see an omega fighter squadron on intercept duty at a starbase. On the previous turn it had shot down a delta bomber squadron of mine that was attacking the battleship that you can see, which is how I realized that it was there.
How did I do it? Just a tiny bit of Python in the loop that processes starbases each turn for missile production, culture, and ranged attacks, to force every starbase to use UNITAI_CARRIER_SEA. That is it. Currently it is forcing the Sensor Station to the same unit AI type, but I'll find a better one since they can't actually carry a squadron - perhaps UNITAI_SPY_SEA. I am selecting the sea type unit AIs for this so they are not counted as any of the types it can actually build, so it doesn't think it has more of them that it can use than it really does. I can't confirm it for sure, but around when I added this, the same AI started to get a significant increase in its military power which is possibly due to the sudden decrease in units with UNITAI_ATTACK causing it to build more. Shortly thereafter they also recaptured a system the pirates had taken from them. So far that is not significant since the game is so random anyway, but it could be a sign that it improved more than just the squadron basing.
After a bit more tweaking and testing I will commit the code change to Sourceforge and also post it here for the mod-moders to get it quickly.
In this screenshot, you can see an omega fighter squadron on intercept duty at a starbase. On the previous turn it had shot down a delta bomber squadron of mine that was attacking the battleship that you can see, which is how I realized that it was there.
How did I do it? Just a tiny bit of Python in the loop that processes starbases each turn for missile production, culture, and ranged attacks, to force every starbase to use UNITAI_CARRIER_SEA. That is it. Currently it is forcing the Sensor Station to the same unit AI type, but I'll find a better one since they can't actually carry a squadron - perhaps UNITAI_SPY_SEA. I am selecting the sea type unit AIs for this so they are not counted as any of the types it can actually build, so it doesn't think it has more of them that it can use than it really does. I can't confirm it for sure, but around when I added this, the same AI started to get a significant increase in its military power which is possibly due to the sudden decrease in units with UNITAI_ATTACK causing it to build more. Shortly thereafter they also recaptured a system the pirates had taken from them. So far that is not significant since the game is so random anyway, but it could be a sign that it improved more than just the squadron basing.
After a bit more tweaking and testing I will commit the code change to Sourceforge and also post it here for the mod-moders to get it quickly.