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

Drakons

Private
75 Badges
Oct 16, 2015
15
1
  • Europa Universalis IV: Call to arms event
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - After Dark
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Third Rome
  • Magicka 2
  • Cities in Motion 2
  • Europa Universalis IV: Res Publica
  • Magicka
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis IV: Art of War
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Cities: Skylines - Green Cities
  • Stellaris: Digital Anniversary Edition
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Mandate of Heaven
  • BATTLETECH
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Expansion Pass
  • Tyranny - Bastards Wound
  • Tyranny: Archon Edition
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV Sign-up
  • Stellaris: Humanoids Species Pack
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Stellaris: Necroids
  • Crusader Kings II: Way of Life
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • ROOT is the character who has a case for war. (for both titles and character scopes)
  • FROM is the character who is being declared war on. (for both titles and character scopes)
http://www.ckiiwiki.com/Casus_Belli_modding#Scopes

So I assume you need to do something like this:

Code:
your_cb = {
  ai_will_do = {
    factor = 1
    modifier = {
      factor = 0
      ROOT = {
        has_character_flag = peaceful_ai
      }
    }
  }
}

However if you just want to overwrite all CB for your mp-mod just set
Code:
ai_will_do = { factor = 0 }
for any CB? no need to check a flag then.

-----------------------------

@NoxBestia

Code:
random_character = {
  limit = {
    is_lowborn = no
  }
  random_dynasty_member_even_if_dead = {
    limit = {
      is_alive = no
      is_female = no
    }
    # your code
  }
}

Does this work?
 
Last edited:

jursamaj

General
125 Badges
Aug 20, 2012
2.360
216
  • Victoria 2: Heart of Darkness
  • Hearts of Iron III
  • Heir to the Throne
  • Knights of Pen and Paper +1 Edition
  • Cities in Motion
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Stellaris: Galaxy Edition
  • Stellaris - Path to Destruction bundle
  • Victoria 2: A House Divided
  • Leviathan: Warships
  • Rome: Vae Victis
  • Stellaris
  • Europa Universalis IV: Pre-order
  • Magicka 2 - Signup Campaign
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Call to arms event
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis III Complete
  • Europa Universalis IV: Conquest of Paradise
  • Divine Wind
  • Europa Universalis IV: Art of War
  • Europa Universalis III: Chronicles
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Conclave
  • Europa Universalis III Complete
  • Europa Universalis IV: Common Sense
  • Europa Universalis III Complete
  • Pillars of Eternity
  • Europa Universalis IV
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Stellaris Sign-up
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: No Step Back
I'm not very experienced in CK2 scripting, so I'm slightly confused by the ai_will_do clause regarding Casus Belli:

does that mean that I can't use something like this:
Code:
 ai_will_do = {
factor = 0
       ROOT =
       {
           has_character_flag = peaceful_ai
       }
}

Because that is character scope, not title?
Further down in the same file:
Code:
# ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character
This is one of the unusual cases where the *starting* scope is not in fact ROOT. There are others. :confused:
 

jursamaj

General
125 Badges
Aug 20, 2012
2.360
216
  • Victoria 2: Heart of Darkness
  • Hearts of Iron III
  • Heir to the Throne
  • Knights of Pen and Paper +1 Edition
  • Cities in Motion
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Stellaris: Galaxy Edition
  • Stellaris - Path to Destruction bundle
  • Victoria 2: A House Divided
  • Leviathan: Warships
  • Rome: Vae Victis
  • Stellaris
  • Europa Universalis IV: Pre-order
  • Magicka 2 - Signup Campaign
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Call to arms event
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis III Complete
  • Europa Universalis IV: Conquest of Paradise
  • Divine Wind
  • Europa Universalis IV: Art of War
  • Europa Universalis III: Chronicles
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Conclave
  • Europa Universalis III Complete
  • Europa Universalis IV: Common Sense
  • Europa Universalis III Complete
  • Pillars of Eternity
  • Europa Universalis IV
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Stellaris Sign-up
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: No Step Back
Yep it is in the public build and has been for a few versions now, not sure when it was added though
Well, I'm going to document this for the wiki, since it's not there yet. :)

