• 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.
This. It basically denotes what is visible of the image
Screenshot (2).png
 
Oh. I don't fool with channels much. Instead I will clip a layer to another layer that's the right shape.

For instance, I will copy one of the existing religious icons as a new layer and drag it over to where I want. Then I will create a new layer, and clip it to the icon copy, meaning only what's within the bounds of the copied icon will appear on the new layer.
 
This. It basically denotes what is visible of the imageView attachment 1137793

It's been ages since I used Photoshop, and I don't really consider myself a graphics modder, but when I added a bunch of religion icons with Gimp about a year back I didn't fiddle with the channels at all; I just used regular layers and assorted techniques for them (e.g. changing the mode/opacity/order, adding overlays, "New from visible") and the Alpha channel and the colour channels filled themselves in ; Gimp's Alpha layer isn't white-on-black, but rather black-on-transparent).
1716493988272.png

1716494093592.png


Doubtlessly, a better artist could have produced something better, but I consider the above at least tolerable.
 
  • 1
Reactions:
It's been ages since I used Photoshop, and I don't really consider myself a graphics modder, but when I added a bunch of religion icons with Gimp about a year back I didn't fiddle with the channels at all; I just used regular layers and assorted techniques for them (e.g. changing the mode/opacity/order, adding overlays, "New from visible") and the Alpha channel and the colour channels filled themselves in ; Gimp's Alpha layer isn't white-on-black, but rather black-on-transparent).
View attachment 1137803
View attachment 1137806

Doubtlessly, a better artist could have produced something better, but I consider the above at least tolerable.
Thanks you! I've used GIMP and i don't have any problem. Thanks you again and the others for your help!
 
Is there some special alchemy needed to make crown laws work?
  • I am trying to create a "regulated inheritance" law for tribal nations. (With difficult preconditions.)
  • As a secondary objective, I'm trying to not overwrite any base game files. (Which should be trivial, since tribals don't get this law in the base game, right? Wrong!)
  • I feel like I almost completely copied the existing crown laws (ze_crown_laws.txt), so I don't understand why those work but mine don't.
  • No errors in Validator (v1.37.7).
Problems:
  • If I set potential = { is_tribal = yes }then all of my de jure and de facto duke+ vassals get access to their own version of the law.
    • This is contrary to base game behaviour, where crown laws are only available to kings and emperors, and follow the complicated rules about whose crown law is controlling.
    • The code here is a simplification: I'm actually setting potential = { expd_at_this_title_should_have_tribal_laws = yes }.
  • If I set potential = { is_tribal = yes tier = EMPEROR }then my duke+ vassals don't get access to the law, but they also aren't bound by it (which you can see in the tooltips in de jure kingdom/empire mapmode).
    • The code here is a simplification: I'm actually adding or removing expd_at_this_title_should_have_crown_laws = yes from the potential block.
  • I can see in de jure kingdom/empire mapmode that the base game's "free inheritance" and "unrestricted vassal wars" crown laws are in effect in my demesne, despite the fact that I'm tribal so I can't see them.
    • This is in addition to the new tribal crown law added by this mod.
    • At the moment, I only really trust the tooltip in my demesne, due to the problems noted above.
    • These hidden crown laws will probably cause problems further down the road, as the base game's "free inheritance" probably clashes with "mymod tribal regulated inheritance".
Screenshots:

Code (for reference):
Code:
# Audax Validator EnableCommentMetadata
# revoke_allowed, ai_will_do and ai_will_revoke are required blocks, but the Validator flags them as errors

law_groups = {
    expd_at_out_of_realm_inheritance_laws = {
        law_type = realm
        allowed_for_councillors = yes
    }
    expd_at_imperial_administration_laws = { ####### Not relevant to this question, except to say that it's a very custom realm law which works exactly as intended.
        law_type = realm
        allowed_for_councillors = yes
    }
}




############################
# Out of realm inheritance #
############################

de_jure_laws = { # Crown law
 
    # Default (free inheritance)
    expd_at_out_of_realm_inheritance_law_0 = {
        group = expd_at_out_of_realm_inheritance_laws
        default = yes
        potential = {
            expd_at_this_title_should_have_tribal_laws = yes
            expd_at_this_title_should_have_crown_laws = yes
        }
        allow = {
            always = yes
        }
        # Audax Validator "." Ignore_NEXT
        revoke_allowed = { always = no }
        # Audax Validator "." Ignore_NEXT
        ai_will_do = { factor = 0 }
        # Audax Validator "." Ignore_NEXT
        ai_will_revoke = { factor = 0 }
        effect = {
            hidden_tooltip = { revoke_law = expd_at_out_of_realm_inheritance_law_1 }
            set_protected_inheritance = no
        }
    }
 
    # Restricted inheritance (restricted inheritance & -20 opinion)
    expd_at_out_of_realm_inheritance_law_1 = {
        group = expd_at_out_of_realm_inheritance_laws
        default = no
        potential = {
            expd_at_this_title_should_have_tribal_laws = yes
            expd_at_this_title_should_have_crown_laws = yes
        }
        allow = {
            expd_at_this_title_is_a_highly_organised_tribe = yes
        }
        # Audax Validator "." Ignore_NEXT
        revoke_allowed = { always = no }
        # Audax Validator "." Ignore_NEXT
        ai_will_do = { factor = 1 }
        # Audax Validator "." Ignore_NEXT
        ai_will_revoke = { factor = 0 }
        effect = {
            hidden_tooltip = { revoke_law = expd_at_out_of_realm_inheritance_law_0 }
            set_protected_inheritance = yes
        }
        # If you use vassal_opinion here, the opinion modifier applies to everyone everywhere in the world - base game bug?
        city_opinion   = -20
        castle_opinion = -20
        temple_opinion = -20
        tribal_opinion = -20
    }
 
}

Code:
expd_at_this_title_should_have_tribal_laws = {
    has_dlc = "Zeus"
    holder_scope = {
        is_tribal = yes
        is_feudal = no
        is_nomadic = no
        is_republic = no
        is_theocracy = no
    }
}

expd_at_this_title_should_have_crown_laws = {
 
    OR = {
  
        # Empires always get crown laws
        tier = EMPEROR
  
        AND = {
            tier = KING
            OR = {
          
                # This kingdom doesn't belong to a de jure empire
                NOT = { any_de_jure_liege_title = { tier = EMPEROR } }
          
                # This kingdom's de jure liege title has no holder
                any_de_jure_liege_title = {
                    tier = EMPEROR
                    NOT = { holder_scope = { always = yes } }
                }
          
            }
        }
    }
 
}

expd_at_this_title_is_a_highly_organised_tribe = {
    holder_scope = {
        show_scope_change = no
        primary_title = {
            show_scope_change = no
      
            # Must have maximum tribal organization
            has_law = tribal_organization_4
      
            # Must have revoked all council powers
            has_law = law_voting_power_0
            has_law = war_voting_power_0
            has_law = revoke_title_voting_power_0
            has_law = imprison_voting_power_0
            has_law = grant_title_voting_power_0
            has_law = banish_voting_power_0
            has_law = execution_voting_power_0
      
            # Must have religious title revocation. Or, if tolerant, must have normal title revocation.
            trigger_if = {
                limit = { holder_scope = { has_religion_feature = religion_cosmopolitan } }
                has_law = revoke_title_law_1
            }
            trigger_else = {
                has_law = revoke_title_law_2
            }
      
        }
    }
}

Here's something I came across while looking for other unrelated things. Have you tried removing ignores_de_jure_laws = yes from tribal_government in common\governments?.
 
Last edited:
  • 1
Reactions:
Is it possible to mod the map color of existing kingdoms and duchies without replacing the entire landed_titles.txt? I want to slim things down.
 
