Any chance you could provide us modders with any_living_character and random_living_character scopes? Seriously, we've had to try some pretty ridiculous workarounds just to say "Trigger an event for all commanders on the enemy side in a battle". It would be so much easier (and way less performance intensive) if we could just search all living characters and filter out the ones we aren't looking for with limit = { }.
Also, rivals and friendships don't work. At all. I mean it. num_of_rivals and num_of_friends will always return 0, no matter what. I'm surprised nobody's mentioned that to you yet.