if you want to join a battle on the side of a hostile faction (i.e bandits), you can take away the restriction on who you can join in a battle:
look in menus.txt for this:
mno_pre_join_help_attackers 6 2204 2 1224979098644774912 144115188075856296 2190 3 1224979098644774913 1224979098644774912 432345564227567629 2204 2 1224979098644774914 144115188075856110 2190 3 1224979098644774915 1224979098644774914 432345564227567629 30 2 1224979098644774913 0 2147483678 2 1224979098644774915 0 Move_in_to_help_the_{s2}. 4 1303 1 0 2133 2 144115188075856032 144115188075856110 2133 2 144115188075856033 144115188075856296 2060 1 864691128455135276 . mno_pre_join_help_defenders 6 2204 2 1224979098644774912 144115188075856296 2190 3 1224979098644774913 1224979098644774912 432345564227567629 2204 2 1224979098644774914 144115188075856110 2190 3 1224979098644774915 1224979098644774914 432345564227567629 30 2 1224979098644774915 0 2147483678 2 1224979098644774913 0 Rush_to_the_aid_of_the_{s1}. 4 1303 1 1 2133 2 144115188075856032 144115188075856296 2133 2 144115188075856033 144115188075856110 2060 1 864691128455135276 .
simply replace both bits in red with 0 so it should look like this:
mno_pre_join_help_attackers 0 Move_in_to_help_the_{s2}. 4 1303 1 0 2133 2 144115188075856032 144115188075856110 2133 2 144115188075856033 144115188075856296 2060 1 864691128455135276 . mno_pre_join_help_defenders 0 Rush_to_the_aid_of_the_{s1}. 4 1303 1 1 2133 2 144115188075856032 144115188075856296 2133 2 144115188075856033 144115188075856110 2060 1 864691128455135276 .