• Crusader Kings III Available Now!

    The realm rejoices as Paradox Interactive announces the launch of Crusader Kings III, the latest entry in the publisher’s grand strategy role-playing game franchise. Advisors may now jockey for positions of influence and adversaries should save their schemes for another day, because on this day Crusader Kings III can be purchased on Steam, the Paradox Store, and other major online retailers.


    Real Strategy Requires Cunning

SauronGorthaur

First Lieutenant
24 Badges
Jun 4, 2014
232
714
  • Crusader Kings III: Royal Edition
  • Crusader Kings II
  • Cities: Skylines
  • Stellaris
  • Europa Universalis IV: Call to arms event
I started with this video, which got me set up with a good text editor that helps browse the existing file structure and copy/paste files into my own mod directory where needed. I highly recommend it as it patiently walks you through the basics without assuming you know... anything. Plus it's only a half-hour long so it stays on topic.
While I'm only 1/4th into the video so far, holy hell, that Atom editor is amazing. Being able to add the entire game folder into the project and then look for certain values throughout all of these files is a godsend. Thanks to that I finally found the solution to my issue of not being able to add a clickable name of my custom region to a custom tooltip.

For future reference for anyone who wants to do something like that, you do this directly in the localization file, with no need for custom localization scope in whatever file you put the connection to the localization value in. And the line is:
Code:
[GetGeographicalRegion('region_name').GetName]
There's whooping one line of localization in the entire game that uses it (and a mention of this modding option being added in the colossal 1.1 patch notes) so I likely wouldn't have found it otherwise.
 
Last edited:
  • 1Like
  • 1
Reactions:

dklfhgkjdgkulzr

Recruit
Nov 15, 2020
4
0
Hey folks,
I'm trying to figure out how to replicate the behaviour of the "decorated dupatta" headgear which makes the top half of indian clothing disappear when both are equipped. But i have searched for hours and couldn't figure out where that interaction is specified in the code. Could you help me out here?
 

unmerged(476547)

The Artist Formerly Known As Bobsy
2 Badges
Apr 15, 2012
196
23
  • Crusader Kings II
In today's episode of "things I really ought to be able to do by now but can't seem to get right":

I'm trying to put a condition in a decision that means you need a certain number of counties inside your realm with a particular religion, but I can't get the syntax right - if I'm even using the right command. I've been trying with num_county_followers but I dunno, there may be an easier way. Any ideas?
 

Anyasia

Lightbringer
60 Badges
Aug 5, 2015
156
55
  • Crusader Kings II
  • Europa Universalis IV: Cossacks
  • The Showdown Effect
  • Victoria 2
  • Warlock: Master of the Arcane
  • War of the Roses
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Magicka: Wizard Wars Founder Wizard
  • Pride of Nations
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Starvoid
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Mare Nostrum
  • Hearts of Iron IV Sign-up
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings Complete
  • Europa Universalis IV: Third Rome
  • Age of Wonders III
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis III
  • Arsenal of Democracy
  • Cities in Motion 2
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings III
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Commander: Conquest of the Americas
  • Darkest Hour
  • Teleglitch: Die More Edition
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Wealth of Nations
  • Gettysburg
  • Leviathan: Warships
  • The Kings Crusade
  • Majesty 2
  • March of the Eagles
  • Naval War: Arctic Circle
  • Europa Universalis IV: Res Publica
  • Sengoku
In today's episode of "things I really ought to be able to do by now but can't seem to get right":

I'm trying to put a condition in a decision that means you need a certain number of counties inside your realm with a particular religion, but I can't get the syntax right - if I'm even using the right command. I've been trying with num_county_followers but I dunno, there may be an easier way. Any ideas?
Something like this should do the trick, adjusted as necessary.

Code:
any_realm_county = {
    count >= 30
    faith = faith:bosnian_church
}
 

unmerged(476547)

The Artist Formerly Known As Bobsy
2 Badges
Apr 15, 2012
196
23
  • Crusader Kings II
