• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Lord Haleth

Corporal
25 Badges
Sep 1, 2016
43
4
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings III: Royal Edition
  • Crusader Kings III
  • Crusader Kings II: Holy Fury
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Crusader Kings II: Jade Dragon
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Crusader Kings II: Reapers Due
  • Stellaris
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Stellaris: Synthetic Dawn
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
Hey all, I'm struggling with modding the elector vote score. I want the electors to value the son of the current ruler. However, since the current truler isn't ROOT, FROM, PREV or FROMFROM*, I'm at a loss how to get the score to trigger. I've tried a number of options, of which a couple I have put down here. Any thoughts on how to handle this? All help is greatly appreciated!

additive_modifier = {
value = 15
localisation_key = tooltip_feudal_elector_vote_player_heir
NOT = { character = FROM }
FROM = {
is_child_of = ROOT_FROMFROM
}
}

additive_modifier = {
value = 15
localisation_key = tooltip_feudal_elector_vote_player_heir
NOT = { character = FROM }
FROM = {
is_child_of = {
holder_scope = FROMFROM }
}
}

additive_modifier = {
value = 15
localisation_key = tooltip_feudal_elector_vote_player_heir
NOT = { character = FROM }
FROM = {
FROMFROM = {
holder_scope = {
is_parent_of = FROM
}
}
}
}
* At the top of the succession voting file ROOT, FROM, FromFrom and FromFromFrom are described.
# Root scope - Voter, the character voting in the election
# From scope - Candidate, Character considered for the title
# FromFrom scope - The title the nomination is for
# FromFromFrom scope - The title owner's candidate

20:27 update: The script below seemed to do something, but I can't see what because the sons of the ruler all got a 0 score. They did seemed to get chosen more often though.
additive_modifier = {
value = 15
localisation_key = tooltip_feudal_elector_vote_player_heir
NOT = { character = FROM }
FROM = {
FROMFROM = {
holder_scope = {
character = {
is_parent_of = FROM
}
}
}
}
}
 
Last edited:
You can use normal scopes, such as 'liege', just as you can in normal scripting. That should allow you to scope to the ruler from any character involved.
 
20:27 update: The script below seemed to do something, but I can't see what because the sons of the ruler all got a 0 score. They did seemed to get chosen more often though.

That looks *almost* correct. See if something like this works:
Code:
additive_modifier = {
    value = 15
    localisation_key = tooltip_feudal_elector_vote_player_heir
    NOT = { character = FROM }
    FROMFROM = {
        holder_scope = {
            is_parent_of = ROOT_FROM
        }
    }
}

You can use normal scopes, such as 'liege', just as you can in normal scripting. That should allow you to scope to the ruler from any character involved.

This will work if electors are always direct vassals of the title's holder, but will cause weirdness otherwise. It might also affect the voting behavior of the title's holder if they are not independent (since the title holder gets a vote as well).
 
Thanks for the tips! In the end the following worked:
Code:
       additive_modifier = {
           value = 15
           localisation_key = tooltip_feudal_elector_vote_player_heir
           NOT = { character = FROM }
           FROM = {
               heir_under_primogeniture_law = {
                   title = FROMFROM
               }
           }
       }
 
Wouldn't this be the correct form?
Code:
additive_modifier = {
    value = 15
    localisation_key = tooltip_feudal_elector_vote_player_heir
    NOT = { character = FROM }
    FROMFROM = {
        heir_under_primogeniture_law = {
           character = ROOT_FROM
        }
    }
}
 
That looks *almost* correct. See if something like this works:
Code:
additive_modifier = {
    value = 15
    localisation_key = tooltip_feudal_elector_vote_player_heir
    NOT = { character = FROM }
    FROMFROM = {
        holder_scope = {
            is_parent_of = ROOT_FROM
        }
    }
}
This is the most successful yet.