Is it possible to mod the map color of existing kingdoms and duchies without replacing the entire landed_titles.txt? I want to slim things down.

Sadly no. One of the many poor choices Paradox made with regard to the map. You can try to redefine select titles' colours' in a new landed_titles file, so long as it's loaded after the file they're in. The Validator will end up complaining about it, but it may work.
 
Sadly no. One of the many poor choices Paradox made with regard to the map. You can try to redefine select titles' colours' in a new landed_titles file, so long as it's loaded after the file they're in. The Validator will end up complaining about it, but it may work.
How do I make a file load after another?
 
All depends on filenames. They're loaded lexicographically, so a_landed_titles.txt loads before b_landed_titles.txt.
Does the system register numbers? "1_landed_titles" before "2_landed_titles", something like that.
 
Does the system register numbers? "1_landed_titles" before "2_landed_titles", something like that.
Yes, absolutely, and I usually call mine 00_whatever.txt to make sure they load first. There are some circumstances where you want your stuff loaded first, and others where you want it loaded last, though. The wiki has a partial guide to this behaviour.

nd
 
Yes, absolutely, and I usually call mine 00_whatever.txt to make sure they load first. There are some circumstances where you want your stuff loaded first, and others where you want it loaded last, though. The wiki has a partial guide to this behaviour.

nd
Time to experiment how numbered and unnumbered files interact for me. I'd prefer not to edit vanilla file names, but I don't know what happens when the game sees a "landed_titles_2.txt" in the mod folder.
 
I've noticed an issue where (non-dynastic, at least) claimants to titles held by Chinese Imperial rulers can't seem to press their own claims while being able to press those of the ruler's dynasty members.

Faction definition (derived from CleanSlate) in the spoiler below. The vassal (I've tested with several, but it's valid for all) is not on the council, does not have an NAP with their liege, is male, is de jure, pass the Chinese triggers, and neither side passes the Japanese/Tenno triggers.

