• 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.
Thanks, this worked perfectly.

Another side effect I notice, of the second case, is that minor titles no longer show up. Apparently the default GetHighestTitles also includes minor titles, so for GetHighestTitlesSummary they're not included. I don't see a localisation command for getting minor titles, is there one? It's a worthwhile tradeoff to me, but if there is a way to work minor titles into my new GetHighestTitlesSummary, that'd be good.

It'd not cover someone with multiple titles, but you could add a custom GetMinorTitle loc called from the summary which checks for all titles and picks the first valid (and you could perhaps have a secondary custom_loc handle council positions and/or regents, since that's usually more important than "Court Dwarf" or the like).

Edit: And now I can't unsee my "Hightest" typo...
 
  • 1
Reactions:
When you want to grant specific county to theocratic vassal it says you can't do that because when you grant land to someone he "must be able to marry and produce heirs" and these vassals can't do that.

Is there any way to create simple mod that would remove that condition or is that somehow hardcoded?
 
When you want to grant specific county to theocratic vassal it says you can't do that because when you grant land to someone he "must be able to marry and produce heirs" and these vassals can't do that.

Is there any way to create simple mod that would remove that condition or is that somehow hardcoded?

That is 100% hardcoded, as are most things related to these hardcoded diplomatic interactions. The few things you can change about them are all in defines, and they mostly impact prestige and piety costs.
 
When you want to grant specific county to theocratic vassal it says you can't do that because when you grant land to someone he "must be able to marry and produce heirs" and these vassals can't do that.

Is there any way to create simple mod that would remove that condition or is that somehow hardcoded?
I've only ever seen this message when trying to grant a title to someone who is unlanded (eg. monk, celibate). In this situation, you can work around the problem by first granting them a temple holding somewhere (preferably a temple that already exists in the county), and then you grant them the county title.
 
Alright, thanks for the answers. As a (kind of?) follow-up question: When you revoke title from your vassal without just cause, even when your laws allow it, you get -60 opinion penalty from that specific vassal you removed it from and -15 from the other vassals and I believe it is stackable. So my question is, would it be possible to somehow change the value of these (like to -1 or 0) or completely remove that penalty? What I am thinking about specifically is revoking temple holding from vassal when you control the province/county capital. Is it possible to change that and if yes can I ask where exactly should I look for it.

And another question I have, is it possible to change who is the court chaplain? Let' say I want my feudal vassal to be one. Is it possible to change that? Because by default, only courtiers or theocratic vassals (aside from muslims that have separate rules for that) can become chaplainsn. Thanks in advance.
 
Last edited:
Alright, thanks for the answers. As a (kind of?) follow-up question: When you revoke title from your vassal without just cause, even when your laws allow it, you get -60 opinion penalty from that specific vassal you removed it from and -15 from the other vassals and I believe it is stackable. So my question is, would it be possible to somehow change the value of these (like to -1 or 0) or completely remove that penalty? What I am thinking about specifically is revoking temple holding from vassal when you control the province/county capital. Is it possible to change that and if yes can I ask where exactly should I look for it.

And another question I have, is it possible to change who is the court chaplain? Let' say I want my feudal vassal to be one. Is it possible to change that? Because by default, only courtiers or theocratic vassals (aside from muslims that have separate rules for that) can become chaplainsn. Thanks in advance.
check the file in \common\opinion_modifiers\ for that, I altered that opinion modifier as well. For the -60, you want opinion_revoked_my_title. You may also be interested in opinion_retracted_my_vassal and opinion_retracted_my_de_jure_vassal. Offhand I don't know the one for the -15 opinion modifier from other vassals, but I'm sure it's in there somewhere.

For your other question, I'm pretty sure you want can_be_spiritual_trigger in \common\scripted_triggers\00_scripted_triggers.txt.
 
check the file in \common\opinion_modifiers\ for that, I altered that opinion modifier as well. For the -60, you want opinion_revoked_my_title. You may also be interested in opinion_retracted_my_vassal and opinion_retracted_my_de_jure_vassal. Offhand I don't know the one for the -15 opinion modifier from other vassals, but I'm sure it's in there somewhere.

For your other question, I'm pretty sure you want can_be_spiritual_trigger in \common\scripted_triggers\00_scripted_triggers.txt.
Thanks very much for the answers and regarding the last question: Do you know if it is possible to add inability to marry (like bishops for example) as one of the conditions to be spiritual leader/chaplain ? Something like "can_marry = no" or "can_get_married = no" ? Does something like that ever exist in triggers? Because I know there is "is_married = yes/no" but it refers only to specific moment, not inability to marry at all.
 
