Anyone know if there is a builtin means to check for opinion modifiers with revoke_reason, execute_reason, etc? I really hope I don't need to make a bunch of large triggers 
Thanks, that'll helpreloadevents in the console should do it, will be a bit slow though as it will go through all of them. Might crash the game if you messed up an event file in the mean time.
You can also put a file in the Documents\Paradox Interactive\Crusader Kings II folder (not the mod folder!) and execute it with [ run filename.txt ] - ROOT will be the player character. So this is only useful for character events.
father_even_if_dead = {
if = {
limit = {
any_child = {
character = ROOT
}
}
save_event_target_as = Player_Father
set_global_variable = Player_Has_Parents
}
}
This is the code you should be using:Another query, is there a way to find out if a given character has a father/mother? I thought this would do it, based on the logic that the "if" would fail if a father wasn't found, but it seems not to work, as the Global is apparently not being set.
father_even_if_dead = {
always = yes
}
This is the code you should be using:
This will return true if the scoped character has a father, and false if the scoped character has no known father.Code:father_even_if_dead = { always = yes }
father_even_if_dead = {
save_event_target_as = Player_Father
set_character_flag = Is_Player_Father
}
mother_even_if_dead = {
save_event_target_as = Player_Mother
set_character_flag = Is_Player_Mother
}
if = {
limit = {
NOT = {
any_character = {
has_character_flag = Is_Player_Mother
}
}
}
create_character = {
name="Unknown"
age = 99
dynasty=ROOT
random_traits = no
religion=ROOT
culture=ROOT
fertility = 0.50
health = 5
female = yes
}
new_character = {
set_character_flag = Is_Player_Mother
save_event_target_as = Player_Mother
set_character_flag = Is_Special_Character
set_graphical_culture = Culture_Unkown_Female
}
set_mother = event_target:Player_Mother
event_target:Player_Mother = {
death = { death_reason = death_natural }
}
}
if = {
limit = {
NOT = {
any_character = {
has_character_flag = Is_Player_Father
}
}
}
create_character = {
name="Unknown"
age = 99
dynasty=ROOT
random_traits = no
religion=ROOT
culture=ROOT
fertility = 0.50
health = 5
female = no
}
new_character = {
set_character_flag = Is_Player_Father
save_event_target_as = Player_Father
set_character_flag = Is_Special_Character
set_graphical_culture = Culture_Unkown_Male
}
set_father = event_target:Player_Father
event_target:Player_Father = {
death = { death_reason = death_natural }
}
}
This appears to be because you add a character flag and check if the character flag has been set in the same effect.Thanks for the help, can you take a look at this code and tell me what's up with it? What it's meant to do is check if the Player character has a Father/Mother, and assign them a flag, then if either one is not found randomly generate and assign them. It seems to be working in that the defined father gets the 'Is_Player_Father' flag, but then a fake-father is still generated and replaces the real one.
father_even_if_dead = {
save_event_target_as = Player_Father
set_character_flag = Is_Player_Father
}
mother_even_if_dead = {
save_event_target_as = Player_Mother
set_character_flag = Is_Player_Mother
}
if = {
limit = {
mother_even_if_dead = {
always = yes
}
}
create_character = {
name="Unknown"
age = 99
dynasty=ROOT
random_traits = no
religion=ROOT
culture=ROOT
fertility = 0.50
health = 5
female = yes
}
new_character = {
set_character_flag = Is_Player_Mother
save_event_target_as = Player_Mother
set_character_flag = Is_Special_Character
set_graphical_culture = Culture_Unkown_Female
}
set_mother = event_target:Player_Mother
event_target:Player_Mother = {
death = { death_reason = death_natural }
}
}
if = {
limit = {
father_even_if_dead = {
always = yes
}
}
create_character = {
name="Unknown"
age = 99
dynasty=ROOT
random_traits = no
religion=ROOT
culture=ROOT
fertility = 0.50
health = 5
female = no
}
new_character = {
set_character_flag = Is_Player_Father
save_event_target_as = Player_Father
set_character_flag = Is_Special_Character
set_graphical_culture = Culture_Unkown_Male
}
set_father = event_target:Player_Father
event_target:Player_Father = {
death = { death_reason = death_natural }
}
}
Thanks for the help, can you take a look at this code and tell me what's up with it? What it's meant to do is check if the Player character has a Father/Mother, and assign them a flag, then if either one is not found randomly generate and assign them. It seems to be working in that the defined father gets the 'Is_Player_Father' flag, but then a fake-father is still generated and replaces the real one.
Also, is the existing father dead? Because I'm pretty sure dead characters can't hold flags.This appears to be because you add a character flag and check if the character flag has been set in the same effect.
They can't.Also, is the existing father dead? Because I'm pretty sure dead characters can't hold flags.
if = {
limit = {
NOT = {
father_even_if_dead = {
always = yes
}
}
}
create_character = {
name = "Unknown"
age = 99
dynasty = ROOT
random_traits = no
religion = ROOT
culture = ROOT
female = no
}
new_character = {
save_event_target_as = father_target
set_graphical_culture = Culture_Unkown_Male
death = yes
}
set_father = event_target:father_target
}
if = {
limit = {
NOT = {
mother_even_if_dead = {
always = yes
}
}
}
create_character = {
name = "Unknown"
age = 99
dynasty = ROOT
random_traits = no
religion = ROOT
culture = ROOT
female = yes
}
new_character = {
save_event_target_as = mother_target
set_graphical_culture = Culture_Unkown_Male
death = yes
}
set_mother = event_target:mother_target
}
Yes, create a new graphical culture alangfx and apply it to the alan culture in common\cultures\00_cultures.txtIs it possible to make the Alans use the Persian portraits but with russian clothing?
Thanks,but i don't understand how to use the easternslavicgfx in the new alan.gfx ive created.Which line do i have too change?Do i have too change everyYes, create a new graphical culture alangfx and apply it to the alan culture in common\cultures\00_cultures.txt
Then create the alangfx in interface\portrait\portraits_alan.gfx. Use the Persian portraits (persiangfx) as base and use the clothes/headgear from the easternslavicgfx (Russian) style.
Don't forget to also clone the persiangfx children to alangfx.
# alan Male
portraitType = {
name = "PORTRAIT_alangfx_male"
effectFile = "gfx/FX/portrait.lua"
layer = { # GFX_TYPE:[d|p]INDEX:COLOR_LINK:DONT_REFRESH_IF_VALID:CULTURE_INDEX
"GFX_character_background:p0"
"GFX_easternslavic_male_clothes_behind:p3:c0"
"GFX_easternslavic_male_headgear_behind:p5:c1"
"GFX_persian_male_hair_behind:p1:h:y"
"GFX_persian_male_beard_behind:p4:h:y"
":p5:c6"
"GFX_persian_male_base:p2"
"GFX_persian_male_neck:d0"
"GFX_persian_male_chin:d1"
"GFX_persian_male_cheeks:d4"
"GFX_persian_male_mouth:d2"
"GFX_persian_male_eyes:d6"
"GFX_persian_male_nose:d3"
"GFX_persian_male_eyes2:d6:e"
"GFX_character_scars:p7:y"
"GFX_character_reddots:p8"
"GFX_character_boils:p9"
"GFX_character_blinded_eyes:p10"
"GFX_easternslavic_male_clothes:p3:c2"
"GFX_easternslavic_male_headgear_mid:p5:c3"
"GFX_persian_male_ear:d7"
"GFX_persian_male_beard:p4:h:y"
"GFX_character_eyepatch:p13:y:o32x63"
"GFX_persian_male_hair:p1:h:y"
":p5:c7"
"GFX_character_mask:p12:y:o40x45"
"GFX_empty:p3:c4"
"GFX_easternslavic_male_headgear:p5:c5"
"GFX_character_imprisoned:p6"
"GFX_player_overlay:p11"
}
hair_color_index = 8
hair_color = { # dark, base, highlight
{ 10 10 10 } { 50 50 50 } { 255 255 255 } #Black
{ 15 8 0 } { 80 47 22 } { 255 255 255 } #Medium Brown
{ 10 10 10 } { 27 25 23 } { 255 255 255 } #Second Black
{ 20 12 8 } { 78 54 37 } { 255 255 255 } #Second Brown
{ 10 10 10 } { 65 65 65 } { 255 255 255 } #Third Black
}
eye_color_index = 9
eye_color = {
{ 120 74 46 } #Brown
{ 34 103 36 } #Green
{ 86 74 46 } #Second Brown
{ 36 32 24 } #Dark Brown
}
headgear_that_hides_hair = { 10 }
}
Yes, that could be it, too.Also, is the existing father dead? Because I'm pretty sure dead characters can't hold flags.
Oops, I forgot the "NOT = { }" in the code. Thanks for the fix!-snip-
Here's what your alan male would look like:
Code:# alan Male portraitType = { name = "PORTRAIT_alangfx_male" effectFile = "gfx/FX/portrait.lua" layer = { # GFX_TYPE:[d|p]INDEX:COLOR_LINK:DONT_REFRESH_IF_VALID:CULTURE_INDEX "GFX_character_background:p0" "GFX_easternslavic_male_clothes_behind:p3:c0" "GFX_easternslavic_male_headgear_behind:p5:c1" "GFX_persian_male_hair_behind:p1:h:y" "GFX_persian_male_beard_behind:p4:h:y" ":p5:c6" "GFX_persian_male_base:p2" "GFX_persian_male_neck:d0" "GFX_persian_male_chin:d1" "GFX_persian_male_cheeks:d4" "GFX_persian_male_mouth:d2" "GFX_persian_male_eyes:d6" "GFX_persian_male_nose:d3" "GFX_persian_male_eyes2:d6:e" "GFX_character_scars:p7:y" "GFX_character_reddots:p8" "GFX_character_boils:p9" "GFX_character_blinded_eyes:p10" "GFX_easternslavic_male_clothes:p3:c2" "GFX_easternslavic_male_headgear_mid:p5:c3" "GFX_persian_male_ear:d7" "GFX_persian_male_beard:p4:h:y" "GFX_character_eyepatch:p13:y:o32x63" "GFX_persian_male_hair:p1:h:y" ":p5:c7" "GFX_character_mask:p12:y:o40x45" "GFX_empty:p3:c4" "GFX_easternslavic_male_headgear:p5:c5" "GFX_character_imprisoned:p6" "GFX_player_overlay:p11" } hair_color_index = 8 hair_color = { # dark, base, highlight { 10 10 10 } { 50 50 50 } { 255 255 255 } #Black { 15 8 0 } { 80 47 22 } { 255 255 255 } #Medium Brown { 10 10 10 } { 27 25 23 } { 255 255 255 } #Second Black { 20 12 8 } { 78 54 37 } { 255 255 255 } #Second Brown { 10 10 10 } { 65 65 65 } { 255 255 255 } #Third Black } eye_color_index = 9 eye_color = { { 120 74 46 } #Brown { 34 103 36 } #Green { 86 74 46 } #Second Brown { 36 32 24 } #Dark Brown } headgear_that_hides_hair = { 10 } }
Anything that is clothes or headgear will be easternslavic, the rest you keep Persian. The result is a Persian person with eastern Slavic clothes.
Make sure you own the DLCs and have them enabled.Hmm ,i have done everything you wrote but now the Alans have the generic facepack (the one french and occitan use).
Also, is the existing father dead? Because I'm pretty sure dead characters can't hold flags.
Thanks for the helpThey can't.
Honestly everyone seems to be unnecessarily complicating this with trying to do a bunch of flags and strange ifs and searching through *every* character for one with a flag just do this:
Unfortunately portrait_age only takes one of the four defined age stages: child, young, middle, old.Greetings, so this might be a bit of an niche question, but to those of you that have worked with portraits, more specifically the new clothing override:
Is it possible to reference real age there in any way?
I know there is portrait_age which differentiates between adult, oldage etc, but I want to check the actual character age.
Use replace_path = "music" in your mod file, that should make it so it can only read your mod's files.is there any way of stopping everything but my tracks playing ?