Something like this should do the trick, adjusted as necessary.

Code:
any_realm_county = {
    count >= 30
    faith = faith:bosnian_church
}
It didn't quite work, or at the very least gave a very confusing in-game description in the decision. However! Just before seeing your reply I tested:
Code:
                faith:roman_pagan = {
                    num_county_followers >= 10
                }
- and that seems to have done the trick.
 

Anyasia

Lightbringer
60 Badges
Aug 5, 2015
156
55
  • Crusader Kings II
  • Europa Universalis IV: Cossacks
  • The Showdown Effect
  • Victoria 2
  • Warlock: Master of the Arcane
  • War of the Roses
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Magicka: Wizard Wars Founder Wizard
  • Pride of Nations
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Starvoid
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Mare Nostrum
  • Hearts of Iron IV Sign-up
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings Complete
  • Europa Universalis IV: Third Rome
  • Age of Wonders III
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis III
  • Arsenal of Democracy
  • Cities in Motion 2
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings III
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Commander: Conquest of the Americas
  • Darkest Hour
  • Teleglitch: Die More Edition
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Wealth of Nations
  • Gettysburg
  • Leviathan: Warships
  • The Kings Crusade
  • Majesty 2
  • March of the Eagles
  • Naval War: Arctic Circle
  • Europa Universalis IV: Res Publica
  • Sengoku
It didn't quite work, or at the very least gave a very confusing in-game description in the decision. However! Just before seeing your reply I tested:
Code:
                faith:roman_pagan = {
                    num_county_followers >= 10
                }
- and that seems to have done the trick.
Just be careful that's not counting all counties globally, not just the ones in your realm. ;)
 

SauronGorthaur

First Lieutenant
24 Badges
Jun 4, 2014
232
714
  • Crusader Kings III: Royal Edition
  • Crusader Kings II
  • Cities: Skylines
  • Stellaris
  • Europa Universalis IV: Call to arms event
It didn't quite work, or at the very least gave a very confusing in-game description in the decision. However! Just before seeing your reply I tested:
Code:
                faith:roman_pagan = {
                    num_county_followers >= 10
                }
- and that seems to have done the trick.
Wouldn't that check all counties and not just those in your realm?
 

unmerged(476547)

The Artist Formerly Known As Bobsy
2 Badges
Apr 15, 2012
196
23
  • Crusader Kings II
Wouldn't that check all counties and not just those in your realm?
Probably! I'll give the other method another whirl tomorrow and weigh them up against each other, but it doesn't seem like it's necessarily a bad thing. If Roman religion is catching on elsewhere and a ruler has taken the risk of converting to it, then changing to Roman culture shouldn't necessarily be a problem. It's an expensive decision at 1000 prestige, so it's not really in reach of counts, and even dukes are going to have to work for it.

I'm in the middle of a big playtest of the mod, and I can say definitively that following this through and converting to Romulism (I know, it's not a great name) is a huge risk, being inevitably surrounded on all sides by powerful Christian or Muslim realms. So even reaching the point where the decision is visible is difficult, and being able to actually go through with it is yet another challenge.

20201115194910_1.jpg


(also featured: convert to Hellenism or ancient Egyptian. But not by the AI for the time being. I don't think it would make a difference anyway)
 

Arko

Orange Heart
45 Badges
Jul 1, 2009
7.059
1.069
  • Crusader Kings II: Holy Knight (pre-order)
  • Crusader Kings II
  • Crusader Kings III
  • Deus Vult
  • Cities: Skylines
  • Magicka
On Paradox Mods, how does one add a version changelog note ?
 

SauronGorthaur

First Lieutenant
24 Badges
Jun 4, 2014
232
714
  • Crusader Kings III: Royal Edition
  • Crusader Kings II
  • Cities: Skylines
  • Stellaris
  • Europa Universalis IV: Call to arms event
OK, I'm doing localization for my events now and I ran into an issue. The events in question are about about flipping certain areas to be De Jure territory of Empire of Slavia, one area after the other, depending on what you control.

So, one of the events in question is flipping the historical region of Bavaria Slavica (in-game duchies of Nordgau and East Franconia) to the Kingdom of Bohemia (which itself is a vassal of the Empire of Slavia at this point). You can either agree to do that or not.

And after that, if you own the entirety of the Kingdom of Bavaria (but don't own all the non-Bavarian land required to form the Kingdom of Carantania, which I also added in my mod, but it's not relevant here), you get a choice to flip Bavaria itself to the Empire of Slavia.

Which is where the issue with localization begins. Because depending on what you conquered before forming Slavia and on the choices you made in the earlier events in the chain, there are three different scenarios:
  1. you had the opportunity to add Bavaria Slavica (i.e. the duchies of Nordgau and East Franconia to Bohemia) and did just that;
  2. you had the opportunity to add Bavaria Slavica, but chose not to;
  3. you didn't have the opportunity to add Bavaria Slavica to Bohemia, but you do have the opportunity to add the Kingdom of Bavaria to the Empire of Slavia (i.e. you control the Duchy of Nordgau, together with the rest of the Kingdom of Bavaria, but you don not control the Duchy of East Franconia).
Which warrants three different (slightly, but still) descriptions of the event pertaining to the Kingdom of Bavaria.

Given that Nordgau is by default part of the Kingdom of Bavaria, at least before the Bavaria Slavica event, the deciding factor here is the Duchy of East Franconia and whether or not:
  1. you control it in the first place and;
  2. it's De Jure liege is the Kingdom of Bohemia or not.
Which is what I chose to check for when making the event decide which description to trigger.

Which makes the Kingdom of Bavaria event not trigger and outright breaks all later events in the file... Even though the piece of code that allows to do dynamic event descriptions depending on circumstances has been covered in a dev diary on modding events and appears to be pretty straightforward. The line is first_valid

After I ran into issues I even decided to check for whether I just control East Franconia itself, leaving the issue of its relation to Bohemia aside for awhile, to see what I'm doing wrong.

So, I tried this code:
Code:
    desc = {
        first_valid = {
            triggered_desc = {
                trigger = {
                    title:d_east_franconia = {
                        target_is_de_facto_liege_or_above = title:e_slavia
                    }
                }
                desc = great_slavia.0011.desc.refused_bavaria_slavica
            }
            great_slavia.0011.desc
        }
    }
Still nothing, still breaks the reminder of the file. I tried flipping things around and using:
Code:
trigger = {
    title:e_slavia = {
        is_de_facto_liege_or_above_target = title:d_east_franconia
    }
}
Same result. I tried moving the specifics of the trigger into a scripted trigger - scripted_trigger refused_bavaria_slavica = - (with both is_de_facto_liege_or_above_target and target_is_de_facto_liege_or_above variants) defined before the event and then making the trigger in the event:
Code:
trigger = {
    scripted_trigger = { refused_bavaria_slavica = yes }
}
Again. Nothing. I've even tried the de_jure variants of both of those lines for k_bohemia and e_slavia and tried to check things by triggering the Bavaria event from console (as such, because of bypassing the initial decision, Bohemia wouldn't be De Jure of the Empire of Slavia), to same effect.

So I don't know what I'm doing wrong. Both is_de_facto_liege_or_above_target and target_is_de_facto_liege_or_above are listed on the page for triggers on the CKIII wiki, so they should work when I'm writing a trigger. I've even found examples of some of those pieces of code being used in the same exact manner (albeit in a limit rather than a trigger).

EDIT: I even just used the target_is_de_jure_liege_or_above in a limit in an earlier event in the chain where I realized it made more sense than what I previously did and it works just fine. So I guess those lines work for limits, but not triggers? Or am I missing something here? And if I'm not, how do I then achieve what I want to achieve here?
 
Last edited:

Thomas_Oak

Captain
8 Badges
May 11, 2018
419
506
  • Crusader Kings II
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sons of Abraham
  • Warlock: Master of the Arcane
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings III
This is probably a bit too deep for me, but I did notice that I would have used an additional "desc =" in the last line of your first code block. Maybe I am using it unnecessarily, but if not then it might help.
 
  • 1Like
Reactions:

SauronGorthaur

First Lieutenant
24 Badges
Jun 4, 2014
232
714
  • Crusader Kings III: Royal Edition
  • Crusader Kings II
  • Cities: Skylines
  • Stellaris
  • Europa Universalis IV: Call to arms event
This is probably a bit too deep for me, but I did notice that I would have used an additional "desc =" in the last line of your first code block. Maybe I am using it unnecessarily, but if not then it might help.
Goddamnit, how could I have missed that... Yes, that solved the issue -.- Oh, well, at least my logic was correct. Only a few issues remaining to figure out, but I'll get there when I'll get there.
 

SauronGorthaur

First Lieutenant
24 Badges
Jun 4, 2014
232
714
  • Crusader Kings III: Royal Edition
  • Crusader Kings II
  • Cities: Skylines
  • Stellaris
  • Europa Universalis IV: Call to arms event
Last question for tonight. I'm now playing around with lists, picking a character from the list, saving them as a scope and using that scope for localization and showing that character in the event screen.

Now, in most of my events the left_portrait character is me while the right_portrait character is some councilor and, if I use a scoped character from the list, they'll appear in the bottom row.

Code:
immediate = {
    play_music_cue = "mx_cue_epic_sacral_moment"
    save_scope_as = scoped_ruler
    every_vassal_or_below = {
        limit = {
            has_culture = culture:bosnian
        }
        add_to_list = serbian_vassals
    }
    random_in_list = {
        list = serbian_vassals
        save_scope_as = serbian_representative
    }
}
A simple example I'm using for testing.

And, from my testing, it appears that if there's no scoped character because the list came up with no results (which is why I'm currently looking for Bosnian vassals or sub-vassals for a position of a Serbian representatives, as I have none of those), the scoped character simply will not appear in the selected bottom row portrait with no issues that I can see.

But for one or two events that I have planned I want the scoped character to be the one on the right with no councilor as a third character. Unless the list comes up empty. In that case I want the councilor to be picked as the right portrait character as a fallback option. Having the councilor to be the one showing in the bottom row portrait was no go, because I don't want him to be in the event if there is a scoped character at all. On top of that, if there is no scoped character I'd have the councilor portrait in the bottom while the right portrait would remain empty, which would look kinda bad.

I tried the following:
Code:
right_portrait = {
    first_valid = {
        limit = {
            exists = scope:serbian_representative
        }
        character = scope:serbian_representative
        animation = beg
    }
    character = cp:councillor_chancellor
    animation = personality_rational
}
Code:
right_portrait = {
    if = {
        limit = {
            exists = scope:serbian_representative
        }
        character = scope:serbian_representative
        animation = beg
    }
    else = {
        character = cp:councillor_chancellor
        animation = personality_rational
    }
}
Code:
if = {
    limit = {
        exists = scope:serbian_representative
    }
    right_portrait = {
        character = scope:serbian_representative
        animation = beg
    }
}
else = {
    right_portrait = {
        character = cp:councillor_chancellor
        animation = personality_rational
    }
}
EDIT: Although, to think of it, I guess you could achieve that with adding the councilor to the list and then using alternative_limit = { always = yes } in the scoped character selection for random lists, or adding a big value modifier for culture (following my example) in an ordered list, with the councilor being picked with the base value + whatever else they may get. But I'll have to test that tomorrow.

Plus that seems like a roundabout solution. And this way you won't be able to choose a different animation if the councilor is picked, which is something I'd like. And, to think of it, it would also maybe mess with localization, since I was planning on having different event description depending on whether there is a scoped character or the event falls back to the councilor. Although that could likely be solved with is_councilor And if you can make some conditions for at least the animation of the portrait, this would work and possibly achieve everything I want this to do. Again, something to test tomorrow.

So if this is possible to achieve in a non-roundabout way, I'd still appreciate any help.
 
Last edited:

Castico

Private
1 Badges
Nov 4, 2020
10
3
  • Crusader Kings III
Does anybody know of a way to input a variable into a size in gui?
Code:
size = { "[GetPlayer.MakeScope.Var('sz_val').GetValue|0]" 100 }

#and lets say elsewhere sz_val = 30

#desired result the gui reads this as

size = { 30 100 }
 

unmerged(476547)

The Artist Formerly Known As Bobsy
2 Badges
Apr 15, 2012
196
23
  • Crusader Kings II
Something like this should do the trick, adjusted as necessary.

Code:
any_realm_county = {
    count >= 30
    faith = faith:bosnian_church
}
Okay, update on this, I was wrong to dismiss it as it does work fine, but the text in the decision window is not particularly clear. I guess I need a custom description here... oh god, I'll need to go into customizable_localization, won't I? WHY MUST IT TORMENT ME SO?

EDIT:

(voiceover) It didn't.
 
Last edited:
  • 1Haha
Reactions:

dklfhgkjdgkulzr

Recruit
Nov 15, 2020
4
0
Hey guys this is a noob question but i wanted to add a new armor with no legwear underneath it, is it sufficient to add the regular no_legwear gene to the armor or do i have to create a new 01_custom_legwear.txt in gfx/portraits/portrait_modifiers? That folder seems to have different modifiers for game usage like 01_clothes.txt and customization usage like 01_custom_clothes.txt.
However by default there is no 01_custom_legwear.txt so maybe that is why my code doesn't work atm?
 

zachhcaz22

Captain
63 Badges
Aug 17, 2007
311
0
  • 500k Club
  • Cities: Skylines
  • Victoria 2: A House Divided
  • Europa Universalis III Complete
  • Crusader Kings II
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Pre-order
  • Europa Universalis III Complete
  • Victoria 2
  • Crusader Kings Complete
  • 200k Club
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Holy Knight (pre-order)
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Rights of Man
  • Mount & Blade: Warband
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Cradle of Civilization
  • Imperator: Rome
  • Imperator: Rome Sign Up
  • Crusader Kings III
  • Imperator: Rome Deluxe Edition
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Rule Britannia
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Europa Universalis IV: Dharma
  • Europa Universalis III Complete
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Semper Fi
  • Europa Universalis: Rome
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Mare Nostrum
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Deus Vult
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
I'm trying to get the coat of arms for the Danelaw to switch based on character religion just like England does for culture. In testing it doesn't automatically switch but will switch before the title is created if you convert to Christianity and then create k_danelaw. It just then won't switch back and forth if you reconvert to Asatru / Christianity. It also works when calling the event coa.1 manually.

These are my triggers:

Code:
coa_switch_to_asatru_trigger = {
    has_religion = religion:germanic_religion
}
coa_switch_to_christian_trigger = {
    has_religion = religion:christianity_religion
}
This is the event code:

Code:
coa.1 = {
    type = character_event
    hidden = yes
    trigger = {
        is_ruler = yes
    }
    immediate = {
        trigger_event = coa.10 # England
        trigger_event = coa.11 # Normans, Welsh, Saxons
        trigger_event = coa.12 # Danelaw
    }
}

...

coa.12 = {
    type = character_event
    hidden = yes
    trigger = {
        any_held_title = { this = title:k_danelaw }
    }
    immediate = {
        if = {
            limit = { coa_switch_to_asatru_trigger = yes }
            title:k_danelaw = { set_coa = k_danelaw } # reset
        }
        
        if = {
            limit = { coa_switch_to_christian_trigger = yes }
            title:k_danelaw = { set_coa = k_danelaw_christian }
        }
    }
}
I then added coa.1 to the religion_on_actions file:

Code:
on_character_faith_change = {
    effect = {
        check_for_equal_doctrine_effect = yes
    }
    events = {
        faith_conversion.0002 # Remove obsolete modifiers
        faith_conversion.0004 # Convert Theocracies
        faith_conversion.0005 # Update marriage opinions
        great_holy_war.0025 # Replace Recipient for ongoing GHW
        great_holy_war.0029 # Beneficiary converted, remove and replace.
        great_holy_war.0059 # Clear Crusader traits on conversion.
        great_holy_war.0084 # Replace fallback ghw recipient
        great_holy_war.0085 # Remove pledged vassals upon conversion of their liege.
        false_conversion.0001    # Flag possible false conversions.
        war_event.3100        # Handles invalidation of religious wars
        coa.1 # check if title Coat of Arms should change.
    }
}
I don't see anything in error.log about this. Anyone able to help debug?
 

Anyasia

Lightbringer
60 Badges
Aug 5, 2015
156
55
  • Crusader Kings II
  • Europa Universalis IV: Cossacks
  • The Showdown Effect
  • Victoria 2
  • Warlock: Master of the Arcane
  • War of the Roses
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Magicka: Wizard Wars Founder Wizard
  • Pride of Nations
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Starvoid
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Mare Nostrum
  • Hearts of Iron IV Sign-up
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings Complete
  • Europa Universalis IV: Third Rome
  • Age of Wonders III
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis III
  • Arsenal of Democracy
  • Cities in Motion 2
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings III
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Commander: Conquest of the Americas
  • Darkest Hour
  • Teleglitch: Die More Edition
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Wealth of Nations
  • Gettysburg
  • Leviathan: Warships
  • The Kings Crusade
  • Majesty 2
  • March of the Eagles
  • Naval War: Arctic Circle
  • Europa Universalis IV: Res Publica
  • Sengoku
Hey guys this is a noob question but i wanted to add a new armor with no legwear underneath it, is it sufficient to add the regular no_legwear gene to the armor or do i have to create a new 01_custom_legwear.txt in gfx/portraits/portrait_modifiers? That folder seems to have different modifiers for game usage like 01_clothes.txt and customization usage like 01_custom_clothes.txt.
However by default there is no 01_custom_legwear.txt so maybe that is why my code doesn't work atm?
I'm not sure what you mean by 'add the regular no_legwear gene to the armor.' My thought is that you might need to create a custom no_legwear rule, as you suggested (or completely overwrite the default 01_legwear.txt file, but that's obviously not as desirable).

I'm trying to get the coat of arms for the Danelaw to switch based on character religion just like England does for culture. In testing it doesn't automatically switch but will switch before the title is created if you convert to Christianity and then create k_danelaw. It just then won't switch back and forth if you reconvert to Asatru / Christianity. It also works when calling the event coa.1 manually.

These are my triggers:

Code:
coa_switch_to_asatru_trigger = {
    has_religion = religion:germanic_religion
}
coa_switch_to_christian_trigger = {
    has_religion = religion:christianity_religion
}
This is the event code:

Code:
coa.1 = {
    type = character_event
    hidden = yes
    trigger = {
        is_ruler = yes
    }
    immediate = {
        trigger_event = coa.10 # England
        trigger_event = coa.11 # Normans, Welsh, Saxons
        trigger_event = coa.12 # Danelaw
    }
}

...

coa.12 = {
    type = character_event
    hidden = yes
    trigger = {
        any_held_title = { this = title:k_danelaw }
    }
    immediate = {
        if = {
            limit = { coa_switch_to_asatru_trigger = yes }
            title:k_danelaw = { set_coa = k_danelaw } # reset
        }
     
        if = {
            limit = { coa_switch_to_christian_trigger = yes }
            title:k_danelaw = { set_coa = k_danelaw_christian }
        }
    }
}
I then added coa.1 to the religion_on_actions file:

Code:
on_character_faith_change = {
    effect = {
        check_for_equal_doctrine_effect = yes
    }
    events = {
        faith_conversion.0002 # Remove obsolete modifiers
        faith_conversion.0004 # Convert Theocracies
        faith_conversion.0005 # Update marriage opinions
        great_holy_war.0025 # Replace Recipient for ongoing GHW
        great_holy_war.0029 # Beneficiary converted, remove and replace.
        great_holy_war.0059 # Clear Crusader traits on conversion.
        great_holy_war.0084 # Replace fallback ghw recipient
        great_holy_war.0085 # Remove pledged vassals upon conversion of their liege.
        false_conversion.0001    # Flag possible false conversions.
        war_event.3100        # Handles invalidation of religious wars
        coa.1 # check if title Coat of Arms should change.
    }
}
I don't see anything in error.log about this. Anyone able to help debug?
coa.1 isn't called by default on conversion—if you let your game run for up to a year, it should change over when it's fired from the yearly_playable_pulse. Alternatively, to ensure it fires immediately, you could set up custom calls in common\on_action for either on_faith_conversion, on_character_faith_change, or both, depending on your needs. Be aware that if you want to call it as an event from these on_actions, you will need to completely copy the vanilla event calls, as your modded events block will overwrite those in common/on_action/religion_on_actions.txt. To avoid this, I'd set up a custom on action and call it from those triggers instead, since they don't have an on_actions block that can be overwritten:—

Code:
# common/on_action/danelaw_on_actions.txt

danelaw_conversion = {
    events = {
        coa.1
    }
}

on_faith_conversion = {
    on_actions = {
        danelaw_conversion
    }
}

on_character_faith_change = {
    on_actions = {
        danelaw_conversion
    }
}
 
  • 1Like
Reactions:

cray935

Second Lieutenant
51 Badges
Apr 14, 2017
180
1
  • Cities in Motion
  • Stellaris: Synthetic Dawn
  • Tyranny - Tales from the Tiers
  • Hearts of Iron IV: Death or Dishonor
  • Crusader Kings III
  • Tyranny - Bastards Wound
  • Age of Wonders III
  • Cities: Skylines - Green Cities
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Surviving Mars: Digital Deluxe Edition
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Surviving Mars: First Colony Edition
  • Cities: Skylines Industries
  • Prison Architect
  • Surviving Mars: First Colony Edition
  • Cities: Skylines - Campus
  • Age of Wonders: Planetfall
  • Stellaris: Lithoids
  • Prison Architect: Psych Ward
  • Stellaris: Galaxy Edition
  • Crusader Kings II
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Wealth of Nations
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Stellaris: Galaxy Edition
  • BATTLETECH
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Rights of Man
  • Tyranny: Archon Edition
  • Tyranny: Archon Edition
  • Tyranny: Gold Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris
  • Stellaris: Megacorp
  • Imperator: Rome
  • Stellaris: Ancient Relics
  • Stellaris - Path to Destruction bundle
Hi, can someone explain the duel = { ... } stuff ? I have two script_values i want to use for success outcome, but I don't find explanations to duels and compare_modifiers. One of my script_values are the requirement/base value for success, the other one is calculated based on a character trait. i want to compare both numbers and make the success/fail outcome.

Perl:
    option = {
        name = ctda_activity_practice_necromancy_events.1.a
        duel = {
            value = ctda_necromancer_skill_req_novice # for me it is the base value to check against

            compare_modifier = {
                value = ctda_necromancer_skill_value # for me it is the character's skill value
                multiplier = 1 # i don't use it because i calculate success chance within ctda_necromancer_skill_value
            }
        }
    }
here are all the script_values with some explanation, in case my question is not clear enough.
Perl:
#########################################################################################################################
# Required base values for skilled actions per expert level.
# The character's necromancer trait level determines the success chance for activities on equal expert level.
# Novice    : 55 %
# Apprentice: 65 %
# Adept     : 75 %
# Exoert    : 85 %
# Master    : 95 %
#########################################################################################################################
ctda_necromancer_skill_req_novice = 5
ctda_necromancer_skill_req_apprentice = 10
ctda_necromancer_skill_req_adept = 15
ctda_necromancer_skill_req_expert = 20
ctda_necromancer_skill_req_master = 25
ctda_necromancer_success_chance_novice = 0.55
ctda_necromancer_success_chance_apprentice = 0.65
ctda_necromancer_success_chance_adept = 0.75
ctda_necromancer_success_chance_expert = 0.85
ctda_necromancer_success_chance_master = 0.95
 

cray935

Second Lieutenant
51 Badges
Apr 14, 2017
180
1
  • Cities in Motion
  • Stellaris: Synthetic Dawn
  • Tyranny - Tales from the Tiers
  • Hearts of Iron IV: Death or Dishonor
  • Crusader Kings III
  • Tyranny - Bastards Wound
  • Age of Wonders III
  • Cities: Skylines - Green Cities
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Surviving Mars: Digital Deluxe Edition
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Surviving Mars: First Colony Edition
  • Cities: Skylines Industries
  • Prison Architect
  • Surviving Mars: First Colony Edition
  • Cities: Skylines - Campus
  • Age of Wonders: Planetfall
  • Stellaris: Lithoids
  • Prison Architect: Psych Ward
  • Stellaris: Galaxy Edition
  • Crusader Kings II
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Wealth of Nations
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Stellaris: Galaxy Edition
  • BATTLETECH
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Rights of Man
  • Tyranny: Archon Edition
  • Tyranny: Archon Edition
  • Tyranny: Gold Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris
  • Stellaris: Megacorp
  • Imperator: Rome
  • Stellaris: Ancient Relics
  • Stellaris - Path to Destruction bundle
I'm trying to get the coat of arms for the Danelaw to switch based on character religion just like England does for culture. In testing it doesn't automatically switch but will switch before the title is created if you convert to Christianity and then create k_danelaw. It just then won't switch back and forth if you reconvert to Asatru / Christianity. It also works when calling the event coa.1 manually.

These are my triggers:

Code:
coa_switch_to_asatru_trigger = {
    has_religion = religion:germanic_religion
}
coa_switch_to_christian_trigger = {
    has_religion = religion:christianity_religion
}
This is the event code:

Code:
coa.1 = {
    type = character_event
    hidden = yes
    trigger = {
        is_ruler = yes
    }
    immediate = {
        trigger_event = coa.10 # England
        trigger_event = coa.11 # Normans, Welsh, Saxons
        trigger_event = coa.12 # Danelaw
    }
}

...

coa.12 = {
    type = character_event
    hidden = yes
    trigger = {
        any_held_title = { this = title:k_danelaw }
    }
    immediate = {
        if = {
            limit = { coa_switch_to_asatru_trigger = yes }
            title:k_danelaw = { set_coa = k_danelaw } # reset
        }
       
        if = {
            limit = { coa_switch_to_christian_trigger = yes }
            title:k_danelaw = { set_coa = k_danelaw_christian }
        }
    }
}
I then added coa.1 to the religion_on_actions file:

Code:
on_character_faith_change = {
    effect = {
        check_for_equal_doctrine_effect = yes
    }
    events = {
        faith_conversion.0002 # Remove obsolete modifiers
        faith_conversion.0004 # Convert Theocracies
        faith_conversion.0005 # Update marriage opinions
        great_holy_war.0025 # Replace Recipient for ongoing GHW
        great_holy_war.0029 # Beneficiary converted, remove and replace.
        great_holy_war.0059 # Clear Crusader traits on conversion.
        great_holy_war.0084 # Replace fallback ghw recipient
        great_holy_war.0085 # Remove pledged vassals upon conversion of their liege.
        false_conversion.0001    # Flag possible false conversions.
        war_event.3100        # Handles invalidation of religious wars
        coa.1 # check if title Coat of Arms should change.
    }
}
I don't see anything in error.log about this. Anyone able to help debug?
I am more familiar with stellaris, but maybe it is valid here. The check is a trigger right ? so it needs to be in trigger and not in effect (?)