Thanks very much for the answers and regarding the last question: Do you know if it is possible to add inability to marry (like bishops for example) as one of the conditions to be spiritual leader/chaplain ? Something like "can_marry = no" or "can_get_married = no" ? Does something like that ever exist in triggers? Because I know there is "is_married = yes/no" but it refers only to specific moment, not inability to marry at all.

As mentioned by @GodModder, it is possible with "can_marry = no", but you probably only want that condition in some cases since e.g. the Muslim religions don't practice clerical celibacy and thus would be unable to appoint a Court Imam (which would be very side-effecty).
 
As mentioned by @GodModder, it is possible with "can_marry = no", but you probably only want that condition in some cases since e.g. the Muslim religions don't practice clerical celibacy and thus would be unable to appoint a Court Imam (which would be very side-effecty).
Exactly what I want. I'm trying to add possibility for custom playable theocracy government to be court chaplain (because game apparently detects it as entirely different government from feudal group) so I thought about somehow combining the following into one trigger: can_marry = no, is_christian = yes (to include only clerical bishop celibacy) and probably holy_order = no because as far as I know they can't marry either just like bishops. Though I wanted to add these making it possible to become chaplain aside from other options and not absolutely required (if it's possible at all) like i.e. independent = no.
 
Last edited:
The wiki's wiki's Scripting page's entry for preferred_limit, on careful reading, seems to suggest that the game will stop looking for matches once it meets a preferred limit that qualifies. However, the example used there is for a clearly nested set of preferred limits, that is, the first of three preferred limits in the example is is_powerful_vassal = yes, followed by being a tier of KING or DUKE, followed by a tier of COUNT.

But what if I'm trying to match multiple things that aren't all nested? For instance, something like this.
Code:
random_vassal = {
   limit = { trait = ambitious }
   preferred_limit = { is_powerful_vassal = yes }
   preferred_limit = { trait = diligent }
}

If there are one or more ambitious vassals who's a powerful vassal, will the game stop looking there and pick one of them, or will it then look, among any ambitious powerful vassals, for one that is also diligent?

I thought the latter would work, but a few results of my code in-game seems to indicate that maybe it's the former that's true?

If it is the former that's true, is there an easy way to simulate the latter, so that I can keep narrowing down? (That is, for the example code I posited just above, if there are more than one ambitious powerful vassals, how would I then have the game prefer one of those that's diligent?)
 
Last edited:
The wiki's wiki's Scripting page's entry for preferred_limit, on careful reading, seems to suggest that the game will stop looking for matches once it meets a preferred limit that qualifies. However, the example used there is for a clearly nested set of preferred limits, that is, the first of three preferred limits in the example is is_powerful_vassal = yes, followed by being a tier of KING or DUKE, followed by a tier of COUNT.

But what if I'm trying to match multiple things that aren't all nested? For instance, something like this.
Code:
random_vassal = {
   limit = { trait = ambitious }
   preferred_limit = { is_powerful_vassal = yes }
   preferred_limit = { trait = diligent }
}

If there are one or more ambitious vassals who's a powerful vassal, will the game stop looking there and pick one of them, or will it then look, among any ambitious powerful vassals, for one that is also diligent?

I thought the latter would work, but a few results of my code in-game seems to indicate that maybe it's the former that's true?

If it is the former that's true, is there an easy way to simulate the latter, so that I can keep narrowing down? (That is, for the example code I posited just above, if there are more than one ambitious powerful vassals, how would I then have the game prefer one of those that's diligent?)
The former. You need to use more thorough preferred_limits to cover several preferences, e.g.

Code:
random_vassal = {
    limit = {
        trait = ambitious
    }
    preferred_limit = {
        is_powerful_vassal = yes
        trait = diligent
    }
    preferred_limit = {
        is_powerful_vassal = yes
    }
    preferred_limit = {
        trait = diligent
    }
    
    # Commands
}

The above will select a powerful and Diligent vassal before a powerful vassal, a powerful vassal before a Diligent one, and a Diligent one before one that only meets the base limit of being Ambitious; if all vassals fail that one, the commands are simply not executed for any vassal, as if there weren't any preferred_limits.
 
  • 1
  • 1
Reactions:
The former. You need to use more thorough preferred_limits to cover several preferences, e.g.

