• 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.
Is there a define for the AI chance to chose divine blood marriages? Also can you specify which close kin relations are allowed while prohibiting others? Like allowing brother/sister, and disallowing parent/child?
The latter is doable, it's controlled by relation_with_character_is_incestuous_in_faith_trigger in scripted_triggers/00_religious_triggers.txt. You could add your own new consanguinity doctrine and then modify that trigger to check for it, or change the behaviour of one of the existing doctrines, or whatever else.

For the former, I don't think it's possible. You can completely control who is allowed to marry whom in script, but you have very very limited control over how the AI actually chooses from among those allowed options.
 
  • 2
Reactions:
For the former, I don't think it's possible. You can completely control who is allowed to marry whom in script, but you have very very limited control over how the AI actually chooses from among those allowed options.

Not really. You have a ton of control over whom the AI marries. Actually, pretty much every bit of control. In the ai_will_do part of the interaction you'd just need to weight some candidates extremely heavily. You could also do it through ai_potential and/or make a special 'marry_divine_blood_interaction' that will (nearly) always trigger if the AI can marry divine blood.
 
Last edited:
Not really. You have a ton of control over whom the AI marries. Actually, pretty much every bit of control. In the ai_will_do part of the interaction you'd just need to weight some candidates extremely heavily. You could also do it through ai_potential and/or make a special 'marry_divine_blood_interaction' that will (nearly) always trigger if the AI can marry divine blood.
AI marriage proposal logic is hardcoded and does not use the normal character interaction logic. Indeed the vanilla interaction doesn't even have an ai_will_do. Instead there are various SPOUSE_SCORE defines which control the actual weights it uses, but these mostly only relate to alliances and prestige gain. There isn't one for divine marriage related things.

If you want the AI to always marry incestuously, your other workarounds would work, but if you just want them to weight it a bit higher there really isn't a way to do that right now.
 
If you want the AI to always marry incestuously, your other workarounds would work, but if you just want them to weight it a bit higher there really isn't a way to do that right now.

It doesn't need to be always. Just alter the ai_will_do and/or the frequency until you get a desired result.
 
Last edited:
Related to ai_will_do stuff...

In a lot of interactions I see stuff like this:

Code:
        modifier = { # The AI will only use a Hook if they couldn't otherwise do this
            scope:divorce_hook = yes
            add = -1
        }

or more commonly with add = 1 like this:

Code:
        modifier = { # Make sure the AI uses hooks for this as it's % based
            scope:hook = yes
            add = 1
        }

Are these just dummy modifiers that force the AI to use a hook if it can or something? I don't understand the logic in them.

For reference, here's the full ai_will_do block of imprison_interaction

