This is quite specific, but I wonder if it is to make militia unavailable, so you don’t see it in the barrack (rather than having it grey). Then you can make swordsman once you reach the caste age.
Let’s say I want this effect for the Aztecs. I go under “EFFECTS” to “Aztecs Tech Tree” and I add the command “Disable unit 74”, 74 being the militia. For good measure I disable the man-at-arms tech as well. It works, I can no longer make militia. But I still see its grey icon.
I made the changes to get long swordsman upgrade for free in castle age. But I only see the grey militia icon.
I saw there is, for knights, a “Knight (make available)” tech that start the effect “Knight (make available)” and, indeed, make knights available. There are no such tech and effect for the militia, so I try to create them. I make sure the tech take effect in dark age. Then I disable the tech for the Aztecs. But I still have the grey militia icon in my barracks, at any age.
What am I missing? Is it hard coded to always have militias at the barracks?