From your post, the text file needs to be directly in the CK2 documents directory. The commands are run in the scope of the player who consoles it. I assume no FROM-type scopes are set (wouldn't make sense).
 

blackninja9939

Experienced Programmer - Crusader Kings 3
Paradox Staff
78 Badges
Aug 28, 2013
2.401
7.847
  • Crusader Kings III
  • Stellaris: Federations
  • Battle for Bosporus
  • Stellaris: Nemesis
  • Hearts of Iron IV: No Step Back
  • Europa Universalis IV
  • Crusader Kings III: Royal Edition
  • Europa Universalis 4: Emperor
  • Stellaris: Necroids
  • Crusader Kings II
  • Crusader Kings II: Holy Fury
  • Imperator: Rome - Magna Graecia
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Synthetic Dawn
  • Surviving Mars
  • BATTLETECH
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Monks and Mystics
  • Tyranny: Archon Edition
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Colonel
  • Stellaris Sign-up
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Apocalypse
  • Stellaris: Lithoids
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Shadowrun Returns
  • Imperator: Rome Deluxe Edition
  • Prison Architect
  • Imperator: Rome Sign Up
  • Stellaris: Ancient Relics
  • Age of Wonders: Planetfall
  • Crusader Kings II: Conclave
  • Crusader Kings II: The Republic
  • Victoria 2
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Stellaris
  • Mount & Blade: Warband
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Sunset Invasion
Well, I'm going to document this for the wiki, since it's not there yet. :)

