• 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.

iloathecapcha

Major
86 Badges
Jun 2, 2012
629
137
  • Crusader Kings II
  • Victoria 2: A House Divided
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • Heir to the Throne
  • Hearts of Iron III Collection
  • Europa Universalis IV: Art of War
  • Divine Wind
  • Europa Universalis III Complete
  • Darkest Hour
  • Stellaris: Leviathans Story Pack
  • Stellaris: Necroids
  • Europa Universalis IV: Cradle of Civilization
  • Age of Wonders III
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Nemesis
  • Surviving Mars
  • Knights of Honor
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis 4: Emperor
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Field Marshal
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Distant Stars
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Imperator: Rome
  • Stellaris: Federations
  • Crusader Kings II: Holy Fury
  • Stellaris: Megacorp
  • Europa Universalis IV: Dharma
  • Prison Architect
  • Cities: Skylines - Parklife
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Apocalypse
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Stellaris: Humanoids Species Pack
  • Hearts of Iron IV: Expansion Pass
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
Attempting to add the High Tribal Government from WtWSMS to CK2+. The decision appears but the AI will not take the decision. I figured I screwed up the decisions so could someone take a look?


Code:
decisions = {
    convert_to_high_tribal_indep  = {
        only_independent = yes
        is_high_prio = yes
        
        potential = {
            is_playable = yes
            is_tribal = yes
            independent = yes
        }
        allow = {
            war = no
            custom_tooltip = {
                text = TT_NOT_UNREFORMED_PAGAN
                hidden_tooltip = {
                    OR = {
                        NOT = { religion_group = pagan_group }
                        is_reformed_religion = yes
                        religion = bon
                    }
                }
            }
            primary_title = { has_law = tribal_organization_4 }
            capital_holding = {
                OR = {
                    AND = {
                        holding_type = tribal
                        has_building = tb_hillfort_4
                    }
                    holding_type = castle
                }
            }
        }
        
        effect = {
            if = {
                limit = { ai = no }
                set_character_flag = achievement_not_a_tribe
            }
    
            set_government_type = high_tribal_government
            primary_title = {
                set_title_flag = high_tribal_government_flag
            }
            
            hidden_tooltip = {
                any_demesne_title = {
                    limit = {
                        tier = baron
                        holding_type = tribal
                    }
                    convert_to = CASTLE
                    refill_holding_levy = yes
                    
                    if = {
                        limit = {
                            dejure_liege_title = {
                                holder = ROOT
                                location = {
                                    num_of_empty_holdings = 2
                                }
                                NOT = {
                                    any_direct_de_jure_vassal_title = {
                                        holding_type = city
                                    }
                                }
                            }
                        }
                        location = {
                            build_holding = {
                                type = city
                            }
                        }
                    }
                    if = {
                        limit = {
                            dejure_liege_title = {
                                holder = ROOT
                                location = {
                                    num_of_empty_holdings = 2
                                }
                                NOT = {
                                    any_direct_de_jure_vassal_title = {
                                        holding_type = temple
                                    }
                                }
                            }
                        }
                        location = {
                            build_holding  ={
                                type = temple
                            }
                        }
                    }
                }
            }
        }
        
        ai_will_do = {
            factor = 1
        }
    }
    
    convert_to_high_tribal_vassal = {
        only_rulers = yes
        is_high_prio = yes
        
        potential = {
            is_ruler = yes
            is_tribal = yes
            independent = no
        }
        allow = {
            war = no
            custom_tooltip = {
                text = TT_NOT_UNREFORMED_PAGAN
                hidden_tooltip = {
                    OR = {
                        NOT = { religion_group = pagan_group }
                        is_reformed_religion = yes
                        religion = bon
                    }
                }
            }
            liege = {
                OR = {
                    is_feudal = yes
                    is_republic = yes
                    AND = {
                        is_theocracy = yes
                        custom_tooltip = {
                            text = TT_NOT_UNREFORMED_PAGAN
                            hidden_tooltip = {
                                OR = {
                                    NOT = { religion_group = pagan_group }
                                    is_reformed_religion = yes
                                    religion = bon
                                }
                            }
                        }
                    }
                }
            }
            OR = {
                capital_holding = {
                    OR = {
                        AND = {
                            holding_type = tribal
                            has_building = tb_hillfort_4
                        }
                        holding_type = castle
                    }
                }
                AND = {
                    NOT = { tier = BARON }
                    capital_scope = {
                        any_province_holding = {
                            holding_type = castle
                            holder_scope = {
                                OR = {
                                    character = ROOT
                                    is_liege_or_above = ROOT
                                }
                            }
                        }
                    }
                }
            }
        }
        
        effect = {
            set_character_flag = achievement_not_a_tribe
            
            set_government_type = high_tribal_government
            primary_title = {
                set_title_flag = high_tribal_government_flag
            }
                        
            hidden_tooltip = {
                if = {
                    limit = {
                        capital_holding = {
                            holding_type = tribal
                            ROOT = { NOT = { tier = BARON } }
                        }
                        capital_scope = {
                            any_province_holding = {
                                holding_type = castle
                                holder_scope = {
                                    OR = {
                                        character = ROOT
                                        is_liege_or_above = ROOT
                                    }
                                }
                            }
                        }
                    }
                    
                    capital_scope = {
                        random_province_holding = {
                            limit = {
                                holding_type = castle
                                holder_scope = {
                                    OR = {
                                        character = ROOT
                                        is_liege_or_above = ROOT
                                    }
                                }
                            }
                            if = {
                                limit = {
                                    NOT = { holder = ROOT }
                                }
                                usurp_title = ROOT
                            }
                            make_capital_holding = yes
                            ROOT = { set_character_flag = feudalize_handled_capital }
                        }
                    }
                }
                
                any_demesne_title = {
                    limit = {
                        tier = baron
                        holding_type = tribal
                        location = {
                            capital_holding = {
                                NOT = { holding_type = castle }
                            }
                        }
                    }
                    convert_to = CASTLE
                    refill_holding_levy = yes
                    
                    if = {
                        limit = {
                            dejure_liege_title = {
                                holder = ROOT
                                location = {
                                    num_of_empty_holdings = 2
                                }
                                NOT = {
                                    any_direct_de_jure_vassal_title = {
                                        holding_type = city
                                    }
                                }
                            }
                        }
                        location = {
                            build_holding = {
                                type = city
                            }
                        }
                    }
                    if = {
                        limit = {
                            dejure_liege_title = {
                                holder = ROOT
                                location = {
                                    num_of_empty_holdings = 2
                                }
                                NOT = {
                                    any_direct_de_jure_vassal_title = {
                                        holding_type = temple
                                    }
                                }
                            }
                        }
                        location = {
                            build_holding = {
                                type = temple
                            }
                        }
                    }
                }
                
                liege = {
                    character_event = { id = 55100 } # Notify Liege
                }
            }
        }
        
        ai_will_do = {
            factor = 1
            modifier = {
                factor = 0.001
                liege = {
                    OR = {
                        NOT = { religion_group = ROOT }
                        AND = {
                            religion_group = pagan_group
                            NOT = { religion = ROOT }
                        }
                    }
                }
            }
            modifier = {
                factor = 0.01
                liege = {
                    NOT = { culture_group = ROOT }
                }
            }
            
            modifier = {
                factor = 0.01
                liege = {
                    religion_group = ROOT
                    NOT = { religion_group = pagan_group }
                    NOT = { religion = ROOT }
                }
            }
            modifier = {
                factor = 0.1
                liege = {
                    culture_group = ROOT
                    NOT = { culture = ROOT }
                }
            }
        }
    }   
}