Code:
faction_claimant = {
    type = liege_titles_w_claimant # 'new_character' is a Claimant, or, if the title is Elective, anyone eligible for election
    exclusive = yes # Can only lead or be in one faction of this type

    warning_level = 0.70

    # Plotter scope
    potential = {
        is_landed = yes
        higher_real_tier_than = BARON
        is_adult = yes
        independent = no
        prisoner = no
        is_incapable = no # Works fine here
        holy_order = no

        NOR = {
            has_character_modifier = faction_claimant_timer

            has_opinion_modifier = {
                modifier = opinion_coerced_into_leaving_faction
                who = LIEGE
            }

            has_opinion_modifier = {
                modifier = opinion_intimidated_out_of_factions
                who = LIEGE
            }
            
            trait = treasure_fleet_preparation
            trait = treasure_fleet_voyage
            trait = penglai_expedition_preparation
            trait = on_penglai_expedition
            trait = in_mourning
        }

        liege = {
            is_vice_royalty = no

            OR = {
                is_feudal = yes
                is_tribal = yes
                is_nomadic = yes
            }

            ## Hordes should have less problems with this type of faction until ca 1350
            #trigger_if = {
            #    limit = { has_horde_culture = yes }
            #
            #    NAND = {
            #        year < 1350
            #        culture = ROOT
            #        religion = ROOT
            #    }
            #}
            
            trigger_if = {
                limit = {
                    has_landed_title = e_mongol_empire
                    culture = mongol
                }
                
                NAND = {
                    religion = ROOT
                    culture = ROOT
                    year < 1350
                }
            }
            
            trigger_else_if = {
                limit = {
                    has_landed_title = e_aztec_empire
                    culture = nahua
                }
                
                NAND = {
                    religion = ROOT
                    culture = ROOT
                    year < 1350
                }
            }
            
            trigger_else_if = {
                limit = {
                    has_landed_title = e_inca_empire
                    culture = quechua
                }
                
                NAND = {
                    religion = ROOT
                    culture = ROOT
                    year < 1350
                }
            }

            NOT = {
                any_demesne_title = {
                    temporary = yes
                }
            }
        }

        trigger_if = {
            limit = { has_dlc = "Conclave" }

            OR = {
                is_voter = no
                is_nomadic = yes
                is_tribal = yes

                liege = {
                    OR = {
                        is_council_content = no
                        NOT = { has_law = war_voting_power_1 }
                        
                        has_character_modifier = mandate_of_heaven_2
                        has_character_modifier = mandate_of_heaven_1
                        
                        AND = {
                            has_religion_feature = religion_feature_ryukyuan_three_mountains
                            ROOT = {
                                has_religion_feature = religion_feature_ryukyuan_three_mountains
                            }
                        }
                        
                        AND = {
                            has_law = grand_chancellor_law_2
                            ROOT = {
                                has_minor_title = title_grand_chancellor
                            }
                        }
                    }
                }
            }
        }
        
        trigger_else_if = {
            limit = {
                # If affected by a Crown Law title not held by my liege
                crownlaw_title = {
                    holder_scope = {
                        NOT = { is_liege_of = ROOT }
                    }
                }
            }

            crownlaw_title = {
                # The Crown Law title allows vassal infighting
                NOR = {
                    has_law = crown_authority_2
                    has_law = crown_authority_3
                    has_law = crown_authority_4
                }
            }
        }

        trigger_if = {
            limit = {
                liege = {
                    is_nomadic = yes
                }
            }

            character = new_character # Claimant
            has_dlc = "Horse Lords"
            is_nomadic = yes
            NOT = { has_blood_oath_with = liege }
        }

        NAND = { # Not against the Tenno if you care!
            ROOT = {
                can_have_japanese_bureaucracy_and_feudal_trigger = yes
                liege = {
                    is_the_tenno_trigger = yes
                }
            }
            liege = {
                tier = PREV
            }
        }
        
        NAND = { # Not against the Ryukyuan knockoff if you care!
            ROOT = {
                can_have_japanese_bureaucracy_and_feudal_trigger = yes
                liege = {
                    is_ryukyuan_tenno_trigger = yes
                }
            }
            liege = {
                tier = PREV
            }
        }
    }

    # Target scope
    # ROOT is target title
    # FROM is faction creator
    allow = {
        ROOT = {
            OR = {
                # Don't faction for titles you don't care about!
                AND = {
                    holder_scope = {
                        NOT = {
                            de_jure_vassal_or_below = FROM
                        }
                    }
                    is_primary_holder_title = yes
                }
                AND = {
                    is_primary_holder_title_tier = yes # Changed from is_primary_holder_title, since secondary titles might matter
                    de_jure_vassal_or_below = FROM
                }
                higher_real_tier_than = DUKE
                new_character = {
                    character = FROM
                }
            }

            OR = {
                claimed_by = new_character

                trigger_if = {
                    limit = {
                        OR = {
                            has_law = succ_feudal_elective
                            has_law = succ_hre_elective
                        }
                    }

                    any_elector_character = {
                        character = new_character
                    }
                }
            }
        }

        new_character = {
            OR = {
                same_realm = FROM

                FROM = {
                    liege = { independent = yes }
                }
            }

            trigger_if = {
                limit = { is_female = no }

                NOR = {
                    FROM = {
                        OR = {
                            has_religion_feature = religion_matriarchal
                            has_religion_feature = religion_feature_minangkabau
                        }
                    }

                    ROOT = {
                        succ_law_title = {
                            has_law = enatic_succession
                        }
                    }
                }
            }
            trigger_else = {
                NOR = {
                    FROM = {
                        OR = {
                            has_religion_feature = religion_patriarchal
                            has_religion_feature = religion_feature_batak
                            has_religion_feature = religion_feature_yi
                            AND = {
                                religion = confucian
                                gender_equality_trigger = no
                                religions_are_standard_trigger = yes
                            }
                        }
                    }
                    
                    ROOT = {
                        succ_law_title = {
                            has_law = agnatic_succession
                        }
                    }
                }
            }

            NOR = {
                has_landed_title = PREV
                is_liege_or_above_of = FROM
                has_landed_title = k_papacy
                has_landed_title = d_fraticelli
            }

            # The Pope, static mercs and holy orders shouldn't get titles at or above their tier
            trigger_if = {
                limit = {
                    is_ruler = yes

                    primary_title = {
                        is_primary_type_title = yes
                    }
                }

                lower_real_tier_than = ROOT
            }

            # Claimant isn't already fighting for claim on this title
            ROOT = {
                holder_scope = {
                    NOT = {
                        defending_against_claimant = {
                            character = PREVPREV
                            title = ROOT
                        }
                    }
                }
            }
            
            # The Tenno is safe from regular claims...
            trigger_if = {
                limit = {
                    ROOT = {
                        holder_scope = {
                            is_the_tenno_trigger = yes
                        }
                    }
                }
                
                OR = {
                    ROOT = { # ... unless it's just a kingdom...
                        tier = king
                        holder_scope = {
                            real_tier = emperor
                            NOT = {
                                dynasty = PREVPREV
                            }
                        }
                    }
                    FROM = { # ... or we don't care...
                        could_have_japanese_government_trigger = no
                    }
                    FROM = { # ... or we're the knockoff
                        character = PREV
                        is_ryukyuan_tenno_trigger = yes
                    }
                }
            }
            
            # The Ryukyuan knockoff is safe from regular claims...
            trigger_else_if = {
                limit = {
                    ROOT = {
                        holder_scope = {
                            is_ryukyuan_tenno_trigger = yes
                        }
                    }
                }
                
                OR = {
                    ROOT = { # ... unless it's a lower title
                        holder_scope = {
                            real_tier = emperor
                        }
                        tier = king
                    }
                    any_owned_bloodline = { # or it's a bloodline member...
                        has_bloodline_flag = divine_ancestry_bloodline_ryukyuan
                    }
                    FROM = { # ... or we don't care...
                        could_have_japanese_government_trigger = no
                    }
                    FROM = { # ... or we're the Tenno
                        character = PREV
                        is_the_tenno_trigger = yes
                    }
                }
            }
            
            # The Shogun shouldn't face claimant factions for the Tenno's claim
            trigger_else_if = {
                limit = {
                    ROOT = {
                        holder_scope = {
                            has_japanese_government_trigger = yes
                        }
                        tier = emperor
                    }
                }
                
                is_the_tenno_trigger = no
                
                NOT = {
                    any_dynasty_member = {
                        is_the_tenno_trigger = yes
                    }
                }
            }
            
            # Avoid putting women on the throne of China/etc. under normal conditions
            trigger_else_if = {
                limit = {
                    is_female = yes
                    ROOT = {
                        holder_scope = {
                            government = chinese_imperial_government
                            is_female = no
                            has_law = agnatic_succession
                        }
                        tier = emperor
                    }
                }
                
                FROM = {
                    OR = {
                        is_female = yes
                        AND = {
                            could_have_chinese_government_trigger = no
                            OR = {
                                could_have_japanese_government_trigger = no
                                has_religion_feature = religion_equal
                                has_religion_feature = religion_matriarchal
                            }
                        }
                    }
                }
            }
        }
    }

    # Faction member scope
    # ROOT is joiner
    # FROM is target
    allow_join = {
        ROOT = {
            is_landed = yes
            is_adult = yes
            independent = no
            prisoner = no
            is_incapable = no # Works fine here

            trigger_if = {
                limit = { has_dlc = "Conclave" }

                OR = {
                    is_voter = no
                    is_nomadic = yes
                    is_tribal = yes

                    liege = {
                        OR = {
                            is_council_content = no
                            NOT = { has_law = war_voting_power_1 }
                            
                            has_character_modifier = mandate_of_heaven_2
                            has_character_modifier = mandate_of_heaven_1
                            
                            AND = {
                                has_religion_feature = religion_feature_ryukyuan_three_mountains
                                ROOT = {
                                    has_religion_feature = religion_feature_ryukyuan_three_mountains
                                }
                            }
                            
                            AND = {
                                has_law = grand_chancellor_law_2
                                ROOT = {
                                    has_minor_title = title_grand_chancellor
                                }
                            }
                        }
                    }
                }
            }

            # Can't join factions when in blood oath with liege
            trigger_if = {
                limit = { is_nomadic = yes }
                NOT = { has_blood_oath_with = liege }
            }

            NOR = {
                has_character_modifier = faction_claimant_timer

                has_opinion_modifier = {
                    modifier = opinion_coerced_into_leaving_faction
                    who = LIEGE
                }

                has_opinion_modifier = {
                    modifier = opinion_intimidated_out_of_factions
                    who = LIEGE
                }
            
                trait = treasure_fleet_preparation
                trait = treasure_fleet_voyage
                trait = penglai_expedition_preparation
                trait = on_penglai_expedition
                trait = in_mourning
            }
        }
        
        # Protect the Tenno from stupid factions
        trigger_if = {
            limit = {
                liege = {
                    is_the_tenno_trigger = yes
                }
            }
            
            OR = { # We either don't care or it's irrelevant
                could_have_japanese_government_trigger = no
                AND = {
                    liege = {
                        real_tier = emperor
                    }
                    FROM = {
                        tier = king
                    }
                }
                AND = {
                    new_character = {
                        character = ROOT
                    }
                    is_ryukyuan_tenno_trigger = yes
                }
            }
        }
        
        # Protect the knockoff from stupid factions
        trigger_else_if = {
            limit = {
                liege = {
                    is_ryukyuan_tenno_trigger = yes
                }
            }
            
            OR = { # We either don't care or it's irrelevant
                could_have_japanese_government_trigger = no
                AND = {
                    liege = {
                        real_tier = emperor
                    }
                    FROM = {
                        tier = king
                    }
                }
                AND = {
                    new_character = {
                        character = ROOT
                    }
                    is_the_tenno_trigger = yes
                }
                new_character = {
                    any_owned_bloodline = {
                        has_bloodline_flag = divine_ancestry_bloodline_ryukyuan
                    }
                }
            }
        }
    }

    # AI creation weight
    # FROM is faction creator
    # ROOT is title scope
    chance = {
        factor = 1

        trigger = {
            FROM = {
                in_seclusion = no
                preparing_invasion = no
                NOT = { is_married = liege }

                # If I have a claim, don't support anyone else
                trigger_if = {
                    limit = { has_claim = ROOT }
                    character = new_character
                }

                # To keep leading the faction
                trigger_if = {
                    limit = { leads_faction = faction_claimant }

                    opinion = {
                        who = LIEGE
                        value < 50
                    }
                }
                # To start the faction
                trigger_else = {
                    opinion = {
                        who = LIEGE
                        value < 25
                    }
                }

                # Religious dogma check
                trigger_if = {
                    limit = {
                        OR = {
                            has_religion_feature = religion_patriarchal
                            has_religion_feature = religion_feature_batak
                            has_religion_feature = religion_feature_yi
                            AND = {
                                religion = confucian
                                gender_equality_trigger = no
                                religions_are_standard_trigger = yes
                            }
                        }
                    }
                    new_character = { is_female = no }
                }
                trigger_else_if = {
                    limit = {
                        OR = {
                            has_religion_feature = religion_matriarchal
                            has_religion_feature = religion_feature_minangkabau
                        }
                    }
                    new_character = { is_female = yes }
                }

                # If there is an antiking faction, prioritize that
                trigger_if = {
                    limit = {
                        OR = {
                            religion = catholic
                            religion = fraticelli
                        }

                        top_liege = {
                            is_liege_of = FROM
                            religion = FROM

                            # Has an antipope
                            rightful_religious_head_scope = {
                                is_antipope = yes
                            }
                        }
                    }

                    liege = {
                        NOT = {
                            faction_exists = {
                                faction = faction_antiking
                                title = ROOT
                            }
                        }
                    }
                }
            }

            # Only support claimants of my culture (for both the conquered and the conquerors)
            trigger_if = {
                limit = { is_conquered = yes }
                new_character = { culture = FROM }
            }

            holder_scope = {
                # None of my liege's primary tier titles are my de jure liege title
                NOT = {
                    any_demesne_title = {
                        is_primary_holder_title_tier = yes
                        de_jure_vassal_or_below = FROM
                    }
                }
            }

            new_character = {
                religion = FROM
                culture_group = FROM
                is_incapable = no # Works fine here

                NOR = {
                    trait = blinded
                    trait = eunuch
                    trait = imbecile
                    trait = inbred
                }

                # Will not install old women
                trigger_if = {
                    limit = { is_female = yes }
                    age < 40
                }

                # If I'm not the claimant, opinion of the claimant matters
                trigger_if = {
                    limit = {
                        NOT = { character = FROM }
                    }

                    FROM = {
                        # To keep leading the faction
                        trigger_if = {
                            limit = { leads_faction = faction_claimant }

                            opinion_diff = {
                                first = PREV
                                second = liege
                                value >= -25
                                as_if_liege = yes
                            }
                        }
                        # To start the faction
                        trigger_else = {
                            opinion_diff = {
                                first = PREV
                                second = liege
                                value >= 5 # I like the Claimant more than the current ruler
                                as_if_liege = yes
                            }
                        }
                    }
                }

                # Will not install a parent or child of the current ruler
                FROM = {
                    liege = {
                        NOR = {
                            is_child_of = PREVPREV
                            is_parent_of = PREVPREV
                        }
                    }
                }
            }

            # Title does NOT have Elective and I'm the current heir
            trigger_if = {
                limit = {
                    NOR = {
                        has_law = succ_feudal_elective
                        has_law = succ_hre_elective
                    }
                }

                current_heir = {
                    NOT = { character = FROM }
                }

                # Vanilla original, without negation
            #    current_heir = {
            #        OR = {
            #            character = FROM
            #            ROOT = {
            #                new_character = {
            #                    character = PREVPREV
            #                }
            #            }
            #        }
            #    }
            }

            # Under elective law, only faction for self for these reasons
            trigger_else = {
                new_character = {
                    character = FROM

                    OR = {
                        trait = ambitious
                        trait = deceitful
                        trait = proud
                        has_strong_claim = PREV
                    }
                }
            }

            # Only push dynasty claimants if liege is my dynasty
            trigger_if = {
                limit = {
                    holder_scope = {
                        dynasty = FROM
                        religion = FROM
                        culture = FROM
                    }
                }

                new_character = {
                    dynasty = FROM
                }
            }
            
            trigger_if = {
                limit = {
                    holder_scope = {
                        OR = {
                            is_the_tenno_trigger = yes
                            is_ryukyuan_tenno_trigger = yes
                        }
                    }
                }
                
                OR = {
                    new_character = {
                        character = FROM
                    }
                    
                    AND = {
                        new_character = {
                            has_japanese_government_trigger = yes
                        }
                        ROOT = {
                            holder_scope = {
                                has_japanese_government_trigger = no
                            }
                            NOT = {
                                claimed_by = FROM
                            }
                        }
                    }
                }
            }
        }

        # mult_modifier = {
        #    factor = 0
        #    NOT = { has_law = succ_feudal_elective }
        #    holder_scope = {
        #        culture_group = FROM
        #        religion = FROM
        #
        #        any_war = {
        #            war_title = ROOT
        #            defender = { character = THIS }
        #            attacker = {
        #                OR = {
        #                    NOT = { culture_group = FROM }
        #                    NOT = { religion = FROM }
        #                }
        #            }
        #        }
        #    }
        # }

        mult_modifier = {
            factor = 0.1

            # If we are subjugated, tend to unite behind one single claimant
            is_conquered = yes
            NOT = { conquest_culture = FROM }

            holder_scope = {
                faction_exists = {
                    faction = faction_claimant
                    title = ROOT
                }
            }

            new_character = {
                culture = FROM

                FROM = {
                    opinion_diff = {
                        first = PREV
                        second = liege
                        value >= 10 # I like the Claimant more than the current ruler
                        as_if_liege = yes
                    }
                }
            }
        }

        mult_modifier = {
            factor = 0.5

            holder_scope = {
                any_owned_bloodline = {
                    has_bloodline_flag = bloodline_less_factions
                    bloodline_is_active_for = PREV
                }
            }
        }

        mult_modifier = {
            factor = 0.2
            FROM = { pacifist = yes }
        }

        # Or if vassal is under the yoke of the wrong kind of liege.
        mult_modifier = {
            factor = 3

            FROM = {
                OR = {
                    has_religion_feature = religion_patriarchal
                    has_religion_feature = religion_feature_batak
                    has_religion_feature = religion_feature_yi
                    AND = {
                        religion = confucian
                        gender_equality_trigger = no
                        religions_are_standard_trigger = yes
                    }
                }
                is_female = yes
            }

            new_character = {
                is_female = no
            }
        }

        mult_modifier = {
            factor = 3

            FROM = {
                OR = {
                    has_religion_feature = religion_matriarchal
                    has_religion_feature = religion_feature_minangkabau
                }
                is_female = no
            }

            new_character = {
                is_female = yes
            }
        }

        mult_modifier = {
            factor = 0.7

            new_character = {
                is_female = yes
                NOT = { character = FROM }
            }

            trigger_if = {
                limit = { has_dlc = "Conclave" }

                NOR = {
                    FROM = {
                        OR = {
                            has_religion_feature = religion_matriarchal
                            has_religion_feature = religion_equal
                            has_religion_feature = religion_feature_bon
                            has_religion_feature = religion_feature_bai
                            has_religion_feature = religion_feature_minahasan
                            has_religion_feature = religion_feature_ryukyuan
                            has_religion_feature = religion_feature_minangkabau
                        }
                    }

                    has_law = status_of_women_4

                    has_game_rule = {
                        name = gender
                        value = all
                    }
                }
            }
        }

        mult_modifier = {
            factor = 0.5
            new_character = { practical_age < 13 }
        }

        mult_modifier = {
            factor = 0.5
            new_character = { practical_age < 10 }
        }

        mult_modifier = {
            factor = 0.5
            new_character = { practical_age < 5 }
        }

        mult_modifier = {
            factor = 1.5

            FROM = {
                opinion = {
                    who = LIEGE
                    value < 0
                }
            }
        }

        mult_modifier = {
            factor = 1.5

            FROM = {
                opinion = {
                    who = LIEGE
                    value < -25
                }
            }
        }

        mult_modifier = {
            factor = 2.0

            FROM = {
                opinion = {
                    who = LIEGE
                    value < -50
                }
            }
        }

        mult_modifier = {
            factor = 4.0

            FROM = {
                opinion = {
                    who = LIEGE
                    value < -75
                }
            }
        }

        mult_modifier = {
            factor = 3.0

            new_character = {
                character = FROM
            }
        }

        mult_modifier = {
            factor = 1.5

            new_character = {
                dynasty = FROM
            }
        }

        mult_modifier = {
            factor = 0.5

            title = e_byzantium
            FROM = { culture_group = byzantine }

            new_character = {
                NOT = { trait = born_in_the_purple }
            }
        }

        mult_modifier = {
            factor = 2.0

            title = e_byzantium
            FROM = { culture_group = byzantine }

            new_character = {
                trait = born_in_the_purple
            }
        }

        mult_modifier = {
            factor = 0.5

            title = e_byzantium
            FROM = { culture_group = byzantine }

            holder_scope = {
                trait = born_in_the_purple
            }
        }

        mult_modifier = {
            factor = 2.0

            title = e_byzantium
            FROM = { culture_group = byzantine }

            holder_scope = {
                NOT = { trait = born_in_the_purple }
            }
        }

        mult_modifier = {
            factor = 2.0

            new_character = {
                trait = sayyid
            }

            holder_scope = {
                NOT = { trait = sayyid }
            }
        }

        mult_modifier = {
            factor = 1.5

            new_character = {
                trait = mirza
            }

            holder_scope = {
                NOR = {
                    trait = sayyid
                    trait = mirza
                }
            }
        }

        mult_modifier = {
            factor = 4.0

            is_conquered = yes
            NOT = { conquest_culture = FROM }
            new_character = { culture = FROM }
        }

        mult_modifier = {
            factor = 2.0

            holder_scope = {
                dynasty_realm_power >= 0.25
            }

            new_character = {
                ROOT = {
                    holder_scope = {
                        NOT = { dynasty = PREVPREV }
                    }
                }
            }
        }

        mult_modifier = {
            factor = 2.0

            holder_scope = {
                dynasty_realm_power >= 0.4
            }

            new_character = {
                ROOT = {
                    holder_scope = {
                        NOT = { dynasty = PREVPREV }
                    }
                }
            }
        }

        mult_modifier = {
            factor = 0.01

            FROM = { trait = content }

            trigger_if = {
                limit = { is_conquered = yes }
                conquest_culture = FROM
            }
        }

        mult_modifier = {
            factor = 0.01
            FROM = { trait = imbecile }
        }

        mult_modifier = {
            factor = 0.1
            FROM = { trait = inbred }
        }

        mult_modifier = {
            factor = 0.1
            FROM = { trait = craven }
        }

        mult_modifier = {
            factor = 0.2
            FROM = { is_dumb_trigger = yes }
        }

        mult_modifier = {
            factor = 1.5
            FROM = { trait = brave }
        }

        mult_modifier = {
            factor = 4.0
            FROM = { trait = ambitious }
        }

        mult_modifier = {
            factor = 5
            FROM = { same_society_as = new_character }
        }

        mult_modifier = {
            factor = 2

            FROM = {
                OR = {
                    has_opinion_modifier = {
                        modifier = opinion_evil_tyrant
                        who = LIEGE
                    }

                    has_opinion_modifier = {
                        modifier = opinion_tyrant
                        who = LIEGE
                    }
                }
            }
        }

        mult_modifier = {
            factor = 2

            FROM = {
                OR = {
                    has_opinion_modifier = {
                        modifier = opinion_evil_tyrant
                        who = LIEGE
                    }

                    has_opinion_modifier = {
                        modifier = opinion_tyrant
                        who = LIEGE
                    }
                }
            
                liege = {
                    government = chinese_imperial_government
                }
            }
        }
        
        mult_modifier = {
            factor = 0.25
            FROM = {
                liege = {
                    has_character_modifier = mandate_of_heaven_4
                    FROM = {
                        can_have_confucian_bureaucracy_and_eastern_imperial_trigger = yes
                        culture_group = PREV
                    }
                }
            }
        }
        
        mult_modifier = {
            factor = 0.1
            FROM = {
                liege = {
                    has_character_modifier = mandate_of_heaven_5
                    FROM = {
                        can_have_confucian_bureaucracy_and_eastern_imperial_trigger = yes
                        culture_group = PREV
                    }
                }
            }
        }
        
        ### Try to keep people from supporting someone that'd switch to a weird government
        # We desire a Japanese government
        mult_modifier = {
            factor = 0.001
            FROM = {
                could_have_japanese_government_trigger = yes
                liege = {
                    has_japanese_government_trigger = yes
                }
            }
            
            new_character = {
                NOT = {
                    dynasty = FROM
                }
                could_have_japanese_government_trigger = no
                could_have_chinese_government_trigger = no
            }
        }
        
        mult_modifier = {
            factor = 0.01
            FROM = {
                could_have_japanese_government_trigger = yes
                liege = {
                    has_japanese_government_trigger = yes
                }
            }
            
            new_character = {
                NOT = {
                    dynasty = FROM
                }
                could_have_japanese_government_trigger = no
                could_have_chinese_government_trigger = yes
            }
        }
        
        # We desire a Chinese government
        mult_modifier = {
            factor = 0.001
            FROM = {
                can_have_chinese_imperial_trigger = yes
                liege = {
                    government = chinese_imperial_government
                }
            }
            
            new_character = {
                NOT = {
                    dynasty = FROM
                }
                could_have_chinese_government_trigger = no
                could_have_japanese_government_trigger = no
            }
        }
        
        mult_modifier = {
            factor = 0.01
            FROM = {
                can_have_chinese_imperial_trigger = yes
                liege = {
                    government = chinese_imperial_government
                }
            }
            
            new_character = {
                NOT = {
                    dynasty = FROM
                }
                can_have_chinese_imperial_trigger = no
                OR = {
                    could_have_chinese_government_trigger = yes
                    could_have_japanese_government_trigger = yes
                }
            }
        }
        
        mult_modifier = {
            factor = 0.01
            FROM = {
                can_have_chinese_imperial_trigger = yes
                liege = {
                    government = chinese_imperial_government
                }
            }
            
            new_character = {
                dynasty = FROM
                could_have_chinese_government_trigger = no
                could_have_japanese_government_trigger = no
            }
        }
        
        mult_modifier = {
            factor = 0.1
            FROM = {
                can_have_chinese_imperial_trigger = yes
                liege = {
                    government = chinese_imperial_government
                }
            }
            
            new_character = {
                dynasty = FROM
                can_have_chinese_imperial_trigger = no
                OR = {
                    could_have_chinese_government_trigger = yes
                    could_have_japanese_government_trigger = yes
                }
            }
        }
        
        mult_modifier = {
            factor = 0.001
            FROM = {
                could_have_chinese_government_trigger = yes
                liege = {
                    has_chinese_government_trigger = yes
                    NOT = {
                        government = chinese_imperial_government
                    }
                }
            }
            
            new_character = {
                NOT = {
                    dynasty = FROM
                }
                could_have_chinese_government_trigger = no
                could_have_japanese_government_trigger = no
            }
        }
        
        mult_modifier = {
            factor = 0.01
            FROM = {
                could_have_chinese_government_trigger = yes
                liege = {
                    has_chinese_government_trigger = yes
                    NOT = {
                        government = chinese_imperial_government
                    }
                }
            }
            
            new_character = {
                NOT = {
                    dynasty = FROM
                }
                could_have_chinese_government_trigger = no
                could_have_japanese_government_trigger = yes
            }
        }
        
        mult_modifier = {
            factor = 0.01
            FROM = {
                could_have_chinese_government_trigger = yes
                liege = {
                    has_chinese_government_trigger = yes
                    NOT = {
                        government = chinese_imperial_government
                    }
                }
            }
            
            new_character = {
                dynasty = FROM
                could_have_chinese_government_trigger = no
                could_have_japanese_government_trigger = no
            }
        }
        
        mult_modifier = {
            factor = 0.1
            FROM = {
                could_have_chinese_government_trigger = yes
                liege = {
                    has_chinese_government_trigger = yes
                    NOT = {
                        government = chinese_imperial_government
                    }
                }
            }
            
            new_character = {
                dynasty = FROM
                could_have_chinese_government_trigger = no
                could_have_japanese_government_trigger = yes
            }
        }
        
        # We desire some other kind of feudalism
        mult_modifier = {
            factor = 0.001
            FROM = {
                could_have_chinese_government_trigger = no
                could_have_japanese_government_trigger = no
                liege = {
                    has_chinese_government_trigger = no
                    has_japanese_government_trigger = no
                }
            }
            
            new_character = {
                NOT = {
                    dynasty = FROM
                }
                OR = {
                    could_have_chinese_government_trigger = yes
                    could_have_japanese_government_trigger = yes
                }
            }
        }
        
        mult_modifier = {
            factor = 0.01
            FROM = {
                could_have_chinese_government_trigger = no
                could_have_japanese_government_trigger = no
                liege = {
                    has_chinese_government_trigger = no
                    has_japanese_government_trigger = no
                }
            }
            
            new_character = {
                dynasty = FROM
                OR = {
                    could_have_chinese_government_trigger = yes
                    could_have_japanese_government_trigger = yes
                }
            }
        }
        
        mult_modifier = {
            factor = 10
            FROM = {
                has_religion_feature = religion_feature_ryukyuan_three_mountains
            }
            
            new_character = {
                character = FROM
            }
        }
        
        mult_modifier = {
            factor = 0.1 # Overthrowing a CI dynasty is better than putting someone from the same dynasty on the throne...
            FROM = {
                liege = {
                    NOT = {
                        dynasty = FROM
                    }
                    
                    new_character = {
                        dynasty = PREV
                    }
                    
                    government = chinese_imperial_government
                    
                    OR = {
                        has_character_modifier = mandate_of_heaven_2
                        has_character_modifier = mandate_of_heaven_1
                    }
                }
            }
        }
        
        mult_modifier = {
            factor = 0.001
            new_character = {
                trait = former_eoc_trait
                NOT = {
                    dynasty = FROM
                }
            }
            
            FROM = {
                could_have_chinese_government_trigger = yes
            }
        }
        
        mult_modifier = {
            factor = 0.25
            
            FROM = {
                liege = {
                    has_character_modifier = hwarang_faction_discouragement
                }
            }
        }
    }

    # AI membership weight
    # ROOT is the prospective member
    # FROM is the faction leader
    # FROMFROM is the target title or character
    membership = {
        factor = 1

        trigger = {
            in_seclusion = no
            preparing_invasion = no

            # The following require spymaster coercion to overrule
            trigger_if = {
                limit = {
                    OR = {
                        opinion = {
                            who = LIEGE
                            value >= 40
                        }

                        # Exclude heretics and obviously bad rulers
                        new_character = {
                            OR = {
                                NOT = { religion = ROOT }
                                # NOT = { culture_group = ROOT }
                                trait = blinded
                                trait = eunuch
                                is_incapable = yes
                                trait = imbecile
                                trait = inbred
                            }
                        }

                        # I'm not the claimant and I like my liege more than the claimant
                        new_character = {
                            NOT = { character = ROOT }

                            ROOT = {
                                # To stay in the faction
                                trigger_if = {
                                    limit = { in_faction = faction_claimant }

                                    opinion_diff = {
                                        first = liege
                                        second = PREV
                                        value >= -25
                                        as_if_liege = yes
                                    }
                                }
                                # To join the faction
                                trigger_else = {
                                    opinion_diff = {
                                        first = liege
                                        second = PREV
                                        value >= 10
                                        as_if_liege = yes
                                    }
                                }
                            }
                        }

                        # I do not join factions if I am the heir, unless I am the claimant
                        trigger_if = {
                            limit = { is_heir = FROMFROM }
                            NOT = { character = new_character }
                        }

                        # If my liege is my dynasty, only push claimants of my dynasty
                        trigger_if = {
                            limit = {
                                liege = { dynasty = PREV }
                                liege = {
                                    religion = FROM
                                    culture = FROM
                                }
                            }

                            new_character = {
                                NOT = { dynasty = FROM }
                            }
                        }

                        # If the title is not my De Jure liege, and my liege holds my De Jure title, don't push claimants
                        FROMFROM = {
                            NOT = { de_jure_vassal_or_below = ROOT }

                            holder_scope = {
                                any_demesne_title = {
                                    is_primary_holder_title_tier = yes
                                    de_jure_vassal_or_below = ROOT
                                    NOT = { title = PREVPREV }
                                }
                            }
                        }

                        # If the title is conquered only push claimants of my exact culture
                        trigger_if = {
                            limit = {
                                FROMFROM = {
                                    is_conquered = yes
                                }
                            }

                            new_character = {
                                NOT = { culture = ROOT }
                            }
                        }

                        # Hordes should have less problems with this type of faction until ca 1350
                        liege = {
                            ## Hordes should have less problems with this type of faction until ca 1350
                            #trigger_if = {
                            #    limit = { has_horde_culture = yes }
                            #
                            #    NAND = {
                            #        year < 1350
                            #        culture = ROOT
                            #        religion = ROOT
                            #    }
                            #}
                            
                            trigger_if = {
                                limit = {
                                    has_landed_title = e_mongol_empire
                                    culture = mongol
                                }
                                
                                NAND = {
                                    religion = ROOT
                                    culture = ROOT
                                    year < 1350
                                }
                            }
                            
                            trigger_else_if = {
                                limit = {
                                    has_landed_title = e_aztec_empire
                                    culture = nahua
                                }
                                
                                NAND = {
                                    religion = ROOT
                                    culture = ROOT
                                    year < 1350
                                }
                            }
                            
                            trigger_else_if = {
                                limit = {
                                    has_landed_title = e_inca_empire
                                    culture = quechua
                                }
                                
                                NAND = {
                                    religion = ROOT
                                    culture = ROOT
                                    year < 1350
                                }
                            }
                    
                            trigger_else = {
                                always = no
                            }
                        }

                        # If there is an antiking faction, prioritize that
                        AND = {
                            OR = {
                                religion = catholic
                                religion = fraticelli
                            }

                            top_liege = {
                                is_liege_of = ROOT
                                religion = ROOT

                                # Has an antipope
                                rightful_religious_head_scope = {
                                    is_antipope = yes
                                }

                                faction_exists = {
                                    faction = faction_antiking
                                    title = FROMFROM
                                }
                            }
                        }
                    }
                }
                
                OR = {
                    has_opinion_modifier = {
                        modifier = opinion_coerced_into_joining_faction
                        who = FROM
                    }
                    
                    has_opinion_modifier = {
                        modifier = opinion_intimidated_into_factions
                        who = FROM
                    }
                }
            }
        }

        mult_modifier = {
            factor = 0.5

            liege = {
                any_owned_bloodline = {
                    has_bloodline_flag = bloodline_less_factions
                    bloodline_is_active_for = PREV
                }
            }
        }

        mult_modifier = {
            factor = 0.2

            pacifist = yes
                
            NOR = {
                has_opinion_modifier = {
                    modifier = opinion_coerced_into_joining_faction
                    who = FROM
                }
                
                has_opinion_modifier = {
                    modifier = opinion_intimidated_into_factions
                    who = FROM
                }
            }
        }

        mult_modifier = { # Lower chance of joining if I myself have a claim on the same title
            factor = 0.1

            has_claim = FROMFROM

            NOR = {
                character = new_character

                has_opinion_modifier = {
                    modifier = opinion_coerced_into_joining_faction
                    who = FROM
                }
                
                has_opinion_modifier = {
                    modifier = opinion_intimidated_into_factions
                    who = FROM
                }
            }
        }

        mult_modifier = {
            factor = 1000

            has_opinion_modifier = {
                modifier = opinion_coerced_into_joining_faction
                who = FROM
            }
        }

        mult_modifier = {
            factor = 1000

            has_opinion_modifier = {
                modifier = opinion_intimidated_into_factions
                who = FROM
            }
        }

        mult_modifier = {
            factor = 3.0
            character = new_character
        }

        mult_modifier = {
            factor = 1.5
            dynasty = new_character
        }

        mult_modifier = {
            factor = 0.7

            new_character = {
                is_female = yes
                NOT = { character = ROOT }
            }

            trigger_if = {
                limit = { has_dlc = "Conclave" }

                NOR = {
                    has_law = status_of_women_4
                    has_religion_feature = religion_equal
                    has_religion_feature = religion_matriarchal
                    has_religion_feature = religion_feature_bon
                    has_religion_feature = religion_feature_bai
                    has_religion_feature = religion_feature_minahasan
                    has_religion_feature = religion_feature_ryukyuan
                    has_religion_feature = religion_feature_minangkabau

                    has_game_rule = {
                        name = gender
                        value = all
                    }
                }
            }
                
            NOR = {
                has_opinion_modifier = {
                    modifier = opinion_coerced_into_joining_faction
                    who = FROM
                }
                
                has_opinion_modifier = {
                    modifier = opinion_intimidated_into_factions
                    who = FROM
                }
            }
        }

        mult_modifier = {
            factor = 0.5
            new_character = { practical_age < 13 }
        }

        mult_modifier = {
            factor = 0.5
            new_character = { practical_age < 10 }
        }

        mult_modifier = {
            factor = 0.5
            new_character = { practical_age < 5 }
        }

        mult_modifier = {
            factor = 0.5

            culture_group = byzantine

            FROMFROM = {
                title = e_byzantium
            }

            new_character = {
                NOT = { trait = born_in_the_purple }
            }
        }

        mult_modifier = {
            factor = 0.5

            culture_group = byzantine

            FROMFROM = {
                title = e_byzantium
            }

            liege = {
                trait = born_in_the_purple
            }
        }

        mult_modifier = {
            factor = 2.0

            culture_group = byzantine

            FROMFROM = {
                title = e_byzantium
            }

            new_character = {
                trait = born_in_the_purple
            }
        }

        mult_modifier = {
            factor = 2.0

            culture_group = byzantine

            FROMFROM = {
                title = e_byzantium
            }

            liege = {
                NOT = { trait = born_in_the_purple }
            }
        }

        mult_modifier = {
            factor = 2.0

            new_character = {
                religion_group = muslim
                trait = sayyid
            }

            liege = {
                religion_group = muslim
                NOT = { trait = sayyid }
            }
        }

        mult_modifier = {
            factor = 1.5

            new_character = {
                religion_group = muslim
                trait = mirza
            }

            liege = {
                religion_group = muslim

                NOR = {
                    trait = sayyid
                    trait = mirza
                }
            }
        }

        mult_modifier = {
            factor = 2.0

            new_character = {
                ROOT = {
                    opinion_diff = {
                        first = PREV
                        second = liege
                        value >= 20
                        as_if_liege = yes
                    }
                }
            }
        }

        mult_modifier = {
            factor = 2.0

            new_character = {
                ROOT = {
                    opinion_diff = {
                        first = PREV
                        second = liege
                        value >= 30
                        as_if_liege = yes
                    }
                }
            }
        }

        mult_modifier = {
            factor = 2.0

            new_character = {
                ROOT = {
                    opinion_diff = {
                        first = PREV
                        second = liege
                        value >= 40
                        as_if_liege = yes
                    }
                }
            }
        }

        mult_modifier = {
            factor = 0.01

            trait = content

            FROMFROM = {
                trigger_if = {
                    limit = { is_conquered = yes }
                    conquest_culture = ROOT
                }
            }
                
            NOR = {
                has_opinion_modifier = {
                    modifier = opinion_coerced_into_joining_faction
                    who = FROM
                }
                
                has_opinion_modifier = {
                    modifier = opinion_intimidated_into_factions
                    who = FROM
                }
            }
        }

        mult_modifier = {
            factor = 2.0

            liege = {
                dynasty_realm_power >= 0.25
            }

            new_character = {
                ROOT = {
                    liege = {
                        NOT = { dynasty = PREVPREV }
                    }
                }
            }
        }

        mult_modifier = {
            factor = 2.0

            liege = {
                dynasty_realm_power >= 0.40
            }

            new_character = {
                ROOT = {
                    liege = {
                        NOT = { dynasty = PREVPREV }
                    }
                }
            }
        }

        mult_modifier = {
            factor = 0.01

            trait = imbecile
                
            NOR = {
                has_opinion_modifier = {
                    modifier = opinion_coerced_into_joining_faction
                    who = FROM
                }
                
                has_opinion_modifier = {
                    modifier = opinion_intimidated_into_factions
                    who = FROM
                }
            }
        }

        mult_modifier = {
            factor = 0.1

            trait = inbred
                
            NOR = {
                has_opinion_modifier = {
                    modifier = opinion_coerced_into_joining_faction
                    who = FROM
                }
                
                has_opinion_modifier = {
                    modifier = opinion_intimidated_into_factions
                    who = FROM
                }
            }
        }

        mult_modifier = {
            factor = 0.1

            trait = craven
                
            NOR = {
                has_opinion_modifier = {
                    modifier = opinion_coerced_into_joining_faction
                    who = FROM
                }
                
                has_opinion_modifier = {
                    modifier = opinion_intimidated_into_factions
                    who = FROM
                }
            }
        }

        mult_modifier = {
            factor = 0.2

            is_dumb_trigger = yes
                
            NOR = {
                has_opinion_modifier = {
                    modifier = opinion_coerced_into_joining_faction
                    who = FROM
                }
                
                has_opinion_modifier = {
                    modifier = opinion_intimidated_into_factions
                    who = FROM
                }
            }
        }

        mult_modifier = {
            factor = 1.5
            trait = proud
        }

        mult_modifier = {
            factor = 1.5
            trait = brave
        }

        mult_modifier = {
            factor = 1.5
            trait = arbitrary
        }

        mult_modifier = {
            factor = 2.0
            trait = envious
        }

        mult_modifier = {
            factor = 2.0
            trait = greedy
        }

        mult_modifier = {
            factor = 2.0
            trait = impaler
        }

        mult_modifier = {
            factor = 2.0
            trait = deceitful
        }

        mult_modifier = {
            factor = 4.0
            trait = ambitious
        }

        mult_modifier = {
            factor = 5
            new_character = { same_society_as = PREV }
        }

        mult_modifier = {
            factor = 1.5

            opinion = {
                who = LIEGE
                value < 0
            }
        }

        mult_modifier = {
            factor = 1.5

            opinion = {
                who = LIEGE
                value < -25
            }
        }

        mult_modifier = {
            factor = 2.0

            opinion = {
                who = LIEGE
                value < -50
            }
        }

        mult_modifier = {
            factor = 4.0

            opinion = {
                who = LIEGE
                value < -75
            }
        }

        mult_modifier = {
            factor = 2

            OR = {
                has_opinion_modifier = {
                    modifier = opinion_evil_tyrant
                    who = LIEGE
                }

                has_opinion_modifier = {
                    modifier = opinion_tyrant
                    who = LIEGE
                }
            }
        }

        mult_modifier = {
            factor = 2
            OR = {
                has_opinion_modifier = {
                    modifier = opinion_evil_tyrant
                    who = LIEGE
                }

                has_opinion_modifier = {
                    modifier = opinion_tyrant
                    who = LIEGE
                }
            }
        
            liege = {
                government = chinese_imperial_government
            }
        }
        
        mult_modifier = {
            factor = 0.25
            liege = {
                has_character_modifier = mandate_of_heaven_4
                ROOT = {
                    can_have_confucian_bureaucracy_and_eastern_imperial_trigger = yes
                    culture_group = PREV
                }
            }
        }
        
        mult_modifier = {
            factor = 0.1
            liege = {
                has_character_modifier = mandate_of_heaven_5
                ROOT = {
                    can_have_confucian_bureaucracy_and_eastern_imperial_trigger = yes
                    culture_group = PREV
                }
            }
        }
        
        ### Try to keep people from supporting someone that'd switch to a weird government
        # We desire a Japanese government
        mult_modifier = {
            factor = 0.001
            ROOT = {
                could_have_japanese_government_trigger = yes
                liege = {
                    has_japanese_government_trigger = yes
                }
            }
            
            new_character = {
                NOT = {
                    dynasty = ROOT
                }
                could_have_japanese_government_trigger = no
                could_have_chinese_government_trigger = no
            }
        }
        
        mult_modifier = {
            factor = 0.01
            ROOT = {
                could_have_japanese_government_trigger = yes
                liege = {
                    has_japanese_government_trigger = yes
                }
            }
            
            new_character = {
                NOT = {
                    dynasty = ROOT
                }
                could_have_japanese_government_trigger = no
                could_have_chinese_government_trigger = yes
            }
        }
        
        # We desire a Chinese government
        mult_modifier = {
            factor = 0.001
            ROOT = {
                can_have_chinese_imperial_trigger = yes
                liege = {
                    government = chinese_imperial_government
                }
            }
            
            new_character = {
                NOT = {
                    dynasty = ROOT
                }
                could_have_chinese_government_trigger = no
                could_have_japanese_government_trigger = no
            }
        }
        
        mult_modifier = {
            factor = 0.01
            ROOT = {
                can_have_chinese_imperial_trigger = yes
                liege = {
                    government = chinese_imperial_government
                }
            }
            
            new_character = {
                NOT = {
                    dynasty = ROOT
                }
                can_have_chinese_imperial_trigger = no
                OR = {
                    could_have_chinese_government_trigger = yes
                    could_have_japanese_government_trigger = yes
                }
            }
        }
        
        mult_modifier = {
            factor = 0.01
            ROOT = {
                can_have_chinese_imperial_trigger = yes
                liege = {
                    government = chinese_imperial_government
                }
            }
            
            new_character = {
                dynasty = ROOT
                could_have_chinese_government_trigger = no
                could_have_japanese_government_trigger = no
            }
        }
        
        mult_modifier = {
            factor = 0.1
            ROOT = {
                can_have_chinese_imperial_trigger = yes
                liege = {
                    government = chinese_imperial_government
                }
            }
            
            new_character = {
                dynasty = ROOT
                can_have_chinese_imperial_trigger = no
                OR = {
                    could_have_chinese_government_trigger = yes
                    could_have_japanese_government_trigger = yes
                }
            }
        }
        
        mult_modifier = {
            factor = 0.001
            ROOT = {
                could_have_chinese_government_trigger = yes
                liege = {
                    has_chinese_government_trigger = yes
                    NOT = {
                        government = chinese_imperial_government
                    }
                }
            }
            
            new_character = {
                NOT = {
                    dynasty = ROOT
                }
                could_have_chinese_government_trigger = no
                could_have_japanese_government_trigger = no
            }
        }
        
        mult_modifier = {
            factor = 0.01
            ROOT = {
                could_have_chinese_government_trigger = yes
                liege = {
                    has_chinese_government_trigger = yes
                    NOT = {
                        government = chinese_imperial_government
                    }
                }
            }
            
            new_character = {
                NOT = {
                    dynasty = ROOT
                }
                could_have_chinese_government_trigger = no
                could_have_japanese_government_trigger = yes
            }
        }
        
        mult_modifier = {
            factor = 0.01
            ROOT = {
                could_have_chinese_government_trigger = yes
                liege = {
                    has_chinese_government_trigger = yes
                    NOT = {
                        government = chinese_imperial_government
                    }
                }
            }
            
            new_character = {
                dynasty = ROOT
                could_have_chinese_government_trigger = no
                could_have_japanese_government_trigger = no
            }
        }
        
        mult_modifier = {
            factor = 0.1
            ROOT = {
                could_have_chinese_government_trigger = yes
                liege = {
                    has_chinese_government_trigger = yes
                    NOT = {
                        government = chinese_imperial_government
                    }
                }
            }
            
            new_character = {
                dynasty = ROOT
                could_have_chinese_government_trigger = no
                could_have_japanese_government_trigger = yes
            }
        }
        
        # We desire some other kind of feudalism
        mult_modifier = {
            factor = 0.001
            ROOT = {
                could_have_chinese_government_trigger = no
                could_have_japanese_government_trigger = no
                liege = {
                    has_chinese_government_trigger = no
                    has_japanese_government_trigger = no
                }
            }
            
            new_character = {
                NOT = {
                    dynasty = ROOT
                }
                OR = {
                    could_have_chinese_government_trigger = yes
                    could_have_japanese_government_trigger = yes
                }
            }
        }
        
        mult_modifier = {
            factor = 0.01
            ROOT = {
                could_have_chinese_government_trigger = no
                could_have_japanese_government_trigger = no
                liege = {
                    has_chinese_government_trigger = no
                    has_japanese_government_trigger = no
                }
            }
            
            new_character = {
                dynasty = ROOT
                OR = {
                    could_have_chinese_government_trigger = yes
                    could_have_japanese_government_trigger = yes
                }
            }
        }
        
        mult_modifier = {
            factor = 10
            ROOT = {
                has_religion_feature = religion_feature_ryukyuan_three_mountains
            }
            
            new_character = {
                character = ROOT
            }
        }
        
        mult_modifier = {
            factor = 0.1 # Overthrowing a CI dynasty is better than putting someone from the same dynasty on the throne...
            liege = {
                NOT = {
                    dynasty = ROOT
                }
                
                new_character = {
                    dynasty = PREV
                }
                
                government = chinese_imperial_government
                
                OR = {
                    has_character_modifier = mandate_of_heaven_2
                    has_character_modifier = mandate_of_heaven_1
                }
            }
        }
        
        mult_modifier = {
            factor = 0.001
            new_character = {
                trait = former_eoc_trait
                NOT = {
                    dynasty = ROOT
                }
            }
            
            ROOT = {
                could_have_chinese_government_trigger = yes
            }
        }
        
        mult_modifier = {
            factor = 0.25
            
            ROOT = {
                liege = {
                    has_character_modifier = hwarang_faction_discouragement
                }
            }
        }
    }

    success = {
        always = no
    }

    abort = {
        always = no    # Factions will abort if the Potential or Allow trigger is no longer valid
    }
}

The faction seems to work as it should elsewhere in the world (tested with William the Conqueror against k_france, an ERE vassal against the ERE).

Moving the potential and allow blocks to a decision (and restructuring things to get proper scopes and removing some superfluous things) shows the decision as available, and the Validator is not complaining about anything, so I'm having a hard time figuring out what's causing the issue. Any help would be appreciated.
 
I've noticed an issue where (non-dynastic, at least) claimants to titles held by Chinese Imperial rulers can't seem to press their own claims while being able to press those of the ruler's dynasty members.

Faction definition (derived from CleanSlate) in the spoiler below. The vassal (I've tested with several, but it's valid for all) is not on the council, does not have an NAP with their liege, is male, is de jure, pass the Chinese triggers, and neither side passes the Japanese/Tenno triggers.

The faction seems to work as it should elsewhere in the world (tested with William the Conqueror against k_france, an ERE vassal against the ERE).

Moving the potential and allow blocks to a decision (and restructuring things to get proper scopes and removing some superfluous things) shows the decision as available, and the Validator is not complaining about anything, so I'm having a hard time figuring out what's causing the issue. Any help would be appreciated.

What I tend to do in these situations is comment out blocks of script until it does start working, and from there narrow down the issue(s).
 
What I tend to do in these situations is comment out blocks of script until it does start working, and from there narrow down the issue(s).

That's something I'll attempt (alternatively reverting it to base CleanSlate and slowly adding things back to see when it breaks); I just figured a second set of eyes might spot something obvious I've missed since code blindness happens.