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

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
Just checked these out. The while clause doesn't appear to have anything to do with the remove_character_modifiers. Furthermore, in all 7 of these instances, the command is used to remove all instances of a character modifier anyway (999 for the duels and 30 for the coronation). This makes me think that the command is intended to remove all instances of a modifier anyway, though I'm not sure why they'd do that as simply remove_character_modifier does this anyway.
Yes, that version of the code wipes out the modifiers, then the 'while' counts the modifiers in as it counts the variable down. I was thinking, if the remove_character_modifiers with amount 1 works, it would be simple to reverse the logic to put the number into a variable, subtract 1 from the variable, then use the original logic to put the number of modifiers in the variable back on the character.

I just had a thought: are we looking at this backwards? Does 'remove_character_modifier' only remove 1 of a stacking modifier?
 

GodModder

First Lieutenant
39 Badges
May 10, 2021
281
41
  • Shadowrun Returns
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Digital Anniversary Edition
  • Shadowrun: Hong Kong
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Crusader Kings II: Way of Life
  • 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
  • Majesty 2 Collection
  • Crusader Kings II
  • Pillars of Eternity
  • Magicka 2
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
Yes, that version of the code wipes out the modifiers, then the 'while' counts the modifiers in as it counts the variable down. I was thinking, if the remove_character_modifiers with amount 1 works, it would be simple to reverse the logic to put the number into a variable, subtract 1 from the variable, then use the original logic to put the number of modifiers in the variable back on the character.

I just had a thought: are we looking at this backwards? Does 'remove_character_modifier' only remove 1 of a stacking modifier?
remove_character_modifier removes all instances of a modifier. remove_character_modifiers also removes all instances of a modifier, according to Whizzer's tests confirming my issue, unfortunately.

I'd like to write something that would save the number of modifier instances, subtract it by one, and add that number back after removing them, but I don't know where to even start with variables.
 

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
remove_character_modifier removes all instances of a modifier. remove_character_modifiers also removes all instances of a modifier, according to Whizzer's tests confirming my issue, unfortunately.

I'd like to write something that would save the number of modifier instances, subtract it by one, and add that number back after removing them, but I don't know where to even start with variables.
Are these your own modifiers? If so, then here's a solution:

Whenever you add modifier instances, add that many to a corresponding variable as well. When you later want to remove 1 or more instances, subtract that many from the variable (minimum of 0), remove all instances, and use a while loop to add the new total number of instances.

It's clunky, but at this point, I don't expect the devs to fix the remove_character_modifiers functionality.
 

GodModder

First Lieutenant
39 Badges
May 10, 2021
281
41
  • Shadowrun Returns
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Digital Anniversary Edition
  • Shadowrun: Hong Kong
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Crusader Kings II: Way of Life
  • 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
  • Majesty 2 Collection
  • Crusader Kings II
  • Pillars of Eternity
  • Magicka 2
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
Are these your own modifiers? If so, then here's a solution:

Whenever you add modifier instances, add that many to a corresponding variable as well. When you later want to remove 1 or more instances, subtract that many from the variable (minimum of 0), remove all instances, and use a while loop to add the new total number of instances.

It's clunky, but at this point, I don't expect the devs to fix the remove_character_modifiers functionality.
That's what I'd like to do, but I don't know how to do variables. I'll see if the wiki has a page on them.
 

jonjowett

Field Marshal
83 Badges
Aug 31, 2012
3.334
1.950
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV: Mare Nostrum
  • Crusader Kings II: Monks and Mystics
  • BATTLETECH
  • Cities: Skylines - Natural Disasters
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Tyranny: Archon Edition
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Distant Stars
  • Europa Universalis IV: Golden Century
  • Surviving Mars
  • Shadowrun Returns
  • Cities: Skylines - Parklife
  • Tyranny - Bastards Wound
  • Cities: Skylines - Green Cities
  • Stellaris: Megacorp
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Crusader Kings II: Charlemagne
  • Europa Universalis IV
  • Europa Universalis IV: Dharma
  • Imperator: Rome Sign Up
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Rule Britannia
  • BATTLETECH - Digital Deluxe Edition
  • Shadowrun: Dragonfall
  • Victoria 2
  • 500k Club
  • Stellaris: Ancient Relics
  • Europa Universalis IV: El Dorado
  • Europa Universalis 4: Emperor
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Imperator: Rome Deluxe Edition
Thank you!

It doesn't look like instances of a character modifier are something that can be exported to a variable though. That torpedoes my idea. Unless I'm missing something?
Pseudocode:

