• 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.
I'm having a couple of problems modding the EU4 converter.

First, this is my .mod file:
Code:
name = "After the End - EU4 Converter"
path = "mod/After the End - EU4 Converter"

replace_path = "eu4_converter/sunset_invasion/"
replace_path = "eu4_converter/common/cultures/"
As you can see, I have a couple of replace_paths, but they aren't working. Vanilla files which I've removed from the relevant folders still end up in the converter output. For culture this isn't a big deal, since I can just add blank copies of those files to overwrite them, but doing so with Sunset Invasion will interfere with plans I have to use native American tags. Is this a problem I can fix or is it something deeper?

The second problem is with government_table.csv. It seems to work fine with the government flavors used in the vanilla converter, and with specific titles, but when I add new flavors (even those which are in Vanilla) they get ignored. For example, I added this line:

gov_republic;merchant_republic;1;

yet inland republics still convert as Feudal Monarchies.
 
This is the code that worked for me:

Code:
    spriteType = {
        name = "GFX_society_main_background_secret_religious_society_inconnu"
        texturefile = "gfx\\interface\\societies\\society_bg_inconnu.dds"
    }

unknown.png



Thanks, I'll try "GFX_society_main_background_secret_society_secret_religious_society_inconnu" for the religion "inconnu" for when it is a secret religion with a secret religious society. The secret religious societies are now generated spontaneously, rather than being explicitly listed in the text files.
 
I have been struggling with a CTD in my custom AGOT build that I can't seem to resolve. After the game assigns region names, the game always CTDs with my mods at bounding box set up. What are bounding boxes, and how can I fix this? This is making me lose my mind. I've dumped hours into hunting down this stupid bug with no success.
 
Does anyone know why the following error is caused by the CB?
Code:
[triggerimplementation.cpp:5301]: Script Assert! assert: "pLandedTitle->IsValid()", type: "any_direct_de_jure_vassal_title", location: " file: common/cb_types/00_cb_types.txt line: 3166"

