@pan-boroda At least let us enjoy what is already there, even if it's only half functional!
We're modders, we can deal with some technical hiccups along the way, just let us use it finally, in whatever state it currently is - I have personally waited for a few years now.
I'm not even asking for source code, I just want to play it. To see this huge, historical world in front of me...
Also, let me answer (or at least shed some light) on your 3 questions asked earlier:
ad. 1: Go to module_scripts and in the first script "game_start" set faction relations, for example with:
(set_relation,"fac_kingdom_1","fac_kingdom_2),-50),
ad. 2: Yes, defections are like that, but it can be changed - the code is in module_simple_triggers, look for phrase: #Individual lord political calculations
AI in Warband is written in a pretty tangled code, not very clear and not very easy to edit, but good luck - this part should be relatively uncomplicated
ad. 3: And again it's about editing AI, but complicated this time - there is a lot of code that makes decisions for lords, and one of those many decisions is to capture a town or castle. It's all randomly generated, so the lord will do some calculations on which target is easy enough, which target is worth his time, oh and if there isn't a feast going on, etc. Well, eventually he might decide to actually capture a castle, and he might even succeed (although in most cases solo sieges usually fail, they have better chances to capture anything when it's a military campaign, with marshal and many lord parties working together). Then after the castle is taken, it's not given to anybody - king will decide that eventually (there is a simple trigger that deals with political decisions like that, runs from time to time). Eventually king decides which lord gets the castle.
You'd have to hook into this process - detect that a castle was taken, write some "treason code" that will make the lord decide to just leave the faction and keep the castle. In my opinion this is not very worthwile, because it happens so rarely - most successful sieges are with allies close by, meaning a rebellion would be punished by nearby parties pretty quickly.