Wouldn't this be the correct form?
Code:
additive_modifier = {
    value = 15
    localisation_key = tooltip_feudal_elector_vote_player_heir
    NOT = { character = FROM }
    FROMFROM = {
        heir_under_primogeniture_law = {
           character = ROOT_FROM
        }
    }
}
This one didn't work. It gives the +15 bonus to the person who has the most votes. So the person who will get elected, not the firstborn son. So either the heir_under_primogeniture_law isn't doing what is implies it does and acts like current_heir, or the scoping is somehow off.

Thanks for the tips! In the end the following worked:
Code:
       additive_modifier = {
           value = 15
           localisation_key = tooltip_feudal_elector_vote_player_heir
           NOT = { character = FROM }
           FROM = {
               heir_under_primogeniture_law = {
                   title = FROMFROM
               }
           }
       }
And this one looked promising, but at a second glance it gave the vote score to everybody, not just the son of the ruler. :rolleyes:

Since the top one works for all the sons, I'm now hoping to script one with the heir_under_primogeniture_law just for the eldest son.
 
Last edited:
Since I couldn't get the knack of how the whole heir_under_primogeniture_law thing works, I decided to go for a somewhat less elegant solution.

Code:
       additive_modifier = { # Bonus for the first born child of the ruler.
           value = 15
           localisation_key = tooltip_feudal_elector_vote_player_heir
           NOT = { character = FROM }
           AND = {
               FROMFROM = {
                   holder_scope = {
                       is_parent_of = ROOT_FROM
                   }
               }
               FROM = {
                   NOT = {
                       any_sibling = {   is_older_than = PREV }
                   }
               }
           }
       }

       additive_modifier = { # Bonus for the other childeren of the ruler.
           value = 5
           localisation_key = tooltip_feudal_elector_vote_child_of_ruler
           NOT = { character = FROM }
           FROMFROM = {
               holder_scope = {
                   is_parent_of = ROOT_FROM
               }
           }
           FROM = {
               any_sibling = {   is_older_than = PREV }
           }
       }
 
Since it kept bugging me, I returned to this issue this week. The code below works. :D
Code:
       additive_modifier = { # Bonus for the primo heir of the ruler.
           value = 50
           localisation_key = tooltip_feudal_elector_vote_player_heir
           NOT = {
               character = FROM
               FROMFROM = {
                   holder_scope = {
                       character = PREVPREV
                   }
               }
           }
           FROMFROM = {
               would_be_heir_under_law = { who = ROOT_FROM law = primogeniture }
           }
       }
 
Last edited:
This is the way I did it
Code:
additive_modifier = { #Electors should favor children of current ruler
            value = 80
            localisation_key = tooltip_feudal_elector_child_of_ruler
            NOT = {
                character = FROM
            }
            NOT = {
                FROMFROM = {
                    holder_scope = {
                        character = ROOT
                    }
                }
            }
          
            FROM = {
                OR = {             
                    father = {
                        AND = {
                            is_alive = yes
                            has_landed_title = ROOT_FROMFROM
                        }
                    }
                    mother = {
                        AND = {
                            is_alive = yes
                            has_landed_title = ROOT_FROMFROM
                        }
                    }
                }
            }
          
        }

additive_modifier = { #Electors should favor children of some previous ruler
            value = 40
            localisation_key = tooltip_feudal_elector_child_of_dead_ruler
            NOT = {
                character = FROM
            }
            NOT = {
                FROMFROM = {
                    holder_scope = {
                        character = ROOT
                    }
                }
            }
            FROM = {
                OR = {             
                    father = {
                        AND = {
                            is_alive = no
                            has_landed_title = ROOT_FROMFROM
                        }
                    }
                    mother = {
                        AND = {
                            is_alive = no
                            has_landed_title = ROOT_FROMFROM
                        }
                    }
                }
            }
          
        }

Since it kept bugging me, I returned to this issue this week. The code below works. :D
Does this really work? I have never managed to get would_be_heir_under_law work properly
 
So far it has worked for me, but I haven't played long enough to test it in all kinds of settings. I found that once the character became the elected heir, he would loose the primo heir +50 modifier. I assume would_be_heir_under_law no longer triggers when the character becomes the regular heir. I've posted how I worked around that here: https://forum.paradoxplaza.com/foru...eir_under_law-not-work.1128603/#post-26024073.