Quote Originally Posted by uanime5
Here is the results of my modding:
1) You cannot create a building that will train heretics, witches, and inquisitors in the same way you can train spies, assassins, merchants, and diplomats. Trying to do this will result in the game crashing with the error message 'agent xxx not found'.

However you can create admirals when you construct ships, and its possible to give units the ability to be a general (just add 'general_unit' to the attributes in export_descr_unit.txt).

I have not tested whether you can recruit princesses but you probably cannot.

2) It is possible for any faction to start with heretics, witches, and inquisitors by adding this unit to your faction (modify descr_character.txt), and modifying the world\maps\campaign\imperial_campaign\descr_strat.txt so that you start with this unit.

However since you cannot train more heretics, witches, and inquisitors when they die you will not longer have these units. Any new heretics, witches, and inquisitors that are spawned will belong to the heretic faction or Papal States.
I made more tests but I must say you are 100% correct.

It appears recruitable agents (spy, assassin, diplomat, merchant, priest) are hardcoded recruitable, and spawned agents (princess, heretic, witch, inquisitor) are hardcoded spawned.

So...

I like your idea to make a faction start with a spawned agent but, as you say, as soon as they die you cannot replace them and you cannot use them properly in a Mod.

I thought to make it possible to acquire them from the faction who spawn them (i.e. bribing a papal inquisitor to make him shift to your faction), so I modded the descr_cursor_action and I could make merchants possible to bribe (I tested it many times). The side effect is that to make them bribable (sp?), you must make them able to accept diplomacy, so you also give merchants the chance to do passive diplomacy, so to exchange map info, in short they can act as diplomats AND merchants (I didn't remember if they could make active diplomacy, but IIRC when you give them in descr_characters and descr_cursor_actions the diplomacy option, you give them all).

I made no further tests but I think you should be able to bribe even spawned agents, assuming you turn them into diplomats as well and you allow them into your faction. The fact is, if you don't control the hardcoded spawning, you cannot rely on it :(