I don't have the time to go through all the posts, but months ago I worked on this and had a working version, attaching it if anyone wants to take over. It works like this:
- Adds a new medic line of units: (iirc) Healer -> Physician -> Surgeon -> Field doctor-> Combat medic -> Mobile Field Hospital -> Medevac . Progression roughly follows that of the melee units tech and cost wise.
- Obviously, medic units get obsolete with technology, so you can't create a healer, call it a day and heal mechanized infantries and GDRs with it. I did this by creating "negation" promotions for each tier, so a healer gets a negation promotion with -10 healing when physician is unlocked, effectively removing its healing.
- This bit may be redundant, but I wanted the player to make investments to military infrastructure to recruit medic units. So, you need a barracks to recruit ancient medics, an armory for medieval, a military academy for the later. Under the hood this works by creating 3 new resources, ancient, medieval and modern military medicine, produced by military training (and possibly with hospital later on) building. This both forces the player to invest in military training, and implements a soft cap on medics to prevent the AI from going crazy with it. (It crowds the top panel, but I know how to fix that now)
- The hard part: Medics have a new unitai, UNITAI_MEDIC. This needs to be tied into the tactical AI and production AI dll functions to properly work. I made some progress with that, but my branch is horribly outdated (pre 2.0 iirc) and wasn't even complete. Naturally, the attached file doesn't include a custom dll, iirc the AI still builds medics but do not expect proper placement.
- I'll try to isolate my dll edits if anyone wants to take this further, but here's what I remember. Tactical AI has a check about where to place the units, as in frontline, second-line and third-line. You'll need to add medic UNITAI to that (second line). Then, basically go through all tactical AI entries about great generals and replicate that for medics. This is the saving grace and what makes a medic civilian/combat support unit feasible, it's usage is pretty much the same as a great general. (before anybody asks, no you can't just give medics the general AI, because that's hardcoded for some stuff) You can also look for the city special unitai, which is used for the siege tower UU, another civilian combat support unit. In any case, you'll need to get ilteroi's support for a polished implementation.
More than medics, my end goal was to create a framework for frontline and backline combat support units, which would allow modders to come up with their own unit lines or UUs. Like I really wanted to make anti-aircraft guns a defensive combat support unit, and I can see pdan's zeppelins working great as a frontline combat support unit too.
While I made some modifications, none of the art in this mod belongs to me and I didn't ask for permissions as nothing was released, keep that in mind. I'm not active these days so this is pretty much all the support I can provide.