The CB
Code:
religious = {
    name = CB_NAME_RELIGIOUS
    war_name = WAR_NAME_RELIGIOUS
    sprite = 9
    truce_days = 3650
    is_permanent = yes
    is_holy_war = yes
    check_de_jure_tier = DUKE # this scans all dejure duchies for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes

    allowed_to_target_tributaries = no
    allowed_to_target_suzerains = no
   
    prestige_cost = 500

    can_use = {
        ROOT = {
            is_nomadic = no
            NOT = { pacifist = yes }
            NOT = { same_realm = FROM }
            OR = {
                NOT = { religion_group = FROM }
                is_heresy_of = FROM
                is_parent_religion = FROM
            }
            top_liege = {
                religion_group = ROOT
                NOT = { religion = FROM }
                OR = {
                    religion = ROOT
                    AND = {
                        is_heretic = no
                        ROOT = { is_heretic = no }
                    }
                }
            }
            mercenary = no
            NOT = {
                has_character_flag = soul_sold #Use Soul Harvest instead
            }
            OR = {
                NOT = { trait = mane }
                trait = powerful_mane
            }
        }
    }
   
    can_use_gui = {
        ROOT = {
            independent = yes
            prestige = 1000
            piety = 500   
            trait = zealous
           
            NOT = { trait = excommunicated }
        }
    }
   
    can_use_title = {
        # The attacker needs at least one county in the target kingdom, or a border, or be only two sea zones away from one of your counties
        any_direct_de_jure_vassal_title = {
            OR = {
                holder_scope = {
                    OR = {
                        character = ROOT
                        is_liege_or_above = ROOT
                    }
                }
                location = {
                    any_neighbor_province = {
                        OR = {
                            AND = {
                                has_owner = yes
                                owner = {
                                    OR = {
                                        character = ROOT
                                        is_liege_or_above = ROOT
                                    }
                                }
                            }
                            AND = {
                                is_land = no
                                any_neighbor_province = {
                                    OR = {
                                        AND = {
                                            has_owner = yes
                                            owner = {
                                                OR = {
                                                    character = ROOT
                                                    is_liege_or_above = ROOT
                                                }
                                            }
                                        }
                                        AND = {
                                            is_land = no
                                            any_neighbor_province = {
                                                owner = {
                                                    OR = {
                                                        character = ROOT
                                                        is_liege_or_above = ROOT
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    is_valid = {
        ROOT = {
            NOT = { pacifist = yes }
            NOT = { same_realm = FROM }
            OR = {
                NOT = { religion_group = FROM }
                is_heresy_of = FROM
                is_parent_religion = FROM
            }
            top_liege = {
                NOT = { religion = FROM }
            }
        }
    }
   
    on_success = {
        any_attacker = {
            limit = { character = ROOT }
            participation_scaled_piety = 100
            participation_scaled_prestige = 50
            if = {
                limit = {
                    uses_decadence = yes
                }
                participation_scaled_decadence = -10
            }
        }
        any_attacker = {
            limit = { NOT = { character = ROOT } }
            hidden_tooltip = { 
                participation_scaled_piety = 100
                participation_scaled_prestige = 50
                if = {
                    limit = {
                        uses_decadence = yes
                    }
                    participation_scaled_decadence = -10
                }
            }
        }
       
        ROOT = { 
            religion_authority = {
                modifier = won_holy_war
                years = 20
            }
        }
        FROM = { 
            religion_authority = {
                modifier = lost_holy_war
                years = 20
            }       
        }
        FROM = { piety = -100 }
        FROM = { prestige = -50 }
    }

    on_success_title = {
        custom_tooltip = {
            text = religious_cb_succ_tip
            hidden_tooltip = {
                ROOT = {
                    vassalize_or_take_under_title = {
                        title = PREV
                        enemy = FROM
                        same_religion = yes # Only vassalize rulers of my religion
                        is_religious = yes
                        type = holy_war
                    }
                }
            }
        }
    }

    on_fail = {
        ROOT = { 
            piety = -50 
            prestige = -100
        }
    }

    on_reverse_demand = {
        ROOT = {
            transfer_scaled_wealth = {
                to = FROM
                value = 4.0
            }
            piety = -75
            prestige = -150
        }
        any_defender = {
            limit = { character = FROM }
            participation_scaled_piety = 200
            participation_scaled_prestige = 100
            if = {
                limit = {
                    uses_decadence = yes
                }
                participation_scaled_decadence = -10
            }
        }
        any_defender = {
            limit = { NOT = { character = FROM } }
            hidden_tooltip = { 
                participation_scaled_piety = 200
                participation_scaled_prestige = 100
                if = {
                    limit = {
                        uses_decadence = yes
                    }
                    participation_scaled_decadence = -10
                }
            }
        }
        any_attacker = {
            limit = {
                character = ROOT
                uses_decadence = yes
            }
            participation_scaled_decadence = 20
        }
        any_attacker = {
            limit = {
                NOT = { character = ROOT }
                uses_decadence = yes
            }
            hidden_tooltip = { 
                participation_scaled_decadence = 20
            }
        }
        ROOT = { 
            religion_authority = {
                modifier = lost_holy_war
                years = 20
            }
        }
        FROM = { 
            religion_authority = {
                modifier = won_holy_war
                years = 20
            }       
        }
    }

    attacker_ai_victory_worth = {
        factor = -1 # always accept
    }
   
    attacker_ai_defeat_worth = {
        factor = 100
    }

    defender_ai_victory_worth = {
        factor = -1 # always accept
    }
   
    defender_ai_defeat_worth = {
        factor = 100
    }
   
    ai_will_do = { 
        factor = 1
    }
}


This is the still intact vanilla CB, you'll notice that the only change is the removal of references to vanilla religions. If I leave those references in but change them to EK religions the error still comes up.
Code:
religious = {
    name = CB_NAME_RELIGIOUS
    war_name = WAR_NAME_RELIGIOUS
    sprite = 9
    truce_days = 3650
    is_permanent = yes
    is_holy_war = yes
    check_de_jure_tier = DUKE # this scans all dejure duchies for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes

    allowed_to_target_tributaries = no
    allowed_to_target_suzerains = no

    can_use = {
        ROOT = {
            is_nomadic = no
            NOT = { religion_group = pagan_group }
            NOT = { pacifist = yes }
            NOT = { religion = buddhist }
            OR = {
                NOT = { religion = hindu }
                FROM = { NOT = { religion_group = indian_group } }
                AND = {
                    religion_group = FROM
                    FROM = {
                        has_character_modifier = known_satanist
                    }
                    NOT = {
                        has_character_modifier = known_satanist
                    }
                }
            }
            NOT = { same_realm = FROM }
            OR = {
                NOT = { religion_group = FROM }
                is_heresy_of = FROM
                is_parent_religion = FROM
                AND = {
                    religion_group = muslim
                    NOT = { religion = FROM }
                    FROM = {
                        NOT = {
                            any_current_enemy = {
                                NOT = {
                                    religion_group = muslim
                                }
                            }
                        }
                    }
                }
                AND = {
                    religion_group = FROM
                    FROM = {
                        has_character_modifier = known_satanist
                    }
                    NOT = {
                        has_character_modifier = known_satanist
                    }
                }
            }
            top_liege = {
                religion_group = ROOT
                OR = {
                    NOT = { religion = FROM }
                    AND = {
                        religion = FROM
                        FROM = {
                            has_character_modifier = known_satanist
                        }
                        NOT = {
                            has_character_modifier = known_satanist
                        }
                        ROOT = {
                            NOT = {
                                has_character_modifier = known_satanist
                            }
                        }
                    }
                }
                OR = {
                    religion = ROOT
                    AND = {
                        is_heretic = no
                        ROOT = { is_heretic = no }
                    }
                }
            }
            mercenary = no
        }
    }
  
    can_use_title = {
        # The attacker needs at least one county in the target kingdom, or a border, or be only two sea zones away from one of your counties
        any_direct_de_jure_vassal_title = {
            OR = {
                holder_scope = {
                    OR = {
                        character = ROOT
                        is_liege_or_above = ROOT
                    }
                }
                location = {
                    any_neighbor_province = {
                        OR = {
                            AND = {
                                has_owner = yes
                                owner = {
                                    OR = {
                                        character = ROOT
                                        is_liege_or_above = ROOT
                                    }
                                }
                            }
                            AND = {
                                is_land = no
                                OR = {
                                    ROOT = { religion_group = muslim }
                                    FROM = { religion_group = muslim }
                                    AND = {
                                        ROOT = { religion_group = pagan_group }
                                        has_global_flag = pagan_ghws_unlocked
                                    }
                                    AND = {
                                        ROOT = { religion_group = christian }
                                        has_global_flag = christian_crusades_unlocked
                                    }
                                    AND = {
                                        ROOT = { religion_group = muslim }
                                        has_global_flag = muslim_jihads_unlocked
                                    }
                                }
                                any_neighbor_province = {
                                    OR = {
                                        AND = {
                                            has_owner = yes
                                            owner = {
                                                OR = {
                                                    character = ROOT
                                                    is_liege_or_above = ROOT
                                                }
                                            }
                                        }
                                        AND = {
                                            is_land = no
                                            any_neighbor_province = {
                                                owner = {
                                                    OR = {
                                                        character = ROOT
                                                        is_liege_or_above = ROOT
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    is_valid = {
        ROOT = {
            NOT = { religion_group = pagan_group }
            NOT = { pacifist = yes }
            NOT = { religion = buddhist }
            NOT = { same_realm = FROM }
            OR = {
                NOT = { religion_group = FROM }
                is_heresy_of = FROM
                is_parent_religion = FROM
                AND = {
                    religion_group = FROM
                    FROM = {
                        has_character_modifier = known_satanist
                    }
                    ROOT = {
                        NOT = {
                            has_character_modifier = known_satanist
                        }
                    }
                }
                AND = {
                    religion_group = muslim
                    NOT = { religion = FROM }
                }
            }
            top_liege = {
                OR = {
                    NOT = { religion = FROM }
                    AND = {
                        religion = FROM
                        FROM = {
                            has_character_modifier = known_satanist
                        }
                        NOT = {
                            has_character_modifier = known_satanist
                        }
                        ROOT = {
                            NOT = {
                                has_character_modifier = known_satanist
                            }
                        }
                    }
                }
            }
        }
    }
  
    on_success = {
        any_attacker = {
            limit = { character = ROOT }
            participation_scaled_piety = 100
            participation_scaled_prestige = 50
            if = {
                limit = {
                    uses_decadence = yes
                }
                participation_scaled_decadence = -10
            }
        }
        any_attacker = {
            limit = { NOT = { character = ROOT } }
            hidden_tooltip = {
                participation_scaled_piety = 100
                participation_scaled_prestige = 50
                if = {
                    limit = {
                        uses_decadence = yes
                    }
                    participation_scaled_decadence = -10
                }
            }
        }
      
        ROOT = {
            religion_authority = {
                modifier = won_holy_war
                years = 20
            }
        }
        FROM = {
            if = {
                limit = {
                    NOT = {
                        has_character_modifier = known_satanist
                    }
                }
                religion_authority = {
                    modifier = lost_holy_war
                    years = 20
                }      
            }
        }
        FROM = { piety = -100 }
        FROM = { prestige = -50 }
    }

    on_success_title = {
        custom_tooltip = {
            text = religious_cb_succ_tip
            hidden_tooltip = {
                ROOT = {
                    vassalize_or_take_under_title = {
                        title = PREV
                        enemy = FROM
                        same_religion = yes # Only vassalize rulers of my religion
                        is_religious = yes
                        type = holy_war
                    }
                }
            }
        }
    }

    on_fail = {
        ROOT = {
            piety = -50
            prestige = -100
        }
    }

    on_reverse_demand = {
        ROOT = {
            transfer_scaled_wealth = {
                to = FROM
                value = 4.0
            }
            piety = -75
            prestige = -150
        }
        any_defender = {
            limit = { character = FROM }
            participation_scaled_piety = 200
            participation_scaled_prestige = 100
            if = {
                limit = {
                    uses_decadence = yes
                }
                participation_scaled_decadence = -10
            }
        }
        any_defender = {
            limit = { NOT = { character = FROM } }
            hidden_tooltip = {
                participation_scaled_piety = 200
                participation_scaled_prestige = 100
                if = {
                    limit = {
                        uses_decadence = yes
                    }
                    participation_scaled_decadence = -10
                }
            }
        }
        any_attacker = {
            limit = {
                character = ROOT
                uses_decadence = yes
            }
            participation_scaled_decadence = 20
        }
        any_attacker = {
            limit = {
                NOT = { character = ROOT }
                uses_decadence = yes
            }
            hidden_tooltip = {
                participation_scaled_decadence = 20
            }
        }
        ROOT = {
            religion_authority = {
                modifier = lost_holy_war
                years = 20
            }
        }
        FROM = {
            religion_authority = {
                modifier = won_holy_war
                years = 20
            }      
        }
    }

    attacker_ai_victory_worth = {
        factor = -1 # always accept
    }
  
    attacker_ai_defeat_worth = {
        factor = 100
    }

    defender_ai_victory_worth = {
        factor = -1 # always accept
    }
  
    defender_ai_defeat_worth = {
        factor = 100
    }
  
    ai_will_do = {
        factor = 1
      
        # Try to guide the Hordes in the right direction
        modifier = {
            factor = 0.1
            ROOT = {
                OR = {
                    dynasty = 613 # Seljuks
                    dynasty = 800 # Timurids
                    primary_title = { title = e_il-khanate }
                }
            }
            OR = {
                empire = {
                    NOT = {
                        OR = {
                            title = e_persia
                            title = e_byzantium
                            title = e_arabia
                        }
                    }
                }
                FROM = {
                    primary_title = { title = e_golden_horde }
                    NOT = { year = 1300 }
                }
            }
        }
        modifier = {
            factor = 0.1
            ROOT = {
                primary_title = { title = e_golden_horde }
            }
            OR = {
                empire = {
                    OR = {
                        title = e_persia
                        title = e_byzantium
                        title = e_arabia
                    }
                }
                FROM = {
                    primary_title = { title = e_il-khanate }
                    NOT = { year = 1300 }
                }
            }
        }
        modifier = {
            factor = 2.0
            OR = {
                culture = persian
                culture = baloch
                culture = afghan
                culture = turkish
            }
            empire = {
                OR = {
                    title = e_persia
                    title = e_rajastan
                }
            }
        }
    }
}
 
Does anyone know why the following error is caused by the CB?
Code:
[triggerimplementation.cpp:5301]: Script Assert! assert: "pLandedTitle->IsValid()", type: "any_direct_de_jure_vassal_title", location: " file: common/cb_types/00_cb_types.txt line: 3166"
The CB
Code:
religious = {
    name = CB_NAME_RELIGIOUS
    war_name = WAR_NAME_RELIGIOUS
    sprite = 9
    truce_days = 3650
    is_permanent = yes
    is_holy_war = yes
    check_de_jure_tier = DUKE # this scans all dejure duchies for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes

    allowed_to_target_tributaries = no
    allowed_to_target_suzerains = no
  
    prestige_cost = 500

    can_use = {
        ROOT = {
            is_nomadic = no
            NOT = { pacifist = yes }
            NOT = { same_realm = FROM }
            OR = {
                NOT = { religion_group = FROM }
                is_heresy_of = FROM
                is_parent_religion = FROM
            }
            top_liege = {
                religion_group = ROOT
                NOT = { religion = FROM }
                OR = {
                    religion = ROOT
                    AND = {
                        is_heretic = no
                        ROOT = { is_heretic = no }
                    }
                }
            }
            mercenary = no
            NOT = {
                has_character_flag = soul_sold #Use Soul Harvest instead
            }
            OR = {
                NOT = { trait = mane }
                trait = powerful_mane
            }
        }
    }
  
    can_use_gui = {
        ROOT = {
            independent = yes
            prestige = 1000
            piety = 500  
            trait = zealous
          
            NOT = { trait = excommunicated }
        }
    }
  
    can_use_title = {
        # The attacker needs at least one county in the target kingdom, or a border, or be only two sea zones away from one of your counties
        any_direct_de_jure_vassal_title = {
            OR = {
                holder_scope = {
                    OR = {
                        character = ROOT
                        is_liege_or_above = ROOT
                    }
                }
                location = {
                    any_neighbor_province = {
                        OR = {
                            AND = {
                                has_owner = yes
                                owner = {
                                    OR = {
                                        character = ROOT
                                        is_liege_or_above = ROOT
                                    }
                                }
                            }
                            AND = {
                                is_land = no
                                any_neighbor_province = {
                                    OR = {
                                        AND = {
                                            has_owner = yes
                                            owner = {
                                                OR = {
                                                    character = ROOT
                                                    is_liege_or_above = ROOT
                                                }
                                            }
                                        }
                                        AND = {
                                            is_land = no
                                            any_neighbor_province = {
                                                owner = {
                                                    OR = {
                                                        character = ROOT
                                                        is_liege_or_above = ROOT
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    is_valid = {
        ROOT = {
            NOT = { pacifist = yes }
            NOT = { same_realm = FROM }
            OR = {
                NOT = { religion_group = FROM }
                is_heresy_of = FROM
                is_parent_religion = FROM
            }
            top_liege = {
                NOT = { religion = FROM }
            }
        }
    }
  
    on_success = {
        any_attacker = {
            limit = { character = ROOT }
            participation_scaled_piety = 100
            participation_scaled_prestige = 50
            if = {
                limit = {
                    uses_decadence = yes
                }
                participation_scaled_decadence = -10
            }
        }
        any_attacker = {
            limit = { NOT = { character = ROOT } }
            hidden_tooltip = {
                participation_scaled_piety = 100
                participation_scaled_prestige = 50
                if = {
                    limit = {
                        uses_decadence = yes
                    }
                    participation_scaled_decadence = -10
                }
            }
        }
      
        ROOT = {
            religion_authority = {
                modifier = won_holy_war
                years = 20
            }
        }
        FROM = {
            religion_authority = {
                modifier = lost_holy_war
                years = 20
            }      
        }
        FROM = { piety = -100 }
        FROM = { prestige = -50 }
    }

    on_success_title = {
        custom_tooltip = {
            text = religious_cb_succ_tip
            hidden_tooltip = {
                ROOT = {
                    vassalize_or_take_under_title = {
                        title = PREV
                        enemy = FROM
                        same_religion = yes # Only vassalize rulers of my religion
                        is_religious = yes
                        type = holy_war
                    }
                }
            }
        }
    }

    on_fail = {
        ROOT = {
            piety = -50
            prestige = -100
        }
    }

    on_reverse_demand = {
        ROOT = {
            transfer_scaled_wealth = {
                to = FROM
                value = 4.0
            }
            piety = -75
            prestige = -150
        }
        any_defender = {
            limit = { character = FROM }
            participation_scaled_piety = 200
            participation_scaled_prestige = 100
            if = {
                limit = {
                    uses_decadence = yes
                }
                participation_scaled_decadence = -10
            }
        }
        any_defender = {
            limit = { NOT = { character = FROM } }
            hidden_tooltip = {
                participation_scaled_piety = 200
                participation_scaled_prestige = 100
                if = {
                    limit = {
                        uses_decadence = yes
                    }
                    participation_scaled_decadence = -10
                }
            }
        }
        any_attacker = {
            limit = {
                character = ROOT
                uses_decadence = yes
            }
            participation_scaled_decadence = 20
        }
        any_attacker = {
            limit = {
                NOT = { character = ROOT }
                uses_decadence = yes
            }
            hidden_tooltip = {
                participation_scaled_decadence = 20
            }
        }
        ROOT = {
            religion_authority = {
                modifier = lost_holy_war
                years = 20
            }
        }
        FROM = {
            religion_authority = {
                modifier = won_holy_war
                years = 20
            }      
        }
    }

    attacker_ai_victory_worth = {
        factor = -1 # always accept
    }
  
    attacker_ai_defeat_worth = {
        factor = 100
    }

    defender_ai_victory_worth = {
        factor = -1 # always accept
    }
  
    defender_ai_defeat_worth = {
        factor = 100
    }
  
    ai_will_do = {
        factor = 1
    }
}


This is the still intact vanilla CB, you'll notice that the only change is the removal of references to vanilla religions. If I leave those references in but change them to EK religions the error still comes up.
Code:
religious = {
    name = CB_NAME_RELIGIOUS
    war_name = WAR_NAME_RELIGIOUS
    sprite = 9
    truce_days = 3650
    is_permanent = yes
    is_holy_war = yes
    check_de_jure_tier = DUKE # this scans all dejure duchies for the counties which are held by or vassals(or below) of selected character. Only valid if is_permanent = yes

    allowed_to_target_tributaries = no
    allowed_to_target_suzerains = no

    can_use = {
        ROOT = {
            is_nomadic = no
            NOT = { religion_group = pagan_group }
            NOT = { pacifist = yes }
            NOT = { religion = buddhist }
            OR = {
                NOT = { religion = hindu }
                FROM = { NOT = { religion_group = indian_group } }
                AND = {
                    religion_group = FROM
                    FROM = {
                        has_character_modifier = known_satanist
                    }
                    NOT = {
                        has_character_modifier = known_satanist
                    }
                }
            }
            NOT = { same_realm = FROM }
            OR = {
                NOT = { religion_group = FROM }
                is_heresy_of = FROM
                is_parent_religion = FROM
                AND = {
                    religion_group = muslim
                    NOT = { religion = FROM }
                    FROM = {
                        NOT = {
                            any_current_enemy = {
                                NOT = {
                                    religion_group = muslim
                                }
                            }
                        }
                    }
                }
                AND = {
                    religion_group = FROM
                    FROM = {
                        has_character_modifier = known_satanist
                    }
                    NOT = {
                        has_character_modifier = known_satanist
                    }
                }
            }
            top_liege = {
                religion_group = ROOT
                OR = {
                    NOT = { religion = FROM }
                    AND = {
                        religion = FROM
                        FROM = {
                            has_character_modifier = known_satanist
                        }
                        NOT = {
                            has_character_modifier = known_satanist
                        }
                        ROOT = {
                            NOT = {
                                has_character_modifier = known_satanist
                            }
                        }
                    }
                }
                OR = {
                    religion = ROOT
                    AND = {
                        is_heretic = no
                        ROOT = { is_heretic = no }
                    }
                }
            }
            mercenary = no
        }
    }
 
    can_use_title = {
        # The attacker needs at least one county in the target kingdom, or a border, or be only two sea zones away from one of your counties
        any_direct_de_jure_vassal_title = {
            OR = {
                holder_scope = {
                    OR = {
                        character = ROOT
                        is_liege_or_above = ROOT
                    }
                }
                location = {
                    any_neighbor_province = {
                        OR = {
                            AND = {
                                has_owner = yes
                                owner = {
                                    OR = {
                                        character = ROOT
                                        is_liege_or_above = ROOT
                                    }
                                }
                            }
                            AND = {
                                is_land = no
                                OR = {
                                    ROOT = { religion_group = muslim }
                                    FROM = { religion_group = muslim }
                                    AND = {
                                        ROOT = { religion_group = pagan_group }
                                        has_global_flag = pagan_ghws_unlocked
                                    }
                                    AND = {
                                        ROOT = { religion_group = christian }
                                        has_global_flag = christian_crusades_unlocked
                                    }
                                    AND = {
                                        ROOT = { religion_group = muslim }
                                        has_global_flag = muslim_jihads_unlocked
                                    }
                                }
                                any_neighbor_province = {
                                    OR = {
                                        AND = {
                                            has_owner = yes
                                            owner = {
                                                OR = {
                                                    character = ROOT
                                                    is_liege_or_above = ROOT
                                                }
                                            }
                                        }
                                        AND = {
                                            is_land = no
                                            any_neighbor_province = {
                                                owner = {
                                                    OR = {
                                                        character = ROOT
                                                        is_liege_or_above = ROOT
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    is_valid = {
        ROOT = {
            NOT = { religion_group = pagan_group }
            NOT = { pacifist = yes }
            NOT = { religion = buddhist }
            NOT = { same_realm = FROM }
            OR = {
                NOT = { religion_group = FROM }
                is_heresy_of = FROM
                is_parent_religion = FROM
                AND = {
                    religion_group = FROM
                    FROM = {
                        has_character_modifier = known_satanist
                    }
                    ROOT = {
                        NOT = {
                            has_character_modifier = known_satanist
                        }
                    }
                }
                AND = {
                    religion_group = muslim
                    NOT = { religion = FROM }
                }
            }
            top_liege = {
                OR = {
                    NOT = { religion = FROM }
                    AND = {
                        religion = FROM
                        FROM = {
                            has_character_modifier = known_satanist
                        }
                        NOT = {
                            has_character_modifier = known_satanist
                        }
                        ROOT = {
                            NOT = {
                                has_character_modifier = known_satanist
                            }
                        }
                    }
                }
            }
        }
    }
 
    on_success = {
        any_attacker = {
            limit = { character = ROOT }
            participation_scaled_piety = 100
            participation_scaled_prestige = 50
            if = {
                limit = {
                    uses_decadence = yes
                }
                participation_scaled_decadence = -10
            }
        }
        any_attacker = {
            limit = { NOT = { character = ROOT } }
            hidden_tooltip = {
                participation_scaled_piety = 100
                participation_scaled_prestige = 50
                if = {
                    limit = {
                        uses_decadence = yes
                    }
                    participation_scaled_decadence = -10
                }
            }
        }
     
        ROOT = {
            religion_authority = {
                modifier = won_holy_war
                years = 20
            }
        }
        FROM = {
            if = {
                limit = {
                    NOT = {
                        has_character_modifier = known_satanist
                    }
                }
                religion_authority = {
                    modifier = lost_holy_war
                    years = 20
                }     
            }
        }
        FROM = { piety = -100 }
        FROM = { prestige = -50 }
    }

    on_success_title = {
        custom_tooltip = {
            text = religious_cb_succ_tip
            hidden_tooltip = {
                ROOT = {
                    vassalize_or_take_under_title = {
                        title = PREV
                        enemy = FROM
                        same_religion = yes # Only vassalize rulers of my religion
                        is_religious = yes
                        type = holy_war
                    }
                }
            }
        }
    }

    on_fail = {
        ROOT = {
            piety = -50
            prestige = -100
        }
    }

    on_reverse_demand = {
        ROOT = {
            transfer_scaled_wealth = {
                to = FROM
                value = 4.0
            }
            piety = -75
            prestige = -150
        }
        any_defender = {
            limit = { character = FROM }
            participation_scaled_piety = 200
            participation_scaled_prestige = 100
            if = {
                limit = {
                    uses_decadence = yes
                }
                participation_scaled_decadence = -10
            }
        }
        any_defender = {
            limit = { NOT = { character = FROM } }
            hidden_tooltip = {
                participation_scaled_piety = 200
                participation_scaled_prestige = 100
                if = {
                    limit = {
                        uses_decadence = yes
                    }
                    participation_scaled_decadence = -10
                }
            }
        }
        any_attacker = {
            limit = {
                character = ROOT
                uses_decadence = yes
            }
            participation_scaled_decadence = 20
        }
        any_attacker = {
            limit = {
                NOT = { character = ROOT }
                uses_decadence = yes
            }
            hidden_tooltip = {
                participation_scaled_decadence = 20
            }
        }
        ROOT = {
            religion_authority = {
                modifier = lost_holy_war
                years = 20
            }
        }
        FROM = {
            religion_authority = {
                modifier = won_holy_war
                years = 20
            }     
        }
    }

    attacker_ai_victory_worth = {
        factor = -1 # always accept
    }
 
    attacker_ai_defeat_worth = {
        factor = 100
    }

    defender_ai_victory_worth = {
        factor = -1 # always accept
    }
 
    defender_ai_defeat_worth = {
        factor = 100
    }
 
    ai_will_do = {
        factor = 1
     
        # Try to guide the Hordes in the right direction
        modifier = {
            factor = 0.1
            ROOT = {
                OR = {
                    dynasty = 613 # Seljuks
                    dynasty = 800 # Timurids
                    primary_title = { title = e_il-khanate }
                }
            }
            OR = {
                empire = {
                    NOT = {
                        OR = {
                            title = e_persia
                            title = e_byzantium
                            title = e_arabia
                        }
                    }
                }
                FROM = {
                    primary_title = { title = e_golden_horde }
                    NOT = { year = 1300 }
                }
            }
        }
        modifier = {
            factor = 0.1
            ROOT = {
                primary_title = { title = e_golden_horde }
            }
            OR = {
                empire = {
                    OR = {
                        title = e_persia
                        title = e_byzantium
                        title = e_arabia
                    }
                }
                FROM = {
                    primary_title = { title = e_il-khanate }
                    NOT = { year = 1300 }
                }
            }
        }
        modifier = {
            factor = 2.0
            OR = {
                culture = persian
                culture = baloch
                culture = afghan
                culture = turkish
            }
            empire = {
                OR = {
                    title = e_persia
                    title = e_rajastan
                }
            }
        }
    }
}
Location can only be used on a character, or a baron or count title. Are you invoking it on a duke or higher title?
 
I'm having a couple of problems modding the EU4 converter.

First, this is my .mod file:
Code:
name = "After the End - EU4 Converter"
path = "mod/After the End - EU4 Converter"

replace_path = "eu4_converter/sunset_invasion/"
replace_path = "eu4_converter/common/cultures/"
As you can see, I have a couple of replace_paths, but they aren't working. Vanilla files which I've removed from the relevant folders still end up in the converter output. For culture this isn't a big deal, since I can just add blank copies of those files to overwrite them, but doing so with Sunset Invasion will interfere with plans I have to use native American tags. Is this a problem I can fix or is it something deeper?

The second problem is with government_table.csv. It seems to work fine with the government flavors used in the vanilla converter, and with specific titles, but when I add new flavors (even those which are in Vanilla) they get ignored. For example, I added this line:

gov_republic;merchant_republic;1;

yet inland republics still convert as Feudal Monarchies.
Be aware: replace_path only replaces files directly in the named folder. So replacing eu4_converter/sunset_invasion/ won't replace eu4_converter/sunset_invasion/common/, eu4_converter/sunset_invasion/copy/, etc. Since eu4_converter/common/cultures/ has no folders in it, it should be working.
 
Location can only be used on a character, or a baron or count title. Are you invoking it on a duke or higher title?

Duke, but if you compare the two CBs posted, the 2nd of which is a direct copy-paste from vanilla you will notice that there were no changes to the scoping from vanilla.

The only alterations was the removal of references to vanilla religions and ai targeting via the modifiers, the addition of a simple can_use_gui section.

I suppose the question is really, why does this throw an error for EK and not vanilla when the scoping and usage is identical?
 
What is the difference between is_valid_attraction and is_valid_romance_target?
is_valid_romance_target is pretty specific: "checking that both characters are adults, not incapable, either homosexual or of different sex and that they are of divine blood religions or not close kin"

There is only one place is_valid_attraction is used, and it must be more general, since it is accompanied by checks for age, capable, opposite sex, and homosexuality. It also doesn't have a localization key, nor changelog note.
 
Duke, but if you compare the two CBs posted, the 2nd of which is a direct copy-paste from vanilla you will notice that there were no changes to the scoping from vanilla.

The only alterations was the removal of references to vanilla religions and ai targeting via the modifiers, the addition of a simple can_use_gui section.

I suppose the question is really, why does this throw an error for EK and not vanilla when the scoping and usage is identical?
Which line is #3166?
 
Which line is #3166?

any_direct_de_jure_vassal_title is what's on line 3166 in the file for EK. It's the can_use_title section.
In EK the code in that segment is;
Code:
  can_use_title = {
        # The attacker needs at least one county in the target kingdom, or a border, or be only two sea zones away from one of your counties
        any_direct_de_jure_vassal_title = {
            OR = {
                holder_scope = {
                    OR = {
                        character = ROOT
                        is_liege_or_above = ROOT
                    }
                }
                location = {
                    any_neighbor_province = {
                        OR = {
                            AND = {
                                has_owner = yes
                                owner = {
                                    OR = {
                                        character = ROOT
                                        is_liege_or_above = ROOT
                                    }
                                }
                            }
                            AND = {
                                is_land = no
                                any_neighbor_province = {
                                    OR = {
                                        AND = {
                                            has_owner = yes
                                            owner = {
                                                OR = {
                                                    character = ROOT
                                                    is_liege_or_above = ROOT
                                                }
                                            }
                                        }
                                        AND = {
                                            is_land = no
                                            any_neighbor_province = {
                                                owner = {
                                                    OR = {
                                                        character = ROOT
                                                        is_liege_or_above = ROOT
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }

In vanilla it's;
Code:
   can_use_title = {
        # The attacker needs at least one county in the target kingdom, or a border, or be only two sea zones away from one of your counties
        any_direct_de_jure_vassal_title = {
            OR = {
                holder_scope = {
                    OR = {
                        character = ROOT
                        is_liege_or_above = ROOT
                    }
                }
                location = {
                    any_neighbor_province = {
                        OR = {
                            AND = {
                                has_owner = yes
                                owner = {
                                    OR = {
                                        character = ROOT
                                        is_liege_or_above = ROOT
                                    }
                                }
                            }
                            AND = {
                                is_land = no
                                OR = {
                                    ROOT = { religion_group = muslim }
                                    FROM = { religion_group = muslim }
                                    AND = {
                                        ROOT = { religion_group = pagan_group }
                                        has_global_flag = pagan_ghws_unlocked
                                    }
                                    AND = {
                                        ROOT = { religion_group = christian }
                                        has_global_flag = christian_crusades_unlocked
                                    }
                                    AND = {
                                        ROOT = { religion_group = muslim }
                                        has_global_flag = muslim_jihads_unlocked
                                    }
                                }
                                any_neighbor_province = {
                                    OR = {
                                        AND = {
                                            has_owner = yes
                                            owner = {
                                                OR = {
                                                    character = ROOT
                                                    is_liege_or_above = ROOT
                                                }
                                            }
                                        }
                                        AND = {
                                            is_land = no
                                            any_neighbor_province = {
                                                owner = {
                                                    OR = {
                                                        character = ROOT
                                                        is_liege_or_above = ROOT
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }


At the moment, since the scoping is identical between vanilla and EK I'm kind of wondering if someone noticed the error happening in vanilla and added an exception to the error logging for vanilla using a direct path rather than hunting down and "correcting" what at this point in time I'm assuming is a false error since the CB (in both vanilla and Elder Kings) works 100% as it should; the problem is that the error is inflating the error.log file unnecessarily.

Maybe @Meneth or @blackninja9939 could take a look?
 
any_direct_de_jure_vassal_title is what's on line 3166 in the file for EK. It's the can_use_title section.
In EK the code in that segment is;
<code snipped>

At the moment, since the scoping is identical between vanilla and EK I'm kind of wondering if someone noticed the error happening in vanilla and added an exception to the error logging for vanilla using a direct path rather than hunting down and "correcting" what at this point in time I'm assuming is a false error since the CB (in both vanilla and Elder Kings) works 100% as it should; the problem is that the error is inflating the error.log file unnecessarily.

Maybe @Meneth or @blackninja9939 could take a look?
I seriously doubt it. It would be far more effort than it was worth to detect that specific error happening only in vanilla scripting. Unfortunately, I'm out of ideas on troubleshooting this. :(
 
I'm not sure is >= currently works with count (though it should in 2.8, per the dev diaries), however, = already means "equal to or greater than", so any_courtier = { count = 5 } would have the same effect
 
I'm not sure is >= currently works with count (though it should in 2.8, per the dev diaries), however, = already means "equal to or greater than", so any_courtier = { count = 5 } would have the same effect
Thanks for the reply. It turns out the issue was that I was using a scripted_effect in a limit, which was not resolving properly. I presume that scripted_effects are not supported in a limit.
 
I seriously doubt it. It would be far more effort than it was worth to detect that specific error happening only in vanilla scripting. Unfortunately, I'm out of ideas on troubleshooting this. :(

I "fixed" it by adding a has_holder = yes condition. CB still functions the same but the warning is gone at least.
 
Is there a more efficient way of creating characters with a random age?
You could make 10 identical "create_character = {}" sections with only the "age =" part changed but that seems like too big of a waste.
Does anyone know of a working way to create a scripted effect "random_age =" or something similar? Recruiting chancellors seems to have something where it randomizes between 19 and 25 years of age but i can't seem to find the part in the code where that comes from.
Someone has an aswer to this? I am interested also
 
Thanks for the reply. It turns out the issue was that I was using a scripted_effect in a limit, which was not resolving properly. I presume that scripted_effects are not supported in a limit.
No effects run in a limit, why would a scripted_effect be any different?
 
This is probably a silly question, but I couldn't figure it out: ever since I switched my pc everytime I mod the defines.lua file the game won't start. Any idea how to fix it? I assume it is something about file compatibility.

I'm only modding numbers/values, not adding anything new.
 
This is probably a silly question, but I couldn't figure it out: ever since I switched my pc everytime I mod the defines.lua file the game won't start. Any idea how to fix it? I assume it is something about file compatibility.

I'm only modding numbers/values, not adding anything new.
Are you sure you modded them correctly? Because modding them changed a while back, now there's a way that ensures broader compatibility, but works differently than before.
See the wiki: http://www.ckiiwiki.com/Defines#Configuration
 
Nevermind, I managed to fix it! Adding a new custom .lua file instead of modding the vanilla one, as per ck2wiki instructions did the trick.

I have a new problem though, and this one got me stumped. For my mod I have increased the amount of patrician families in venice to 12. Everything is working correctly, including sucession in the new families, and the count remains 12 even if one patrician family dies out(that is why I modded the defines).

Here comes the problem: When the head of one of the new families I created is/becomes doge, it dies out on sucession("no dynastic heir"). I attached a screenshot as an example(the patrician in question has 5 able heirs and yet this message appears). Strangely, this only happens with the new patrician families I modded in. When the vanilla patricians becomes elected(i.e: a member of the dandolo or faliero house), inheritance works ok. Can't figure out how to fix it!

https://ibb.co/mn5Wwv

mn5Wwv


mn5Wwv