Just thought of a way to fix this issue that shoudn't be very hard to put in, though it can't be done with modders.
For every hereditary title in monarchies(that I know about at least), there is a list of people with a claim for that title. For example, the norwegian king is around number 40 for the claim to the english crown. What could be implemented into the game, is simply such a list. Every character on the family scroll gets a number in that list, and that number is defined by how close he is to the king, by some definitions. Now here comes the good part, that list needs to be updated every turn, or at least every time there is a change to the family tree. When something happens to change the current heir, the previous heir simply gets the exheir trait(it already exists too!). The title of heir/king cannot be born by underaged characters, but if they are entitled to be heir, it gets the title as soon as it comes of age.
For example, a king has an underage son and a brother. Now the king is king, and the brother is the heir. When the son comes of age, he becomes the heir, and his uncle an exheir. Now, suppose the son dies(after an unfortunate pirat attack...), the uncle becomes an heir again. The king has another son though, but he hasn't come of age yet. Unfortunately, the king dies of the plague. Now, his brother becomes the king(actually, he would become a regent or something), and his son becomes the heir. Now the original king's son comes of age, and he becomes the king, his uncle the heir and the uncles son an exheir.
Bookmarks