Whenever you add 1 instance of the modifier:
Code:
add 1 instance of my_character_modifier
if my_character_variable==0 set my_character_variable=1 ("check_variable", "set_variable")
else increase my_character_variable by 1 ("change_variable")

Whenever you want to remove 1 instance of the modifier:
Code:
remove all instances of my_character_modifier
decrease my_character_variable by 1 ("subtract_variable")
set my_temporary_counter = 0
while my_temporary_counter <= my_character_variable:
 --- add 1 instance of my_character_modifier
 --- increase my_temporary_counter by 1
 
  • 1Like
Reactions:

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
Pseudocode:

Whenever you add 1 instance of the modifier:
Code:
add 1 instance of my_character_modifier
if my_character_variable==0 set my_character_variable=1 ("check_variable", "set_variable")
else increase my_character_variable by 1 ("change_variable")

Whenever you want to remove 1 instance of the modifier:
Code:
remove all instances of my_character_modifier
decrease my_character_variable by 1 ("subtract_variable")
set my_temporary_counter = 0
while my_temporary_counter <= my_character_variable:
 --- add 1 instance of my_character_modifier
 --- increase my_temporary_counter by 1
My understanding is that you don't need the 'if 0 set to 1' bit. Attempting to increase a variable that hasn't previously been set just assumes it starts from 0 anyway.
 
  • 1
Reactions:

neutrondecay

Colonel
23 Badges
Oct 1, 2015
1.107
917
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings III
  • Crusader Kings II: Holy Fury
  • Crusader Kings II: Holy Fury Pre-order
  • Crusader Kings II: Jade Dragon
  • Cities: Skylines - Mass Transit
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Conclave
  • Cities: Skylines - After Dark
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Cities: Skylines
  • Europa Universalis IV
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
What might cause the 'dukes called kings' behaviour to misfire? I have that option set to 'yes' on several cultures, and most of them display the expected behaviour - they use king-tier titles and regnal numbers if they are independent dukes. But I added the option to a longstanding culture recently, and it's only displaying the regnal numbers, not the king-tier titles. The king-tier titles are set in localisation for the culture, and the in-game titles are independent duchies. Would I also need to set a distinctive duke-tier title to make it work?

Thanks,

nd
 

GodModder

First Lieutenant
39 Badges
May 10, 2021
281
41
  • Shadowrun Returns
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Digital Anniversary Edition
  • Shadowrun: Hong Kong
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Crusader Kings II: Way of Life
  • 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
  • Majesty 2 Collection
  • Crusader Kings II
  • Pillars of Eternity
  • Magicka 2
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
Pseudocode:

Whenever you add 1 instance of the modifier:
Code:
add 1 instance of my_character_modifier
if my_character_variable==0 set my_character_variable=1 ("check_variable", "set_variable")
else increase my_character_variable by 1 ("change_variable")

Whenever you want to remove 1 instance of the modifier:
Code:
remove all instances of my_character_modifier
decrease my_character_variable by 1 ("subtract_variable")
set my_temporary_counter = 0
while my_temporary_counter <= my_character_variable:
 --- add 1 instance of my_character_modifier
 --- increase my_temporary_counter by 1
Hit a snag. For the while clause, how do I compare one variable to another? I don't see anything on the Conditions wiki page or Scripting#Variables wiki page.
 

Gunthah

Major
81 Badges
Aug 22, 2012
520
387
  • Crusader Kings II
  • Europa Universalis IV
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Federations
  • Imperator: Rome - Magna Graecia
  • Crusader Kings III
  • Europa Universalis 4: Emperor
  • Crusader Kings II: Holy Fury Pre-order
  • Crusader Kings III Referal
  • Europa Universalis III Complete
  • Rome Gold
  • Victoria 2
  • Hearts of Iron IV: Colonel
  • Imperator: Rome Deluxe Edition
  • 500k Club
I'm having an issue with the Pope where he excommunicated my character, i repented sins, he lifted the excommunication and a few days later he excommunicated me again. I remove the trait with the console but he keeps doing it. By changing character and trying to request excommunication on my character I see the -1000 penalty is working and I can't request it, however the Pope keeps doing it. My question is where is the event or decision the Pope is using to do this?, because I don't think it can be happening through a regular request but I can't find where else.
 

GodModder