Code:
    ai_will_do = {
        base = -100
       
        modifier = { # Make sure the AI uses hooks for this as it's % based
            scope:hook = yes
            add = 1
        }
        modifier = {
            add = 200
            scope:actor = {
                has_imprisonment_reason = scope:recipient
            }
        }
        modifier = { # Avoid Tyranny wars at inopportune times
            add = -190
            scope:actor = {
                ai_rationality >= medium_negative_ai_value
                is_at_war = yes
            }
            scope:recipient = {
                is_landed = yes
            }
        }
        modifier = { # Don't imprison people you like
            scope:actor = {
                NOT = {
                    has_trait = sadistic
                }
                OR = {
                    has_secret_relation_lover = scope:recipient
                    has_relation_lover = scope:recipient
                    has_relation_soulmate = scope:recipient
                    has_relation_friend = scope:recipient
                    has_relation_best_friend = scope:recipient
                    opinion = {
                        target = scope:recipient
                        value > very_high_positive_opinion
                    }
                }
            }
            add = -1000
        }
        modifier = { # Don't imprison your own children... unless they're your rival/nemesis
            scope:recipient = {
                is_child_of = scope:actor
                NOR = {
                    has_relation_rival = scope:actor
                    has_relation_nemesis = scope:actor
                }
            }
            add = -1000
        }
        modifier = { # Don't imprison your spouse, unless they're your rival/have cheated on you
            scope:recipient = {
                is_spouse_of = scope:actor
                NOR = {
                    has_relation_rival = scope:actor
                    has_relation_nemesis = scope:actor
                    exposed_cheating_on_spouse_trigger = { SPOUSE = scope:actor }
                }
            }
            add = -1000
        }
        modifier = { # Try to avoid pointless imprisonments
            scope:recipient = {
                NOR = {
                    scope:actor = { # Sadists want people to torture
                        has_trait = sadistic
                    }
                    AND = { # Imprisoning vassals you have revoke reasons on is relevant
                        is_landed = yes
                        scope:actor = { has_revoke_title_reason = scope:recipient }
                    }
                    is_a_faction_member = yes
                    has_relation_rival = scope:actor
                    has_relation_nemesis = scope:actor
                    exposed_cheating_on_spouse_trigger = { SPOUSE = scope:actor }
                    scope:actor = { # Scheme Agents should be imprisoned indiscriminately
                        any_targeting_scheme = {
                            hostile_scheme_trigger = yes
                            is_scheme_agent_exposed = scope:recipient
                        }
                    }
                    AND = { # Zealots will imprison character sof other faiths
                        scope:actor.ai_zeal >= medium_positive_ai_value
                        NOT = { scope:actor.faith = scope:recipient.faith }
                    }
                    has_opinion_modifier = {
                        modifier = murdered_close_family_crime
                        target = scope:recipient
                    }
                    has_opinion_modifier = {
                        modifier = attempted_murder_close_family_crime
                        target = scope:recipient
                    }
                    has_opinion_modifier = {
                        modifier = executed_close_family
                        target = scope:recipient
                    }
                    has_opinion_modifier = {
                        modifier = slept_with_spouse_discovered_opinion
                        target = scope:recipient
                    }
                    has_opinion_modifier = {
                        modifier = slept_with_spouse_exposed_opinion
                        target = scope:recipient
                    }
                    has_opinion_modifier = {
                        modifier = unfaithful_spouse_discovered_opinion
                        target = scope:recipient
                    }
                    has_opinion_modifier = {
                        modifier = unfaithful_spouse_exposed_opinion
                        target = scope:recipient
                    }
                    has_opinion_modifier = {
                        modifier = refused_to_renounce_lover_opinion
                        target = scope:recipient
                    }
                    has_opinion_modifier = {
                        modifier = betrayed_our_promise
                        target = scope:recipient
                    }
                    has_opinion_modifier = {
                        modifier = botched_my_treatment_crime_opinion
                        target = scope:recipient
                    }
                    has_opinion_modifier = {
                        modifier = botched_treatment_of_kin_crime_opinion
                        target = scope:recipient
                    }
                    has_opinion_modifier = {
                        modifier = smeared_opinion
                        target = scope:recipient
                    }
                    has_opinion_modifier = {
                        modifier = insulted_opinion
                        target = scope:recipient
                    }
                    has_opinion_modifier = {
                        modifier = mocked_me_in_time_of_need
                        target = scope:recipient
                    }
                    has_opinion_modifier = {
                        modifier = loved_one_dungeon_death
                        target = scope:recipient
                    }
                    has_opinion_modifier = {
                        modifier = abandoned_me_opinion
                        target = scope:recipient
                    }
                    has_opinion_modifier = {
                        modifier = reason_child_died
                        target = scope:recipient
                    }
                    has_opinion_modifier = {
                        modifier = falsely_accused
                        target = scope:recipient
                    }
                }
            }
            add = -1000
        }
        modifier = {
            exists = scope:recipient.primary_title
            add = scope:recipient.primary_title.tier
        }
    }

This leaves me scratching my head and the only thing I can think of is that if a hook is referenced in the ai_will_do block of any interaction it will force the AI to use that hook if the modifier is 1 or if they couldn't otherwise perform the interaction and the modifier is -1 as the comments say. I'm guessing it's some weird hack to control when the AI uses hooks...but it's really confusing because it looks totally illogical. Anyone know for sure?
 
AI marriage proposal logic is hardcoded and does not use the normal character interaction logic. Indeed the vanilla interaction doesn't even have an ai_will_do. Instead there are various SPOUSE_SCORE defines which control the actual weights it uses, but these mostly only relate to alliances and prestige gain. There isn't one for divine marriage related things.

If you want the AI to always marry incestuously, your other workarounds would work, but if you just want them to weight it a bit higher there really isn't a way to do that right now.
AI marriage acceptance is modifiable though, in the marriage_ai_accept_modifier key in common\scripted_modifiers\00_marriage_scripted_modifiers.txt so you can weight it from the otherside, including with hard -1000 nerfs of marriages you don't want to happen.

The loophole is characters marrying their own unlanded courtiers, which don't go through the marriage_ai_accept_modifier logic.
 
  • 1
