• 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
Hi, I'm trying to set the graphical_culture of a child after birth to the graphical_culture of its father ( or real_father is existing). I made an on_action event which works fine, but somehow, the graphical_culture setting part in the option is not executed:

Code:
option = {
        name = OK
        if = {
            limit = {
                is_father_real_father = yes
            }
            father = { ROOT = { set_graphical_culture = PREV }}
        }
        if = {
            limit = {
                is_father_real_father = no
            }
            real_father = { ROOT = { set_graphical_culture = PREV }}
        }
    }

Can you maybe help me? Thanks :)
 

Korbah

Ratel
136 Badges
Mar 3, 2011
4.758
1.272
  • Europa Universalis IV
  • Crusader Kings II: Holy Knight (pre-order)
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Natural Disasters
  • Cities: Skylines - Campus
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall Deluxe edition
  • Stellaris: Federations
  • Imperator: Rome - Magna Graecia
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Battle for Bosporus
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Victoria 3 Sign Up
set_graphical_culture only accepts cultures.

Example
Code:
set_graphical_culture = german

This would set the character's graphical culture to "germangfx". To do what you want to do you'd need to do something like this;
Code:
    if = {
        limit = {
            is_father_real_father = yes
        }
        if = {
            limit = { father = { graphical_culture = germangfx } }
            set_graphical_culture = german
        }
    }

Repeating the ifs for each graphical culture. Until we get the elses anyway.
 
Last edited:

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
set_graphical_culture only accepts cultures.

Example
Code:
set_graphical_culture = german

This would set the character's graphical culture to "germangfx". To do what you want to do you'd need to do something like this;
Code:
    if = {
        limit = {
            is_father_real_father = yes
        }
        if = {
            limit = { father = { graphical_culture = germangfx } }
            set_graphical_culture = german
        }
    }

Repeating the ifs for each graphical culture.

Adding to this, it might be worth scripting a scripted effect to fix graphical culture in case you want to reuse it so you can call it with e.g. change_graphical_culture = yes instead of copy-pasting all the cultures again and having to update a multitude of references to it if new cultures are added. Ideally, you should set it up so that it works for any PREV and ROOT (e.g. "capital_scope = { ROOT = { change_graphical_culture = yes }", with change_grapical_culture looking for the culture of PREV).
 

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
Oh thank you. The wiki said the command was able to use cultures, characters and provines:

Sets the ethnicity of character, based on the default graphical_culture of a culture, or of the culture of another character or province.

Which is wrong I assume :(
 

hadaev

Colonel
25 Badges
Sep 7, 2012
972
209
  • Europa Universalis III Complete
  • Divine Wind
  • Crusader Kings II
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Crusader Kings III
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Shadowrun: Dragonfall
  • Stellaris: Distant Stars
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Tyranny: Archon Edition
  • Stellaris Sign-up
  • Stellaris
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV
  • Magicka
Order of pre triggers matter?
What best order in most cases?

@blackninja9939
How to get variable in log?
Can I increase the number of provinces under the direct control for the nomads?
Any way to trigger artifact by slot (need to count only equipped things)?
Can i disable trade post for government type?
 

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
No it is not wrong the command does take a scope.

Well ... then I'm confused. If it actually can take a scope, why does code like this do not work for me?:

Code:
       if = {
            limit = {
                is_father_real_father = yes
            }
            father = { ROOT = { set_graphical_culture = PREV }}
        }

or even

Code:
 set_graphical_culture = father

What would be the correct syntax?
 

Korbah

Ratel
136 Badges
Mar 3, 2011
4.758
1.272
  • Europa Universalis IV
  • Crusader Kings II: Holy Knight (pre-order)
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Natural Disasters
  • Cities: Skylines - Campus
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall Deluxe edition
  • Stellaris: Federations
  • Imperator: Rome - Magna Graecia
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Battle for Bosporus
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Victoria 3 Sign Up
Well ... then I'm confused. If it actually can take a scope, why does code like this do not work for me?:

Code:
       if = {
            limit = {
                is_father_real_father = yes
            }
            father = { ROOT = { set_graphical_culture = PREV }}
        }

or even

Code:
 set_graphical_culture = father

What would be the correct syntax?

Did you try the script I suggested?
 

Korbah

Ratel
136 Badges
Mar 3, 2011
4.758
1.272
  • Europa Universalis IV
  • Crusader Kings II: Holy Knight (pre-order)
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Natural Disasters
  • Cities: Skylines - Campus
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall Deluxe edition
  • Stellaris: Federations
  • Imperator: Rome - Magna Graecia
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Battle for Bosporus
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Victoria 3 Sign Up
Yes I tried it and using it the way you have said it works. I'm more confused by @blackninja9939 who said the command actually could take a character or province scope as input - which would be a lot more elegant.

I completely understand.
EK uses the method I described as the scoping method didn't work properly 3 or 4 (5?) years ago when I first wrote the script, maybe it's been fixed but that method at least is proven to work. I'm sure @blackninja9939 will be around to post the correct method sometime ;)

It'd be great to simplify my own scripts if it works.
 

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
I completely understand.
EK uses the method I described as the scoping method didn't work properly 3 or 4 (5?) years ago when I first wrote the script, maybe it's been fixed but that method at least is proven to work. I'm sure @blackninja9939 will be around to post the correct method sometime ;)

It'd be great to simplify my own scripts if it works.
@Drakons @Korbah
It definitely works with scopes, maybe there is an issue with some specific scopes or in certain use cases but I tested it by just making a file in Documents/Paradox Interactive/Crusader Kings 2 called test.txt and added the following to it:
Code:
create_character = {
    random_traits = yes
    culture = english
    dynasty = ROOT
}
new_character = {
    ROOT = { 
        set_father = PREV
        set_graphical_culture = PREV
    }
}
Then get in game and start as a character who is say Muslim and type in the console "run test.txt" and you will get a newly generated father and your graphical culture will change to be his aka the English graphics.
 

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
@Drakons @Korbah
It definitely works with scopes, maybe there is an issue with some specific scopes or in certain use cases but I tested it by just making a file in Documents/Paradox Interactive/Crusader Kings 2 called test.txt and added the following to it:
Code:
create_character = {
    random_traits = yes
    culture = english
    dynasty = ROOT
}
new_character = {
    ROOT = {
        set_father = PREV
        set_graphical_culture = PREV
    }
}
Then get in game and start as a character who is say Muslim and type in the console "run test.txt" and you will get a newly generated father and your graphical culture will change to be his aka the English graphics.
Wait… you can do that? Just execute a text file of commands from the console? That is *so* cool! Is that in the production version, or just the dev build?
 

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
Wait… you can do that? Just execute a text file of commands from the console? That is *so* cool! Is that in the production version, or just the dev build?
Yep it is in the public build and has been for a few versions now, not sure when it was added though
 

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
I'm not very experienced in CK2 scripting, so I'm slightly confused by the ai_will_do clause regarding Casus Belli:
Casus Belli file comments said:
"#ai_will_do: modifies value AI places on the CB compared to other CBs (default: 1) Note: is in title scope"

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?

Basically, I want to make a (useful in MP) mod that allows the player to forbid the AI to declare war. I was going to put this check in the can_use section, but since there's an ai_will_do section, I thought it was potentially more convenient (albeit more difficult to test and be sure it is actually working).

Thanks in advance :)
 

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
I am trying to scope to two different random dead characters. I can scope to one of my dynasty without problem, but I am unable to scope to any dead character from some other random dynasty. Here is what works:

