Here is what I modded, first I removed all the "is_republic" variables in the open elective definitions:
Then I added a "is_republic" variable to the primogeniture law definitions:
The game crashes before loading now.
succ_open_elective = {
potential = {
NOT = { title = k_papal_state }
temporary = no
OR = {
is_primary_type_title = yes
holy_order = yes
AND = {
tier = baron
OR = {
is_theocracy = yes
NOT = { holder_scope = { religion_group = muslim } }
}
}
holder_scope = {
OR = {
is_theocracy = yes
NOT = { religion_group = muslim }
}
}
}
OR = {
is_landless_type_title = yes
holder_scope = { is_theocracy = no }
holder_scope = {
NOT = { religion = catholic }
NOT = { religion = fraticelli }
}
}
holder_scope = {
is_patrician = no
is_merchant_republic = no
OR = {
independent = yes
is_feudal = no
NOT = {
any_liege = {
holy_order = yes
}
}
}
}
NAND = {
has_law = succession_voting_power_1
has_law = succ_feudal_elective
}
}
effect = {
succession = open_elective
}
revoke_allowed = {
always = no
}
}
Then I added a "is_republic" variable to the primogeniture law definitions:
succ_primogeniture = {
oldest_child_opinion = 10
youngest_child_opinion = -15
child_opinion = -10
dynasty_opinion = -5
potential = {
holder_scope = {
NOT = { religion_group = muslim }
is_merchant_republic = no
is_patrician = no
}
OR = {
is_republic = yes
}
OR = {
holder_scope = { # Viceroyalties can always have primogeniture if not muslim
any_demesne_title = {
is_vice_royalty = yes
}
}
AND = {
holder_scope = {
OR = {
independent = yes
NOT = {
any_liege = {
holy_order = yes
}
}
}
OR = {
NOT = { religion_group = pagan_group }
is_reformed_religion = yes
religion = hellenic_pagan
}
}
OR = {
is_landless_type_title = no
is_tribal_type_title = yes
temporary = yes
}
is_primary_type_title = no
OR = {
AND = {
tier = baron
is_feudal = yes
}
holder_scope = { is_feudal = yes }
}
}
}
}
allow = {
OR = {
holder_scope = { # Viceroyalties can always have primogeniture if not muslim
any_demesne_title = {
is_vice_royalty = yes
}
}
AND = {
has_dlc = "Zeus"
holder_scope = {
primary_title = {
OR = {
has_law = ze_administration_laws_1
has_law = ze_administration_laws_2
}
}
}
}
hidden_tooltip = {
has_crown_law_title = no
NOT = { has_dlc = "Zeus" }
}
crownlaw_title = {
OR = {
has_law = crown_authority_3
has_law = crown_authority_4
}
}
}
holder_scope = { NOT = { has_character_flag = liege_forced_succ_law } }
NAND = {
has_law = succession_voting_power_1
has_law = succ_feudal_elective
}
}
effect = {
succession = primogeniture
}
revoke_allowed = {
always = no
}
}
The game crashes before loading now.