Reactions:
Hi all, when creating a new character, how can you make him look the way you want him to?

The DNA for characters is stored in common>DNA. You can design the character in the in-game portrait window accessed by pressing the ` key while in debug mode and then copy the dna data you need. The DNA name then has to be referenced in history>characters.

Paradox has some good documentation for doing this.

 
  • 1
Reactions:
The DNA for characters is stored in common>DNA. You can design the character in the in-game portrait window accessed by pressing the ` key while in debug mode and then copy the dna data you need. The DNA name then has to be referenced in history>characters.

Paradox has some good documentation for doing this.

Thanks, it's really helpful!
 
Thanks, it's really helpful!

Keep in mind, character DNA can only be used for historical characters, i.e., characters that exist at the beginning of the game. If you want to apply styles to characters created through script, using the create_character function, you need to use flags and portrait modifiers to get the job done, with a lot of caveats. I've written about that previously here:—

The only way I've found, and it's exceptionally hacky, is to create portrait modifiers in gfx\portraits\portrait_modifiers and then apply them with a character flag. The first part of the wiki gives some example code on how to do this.

There are a lot of problems with this, though. For one, using replace to set genes in portrait modifiers requires setting values between 0 and 1 specified to at most 2 decimal places, whereas the DNA values output by the portrait editor have values in the 0–255 range, so you need to do the maths yourself for every single gene you want to replace. Once you do, though, it seems to work, but there's yet another catch: character flags get unset on death, which resets the appearance to the default.

All in all, it's just an awful lot of work when it seems to me create_character should just be able to take a dna string the same way historical characters do. Why those functions don't use the same format, I cannot fathom.

EDIT:
So I've found a workaround to preserve appearance after death, if that's important for you. Rather than setting a character flag that's cleared on death, you can set a global variable with the character whose appearance you want to modify as its value, then check for the variable in the portrait modifiers:—

Code:
# after create_character, with saved scope custom_character_001
set_global_variable = {
    name = custom_character_001
    value = scope:custom_character_001
}

# in your portrait modifier
weight = {
    base = 0
    modifier = {
        add = 200
        AND = {
            exists = global_var:custom_character_001
            global_var:custom_character_001 = {
                this = root
            }
        }
    }
}

Since I'm only doing a few characters where this matters, this isn't a big deal, but it does run the risk of becoming a resource drain if you needed to do a lot of them. But then, so too the portrait modifiers in the first place, I imagine, so… \o_O/

Keep in mind, as the numeric suffix attests, since the value gets overridden if you reset the global variable, each custom character needs his own global variable set to track him. You may be able to fix this with a global list instead, but I haven't tested it, so I'm unsure if dead characters are pruned from those.
 
  • 1
Reactions:
Anyone knows if it's possible if a county can be associated to no De jure Kingdoms or Empire or would it break something in the game ?

I want to delete all the de jure empires except the ones that actually existed (califate, ERE, HRE) and some of the weird kingdoms as well.

I know CK2 1.0 didn't have so many de jure empires and they added them later, but i wonder if it's possible in CK3 as well ?
 
  • 1Like
Reactions:
I am trying to use a numeric variable as a trigger to insert alternative wording in the description of an event. Can someone please glance at this and tell me if this is a valid way of writing the trigger?
Code:
    type = character_event
    title = TOMSbday.1015.t
    desc = {
        desc = TOMSbday.1015.opening
        first_valid = {
            triggered_desc = {
                trigger = { local_var:counter >= 3 }
                desc = TOMSbday.1015.mid1
            }
            desc = TOMSbday.1015.mid2
        }
        desc = TOMSbday.1015.end
    }
 
I'm having a couple problems with localization:—
  1. Does anyone know if there's a way to include apostrophes inside a Concept() localization function?
    Code:
    "[Concept( 'some_game_concept', 'Others' opinions' )|E]"

    I figured maybe it could be escaped with a backslash, but no luck. Using a curly apostrophe (’ rather than ') sort of works, but it noticeably differs in appearance from the plain apostrophe used by other text (such as GetFirstNamePossessive).

  2. Is there an equivalent to CK2's GetBoyGirl function? It seems a really odd thing to suddenly drop support for…
 
How is it possible that my character has a different appearance in an event window, from his appearance in the character window ( left bottom corner of the screen)
In the event window he has a beard in the character window not. What files drive the differences in appearance?