Code:
random_dynasty_member_even_if_dead = {
            limit = {
                is_alive = no
                is_female = no
            }
            save_global_event_target_as = NOX_dead_male_family
        }

Here are a couple of the things I have tried and failed in order to get some random dead guy:
Code:
random_character = {
            limit = {
                is_alive = no
                is_female = no
            }
            save_global_event_target_as = NOX_dead_male1
        }

Code:
any_character = {
            limit = {
                NOT = { is_lowborn = yes}
                random_dynasty_member_even_if_dead = {
                    limit = {
                        is_alive = no
                        is_female = no
                    }
                    save_global_event_target_as = NOX_dead_male1
                }
            }
        }

It would be easier if there was a "random_character_even_if_dead" or "any_character_even_if_dead" command, but both of those blow up the event.

I would greatly appreciate any help on how to do this.

Thanks!
 

Rydelfox

Lt. General
90 Badges
Oct 30, 2016
1.476
12
  • A Game of Dwarves
  • King Arthur II
  • Knights of Pen and Paper +1 Edition
  • Magicka
  • Majesty 2
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Third Rome
  • Sword of the Stars
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Europa Universalis IV: Mare Nostrum
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Jade Dragon
  • Stellaris - Path to Destruction bundle
  • 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
  • Hearts of Iron III
  • Crusader Kings II: Sword of Islam
  • Dungeonland
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II: Sunset Invasion
  • Europa Universalis IV: Art of War
  • Crusader Kings II: Conclave
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Leviathans Story Pack
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Cadet
  • Stellaris: Galaxy Edition
  • Stellaris
  • Hearts of Iron IV: No Step Back
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV
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?

Basically, I want to make a (useful in MP) mod that allows the player to forbid the AI to declare war. I was going to put this check in the can_use section, but since there's an ai_will_do section, I thought it was potentially more convenient (albeit more difficult to test and be sure it is actually working).

Thanks in advance :)
I'm not sure what scope it starts in, but if it's in a title scope, you can just change to the title holder's scope like this:
Code:
 ai_will_do = {
    holder_scope = {
            has_character_flag = peaceful_ai
    }
}
 

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
I'm not sure what scope it starts in, but if it's in a title scope, you can just change to the title holder's scope like this:
Code:
 ai_will_do = {
    holder_scope = {
            has_character_flag = peaceful_ai
    }
}

I don't know what scope it starts in. On the comments at the top of the file , it specifically notes that it "is in title scope". I would assume that means I have to do as you said, but checking another CB as example...
Code:
(stuff went before)
ai_will_do = {
       factor = 1
       modifier = {
           factor = 0
           ROOT = {
               opinion = { who = FROM value = 25 }
           }
       }
       modifier = {
           factor = 0.5
           ROOT = {
               opinion = { who = FROM value = 0 }
           }
       }      
       modifier = {
           factor = 0.5
           ROOT = {
               opinion = { who = FROM value = -25 }
           }
       }          
   }      
(stuff after)
Isn't that what is called character scope in CK2 scripting, what with the ROOT opinion, which implies ROOT is a character?
Again, I'm not experienced with CK2 scripting, just trying to understand if I got it right :)