First Lieutenant
39 Badges
May 10, 2021
281
41
  • Shadowrun Returns
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Digital Anniversary Edition
  • Shadowrun: Hong Kong
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Crusader Kings II: Way of Life
  • 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
  • Majesty 2 Collection
  • Crusader Kings II
  • Pillars of Eternity
  • Magicka 2
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
I'm having an issue with the Pope where he excommunicated my character, i repented sins, he lifted the excommunication and a few days later he excommunicated me again. I remove the trait with the console but he keeps doing it. By changing character and trying to request excommunication on my character I see the -1000 penalty is working and I can't request it, however the Pope keeps doing it. My question is where is the event or decision the Pope is using to do this?, because I don't think it can be happening through a regular request but I can't find where else.
If you use the console command charinfo you can mouse over the event (or its option button) to see the ID of the event.
 
  • 1
Reactions:

Gunthah

Major
81 Badges
Aug 22, 2012
520
387
  • Crusader Kings II
  • Europa Universalis IV
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Federations
  • Imperator: Rome - Magna Graecia
  • Crusader Kings III
  • Europa Universalis 4: Emperor
  • Crusader Kings II: Holy Fury Pre-order
  • Crusader Kings III Referal
  • Europa Universalis III Complete
  • Rome Gold
  • Victoria 2
  • Hearts of Iron IV: Colonel
  • Imperator: Rome Deluxe Edition
  • 500k Club
If you use the console command charinfo you can mouse over the event (or its option button) to see the ID of the event.
Thanks. It says the event ID is just 2. I tried to find it to see if I could follow my way up to something but it must be hard-coded. I also tried to find my way through the localization text, but no luck. I had three kingdom titles, two of which had free investiture. Changed those to papal and the pope finally calmed down. No request, no event or anything, straight up chain excommunications until I guessed what he wanted.
 

Whizzer

CKPlus Triumvirate
77 Badges
Jun 17, 2014
1.617
789
  • Semper Fi
  • Hearts of Iron III Collection
  • Heir to the Throne
  • King Arthur II
  • Knights of Pen and Paper +1 Edition
  • Leviathan: Warships
  • The Kings Crusade
  • Magicka
  • Victoria: Revolutions
  • Rome Gold
  • Cities in Motion
  • Sengoku
  • Sword of the Stars
  • Sword of the Stars II
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • Europa Universalis IV: Mare Nostrum
  • Hearts of Iron III
  • A Game of Dwarves
  • Cities in Motion 2
  • 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: Sword of Islam
  • Dungeonland
  • Crusader Kings II: Sunset Invasion
  • Europa Universalis III
  • Divine Wind
  • Hearts of Iron III: Their Finest Hour
  • For the Motherland
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Conclave
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • War of the Roses
  • Crusader Kings III
  • Europa Universalis IV
Thanks. It says the event ID is just 2. I tried to find it to see if I could follow my way up to something but it must be hard-coded. I also tried to find my way through the localization text, but no luck. I had three kingdom titles, two of which had free investiture. Changed those to papal and the pope finally calmed down. No request, no event or anything, straight up chain excommunications until I guessed what he wanted.

Events 1 and 2 are hardcoded events, used for the notification system, which leaves you no way to track where it came from, but excommunications are mostly done through the semi-hardcoded diplomatic interaction.
 
  • 1
  • 1
Reactions:

GodModder

First Lieutenant
39 Badges
May 10, 2021
281
41
  • Shadowrun Returns
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Digital Anniversary Edition
  • Shadowrun: Hong Kong
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Crusader Kings II: Way of Life
  • 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
  • Majesty 2 Collection
  • Crusader Kings II
  • Pillars of Eternity
  • Magicka 2
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
I'm writing an event that checks if a ruler has seven adult sons that meet one of various criteria (including a specific trait, being landed, or being married to someone of a specific religion). I looked on the wiki for how I can do this, and discovered that "count = N" is a parameter for scopes, which I didn't know before. I've never used it before, so I want to check that I've got the code for the if = { } section right.

Code:
if = {
    limit = {
        any_child = {
            count = 7
            is_female = no
            age = 25
            OR = {
                trait = my_custom_trait
                is_landed = yes
                spouse = {
                    religion = my_custom_religion
                }
            }
        }
    }
    #do thing
}

Does that look right?
I just realized that I may have understood count wrong.

The wiki says "any_ scopes can use count = N. For condition scopes, the scope will evaluate to true only if at least N items match."

I assumed it meant that the scope would evaluate as true if there are N scopes that match all the conditions in the block. But a reread makes me think it means the scope evaluates as true if N conditions given in the trigger block match.

Example.
Code:
if = {
     limit = {
          any_courtier = {
               count = 7
              #numerous conditions listed here
          }
     }
    # do thing
}
Does this evaluate true for any courtier that matches at least 7 of these conditions, or does it evaluate true if there are at least 7 courtiers that match all the given conditions?
 

