I didn't see any threads explaining how to do this, so I decided to make my own, because it is just too easy.
I stumbled across this in the Rusichi: Total War mod - an awesome mod with many awesome features, and even though I'm hardly interested in Russian culture, history or anything (no offence to Russia, Russians or the mod-makers, I just have to admit the setting wasn't really for me) I consider this mod, gameplay-wise, to be among the best I've ever played. And personally I would pick it over most of the other, more popular mods any day. Also, it was in their mod that I found this feature.
Seems like the Russians are ahead of the rest of us in TW modding...
I'm taking that you have a basic knowledge about scripting, as I'm not trying to teach you how to spawn armies in general, I'm just learning you how to spawn someone on the campaign map that instantly gets adopted into the family tree. If you want to do this, please, read other tutorials about scripting first.
You cannot, however, control who becomes the father of this character. The system works like this, I think (I haven't done much testing):
1. The character is spawned as a son of the faction leader.
2. If the faction leader has the maximum amount of children, then the character is spawned as a son of the faction heir.
3. If the heir has the maximum amount of children, I dunno what happens... but I'm pretty sure it works just like the vanilla adoption system (most logical anywho). As said, I haven't done much (hardly any) testing - I've just seen it in the Rusichi mod, opened their script-file, found the characters they spawn as family members, read it and understood how it works.
What you do is that you write a regular spawn_army script, but you add one word:
That should do the trick. The character will not only be spawned as a general, but automatically adopted into the family tree as well - if you spawn him with loads of authority, then the character will probably become the next heir...Code:spawn_army faction <faction_name> character <character_name>, named character, age <age>, x <x-coordinate>, y <y-coordinate>, family traits <traits> unit <bodyguard_unit> end
Oh, and please, the rep's for the Rusichi guys... This is actually not my work at all, I just wanted to share it, just in case...