Hello,
i like an play with your mod, i am in grave need of this, because i am under heavy attack sometimes...
As i understand each ranked turret is a turret on its own.
So far as i see when a ranked up turret is destroyed then it will be only replaced by a similar ranked turret; this leads to some problems when not available....
If no similar ranked turret is available it should be replaced by a new (or lower ranked, or maybe upper ranked; could be an option)
I don't know modding this far if its possible to place a 'false' ghost for a destroyed turret.
Also i have the suggestion ( just a shower thought, don't know the implications to the very end)
How about having a modul (or AI-Card) which will be inserted/added to a turret so that the turret is rankable
Maybe this will lead to a good clear replacement, because the turret is always a standart without AI and can be upgrade / modulinsert-able to have a smooth replacement.
This would even let room for some low-threat / dumb turrets in areas which needs some firepower, but just a little.
If a recipe to manufacture/copy a general-AI is viable and not OP i don't know, but this could be adjusted with option or a probability to successfull copy (even one could loss the original general-AI in the process, so that the build up is very meager)
One then could also think about different AI-Cards leading to different behaivor in terms of firepower / end-rank and also you can spread research for rankable turrets in the tech tree