Whizzer

CKPlus Triumvirate
77 Badges
Jun 17, 2014
1.617
789
  • Semper Fi
  • Hearts of Iron III Collection
  • Heir to the Throne
  • King Arthur II
  • Knights of Pen and Paper +1 Edition
  • Leviathan: Warships
  • The Kings Crusade
  • Magicka
  • Victoria: Revolutions
  • Rome Gold
  • Cities in Motion
  • Sengoku
  • Sword of the Stars
  • Sword of the Stars II
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • Europa Universalis IV: Mare Nostrum
  • Hearts of Iron III
  • A Game of Dwarves
  • Cities in Motion 2
  • 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: Sword of Islam
  • Dungeonland
  • Crusader Kings II: Sunset Invasion
  • Europa Universalis III
  • Divine Wind
  • Hearts of Iron III: Their Finest Hour
  • For the Motherland
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Conclave
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • War of the Roses
  • Crusader Kings III
  • Europa Universalis IV
I just realized that I may have understood count wrong.

The wiki says "any_ scopes can use count = N. For condition scopes, the scope will evaluate to true only if at least N items match."

I assumed it meant that the scope would evaluate as true if there are N scopes that match all the conditions in the block. But a reread makes me think it means the scope evaluates as true if N conditions given in the trigger block match.

Example.
Code:
if = {
     limit = {
          any_courtier = {
               count = 7
              #numerous conditions listed here
          }
     }
    # do thing
}
Does this evaluate true for any courtier that matches at least 7 of these conditions, or does it evaluate true if there are at least 7 courtiers that match all the given conditions?

The latter, all conditions must be met for any given courtier to qualifty towards the count. To do the former, use calc_true_if.
 

GodModder

First Lieutenant
39 Badges
May 10, 2021
281
41
  • Shadowrun Returns
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Digital Anniversary Edition
  • Shadowrun: Hong Kong
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Crusader Kings II: Way of Life
  • 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
  • Majesty 2 Collection
  • Crusader Kings II
  • Pillars of Eternity
  • Magicka 2
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
The latter, all conditions must be met for any given courtier to qualifty towards the count. To do the former, use calc_true_if.
That's right, I forgot about calc_true_if. The wiki description of count at the top of the Conditions page does make it sound more like the former, at least to my reading. Thanks.
 

GodModder

First Lieutenant
39 Badges
May 10, 2021
281
41
  • Shadowrun Returns
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Digital Anniversary Edition
  • Shadowrun: Hong Kong
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Crusader Kings II: Way of Life
  • 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
  • Majesty 2 Collection
  • Crusader Kings II
  • Pillars of Eternity
  • Magicka 2
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
I want to have the Gulf of Riga song (from Holy Fury) play even when I'm not playing pagans. The music modding page on the wiki is very helpful, and I found the .txt file for Holy Fury's music in the /dlc folder.

My plan is to copy that file to my mod and edit the factor for Gulf of Riga playing, but (because it's DLC music) what folder in my mod should I put it? /music? /dlc? /dlc/music?
 

Whizzer

CKPlus Triumvirate
77 Badges
Jun 17, 2014
1.617
789
  • Semper Fi
  • Hearts of Iron III Collection
  • Heir to the Throne
  • King Arthur II
  • Knights of Pen and Paper +1 Edition
  • Leviathan: Warships
  • The Kings Crusade
  • Magicka
  • Victoria: Revolutions
  • Rome Gold
  • Cities in Motion
  • Sengoku
  • Sword of the Stars
  • Sword of the Stars II
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • Europa Universalis IV: Mare Nostrum
  • Hearts of Iron III
  • A Game of Dwarves
  • Cities in Motion 2
  • 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: Sword of Islam
  • Dungeonland
  • Crusader Kings II: Sunset Invasion
  • Europa Universalis III
  • Divine Wind
  • Hearts of Iron III: Their Finest Hour
  • For the Motherland
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Conclave
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • War of the Roses
  • Crusader Kings III
  • Europa Universalis IV
I want to have the Gulf of Riga song (from Holy Fury) play even when I'm not playing pagans. The music modding page on the wiki is very helpful, and I found the .txt file for Holy Fury's music in the /dlc folder.

My plan is to copy that file to my mod and edit the factor for Gulf of Riga playing, but (because it's DLC music) what folder in my mod should I put it? /music? /dlc? /dlc/music?

Use the same folder structure found in the DLC's .zip file, so music goes into MyMod\music.
 
  • 1Like
Reactions: