AI modding

How to make AI train some specific unit for specific civilization. I mean like when modding Indians to get knight line or when playing full tech tree mode, they do not train it. Even if I remove Camels from them they still don’t choose the new option. I heard there is personality of AI for each civilization. But is there a way to mod it?
Any help will be greatly appreciated…
I plan to make many new Civ mods but this thing is what stops me. AI never uses the new tech tree properly. It is kind of pre-scripted for original civilizations…


It also would be interesting if you can tell the AI to build a specific building. Have you posted this question on aokheaven? Maybe we get answers there.

That’s definitely possible as long as you have the ID of your new unit/building.
You can check the AIs’ code to see where it trains/builds something, copy that and replace the object’s names (knight-line, barracks, etc) in the copy-pasted rules with your new ID.