Code:
random_vassal = {
    limit = {
        trait = ambitious
    }
    preferred_limit = {
        is_powerful_vassal = yes
        trait = diligent
    }
    preferred_limit = {
        is_powerful_vassal = yes
    }
    preferred_limit = {
        trait = diligent
    }
   
    # Commands
}

The above will select a powerful and Diligent vassal before a powerful vassal, a powerful vassal before a Diligent one, and a Diligent one before one that only meets the base limit of being Ambitious; if all vassals fail that one, the commands are simply not executed for any vassal, as if there weren't any preferred_limits.
From bitter experience, I'll add that this approach becomes very tedious very quickly as the number of conditions increases.

(Offhand, I think it's ((2^n)-1) preferred_limit clauses for n conditions. 2 conditions => 3 clauses; 3 conditions => 7 clauses; 4 conditions => 15 clauses; etc. But that's just the raw number of clauses - it says nothing about the headaches from ordering. Eg: Is diligent+king better or worse than powerful_vassal+duke?)
 
  • 1
Reactions:
The former. You need to use more thorough preferred_limits to cover several preferences, e.g.

Code:
random_vassal = {
    limit = {
        trait = ambitious
    }
    preferred_limit = {
        is_powerful_vassal = yes
        trait = diligent
    }
    preferred_limit = {
        is_powerful_vassal = yes
    }
    preferred_limit = {
        trait = diligent
    }
  
    # Commands
}

The above will select a powerful and Diligent vassal before a powerful vassal, a powerful vassal before a Diligent one, and a Diligent one before one that only meets the base limit of being Ambitious; if all vassals fail that one, the commands are simply not executed for any vassal, as if there weren't any preferred_limits.

From bitter experience, I'll add that this approach becomes very tedious very quickly as the number of conditions increases.

(Offhand, I think it's ((2^n)-1) preferred_limit clauses for n conditions. 2 conditions => 3 clauses; 3 conditions => 7 clauses; 4 conditions => 15 clauses; etc. But that's just the raw number of clauses - it says nothing about the headaches from ordering. Eg: Is diligent+king better or worse than powerful_vassal+duke?)
This certainly explains why my code wasn't fully functioning as intended. I'm going to have to touch up so much of my code now.

I don't suppose there's a better, easier alternative to preferred limits, than writing out an exponentially increasing number of conditions?
 
Can the on_action trigger on_host_change fire for landed characters, for example if they're taken prisoner?
Have you considered testing it? (Eg: on_host_change, fire a hidden event on the character, which fires a visible event on their current host. Then imprison a landed character with the console - do you receive the visible event?) And then, if the wiki's unclear/misleading, you can update it :)
 
  • 1Like
Reactions:
Another, unrelated question, is there any way to force a character to equip specific artifacts? It's incredibly bothersome when I gift a vassal an artifact, but they already have a lower-quality artifact equipped, and will never ever switch.

I don't see a relevant command for it.
 
Have you considered testing it? (Eg: on_host_change, fire a hidden event on the character, which fires a visible event on their current host. Then imprison a landed character with the console - do you receive the visible event?) And then, if the wiki's unclear/misleading, you can update it :)

Some testing seems to show that it does not fire for landed characters.

An edit: A few minutes later, the test event fired, several months later in game. It should've fired immediately, there's no delay written into the code, so I don't know what's going on.
 
Last edited:
Can the on_action trigger on_host_change fire for landed characters, for example if they're taken prisoner?

As far as I can think of, there's only a few things that change the host of a landed character -- becoming unlanded (and initially being landed; various on_new_holder on_actions), becoming a prisoner/being released from prison (both have on_actions), being appointed a councillor or losing a council spot (gain_/lose_effect), and forced host changes for councillors (related to seclusion; force_host is pretty rare in general) -- so if that one doesn't work it might be possible to use other on_actions and a few specific tweaks to cover other stuff to make an event/effect fire.
 
Some testing seems to show that it does not fire for landed characters.

An edit: A few minutes later, the test event fired, several months later in game. It should've fired immediately, there's no delay written into the code, so I don't know what's going on.
That sounds like your imprisonment action did not change the character's host (for the purpose of the on_action, at least), but something else did a few months later.

You didn't happen to use one of your councillors as your test case, did you?!

Alternatively, and a bit less likely, you may not have carefully checked the FROM portrait in the visible event a few months after - maybe it was actually some other character?