Thanks for your time in advance.
 
On a quick read-through, it seems fine.

I also quickly checked that there's no obvious error with the curly brackets. (There isn't.)

The decisions do not have an ai_check_interval specified but, according to the wiki, this is not strictly necessary. (It should default to 1, ie. 1 month, if it's absent.)

My current hypothesis is that AI aren't taking the decision in your tests because they are unable to do so. (Unreformed / no stone hillfort / at war / etc.)

So, I suggest you follow normal testing protocol:
  • Run the Validator on your mod, and fix any issues. (Or, at the very least, fix any issues relating to this decision.)
  • Set up a game where at least one character fulfils the criteria to take the decision. Save this game, for future testing.
  • Check that the decision works as desired if you press the button.
  • Reload the save, go into observer mode, and run the game. The AI should take the decision within 1 month (but run the game for a few months, just to be sure.)
 
  • 2Like
Reactions:
On a quick read-through, it seems fine.

I also quickly checked that there's no obvious error with the curly brackets. (There isn't.)

The decisions do not have an ai_check_interval specified but, according to the wiki, this is not strictly necessary. (It should default to 1, ie. 1 month, if it's absent.)

My current hypothesis is that AI aren't taking the decision in your tests because they are unable to do so. (Unreformed / no stone hillfort / at war / etc.)

So, I suggest you follow normal testing protocol:
  • Run the Validator on your mod, and fix any issues. (Or, at the very least, fix any issues relating to this decision.)
  • Set up a game where at least one character fulfils the criteria to take the decision. Save this game, for future testing.
  • Check that the decision works as desired if you press the button.
  • Reload the save, go into observer mode, and run the game. The AI should take the decision within 1 month (but run the game for a few months, just to be sure.)
Thank you very much!
 
  • 1Like
Reactions:
Decision works, but government changes to Nomadic??? Suspect issue is with scripted triggers or governments.txt?

Scripted trigger (could be completely screwed up:

# High Tribal
high_tribal_government_potential_trigger = {
feudal_group_potential_trigger = yes
higher_real_tier_than = BARON

}

high_tribal_government_allow_trigger = {
feudal_group_allow_trigger = yes
}

governments.txt:

high_tribal_government = {
preferred_holdings = {
CASTLE
}
allowed_holdings = {
CASTLE
FORT
HOSPITAL
}
accepts_liege_governments_culture = { # Tribals have no opinion penalty towards their liege if of the same culture
feudal_government
republic_government
merchant_republic_government
theocracy_government
muslim_feudal_government
monastic_feudal_government
chinese_imperial_government
}
accepts_liege_governments_culture_and_religion = { # Tribals have no opinion penalty towards their liege if of the same culture and religion
order_government
}
free_revoke_on_governments_religion = { # Tribal vassals of other religions can have their titles revoked for free
tribal_government
}

frame_suffix = "_high tribal"
title_prefix = "high tribal_"
color = { 23 100 23 }

potential = {
primary_title = {
nomad_government_trigger = no
}
primary_title = {
republic_government_trigger = no
}
primary_title = {
merchant_republic_government_trigger = no
}
NOT = {
primary_title = {
has_title_flag = adopted_feudalism
}
}
primary_title = {
OR = {
has_title_flag = high_tribal_government_flag
high_tribal_government_trigger = yes
}
}
is_patrician = no
}

can_build_castle = no
can_build_city = no
can_build_temple = yes
can_build_tribal = no
can_build_hospitals = no

ignore_in_vassal_limit_calculation = {
tribal_government
}

capital_move_delay = 600
max_consorts = 3

## Modifiers
demesne_size = 3
vassal_limit = -5
}

Government is in feudal group.

Thanks again for your time!