From your post, the text file needs to be directly in the CK2 documents directory. The commands are run in the scope of the player who consoles it. I assume no FROM-type scopes are set (wouldn't make sense).
Yeah the file needs to be directly in the documents directory and when you run it in game you need to include the .txt extension in the console.
ROOT is the character running the effect, it does not take an option character to set as ROOT but you can work around that by turning on charinfo and using direct scoping to the character you want to run effects on by doing c_1234 for a character with ID 1234. And yeah do not bother using FROM or chains of FROM.
 

NoxBestia

First Lieutenant
37 Badges
Jul 9, 2014
206
21
  • Crusader Kings II: Charlemagne
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sunset Invasion
  • Cities: Skylines - Green Cities
  • Crusader Kings II: Jade Dragon
  • Surviving Mars: Digital Deluxe Edition
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Crusader Kings II: Holy Fury Pre-order
  • Surviving Mars: First Colony Edition
  • Crusader Kings II: Holy Fury
  • Surviving Mars: First Colony Edition
  • Imperator: Rome Sign Up
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Surviving Mars
  • Cities: Skylines - Mass Transit
  • Crusader Kings II: Monks and Mystics
  • Cities: Skylines - Natural Disasters
  • Crusader Kings II: Reapers Due
  • Cities: Skylines - Snowfall
  • Crusader Kings II: Conclave
  • Cities: Skylines - After Dark
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Cities: Skylines
  • Europa Universalis IV
@NoxBestia

Code:
random_character = {
  limit = {
    is_lowborn = no
  }
  random_dynasty_member_even_if_dead = {
    limit = {
      is_alive = no
      is_female = no
    }
    # your code
  }
}

Does this work?

It did not work either.
 

MrWeRD

Major
49 Badges
Jul 9, 2012
722
141
  • Crusader Kings II: Charlemagne
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Cities: Skylines - Green Cities
  • Stellaris: Nemesis
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Cities: Skylines Industries
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Imperator: Rome Deluxe Edition
  • Prison Architect
  • Cities: Skylines - Campus
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Stellaris: Necroids
  • Stellaris: Galaxy Edition
  • 500k Club
  • Mount & Blade: Warband
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Crusader Kings II: Conclave
  • Cities: Skylines - Snowfall
  • Crusader Kings Complete
  • Crusader Kings II: Reapers Due
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
  • Stellaris: Galaxy Edition
  • Stellaris
  • Imperator: Rome
  • Stellaris: Distant Stars Pre-Order
  • Cities: Skylines
  • Stellaris: Synthetic Dawn
Does anyone know where to edit the province prosperity %? I'm thinking of giving thriving/booming counties more levies (not just reinforcement rate) in order to represent an increased population and the ability to recruit more men.
 

NoxBestia

First Lieutenant
37 Badges
Jul 9, 2014
206
21
  • Crusader Kings II: Charlemagne
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sunset Invasion
  • Cities: Skylines - Green Cities
  • Crusader Kings II: Jade Dragon
  • Surviving Mars: Digital Deluxe Edition
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Crusader Kings II: Holy Fury Pre-order
  • Surviving Mars: First Colony Edition
  • Crusader Kings II: Holy Fury
  • Surviving Mars: First Colony Edition
  • Imperator: Rome Sign Up
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Surviving Mars
  • Cities: Skylines - Mass Transit
  • Crusader Kings II: Monks and Mystics
  • Cities: Skylines - Natural Disasters
  • Crusader Kings II: Reapers Due
  • Cities: Skylines - Snowfall
  • Crusader Kings II: Conclave
  • Cities: Skylines - After Dark
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Cities: Skylines
  • Europa Universalis IV
@Drakons

Well, I _finally_ made it work. It is kludgy and ugly, but it works. Here was my solution:

Code:
any_character = {
            limit = {
                father_even_if_dead = {
                    OR = {
                        is_alive = no
                        father_even_if_dead = {
                            OR = {
                                is_alive = no
                                father_even_if_dead = {
                                    OR = {
                                        is_alive = no
                                        father_even_if_dead = {
                                            is_alive = no
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            random_dynasty_member_even_if_dead = {
                limit = {
                    is_alive = no
                    is_female = no
                }
                save_global_event_target_as = NOX_dead_male
            }
        }

One big limitation this solution has is that the dynasty has to have a living member in order to be included, but without the additional of a "any_character_even_if_dead" scope there is nothing I can imagine that can be done about that.
 

blackninja9939

Experienced Programmer - Crusader Kings 3
Paradox Staff
78 Badges
Aug 28, 2013
2.401
7.847
  • Crusader Kings III
  • Stellaris: Federations
  • Battle for Bosporus
  • Stellaris: Nemesis
  • Hearts of Iron IV: No Step Back
  • Europa Universalis IV
  • Crusader Kings III: Royal Edition
  • Europa Universalis 4: Emperor
  • Stellaris: Necroids
  • Crusader Kings II
  • Crusader Kings II: Holy Fury
  • Imperator: Rome - Magna Graecia
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Synthetic Dawn
  • Surviving Mars
  • BATTLETECH
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Monks and Mystics
  • Tyranny: Archon Edition
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Colonel
  • Stellaris Sign-up
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Apocalypse
  • Stellaris: Lithoids
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Shadowrun Returns
  • Imperator: Rome Deluxe Edition
  • Prison Architect
  • Imperator: Rome Sign Up
  • Stellaris: Ancient Relics
  • Age of Wonders: Planetfall
  • Crusader Kings II: Conclave
  • Crusader Kings II: The Republic
  • Victoria 2
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Stellaris
  • Mount & Blade: Warband
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Sunset Invasion
It did not work either.
Not sure exactly what you are doing but I noticed you are using the lowborn condition, currently the is_lowborn condition is inverted. If you want to check someone is lowborn you must do is_lowborn = yes.
This has already been fixed for 2.8 though but in 2.7.2 it is still inverted.
 

NoxBestia

First Lieutenant
37 Badges
Jul 9, 2014
206
21
  • Crusader Kings II: Charlemagne
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sunset Invasion
  • Cities: Skylines - Green Cities
  • Crusader Kings II: Jade Dragon
  • Surviving Mars: Digital Deluxe Edition
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Crusader Kings II: Holy Fury Pre-order
  • Surviving Mars: First Colony Edition
  • Crusader Kings II: Holy Fury
  • Surviving Mars: First Colony Edition
  • Imperator: Rome Sign Up
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Surviving Mars
  • Cities: Skylines - Mass Transit
  • Crusader Kings II: Monks and Mystics
  • Cities: Skylines - Natural Disasters
  • Crusader Kings II: Reapers Due
  • Cities: Skylines - Snowfall
  • Crusader Kings II: Conclave
  • Cities: Skylines - After Dark
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Cities: Skylines
  • Europa Universalis IV
Not sure exactly what you are doing but I noticed you are using the lowborn condition, currently the is_lowborn condition is inverted. If you want to check someone is lowborn you must do is_lowborn = yes.
This has already been fixed for 2.8 though but in 2.7.2 it is still inverted.

My ultimate goal would be to be able to randomly select _any_ dead character, dynastic or lowborn, but from what I understand of the current scopes that is not possible. I found a somewhat functional workaround, but as I stated here, it only works for dynasties with at least one living member.

For a haunting event I am working on, I'd _really_ love to be able to dig into ghosts from before 400 CE, but only a few of those still have surviving dynasties, so I decided on any dead character from any time.

An even more kludey option (that might even crash the game if I had tried it) was to make a static list of the approximately 2,700 dead characters in a 769 CE start and turn those into a giant random_list, but then as the game progresses and dynasties die out they are lost to the process. EDIT: for grins, I tried this and... it didn't blow up my game but oh what a CPU spike. Worse than scope any_character ever caused me (and I run a very high end system). /laughs
 
Last edited:

Velho e Bom Joe

An Whole Fool
93 Badges
Feb 15, 2012
266
1.253
  • Crusader Kings II: Horse Lords
  • Warlock: Master of the Arcane
  • War of the Roses
  • 500k Club
  • Stellaris: Digital Anniversary Edition
  • Crusader Kings II: Holy Knight (pre-order)
  • Europa Universalis IV: El Dorado
  • Stellaris: Leviathans Story Pack
  • Mount & Blade: Warband
  • Mount & Blade: With Fire and Sword
  • Crusader Kings II: Way of Life
  • Age of Wonders: Planetfall - Revelations
  • Europa Universalis IV: Common Sense
  • The Showdown Effect
  • Cities: Skylines - Natural Disasters
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Conclave
  • Cities: Skylines - Mass Transit
  • Stellaris: Ancient Relics
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Tyranny: Archon Edition
  • Tyranny: Archon Edition
  • Shadowrun: Dragonfall
  • Tyranny - Tales from the Tiers
  • Tyranny - Bastards Wound
  • Age of Wonders: Planetfall
  • Cities: Skylines - Green Cities
  • Age of Wonders: Planetfall Deluxe edition
  • Age of Wonders: Planetfall Premium edition
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Cities: Skylines - Campus
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Stellaris: Federations
  • Imperator: Rome - Magna Graecia
  • Europa Universalis IV
  • Age of Wonders: Planetfall Season pass
  • Stellaris: Lithoids
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Imperator: Rome Sign Up
  • Europa Universalis III Complete
  • Cities: Skylines - Parklife
  • Victoria 3 Sign Up
  • Europa Universalis III Complete
Further down in the same file:
Code:
# ai importance placed on this CB: scope is the targeted title, ROOT is the attacking character, FROM is the defending character
This is one of the unusual cases where the *starting* scope is not in fact ROOT. There are others. :confused:

Ahh, so that means I could do something like this?

Code:
 ai_will_do = {
factor = 0
AND = {
       has_title_flag = some_random_title_flag #check if the specific title has a flag
       ROOT =
       {
           has_character_flag = peaceful_ai
       }
}
 

blackninja9939

Experienced Programmer - Crusader Kings 3
Paradox Staff
78 Badges
Aug 28, 2013
2.401
7.847
  • Crusader Kings III
  • Stellaris: Federations
  • Battle for Bosporus
  • Stellaris: Nemesis
  • Hearts of Iron IV: No Step Back
  • Europa Universalis IV
  • Crusader Kings III: Royal Edition
  • Europa Universalis 4: Emperor
  • Stellaris: Necroids
  • Crusader Kings II
  • Crusader Kings II: Holy Fury
  • Imperator: Rome - Magna Graecia
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Synthetic Dawn
  • Surviving Mars
  • BATTLETECH
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Monks and Mystics
  • Tyranny: Archon Edition
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Colonel
  • Stellaris Sign-up
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Apocalypse
  • Stellaris: Lithoids
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Shadowrun Returns
  • Imperator: Rome Deluxe Edition
  • Prison Architect
  • Imperator: Rome Sign Up
  • Stellaris: Ancient Relics
  • Age of Wonders: Planetfall
  • Crusader Kings II: Conclave
  • Crusader Kings II: The Republic
  • Victoria 2
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Stellaris
  • Mount & Blade: Warband
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Sunset Invasion
My ultimate goal would be to be able to randomly select _any_ dead character, dynastic or lowborn, but from what I understand of the current scopes that is not possible. I found a somewhat functional workaround, but as I stated here, it only works for dynasties with at least one living member.

For a haunting event I am working on, I'd _really_ love to be able to dig into ghosts from before 400 CE, but only a few of those still have surviving dynasties, so I decided on any dead character from any time.

An even more kludey option (that might even crash the game if I had tried it) was to make a static list of the approximately 2,700 dead characters in a 769 CE start and turn those into a giant random_list, but then as the game progresses and dynasties die out they are lost to the process. EDIT: for grins, I tried this and... it didn't blow up my game but oh what a CPU spike. Worse than scope any_character ever caused me (and I run a very high end system). /laughs
You can find any dead lowborn very easily. Create a lowborn character then look for any dynasty member as they all share the same dynasty.
For people with actual dynasty members it is not as easy, a better way of doing it would probably to not search for a character and then their dynasty members but instead a title and one of its holders then go to their dynasty as that way you can pick any title and then any ruler and then members of their dynasty and get a wider spread as all rulers have to be a noble.
 

NoxBestia

First Lieutenant
37 Badges
Jul 9, 2014
206
21
  • Crusader Kings II: Charlemagne
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sunset Invasion
  • Cities: Skylines - Green Cities
  • Crusader Kings II: Jade Dragon
  • Surviving Mars: Digital Deluxe Edition
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Crusader Kings II: Holy Fury Pre-order
  • Surviving Mars: First Colony Edition
  • Crusader Kings II: Holy Fury
  • Surviving Mars: First Colony Edition
  • Imperator: Rome Sign Up
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Surviving Mars
  • Cities: Skylines - Mass Transit
  • Crusader Kings II: Monks and Mystics
  • Cities: Skylines - Natural Disasters
  • Crusader Kings II: Reapers Due
  • Cities: Skylines - Snowfall
  • Crusader Kings II: Conclave
  • Cities: Skylines - After Dark
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Cities: Skylines
  • Europa Universalis IV
You can find any dead lowborn very easily. Create a lowborn character then look for any dynasty member as they all share the same dynasty.
For people with actual dynasty members it is not as easy, a better way of doing it would probably to not search for a character and then their dynasty members but instead a title and one of its holders then go to their dynasty as that way you can pick any title and then any ruler and then members of their dynasty and get a wider spread as all rulers have to be a noble.

Is there a way to select a deceased past holder of a title, or just the current holder?
 

blackninja9939

Experienced Programmer - Crusader Kings 3
Paradox Staff
78 Badges
Aug 28, 2013
2.401
7.847
  • Crusader Kings III
  • Stellaris: Federations
  • Battle for Bosporus
  • Stellaris: Nemesis
  • Hearts of Iron IV: No Step Back
  • Europa Universalis IV
  • Crusader Kings III: Royal Edition
  • Europa Universalis 4: Emperor
  • Stellaris: Necroids
  • Crusader Kings II
  • Crusader Kings II: Holy Fury
  • Imperator: Rome - Magna Graecia
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Synthetic Dawn
  • Surviving Mars
  • BATTLETECH
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Monks and Mystics
  • Tyranny: Archon Edition
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Colonel
  • Stellaris Sign-up
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Apocalypse
  • Stellaris: Lithoids
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Shadowrun Returns
  • Imperator: Rome Deluxe Edition
  • Prison Architect
  • Imperator: Rome Sign Up
  • Stellaris: Ancient Relics
  • Age of Wonders: Planetfall
  • Crusader Kings II: Conclave
  • Crusader Kings II: The Republic
  • Victoria 2
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Stellaris
  • Mount & Blade: Warband
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Sunset Invasion
Is there a way to select a deceased past holder of a title, or just the current holder?
any_previous_holder when in the scope of a title.
egs:
Code:
e_hre = { any_previous_holder = { blah } }
PREVPREV = { any_previous_holder = { blah } }
 

NoxBestia

First Lieutenant
37 Badges
Jul 9, 2014
206
21
  • Crusader Kings II: Charlemagne
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sunset Invasion
  • Cities: Skylines - Green Cities
  • Crusader Kings II: Jade Dragon
  • Surviving Mars: Digital Deluxe Edition
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Crusader Kings II: Holy Fury Pre-order
  • Surviving Mars: First Colony Edition
  • Crusader Kings II: Holy Fury
  • Surviving Mars: First Colony Edition
  • Imperator: Rome Sign Up
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Surviving Mars
  • Cities: Skylines - Mass Transit
  • Crusader Kings II: Monks and Mystics
  • Cities: Skylines - Natural Disasters
  • Crusader Kings II: Reapers Due
  • Cities: Skylines - Snowfall
  • Crusader Kings II: Conclave
  • Cities: Skylines - After Dark
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Cities: Skylines
  • Europa Universalis IV
any_previous_holder when in the scope of a title.
egs:
Code:
e_hre = { any_previous_holder = { blah } }
PREVPREV = { any_previous_holder = { blah } }

Thank you very much. I will try this out!
 

Forestarius

Corporal
18 Badges
Feb 24, 2017
32
0
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II
  • Crusader Kings III: Royal Edition
  • Crusader Kings III
  • Crusader Kings II: Holy Fury
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
The whole thing with dukes, kings and princes joining monastic societies doesn't make sense to me and so I'm creating knightly orders in my mod and leaving the monastic orders as a secondary flavor thing for courties and the like, so I ask the following:

How do I mod said societies so that only characters with religious education traits can join? I also want to make it so that upon joining the character receives the monk/nun trait, but without the risk of disqualifying heirs/destroying dynasties. I couldn't really find it in the game files.

Alternatively add the requirement that characters joining must have the monk/nun trait beforehand, but that is a rare trait right? Only event I know of that adds it is that one from SoA, so I would need to also change it so that it happens more oftenly and so that it happens to random courtiers/lowborn/not belonging to the character's dinasty:

# Child wants to be monk/nun - select child
character_event = {
id = SoA.5216

hide_window = yes

min_age = 16
only_capable = yes
prisoner = no
ai = no
religion_group = christian

trigger = {
has_dlc = "Sons of Abraham"

any_child = {
is_ruler = no
age = 13
NOT = { age = 16 }
NOT = { trait = cynical }
NOT = { is_ascetic_trigger = yes }
}
}

mean_time_to_happen = {
months = 1000
}

immediate = {
random_child = {
limit = {
is_ruler = no
age = 13
NOT = { age = 16 }
NOT = { trait = cynical }
NOT = { is_ascetic_trigger = yes }
}
character_event = { id = SoA.5217 }
}
}
}

# Child bounce event
character_event = {
id = SoA.5217

is_triggered_only = yes

hide_window = yes

immediate = {
FROM = {
character_event = { id = SoA.5218 }
}
}
}

# Child wants to be monk/nun - parent response
character_event = {
id = SoA.5218
desc = EVTDESC_SoA_5218
picture = GFX_evt_courtiers_talking
border = GFX_event_normal_frame_religion

is_triggered_only = yes

option = {
name = EVTOPTA_SoA_5218
ai_chance = {
factor = 0
}
FROM = {
if = {
limit = {
is_female = yes
}
add_trait = nun
}
if = {
limit = {
is_female = no
}
add_trait = monk
}
opinion = {
modifier = opinion_grateful
who = ROOT
years = 100
}
}
custom_tooltip = { text = EVTTOOLTIPA_SOA_5218 }
}
option = {
name = EVTOPTB_SoA_5218
ai_chance = {
factor = 100
}
FROM = {
add_trait = stressed
opinion = {
modifier = opinion_angry
who = ROOT
years = 3
}
}
custom_tooltip = { text = EVTTOOLTIPB_SOA_5218 }
}
}
 

Silversweeeper

Ichi no Hito
58 Badges
Aug 24, 2012
3.937
2.839
  • Stellaris - Path to Destruction bundle
  • 500k Club
  • Europa Universalis IV: El Dorado
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris: Distant Stars
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Imperator: Rome Sign Up
  • Imperator: Rome Deluxe Edition
  • Crusader Kings II: Holy Fury
  • Stellaris: Megacorp
  • Europa Universalis IV
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV: Mare Nostrum
  • Crusader Kings II: Charlemagne
  • Stellaris Sign-up
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Res Publica
  • Crusader Kings II
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III Complete
  • Magicka
Also, anyway to actually make baron-tier characters have any AI at all? As in at least pursuing marriages and alliances

You could fire an on_[something]_pulse (I suggest on_five_year_pulse or on_decade_pulse, because there are plenty of barons) event for them which allows for them to marry. However, because you can't access the AI marriage logic or force the AI to use the marriage interaction, I suggest that you simply code the event to pick a random eligible Lowborn or daughter of some other baron that isn't too old or young, is of the proper religion (group), and perhaps lives up to some other conditions (e.g. same culture group) and have them either automatically marry (if the bride's host is another baron) or send a message to the bride's host about the marriage (if the bride's host is count-tier above) that an AI host is taught to always accept (perhaps excluding e.g. the baron being a rival, the prospective bride is the host's lover, or the like), and perhaps a similar pulse event for the heir of the baron. However, keep in mind that if barons marry and have children more frequently performance might suffer from there being a lot more characters around after a few generations.

You could do something similar for alliances (as you once again can't access the actual logic or interaction), but as non-patrician barons don't declare wars at all (and only rarely end up as the primary defender in a war) it would probably be rather meaningless in the end and end up simply being a performance drain.
 

LordPeter

Marjoram
49 Badges
Mar 5, 2012
2.249
382
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Conclave
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Prison Architect
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Synthetic Dawn
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Imperator: Rome
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Europa Universalis IV
  • Crusader Kings II: Sword of Islam
  • Stellaris
  • Europa Universalis IV: Third Rome
  • Cities: Skylines
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV: Cradle of Civilization
Does anyone know where to edit the province prosperity %? I'm thinking of giving thriving/booming counties more levies (not just reinforcement rate) in order to represent an increased population and the ability to recruit more men.
You mean the major province modifier?
That'd be pretty straightforward: Just make a mod, and include a /common/event_modifiers folder.
Then put a file there like "my_new_prosperity_modifiers.txt" and open the vanilla file (in the folder of the same name, just in the vanilla game files) called "00_event_modifiers.txt" and search for "prosperity_modifier_1" (also 2 & 3, respectively) in it, and copy these modifiers to your own file. Then add a line to them called "levy_size = 0.1" or whatever value you want it, for each of the three prosperity modifiers.
 

jursamaj

General
125 Badges
Aug 20, 2012
2.360
216
  • Victoria 2: Heart of Darkness
  • Hearts of Iron III
  • Heir to the Throne
  • Knights of Pen and Paper +1 Edition
  • Cities in Motion
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Stellaris: Galaxy Edition
  • Stellaris - Path to Destruction bundle
  • Victoria 2: A House Divided
  • Leviathan: Warships
  • Rome: Vae Victis
  • Stellaris
  • Europa Universalis IV: Pre-order
  • Magicka 2 - Signup Campaign
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Call to arms event
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis III Complete
  • Europa Universalis IV: Conquest of Paradise
  • Divine Wind
  • Europa Universalis IV: Art of War
  • Europa Universalis III: Chronicles
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Conclave
  • Europa Universalis III Complete
  • Europa Universalis IV: Common Sense
  • Europa Universalis III Complete
  • Pillars of Eternity
  • Europa Universalis IV
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Stellaris Sign-up
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: No Step Back
Ahh, so that means I could do something like this?

Code:
 ai_will_do = {
factor = 0
AND = {
       has_title_flag = some_random_title_flag #check if the specific title has a flag
       ROOT =
       {
           has_character_flag = peaceful_ai
       }
}
Yes. You could even get back to the title scope within another scope, like so:
Code:
ai_will_do = {
    factor = 0
    AND = {
       has_title_flag = some_random_title_flag #check if the specific title has a flag
       ROOT =
       {
          has_character_flag = peaceful_ai
          PREV = { /back in title scope/ }
       }
    }
}
 

MrWeRD

Major
49 Badges
Jul 9, 2012
722
141
  • Crusader Kings II: Charlemagne
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Cities: Skylines - Green Cities
  • Stellaris: Nemesis
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Cities: Skylines Industries
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Imperator: Rome Deluxe Edition
  • Prison Architect
  • Cities: Skylines - Campus
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Stellaris: Necroids
  • Stellaris: Galaxy Edition
  • 500k Club
  • Mount & Blade: Warband
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Crusader Kings II: Conclave
  • Cities: Skylines - Snowfall
  • Crusader Kings Complete
  • Crusader Kings II: Reapers Due
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
  • Stellaris: Galaxy Edition
  • Stellaris
  • Imperator: Rome
  • Stellaris: Distant Stars Pre-Order
  • Cities: Skylines
  • Stellaris: Synthetic Dawn
You mean the major province modifier?
That'd be pretty straightforward: Just make a mod, and include a /common/event_modifiers folder.
Then put a file there like "my_new_prosperity_modifiers.txt" and open the vanilla file (in the folder of the same name, just in the vanilla game files) called "00_event_modifiers.txt" and search for "prosperity_modifier_1" (also 2 & 3, respectively) in it, and copy these modifiers to your own file. Then add a line to them called "levy_size = 0.1" or whatever value you want it, for each of the three prosperity modifiers.
Thanks, man! I've always wanted to modify those numbers, but I could never find the file.