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

Elbadruhel

Sergeant
19 Badges
Apr 6, 2017
58
1
  • Crusader Kings II: Holy Fury
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Magicka 2
  • Crusader Kings II: Sword of Islam
  • Majesty 2 Collection
  • Cities in Motion 2
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II
Hello,

I want to create a "Migration" style CB for my mod. The idea is that when you win your war, you invade all the new lands conquered, BUT also release the previous lands you hand.

If you win war:
- Save all previous holdings you had inside a "PREVIOUS_LANDS" group to dont lose the track (idk how to do this).
- Get all the new conquered lands from your Migration (invasion) CB.
- Pick every holding inside PREVIOUS_LANDS, for each title create a new character of your culture and religion and give him the title.
- Give independence to all direct vassals and turn them into tributaries.

Is this posible to be made? I tried myself but since idk how to do this "group" to save your previous holdings, the game gives the lands away before obtaining the new lands and so there is 1 second in which you have no holdings at all and is defeat. Could it be made with flagas or something? Help please.
 
It's possible. Not 100 % sure the syntax below is correct since it's written partially from memory, but it should be fairly close.

Code:
on_success_title = { # Other CB stuff ignored
    ROOT = {
        # Release vassals as tributaries
        any_vassal = {
            limit = {
                higher_tier_than = baron
            }
            set_defacto_liege = THIS
            make_tributary = {
                who = ROOT
                tributary_type = TODO # Actual type needed!
            }
        }
        # Flag demesne
        any_demesne_title = {
            limit = {
                tier = count
                # You might want to filter out titles in PREV so that you don't abandon demesne there
            }
            set_title_flag = demesne_to_give_away
        }
        # If desired: Destroy duchies and higher titles held previously (unless rel head title) since you might no longer have the de jure at this point
        # Handle possible unlanding
        if = {
            limit = {
                NOT = {
                    any_demesne_title = {
                        tier = count
                        NOT = {
                            has_title_flag = demesne_to_give_away
                        }
                    }
                }
            }
            FROM = {
                random_realm_province = {
                    limit = {
                        kingdom = PREVPREV # Assuming we're looking at a kingdom
                    }
                    # It might be worth having further preferred_limits to try to get a title with a castle capital, etc.; there are potential issues if you don't
                    preferred_limit = {
                        holder_scope = {
                            ai = yes # Don't unland the player if it can be avoided
                        }
                    }
                    ROOT = {
                        usurp_title = PREV
                    }
                }
            }
        }
        # If higher tier titles were destroyed, make sure we can vassalize people here by granting us a higher title (e.g. the target kingdom)
        # Take land in the invasion target - needs to be different if you take all occupied land
        vassalize_or_take_under_title_destroy_duchies = {
            title = PREV
            enemy = FROM
            is_crusade = no # Even if the title holder is not participating in the war, gain holdings occupied by all Crusade participants
            type = invasion
        }
        # Create new holders for old demesne, then release them and make them tributaries
        # Assuming we're granting each old demesne province to a separate character here; if not, create a single new character and grant them every relevant title
        any_demesne_title = {
            limit = {
                has_title_flag = demesne_to_give_away
            }
            ROOT = {
                create_random_soldier = { # Specifics can be adjusted as necessary
                    random_traits = yes
                    dynasty = random
                    religion = ROOT
                    culture = ROOT
                    female = no
                    age = 25
                }
                new_character = {
                    grant_title = PREV
                    set_defacto_liege = THIS
                    make_tributary = {
                        who = ROOT
                        tributary_type = TODO # Actual type needed!
                    }
                }
            }
        }
    }
}

Note that if you're dealing with nomads using this CB to settle as something else things will get messier since nomadic settling is rather messy. It can still be done, but it would not work well if you just did the above.
 
I dont want it for nomads, i can set this CB forbidden for nomads to avoid posible problems.

Destroy duchies and realms the attacker previously owned sounds a nice option to deal with them, i have to check how to do it.

I read all your code and i have a doubt. The attacker would keep away the counties he had on the "starting land" but not the baronies, right? Or when you give count title to the randomly created soldier it also gives him all minor titles under it (baronies)?


Thanks for so developed and good answer man, you are awesome!
 
I dont want it for nomads, i can set this CB forbidden for nomads to avoid posible problems.

Destroy duchies and realms the attacker previously owned sounds a nice option to deal with them, i have to check how to do it.

I read all your code and i have a doubt. The attacker would keep away the counties he had on the "starting land" but not the baronies, right? Or when you give count title to the randomly created soldier it also gives him all minor titles under it (baronies)?


Thanks for so developed and good answer man, you are awesome!

Held baronies might not transfer properly as written (I'm unsure if grant_title automatically grants relevant baronies or not when you use it on a county), but that's easily solvable by giving the newly created count any title he's the de jure liege of after he has been landed. I believe vassal barons transfer properly when using grant_title, but if not just handing over de jure vassals of the new count inside ROOT's realm should solve it.

A few things I missed:

- Clear the flag after the title is handed over. Otherwise the CB risks unlanding someone that migrates into land held by the newly released character.

- Consider whether certain vassals (e.g. mercs, holy orders, and rel head titles) should be made independent or not in the initial step. As written, every count+ vassal will be released.
 
  • 1
Reactions: