first_valid
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
}
}
trigger = {
title:e_slavia = {
is_de_facto_liege_or_above_target = title:d_east_franconia
}
}
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:trigger = {
scripted_trigger = { refused_bavaria_slavica = yes }
}
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.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).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?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.
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.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
}
}
right_portrait = {
first_valid = {
limit = {
exists = scope:serbian_representative
}
character = scope:serbian_representative
animation = beg
}
character = cp:councillor_chancellor
animation = personality_rational
}
right_portrait = {
if = {
limit = {
exists = scope:serbian_representative
}
character = scope:serbian_representative
animation = beg
}
else = {
character = cp:councillor_chancellor
animation = personality_rational
}
}
if = {
limit = {
exists = scope:serbian_representative
}
right_portrait = {
character = scope:serbian_representative
animation = beg
}
}
else = {
right_portrait = {
character = cp:councillor_chancellor
animation = personality_rational
}
}
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.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.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 }
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?Something like this should do the trick, adjusted as necessary.
Code:any_realm_county = { count >= 30 faith = faith:bosnian_church }
coa_switch_to_asatru_trigger = {
has_religion = religion:germanic_religion
}
coa_switch_to_christian_trigger = {
has_religion = religion:christianity_religion
}
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 }
}
}
}
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'm not sure what you mean by 'add the regularHey 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?
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:—# 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
}
}
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
}
}
}
#########################################################################################################################
# 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
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'm not sure what you mean by 'add the regularno_legwear
gene to the armor.' My thought is that you might need to create a customno_legwear
rule, as you suggested (or completely overwrite the default01_legwear.txt
file, but that's obviously not as desirable).
triggered_animation
.triggered_animation = {
trigger = {
scope:serbian_representative = {
has_culture = culture:serbian
}
}
animation = beg
}
triggered_animation = {
trigger = {
scope:serbian_representative = {
is_councillor_of = scope:scoped_ruler
}
}
animation = personality_rational
}
first_valid
for variable descriptions. If a trigger for a given triggered animation is not met, the event will go to the next triggered animation and continue to do so until a triggered animation's conditions are met, at which point it picks that one and ignores the rest. So put your preferred animation on top and the fallback options below.if = {
# If not holder, only convert the capitals of direct vassals
limit = {
NOR = {
scope:county.holder = scope:councillor_liege #checks if the liege owns it directly
scope:county.holder = {
is_vassal_of = scope:councillor_liege #checks if the holder is a direct vassal of the liege
}
scope:county.holder.capital_county = scope:county # checks if the holder's capital_county is scope:county
}
}
multiply = 0
}
scope:county.holder = {
is_vassal_of = scope:councillor_liege #checks if the holder is a direct vassal of the liege
}
potential_county = {
scope:county = {
NOT = { culture = scope:councillor_liege.culture }
}
trigger_if = {
limit = {
scope:councillor_liege = { is_ai = yes }
}
scope:county = {
OR = {
holder = scope:councillor_liege
holder = {
is_vassal_of = scope:councillor_liege
capital_county = scope:county
}
}
}
OR = {...
}
OR = {...
}
}
}
TOMSprisoner.0100 = {
hidden = yes
trigger = {
is_at_war = no
is_ai = no
any_prisoner = {
is_female = no
age >= 18
age <= 45
prowess >= 14
}
}
immediate = {
ordered_prisoner = {
is_female = no
age >= 18
age <= 45
prowess >= 14
save_scope_as = prisoner_knight
order_by = {
value = 5
add = prowess
}
}
I am trying to create a letter event to trigger if there is a high prowess prisoner in my dungeons, to use as a cheap source of knights. I want to limit it to adults and male only. I mistakenly thought I could use the following script, which is wrong. I am struggling to think of an elegant way of doing it. Any suggestions would be most welcome.
Code:TOMSprisoner.0100 = { hidden = yes trigger = { is_at_war = no is_ai = no any_prisoner = { is_female = no age >= 18 age <= 45 prowess >= 14 } }
is_adult = yes
would achieve that by itself. Moving on, I think your code for the immediate area should look like this:immediate = {
ordered_prisoner = {
limit = {
is_female = no
age >= 18
age <= 45
prowess >= 14
}
order_by = prowess
if = {
limit = {
NOT = { exists = scope:prisoner_knight }
}
save_scope_as = prisoner_knight
}
}
}