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.
You are using an out of date browser. It may not display this or other websites correctly. You should upgrade or use an alternative browser.
The problem appears to be in employer = {}. I think it doesn't tooltip correctly, referring to the wrong character and showing how it evaluates for that wrong character, making it seem as if it evaluates correctly, while actually being false.
FWIW, I normally use constructions like this for checks on unlanded courtiers:
Code:
any_child = {
is_ruler = no # No titles at all, not even mercs or holy orders
liege = { character = PREVPREV }
}
According to the wiki, using employer instead of liege removes the need for the is_ruler=no check, so this construction could be seen as unnecessarily complex. However, it doesn't have the same tooltip issues ;-p
A not-so-quick question: There's a "fun" quirk with claimant factions against elective titles -- tested with Elective Gavelkind, (base is Tanistry), Princely Elective (base is Feudal Elective), Imperial Elective (base is Feudal Elective), and two Tianxia laws (one has Tanistry as its base, one has Feudal Elective as its base -- where you cannot start a Claimant faction for the title unless the candidate can be elected,even if they have a claim. Based on my recollection from the distant past and the Factions page on the wiki (updated for JD/2.8) not specifying this limitation, this might have been changed alongside HF/3.0's elective rework, though I might be mistaken about that since I've rarely played with vanilla elective succession laws.
This does not seem to be possible to circumvent by changing the potential/allow/etc. blocks in the faction; not even the extremely simplified faction below works if the claimant is not a valid candidate in the election (I've let the game run a bit, saved, reloaded, etc.; nothing) whereas making them a valid candidate or swapping the title to e.g. Primogeniture gives them the option to faction for themselves or have others faction for them (as expected):
Code:
faction_claimant = {
type = liege_titles_w_claimant # 'new_character' is a Claimant, or, if the title is Elective, anyone eligible for election
exclusive = yes # Can only lead or be in one faction of this type
warning_level = 0.70
potential = {
ai = no
}
allow = {
new_character = {
character = FROM
}
}
allow_join = {
ai = no
}
chance = {
factor = 1
}
membership = {
factor = 1
}
success = {
always = no
}
abort = {
always = no
}
}
Leaving aside whether the vanilla implementation is as it should be, this limitation on claimants poses a problem for us in Tianxia, particularly as there are cases where we simply cannot permit random people to be candidates (and where hardcode works against it, since those laws use Tanistry as the base and are used by rel head title holders, which limits things by dynasty and religion to begin with), and a workaround is needed. "Claimants can always start the Takeover faction" would work in some cases, but it is of course Conclave-exclusive, wouldn't work in all cases even then (rel heads cannot get Takeover factions, and changing that would be a problem),, and would get weird with secondary titles ("I have a claim on an insignificant border kingdom held by my liege, so I'll try to take over the whole realm!"), so something else would still be needed in at least some cases.
I've come up with three potential solutions and would like some input on the overall feasibility since I'm not really sure what'd work best for this problem (and factions are not something I'm terribly familiar with).
- Option 1: Create a liege_titles-type faction that only can be started by claimants for a specific title (since there's no third party) and create new membership logic based on "Would I prefer the faction leader rather than my liege?". I don't know if liege_titles-type factions really can be used like this, seeing as the non-"Change succession/crown laws" types in vanilla only target the primary title (see e.g. Antiking), and it'd involve rewriting the whole membership logic (doable, but a bit messy).
- Option 2: Create factions like above but have them succeed immediately by having "always = yes" (assuming that works) in the "success" block and make the faction leader start a proper claimant faction in the "effect" block -- though they don't show up as creatable in the Factions menu, those factions work for claimants that are not valid candidates under elective when started from script, for whatever reason (yet another weird CK2 quirk...), other people can join as per usual, and neither the faction leader nor the members get kicked by some kind of validation (at least not for multiple months) -- or have the "faction type swap" happen in a fairly frequent maintenance event (probably something fired in the pulse province). I don't know the limitations on the "effect" and "success" blocks for factions, so I don't know if that approach is feasible. As above, third party claimants would not be an option (ahead of the "faction type swap", at least; script-started claimant factions for elective titles doesn't immediately invalidate if the faction leader leaves it...).
- Option 3: Ignore the liege_titles-type faction entirely and have a (targeted? third_party? title?) decision-started normal claimant faction. Would require rewriting the faction script to the proper scopes for a decision , would possibly be a performance drain (I suppose the AI could do it on_yearly_pulse or something...), and would probably be less intuitive for the player since it'd not be found in the faction menu. In theory, this option could perhaps be on the table for the player only combined with the above, though I generally dislike having the player play by different rules from the AI.
I'd also welcome other suggestions, in case there are better approaches I've not considered.
- Option 3: Ignore the liege_titles-type faction entirely and have a (targeted? third_party? title?) decision-started normal claimant faction. Would require rewriting the faction script to the proper scopes for a decision , would possibly be a performance drain (I suppose the AI could do it on_yearly_pulse or something...), and would probably be less intuitive for the player since it'd not be found in the faction menu. In theory, this option could perhaps be on the table for the player only combined with the above, though I generally dislike having the player play by different rules from the AI.
I personally think this is probably the best option because it allows for the creation of factions where the faction leader is not the claimant. (Which is something you see very often in unmodded/lightly-modded games.)
However, to do this "properly" seems like quite a lot of effort. For example:
Need to have some method to decide whichclaimant you want to start the faction for.
I think the only practical option is to create the faction via a targeted decision on the desired claimant. Unfortunately, this is ugly and possibly rather opaque.
Making a high-prio targeted decision available on all claimants is probably a bad plan, since there might be hundreds.
Having only a low-prio targeted decision is probably a bad plan, since players won't know the option exists.
Having two targeted decisions (low-prio for all + high-prio for close relatives) means double the coding, and also runs the risk of players auto-ignoring that particular alert (because the only vanilla decision which triggers the alert is "go into hiding", which is almost always a bad option).
EDIT: I suppose a title_decision with a third-party slot where you choose the claimant could also work, and might actually be a lot cleaner. But I don't think I've ever seen anything like this in-game, so I don't know if it's even possible.
The AI alsoneeds to have some method to pick which claimant they want to start a faction for.
This will probably need to be scripted completely differently from the player-only method, eg. via an on_yearly_pulse event, because the AI will need to pick its most-preferred claimant from a list of potentially hundreds. (Compared with a human who has many different ways of comparind their options.)
On the other hand, I don't think it would be a performance drain to include AI logic, since it's probably pretty safe for them to check it once a year, and you can filter out 99% of AI characters using pre-triggers (eg. only_playable = yes).
---
EDIT2:
My first thought on reading your post was "why don't you just make claimants valid candidates for election?". (If you don't want them to be elected unless they fulfil the normal conditions, you can give them -1000 reasons, or something.)
I originally discarded this suggestion because, on reading your post, I could imagine a number of potential problems. (And it may not work at all for non-dynastic claimants in tanistry-derived successions.)
However, after thinking about the sheer amount of work that would be needed to edit the faction laws, I think it's worth considering this as a quick-and-dirty workaround that solves about 90% of the problem.
My first thought on reading your post was "why don't you just make claimants valid candidates for election?". (If you don't want them to be elected unless they fulfil the normal conditions, you can give them -1000 reasons, or something.)
I originally discarded this suggestion because, on reading your post, I could imagine a number of potential problems. (And it may not work at all for non-dynastic claimants in tanistry-derived successions.)
However, after thinking about the sheer amount of work that would be needed to edit the faction laws, I think it's worth considering this as a quick-and-dirty workaround that solves about 90% of the problem.
It'd create a new and exciting problem, however: Claimant scores are worthless when it comes to restricting how the player votes, and it's possible to be an elector that has enough voting power to decide the election even in the face of a united opposition, and that'd create assorted "fun" scenarios to handle (e.g. "Player voted another dynasty onto the Dragon Throne; is this to be considered a normal non-dynastic inheritance under Primogeniture or a de facto usurpation (in which case the realm might implode)?") that we can't realistically slap a big "Unsupported!" sign on without likely getting bug reports (though I suppose the "Can't start claimant factions for these titles" thing has been a thing for half a year and change, and nobody has reported that...).
I've started working on an implementation, and I can report that the "success" approach for the "workaround" faction does not work (I didn't try the first option since it'd require different faction ultimatums). Using a targeted decision on the title works fine, regardless of being in a "workaround" faction or not, including with third parties (tentatively with realm_including_me as the third_party_filter; all_including_me would probably be a performance nightmare, and dynasty_including_me might be worse in some cases); the example shown below is for Tanistry with a non-dynastic claimant (missing localisation and the like is of course due to it being WIP).
That leaves figuring out how to make the AI pick the best (from its perspective) claimant, which raises a few new questions (third_party_score is not something I've really worked with):
- Does the AI evaluate decisions with third_party_score for each third party in turn, or does it simply evaluate the decision once for a third party each ai_check interval?
- When evaluating a decision that has third_party_score, does the AI evaluate candidates in the order they're sorted (descending third_party_score) or does it have its own rules for the order (e.g. charid)?
- Is there a straightforward way to tell the AI "If third_party_score is below <thredshold>, don't bother!" ahead of the effect? Putting the claimant faction's chance block as the ai_will_do block (with modified scopes) to tell it to avoid certain claimants is likely an option, but if there's a clear threshold for suitability after adding third_party_scores (which feel worthwhile for the player) then maybe it doesn't need to waste performance checking if the next -- equally bad or worse, assuming it evaluates candidates in score order -- candidate is good enough after the first candidate below the threshold.
If the AI doesn't interact with/understand third_party_score at all, then perhaps it will need to be limited to checking itself in the title decision and checking assorted claimants on_yearly_pulse or something, which I suppose is tolerable and which I suppose could make full use of some scripted_score_values to determine a candidate from all candidates.
That leaves figuring out how to make the AI pick the best (from its perspective) claimant, which raises a few new questions (third_party_score is not something I've really worked with):
- Does the AI evaluate decisions with third_party_score for each third party in turn, or does it simply evaluate the decision once for a third party each ai_check interval?
- When evaluating a decision that has third_party_score, does the AI evaluate candidates in the order they're sorted (descending third_party_score) or does it have its own rules for the order (e.g. charid)?
- Is there a straightforward way to tell the AI "If third_party_score is below <thredshold>, don't bother!" ahead of the effect? Putting the claimant faction's chance block as the ai_will_do block (with modified scopes) to tell it to avoid certain claimants is likely an option, but if there's a clear threshold for suitability after adding third_party_scores (which feel worthwhile for the player) then maybe it doesn't need to waste performance checking if the next -- equally bad or worse, assuming it evaluates candidates in score order -- candidate is good enough after the first candidate below the threshold.
If the AI doesn't interact with/understand third_party_score at all, then perhaps it will need to be limited to checking itself in the title decision and checking assorted claimants on_yearly_pulse or something, which I suppose is tolerable and which I suppose could make full use of some scripted_score_values to determine a candidate from all candidates.
From a performance point of view you will want to make sure the AI's filter is the narrowest possible for your use case. You also want to filter out as many people as possible in from_potential, then potential, since for each step you're checking far more characters
Hardly definitive, but you can probably find out with some use of the log command which can be used in trigger contexts, as well as the GetScopes loc command.
Hardly definitive, but you can probably find out with some use of the log command which can be used in trigger contexts, as well as the GetScopes loc command.
Thanks; I knew there was some information about it somewhere, but I didn't find it when searching for it since a normal Windows search doesn't look inside .info...
It'd create a new and exciting problem, however: Claimant scores are worthless when it comes to restricting how the player votes, and it's possible to be an elector that has enough voting power to decide the election even in the face of a united opposition, and that'd create assorted "fun" scenarios to handle (e.g. "Player voted another dynasty onto the Dragon Throne; is this to be considered a normal non-dynastic inheritance under Primogeniture or a de facto usurpation (in which case the realm might implode)?") that we can't realistically slap a big "Unsupported!" sign on without likely getting bug reports (though I suppose the "Can't start claimant factions for these titles" thing has been a thing for half a year and change, and nobody has reported that...).
The way I look at this is that players can always find a way to ruin the game. In a SP game, this doesn't matter at all (player can always cheat). In a MP game, you need some kind of guidelines between players anyway, so I think this issue could be handled by including it in those agreements.
If you already have a mechanism for "realm implosion on dynasty change" then you could add a quick check in an on_new_holder event. (If {{the title gained is subject to realm implosion, eg. China} and {has held this title for <= 1 day} and {previous ruler lost the title <=3 days ago and was of a different dynasty} and {this character isn't immune to realm implosion, eg. because they just reunified China} and {realm implosion isn't already queued}}, then {do realm implosion}.) If players mess with the succession to force "bad" candidates onto the throne, they destroy China and suffer the consequences (which I'm assuming are bad).
That leaves figuring out how to make the AI pick the best (from its perspective) claimant, which raises a few new questions (third_party_score is not something I've really worked with):
- Does the AI evaluate decisions with third_party_score for each third party in turn, or does it simply evaluate the decision once for a third party each ai_check interval?
the decision is checked by every AI character every ai_check_interval months; and
third-party score is calculated for every possible third party before the AI makes any decisions; and
if the AI decides to take the decision, they will choose the third-party with the highest score (unless there's logic in the ai_will_do_block which interferes).
For this reason, it's probably a good idea to severely limit:
which AI can take the decision (ie. from_potential block - only count+ landed characters whose direct liege has one of the relevant elective successions); and
which titles can be checked (ie. potential block - only the decision-taking character's direct liege's titles which are de facto liege of any of the decision-taker's titles (yes you probably need to support situations where there's more than one valid title!)); and
which third parties are valid (ie. third_party_potential block - only characters who have claims on that particular title).
However, once you've done all that, I don't think you need to worry too much about the third-party filter. In fact, I think that all_including_me is the only logical choice, since it's quite possible for a valid faction claimant to be outside the realm (eg. if they were banished).
- When evaluating a decision that has third_party_score, does the AI evaluate candidates in the order they're sorted (descending third_party_score) or does it have its own rules for the order (e.g. charid)?
- Is there a straightforward way to tell the AI "If third_party_score is below <thredshold>, don't bother!" ahead of the effect? Putting the claimant faction's chance block as the ai_will_do block (with modified scopes) to tell it to avoid certain claimants is likely an option, but if there's a clear threshold for suitability after adding third_party_scores (which feel worthwhile for the player) then maybe it doesn't need to waste performance checking if the next -- equally bad or worse, assuming it evaluates candidates in score order -- candidate is good enough after the first candidate below the threshold.
If the AI doesn't interact with/understand third_party_score at all, then perhaps it will need to be limited to checking itself in the title decision and checking assorted claimants on_yearly_pulse or something, which I suppose is tolerable and which I suppose could make full use of some scripted_score_values to determine a candidate from all candidates.
I believe the score is calculated for every third party every time the AI checks the decision. And, in the absence of third-party logic in the ai_will_do block (ie. anything involving FROMFROM), I believe the AI will always pick the top-rated third-party (if they decide to take the decision).
But, I recommend you do not include third-party logic in the ai_will_do block, because it could become very difficult to keep track of the interactions between these modifiers and the third-party score. Instead, I think it would be better to write your extra AI decision-making logic in the third_party_potential block (so that "bad choices" are filtered out before the AI even sees them).
Alternatively, if it gets too complicated to write a single decision that supports both AI and players, you could write different decisions optimised for each. (But code duplication makes maintenance significantly harder so, if I was forced down this route, I would try to put as much logic as possible into shared scripted_triggers etc.)
Continuing with the faction workaround, I've figured out a setup that seems to work as desired for the player (I might have gone overboard on the "ROOT_" prefix, but after getting some earlier errors due to forgetting it I decided to be on the safe side):
Code:
# Hardcode is why we can't have nice things!
title_decisions = {
faction_claimant_workaround = {
filter = realm_owned
ai_target_filter = realm_owned
only_playable = yes
is_high_prio = yes
third_party = FROM
show_third_party_potential = yes
third_party_filter = realm_including_me # Same as AI
ai_third_party_filter = realm_including_me # Likely the sanest AI restriction, considering performance
ai_check_interval = 3 # Might be too frequent
from_potential = {
independent = no
is_adult = yes
prisoner = no
holy_order = no
is_incapable = no # Works fine here
in_seclusion = no
NOT = {
trait = in_hiding
}
NOT = {
in_faction = faction_claimant
}
}
potential = {
any_claimant = {
same_realm = FROM
}
holder_scope = {
any_vassal = {
character = FROM
}
}
OR = {
holder_scope = {
real_tier = ROOT
}
tier = king
}
#OR = { # Doesn't work for secondary titles for whatever reason
# # All elective laws that either have an inherent dynastic restriction or do not allow the election of unrelated claimants
# has_law = succ_elective_gavelkind
# has_law = succ_eldership
# has_law = succ_tanistry
# has_law = succ_tenno
# has_law = succ_ryukyuan_tenno
# has_law = succ_chinese_imperial_succession
# has_law = succ_ma_chu
#}
NOT = {
title = k_chrysanthemum_throne
}
FROM = {
trigger_if = {
limit = {
liege = {
OR = {
is_the_tenno_trigger = yes
is_ryukyuan_tenno_trigger = yes
}
}
could_have_japanese_government_trigger = yes
}
OR = {
is_the_tenno_trigger = yes
is_ryukyuan_tenno_trigger = yes
}
}
trigger_else_if = {
limit = {
liege = {
government = chinese_imperial_government
}
}
OR = {
ROOT = {
claimed_by = FROM
}
liege = {
OR = {
has_character_modifier = mandate_of_heaven_2
has_character_modifier = mandate_of_heaven_1
}
}
}
}
}
holder_scope = {
is_vice_royalty = no
OR = {
is_feudal = yes
is_tribal = yes
is_nomadic = yes
}
# Hordes should have less problems with this type of faction until ca 1350
trigger_if = {
limit = {
has_landed_title = e_mongol_empire
culture = mongol
}
NAND = {
OR = {
AND = {
religion = FROM
culture = FROM
}
dynasty = FROM
}
year < 1350
}
}
trigger_else_if = {
limit = {
has_landed_title = e_aztec_empire
culture = nahua
}
NAND = {
religion = FROM
culture = FROM
year < 1350
}
}
trigger_else_if = {
limit = {
has_landed_title = e_inca_empire
culture = quechua
}
NAND = {
religion = FROM
culture = FROM
year < 1350
}
}
NOT = {
any_demesne_title = {
temporary = yes
}
}
}
FROM = {
trigger_if = {
limit = { has_dlc = "Conclave" }
OR = {
is_voter = no
is_nomadic = yes
is_tribal = yes
liege = {
OR = {
is_council_content = no
NOT = { has_law = war_voting_power_1 }
in_seclusion = yes
has_character_modifier = mandate_of_heaven_2
has_character_modifier = mandate_of_heaven_1
AND = {
has_religion_feature = religion_feature_ryukyuan_three_mountains
FROM = {
has_religion_feature = religion_feature_ryukyuan_three_mountains
}
}
AND = {
has_law = grand_chancellor_law_2
FROM = {
has_minor_title = title_grand_chancellor
}
}
}
}
}
}
trigger_else_if = {
limit = {
# If affected by a Crown Law title not held by my liege
crownlaw_title = {
holder_scope = {
NOT = { is_liege_of = FROM }
}
}
}
crownlaw_title = {
# The Crown Law title allows vassal infighting
NOR = {
has_law = crown_authority_2
has_law = crown_authority_3
has_law = crown_authority_4
}
}
}
trigger_if = {
limit = {
has_game_rule = {
name = non_aggression_pacts_block_factions
value = on
}
}
liege = {
NOT = {
has_non_aggression_pact_with = FROM
}
}
}
}
}
allow = {
OR = {
AND = {
holder_scope = {
NOT = {
de_jure_vassal_or_below = FROM
}
}
is_primary_holder_title = yes
}
AND = {
is_primary_holder_title_tier = yes # Changed from is_primary_holder_title, since secondary titles might matter
de_jure_vassal_or_below = FROM
}
claimed_by = FROM
}
trigger_if = {
limit = {
FROM = {
ai = yes
}
}
FROM = {
preparing_invasion = no
NOT = { is_married = liege }
opinion = {
who = LIEGE
value < 25
}
trigger_if = {
limit = {
OR = {
religion = catholic
religion = fraticelli
}
top_liege = {
is_liege_of = FROM
religion = FROM
# Has an antipope
rightful_religious_head_scope = {
is_antipope = yes
}
}
}
liege = {
NOT = {
faction_exists = {
faction = faction_antiking
title = ROOT
}
}
}
}
}
trigger_if = {
limit = {
NOT = {
has_law = succ_ma_chu
}
}
NOT = {
current_heir = {
character = FROM
}
}
}
}
}
third_party_potential = {
FROMFROM = {
ROOT = {
claimed_by = ROOT_FROMFROM
trigger_if = {
limit = {
holder_scope = {
government = chinese_imperial_government
}
}
OR = {
holder_scope = {
OR = {
has_character_modifier = mandate_of_heaven_2
has_character_modifier = mandate_of_heaven_1
}
}
ROOT_FROMFROM = {
character = ROOT_FROM
}
holder_scope = {
ROOT_FROMFROM = {
dynasty = PREV
}
}
}
}
trigger_if = {
limit = {
ROOT_FROMFROM = {
is_female = no
}
}
NOR = {
ROOT_FROM = {
OR = {
has_religion_feature = religion_matriarchal
has_religion_feature = religion_feature_minangkabau
}
}
succ_law_title = {
has_law = enatic_succession
}
}
}
trigger_else = {
NOR = {
ROOT_FROM = {
OR = {
has_religion_feature = religion_patriarchal
has_religion_feature = religion_feature_batak
has_religion_feature = religion_feature_yi
AND = {
religion = confucian
gender_equality_trigger = no
religions_are_standard_trigger = yes
}
}
}
succ_law_title = {
has_law = agnatic_succession
}
}
}
}
NOR = {
is_liege_or_above_of = ROOT_FROM
AND = {
controls_religion = yes
is_theocracy = yes
}
}
# The Pope, static mercs and holy orders shouldn't get titles at or above their tier
trigger_if = {
limit = {
is_ruler = yes
primary_title = {
is_primary_type_title = yes
}
}
lower_real_tier_than = ROOT
}
# Claimant isn't already fighting for claim on this title
ROOT = {
holder_scope = {
NOT = {
defending_against_claimant = {
character = ROOT_FROMFROM
title = ROOT
}
}
}
}
}
ROOT = {
# The Tenno is safe from regular claims...
trigger_if = {
limit = {
holder_scope = {
is_the_tenno_trigger = yes
}
}
OR = {
ROOT = { # ... unless it's just a kingdom...
tier = king
holder_scope = {
real_tier = emperor
NOT = {
dynasty = ROOT_FROMFROM
}
}
}
ROOT_FROM = { # ... or we don't care...
could_have_japanese_government_trigger = no
}
ROOT_FROMFROM = { # ... or we're the knockoff
character = ROOT_FROM
is_ryukyuan_tenno_trigger = yes
}
}
}
# The Ryukyuan knockoff is safe from regular claims...
trigger_else_if = {
limit = {
holder_scope = {
is_ryukyuan_tenno_trigger = yes
}
}
OR = {
ROOT = { # ... unless it's a lower title
holder_scope = {
real_tier = emperor
}
tier = king
}
any_owned_bloodline = { # or it's a bloodline member...
has_bloodline_flag = divine_ancestry_bloodline_ryukyuan
}
ROOT_FROM = { # ... or we don't care...
could_have_japanese_government_trigger = no
}
ROOT_FROMFROM = { # ... or we're the Tenno
character = ROOT_FROM
is_the_tenno_trigger = yes
}
}
}
# The Shogun shouldn't face claimant factions for the Tenno's claim
trigger_else_if = {
limit = {
holder_scope = {
has_japanese_government_trigger = yes
}
tier = emperor
}
ROOT_FROMFROM = {
is_the_tenno_trigger = no
NAND = {
could_have_japanese_government_trigger = yes
any_dynasty_member = {
is_the_tenno_trigger = yes
}
}
}
}
# Avoid putting women on the throne of China/etc. under normal conditions
trigger_else_if = {
limit = {
ROOT_FROMFROM = {
is_female = yes
ROOT = {
holder_scope = {
government = chinese_imperial_government
is_female = no
}
succ_law_title = {
has_law = agnatic_succession
}
tier = emperor
}
}
}
ROOT_FROM = {
OR = {
is_female = yes
AND = {
could_have_chinese_government_trigger = no
OR = {
could_have_japanese_government_trigger = no
has_religion_feature = religion_equal
has_religion_feature = religion_matriarchal
}
}
}
}
}
}
FROMFROM = {
ROOT = {
OR = {
AND = {
holder_scope = {
NOT = {
any_demesne_title = {
is_primary_holder_title_tier = yes # Changed from is_primary_holder_title, since secondary titles might matter
de_jure_vassal_or_below = ROOT_FROM
}
}
}
is_primary_holder_title = yes
}
de_jure_vassal_or_below = ROOT_FROM
ROOT_FROMFROM = {
character = ROOT_FROM
}
}
}
}
}
third_party_allow = {
trigger_if = {
limit = {
ROOT_FROM = {
ai = yes
}
}
ROOT_FROM = {
trigger_if = {
limit = {
has_claim = ROOT
}
ROOT_FROMFROM = {
character = ROOT_FROM
}
}
trigger_if = {
limit = {
OR = {
has_religion_feature = religion_patriarchal
has_religion_feature = religion_feature_batak
has_religion_feature = religion_feature_yi
AND = {
religion = confucian
gender_equality_trigger = no
religions_are_standard_trigger = yes
}
}
}
ROOT_FROMFROM = { is_female = no }
}
trigger_else_if = {
limit = {
OR = {
has_religion_feature = religion_matriarchal
has_religion_feature = religion_feature_minangkabau
}
}
ROOT_FROMFROM = { is_female = yes }
}
trigger_if = {
limit = {
ROOT = {
is_conquered = yes
}
}
ROOT_FROMFROM = { culture = ROOT_FROM }
}
ROOT_FROMFROM = {
trigger_if = {
limit = {
is_female = yes
NOT = {
character = ROOT_FROM
}
}
practical_age < 40
}
trigger_if = {
limit = {
NOT = { character = ROOT_FROM }
}
ROOT_FROM = {
opinion_diff = {
first = ROOT_FROMFROM
second = liege
value >= 5 # I like the Claimant more than the current ruler
as_if_liege = yes
}
}
}
}
}
trigger_if = {
limit = {
ROOT = {
holder_scope = {
dynasty = ROOT_FROM
OR = {
religion = ROOT_FROM
AND = {
could_have_chinese_government_trigger = yes
ROOT_FROM = {
could_have_chinese_government_trigger = yes
}
}
AND = {
could_have_japanese_government_trigger = yes
ROOT_FROM = {
could_have_japanese_government_trigger = yes
}
}
}
culture = ROOT_FROM
}
}
}
ROOT_FROMFROM = {
dynasty = ROOT_FROM
}
}
trigger_if = {
limit = {
holder_scope = {
OR = {
is_the_tenno_trigger = yes
is_ryukyuan_tenno_trigger = yes
}
}
}
OR = {
ROOT_FROMFROM = {
character = ROOT_FROM
}
AND = {
ROOT_FROMFROM = {
could_have_japanese_government_trigger = no
}
could_have_japanese_government_trigger = no
ROOT = {
NOT = {
claimed_by = ROOT_FROM
}
}
}
}
}
}
}
third_party_score = {
factor = 1
additive_modifier = {
value = 99
FROMFROM = {
character = ROOT_FROM
}
}
additive_modifier = {
value = 98
FROMFROM = {
NOT = {
character = ROOT_FROM
}
OR = {
dynasty = ROOT_FROM
is_married = ROOT_FROM
any_child = {
character = ROOT_FROM
}
}
OR = {
NOT = {
ROOT_FROM = {
liege = {
dynasty = ROOT_FROMFROM
}
}
}
dynasty = ROOT_FROM
is_married = ROOT_FROM
}
culture = ROOT_FROM
OR = {
religion = ROOT_FROM
AND = {
could_have_chinese_government_trigger = yes
ROOT_FROM = {
could_have_chinese_government_trigger = yes
}
}
AND = {
could_have_japanese_government_trigger = yes
ROOT_FROM = {
could_have_japanese_government_trigger = yes
}
}
}
OR = {
is_friend = ROOT_FROM
is_lover = ROOT_FROM
}
NOT = {
is_rival = ROOT_FROM
}
}
}
additive_modifier = {
value = 97
FROMFROM = {
NOT = {
character = ROOT_FROM
}
OR = {
dynasty = ROOT_FROM
is_married = ROOT_FROM
any_child = {
character = ROOT_FROM
}
}
OR = {
NOT = {
ROOT_FROM = {
liege = {
dynasty = ROOT_FROMFROM
}
}
}
dynasty = ROOT_FROM
is_married = ROOT_FROM
}
culture = ROOT_FROM
OR = {
religion = ROOT_FROM
AND = {
could_have_chinese_government_trigger = yes
ROOT_FROM = {
could_have_chinese_government_trigger = yes
}
}
AND = {
could_have_japanese_government_trigger = yes
ROOT_FROM = {
could_have_japanese_government_trigger = yes
}
}
}
NOR = {
is_friend = ROOT_FROM
is_lover = ROOT_FROM
is_rival = ROOT_FROM
}
}
}
additive_modifier = {
value = 96
FROMFROM = {
NOT = {
character = ROOT_FROM
}
OR = {
dynasty = ROOT_FROM
is_married = ROOT_FROM
any_child = {
character = ROOT_FROM
}
}
OR = {
NOT = {
ROOT_FROM = {
liege = {
dynasty = ROOT_FROMFROM
}
}
}
dynasty = ROOT_FROM
is_married = ROOT_FROM
}
NOT = {
culture = ROOT_FROM
}
culture_group = ROOT_FROM
OR = {
religion = ROOT_FROM
AND = {
could_have_chinese_government_trigger = yes
ROOT_FROM = {
could_have_chinese_government_trigger = yes
}
}
AND = {
could_have_japanese_government_trigger = yes
ROOT_FROM = {
could_have_japanese_government_trigger = yes
}
}
}
OR = {
is_friend = ROOT_FROM
is_lover = ROOT_FROM
}
NOT = {
is_rival = ROOT_FROM
}
}
}
additive_modifier = {
value = 95
FROMFROM = {
NOT = {
character = ROOT_FROM
}
OR = {
dynasty = ROOT_FROM
is_married = ROOT_FROM
any_child = {
character = ROOT_FROM
}
}
OR = {
NOT = {
ROOT_FROM = {
liege = {
dynasty = ROOT_FROMFROM
}
}
}
dynasty = ROOT_FROM
is_married = ROOT_FROM
}
NOT = {
culture = ROOT_FROM
}
culture_group = ROOT_FROM
OR = {
religion = ROOT_FROM
AND = {
could_have_chinese_government_trigger = yes
ROOT_FROM = {
could_have_chinese_government_trigger = yes
}
}
AND = {
could_have_japanese_government_trigger = yes
ROOT_FROM = {
could_have_japanese_government_trigger = yes
}
}
}
NOR = {
is_friend = ROOT_FROM
is_lover = ROOT_FROM
is_rival = ROOT_FROM
}
}
}
additive_modifier = {
value = 94
FROMFROM = {
NOT = {
character = ROOT_FROM
}
NOR = {
dynasty = ROOT_FROM
is_married = ROOT_FROM
any_child = {
character = ROOT_FROM
}
}
OR = {
NOT = {
ROOT_FROM = {
liege = {
dynasty = ROOT_FROMFROM
}
}
}
dynasty = ROOT_FROM
}
culture = ROOT_FROM
OR = {
religion = ROOT_FROM
AND = {
could_have_chinese_government_trigger = yes
ROOT_FROM = {
could_have_chinese_government_trigger = yes
}
}
AND = {
could_have_japanese_government_trigger = yes
ROOT_FROM = {
could_have_japanese_government_trigger = yes
}
}
}
OR = {
is_friend = ROOT_FROM
is_lover = ROOT_FROM
}
NOT = {
is_rival = ROOT_FROM
}
}
}
additive_modifier = {
value = 93
FROMFROM = {
NOT = {
character = ROOT_FROM
}
NOR = {
dynasty = ROOT_FROM
is_married = ROOT_FROM
any_child = {
character = ROOT_FROM
}
}
OR = {
NOT = {
ROOT_FROM = {
liege = {
dynasty = ROOT_FROMFROM
}
}
}
dynasty = ROOT_FROM
}
culture = ROOT_FROM
OR = {
religion = ROOT_FROM
AND = {
could_have_chinese_government_trigger = yes
ROOT_FROM = {
could_have_chinese_government_trigger = yes
}
}
AND = {
could_have_japanese_government_trigger = yes
ROOT_FROM = {
could_have_japanese_government_trigger = yes
}
}
}
NOR = {
is_friend = ROOT_FROM
is_lover = ROOT_FROM
is_rival = ROOT_FROM
}
}
}
additive_modifier = {
value = 92
FROMFROM = {
NOT = {
character = ROOT_FROM
}
NOR = {
dynasty = ROOT_FROM
is_married = ROOT_FROM
any_child = {
character = ROOT_FROM
}
}
OR = {
NOT = {
ROOT_FROM = {
liege = {
dynasty = ROOT_FROMFROM
}
}
}
dynasty = ROOT_FROM
}
NOT = {
culture = ROOT_FROM
}
culture_group = ROOT_FROM
OR = {
religion = ROOT_FROM
AND = {
could_have_chinese_government_trigger = yes
ROOT_FROM = {
could_have_chinese_government_trigger = yes
}
}
AND = {
could_have_japanese_government_trigger = yes
ROOT_FROM = {
could_have_japanese_government_trigger = yes
}
}
}
OR = {
is_friend = ROOT_FROM
is_lover = ROOT_FROM
}
NOT = {
is_rival = ROOT_FROM
}
}
}
additive_modifier = {
value = 91
FROMFROM = {
NOT = {
character = ROOT_FROM
}
NOR = {
dynasty = ROOT_FROM
is_married = ROOT_FROM
any_child = {
character = ROOT_FROM
}
}
OR = {
NOT = {
ROOT_FROM = {
liege = {
dynasty = ROOT_FROMFROM
}
}
}
dynasty = ROOT_FROM
}
NOT = {
culture = ROOT_FROM
}
culture_group = ROOT_FROM
OR = {
religion = ROOT_FROM
AND = {
could_have_chinese_government_trigger = yes
ROOT_FROM = {
could_have_chinese_government_trigger = yes
}
}
AND = {
could_have_japanese_government_trigger = yes
ROOT_FROM = {
could_have_japanese_government_trigger = yes
}
}
}
NOR = {
is_friend = ROOT_FROM
is_lover = ROOT_FROM
is_rival = ROOT_FROM
}
}
}
additive_modifier = {
value = 90
FROMFROM = {
NOT = {
character = ROOT_FROM
}
OR = {
dynasty = ROOT_FROM
any_child = {
character = ROOT_FROM
}
}
ROOT_FROM = {
liege = {
dynasty = ROOT_FROMFROM
NOT = {
dynasty = ROOT_FROM
}
}
}
culture = ROOT_FROM
OR = {
religion = ROOT_FROM
AND = {
could_have_chinese_government_trigger = yes
ROOT_FROM = {
could_have_chinese_government_trigger = yes
}
}
AND = {
could_have_japanese_government_trigger = yes
ROOT_FROM = {
could_have_japanese_government_trigger = yes
}
}
}
OR = {
is_friend = ROOT_FROM
is_lover = ROOT_FROM
}
NOT = {
is_rival = ROOT_FROM
}
}
}
additive_modifier = {
value = 89
FROMFROM = {
NOT = {
character = ROOT_FROM
}
NOR = {
dynasty = ROOT_FROM
any_child = {
character = ROOT_FROM
}
}
ROOT_FROM = {
liege = {
dynasty = ROOT_FROMFROM
NOT = {
dynasty = ROOT_FROM
}
}
}
culture = ROOT_FROM
OR = {
religion = ROOT_FROM
AND = {
could_have_chinese_government_trigger = yes
ROOT_FROM = {
could_have_chinese_government_trigger = yes
}
}
AND = {
could_have_japanese_government_trigger = yes
ROOT_FROM = {
could_have_japanese_government_trigger = yes
}
}
}
NOR = {
is_friend = ROOT_FROM
is_lover = ROOT_FROM
is_rival = ROOT_FROM
}
}
}
additive_modifier = {
value = 88
FROMFROM = {
NOT = {
character = ROOT_FROM
}
OR = {
dynasty = ROOT_FROM
any_child = {
character = ROOT_FROM
}
}
ROOT_FROM = {
liege = {
dynasty = ROOT_FROMFROM
NOT = {
dynasty = ROOT_FROM
}
}
}
NOT = {
culture = ROOT_FROM
}
culture_group = ROOT_FROM
OR = {
religion = ROOT_FROM
AND = {
could_have_chinese_government_trigger = yes
ROOT_FROM = {
could_have_chinese_government_trigger = yes
}
}
AND = {
could_have_japanese_government_trigger = yes
ROOT_FROM = {
could_have_japanese_government_trigger = yes
}
}
}
OR = {
is_friend = ROOT_FROM
is_lover = ROOT_FROM
}
NOT = {
is_rival = ROOT_FROM
}
}
}
additive_modifier = {
value = 87
FROMFROM = {
NOT = {
character = ROOT_FROM
}
NOR = {
dynasty = ROOT_FROM
any_child = {
character = ROOT_FROM
}
}
ROOT_FROM = {
liege = {
dynasty = ROOT_FROMFROM
NOT = {
dynasty = ROOT_FROM
}
}
}
NOT = {
culture = ROOT_FROM
}
culture_group = ROOT_FROM
OR = {
religion = ROOT_FROM
AND = {
could_have_chinese_government_trigger = yes
ROOT_FROM = {
could_have_chinese_government_trigger = yes
}
}
AND = {
could_have_japanese_government_trigger = yes
ROOT_FROM = {
could_have_japanese_government_trigger = yes
}
}
}
NOR = {
is_friend = ROOT_FROM
is_lover = ROOT_FROM
is_rival = ROOT_FROM
}
}
}
}
effect = {
custom_tooltip = {
text = start_claimant_faction
ROOT = {
save_event_target_as = claimed_title
}
ROOT_FROMFROM = {
save_event_target_as = claimant
}
FROM = {
start_faction = {
faction = faction_claimant
title = event_target:claimed_title
thirdparty = event_target:claimant
can_join_existing = yes
}
}
}
log = "[From.GetBestName] started a claimant faction for [claimant.GetBestName]'s claim on [claimed_title.GetName], currently held by [From.Liege.GetBestName]!"
}
ai_will_do = {
factor = 1
mult_modifier = {
factor = 0.1
# If we are subjugated, tend to unite behind one single claimant
is_conquered = yes
NOT = { conquest_culture = ROOT_FROM }
holder_scope = {
faction_exists = {
faction = faction_claimant
title = ROOT
}
}
ROOT_FROMFROM = {
culture = ROOT_FROM
ROOT_FROM = {
opinion_diff = {
first = PREV
second = liege
value >= 10 # I like the Claimant more than the current ruler
as_if_liege = yes
}
}
}
}
mult_modifier = {
factor = 0.5
holder_scope = {
any_owned_bloodline = {
has_bloodline_flag = bloodline_less_factions
bloodline_is_active_for = PREV
}
}
}
mult_modifier = {
factor = 0.2
FROM = { pacifist = yes }
}
# Or if vassal is under the yoke of the wrong kind of liege.
mult_modifier = {
factor = 3
FROM = {
OR = {
has_religion_feature = religion_patriarchal
has_religion_feature = religion_feature_batak
has_religion_feature = religion_feature_yi
AND = {
religion = confucian
gender_equality_trigger = no
religions_are_standard_trigger = yes
}
}
is_female = yes
}
ROOT_FROMFROM = {
is_female = no
}
}
mult_modifier = {
factor = 3
FROM = {
OR = {
has_religion_feature = religion_matriarchal
has_religion_feature = religion_feature_minangkabau
}
is_female = no
}
ROOT_FROMFROM = {
is_female = yes
}
}
mult_modifier = {
factor = 0.7
ROOT_FROMFROM = {
is_female = yes
NOT = { character = ROOT_FROM }
}
trigger_if = {
limit = { has_dlc = "Conclave" }
NOR = {
FROM = {
OR = {
has_religion_feature = religion_matriarchal
has_religion_feature = religion_equal
has_religion_feature = religion_feature_bon
has_religion_feature = religion_feature_bai
has_religion_feature = religion_feature_minahasan
has_religion_feature = religion_feature_ryukyuan
has_religion_feature = religion_feature_minangkabau
}
}
has_law = status_of_women_4
has_game_rule = {
name = gender
value = all
}
}
}
}
mult_modifier = {
factor = 0.5
ROOT_FROMFROM = { practical_age < 13 }
}
mult_modifier = {
factor = 0.5
ROOT_FROMFROM = { practical_age < 10 }
}
mult_modifier = {
factor = 0.5
ROOT_FROMFROM = { practical_age < 5 }
}
mult_modifier = {
factor = 1.5
FROM = {
opinion = {
who = LIEGE
value < 0
}
}
}
mult_modifier = {
factor = 1.5
FROM = {
opinion = {
who = LIEGE
value < -25
}
}
}
mult_modifier = {
factor = 2.0
FROM = {
opinion = {
who = LIEGE
value < -50
}
}
}
mult_modifier = {
factor = 4.0
FROM = {
opinion = {
who = LIEGE
value < -75
}
}
}
mult_modifier = {
factor = 3.0
ROOT_FROMFROM = {
character = ROOT_FROM
}
}
mult_modifier = {
factor = 1.5
ROOT_FROMFROM = {
dynasty = ROOT_FROM
}
}
mult_modifier = {
factor = 0.5
title = e_byzantium
FROM = { culture_group = byzantine }
ROOT_FROMFROM = {
NOT = { trait = born_in_the_purple }
}
}
mult_modifier = {
factor = 2.0
title = e_byzantium
FROM = { culture_group = byzantine }
ROOT_FROMFROM = {
trait = born_in_the_purple
}
}
mult_modifier = {
factor = 0.5
title = e_byzantium
FROM = { culture_group = byzantine }
ROOT_FROMFROM = {
trait = born_in_the_purple
}
}
mult_modifier = {
factor = 2.0
title = e_byzantium
FROM = { culture_group = byzantine }
ROOT_FROMFROM = {
NOT = { trait = born_in_the_purple }
}
}
mult_modifier = {
factor = 2.0
ROOT_FROMFROM = {
trait = sayyid
}
ROOT_FROM = {
religion_group = muslim
}
holder_scope = {
NOT = { trait = sayyid }
}
}
mult_modifier = {
factor = 1.5
ROOT_FROMFROM = {
trait = mirza
}
ROOT_FROM = {
religion_group = muslim
}
holder_scope = {
NOR = {
trait = sayyid
trait = mirza
}
}
}
# TIANXIATODO: Amaterasu Descendant, Saoshyant Descendant, Divine Ancestry
mult_modifier = {
factor = 4.0
is_conquered = yes
NOT = { conquest_culture = ROOT_FROM }
ROOT_FROMFROM = { culture = ROOT_FROM }
}
mult_modifier = {
factor = 2.0
holder_scope = {
dynasty_realm_power >= 0.25
}
ROOT_FROMFROM = {
ROOT = {
holder_scope = {
NOT = { dynasty = ROOT_FROMFROM }
}
}
}
}
mult_modifier = {
factor = 2.0
holder_scope = {
dynasty_realm_power >= 0.4
}
ROOT_FROMFROM = {
ROOT = {
holder_scope = {
NOT = { dynasty = ROOT_FROMFROM }
}
}
}
}
mult_modifier = {
factor = 0.01
ROOT_FROM = { trait = content }
trigger_if = {
limit = { is_conquered = yes }
conquest_culture = ROOT_FROM
}
}
mult_modifier = {
factor = 0.01
ROOT_FROM = { trait = imbecile }
}
mult_modifier = {
factor = 0.1
ROOT_FROM = { trait = inbred }
}
mult_modifier = {
factor = 0.1
FROMROOT_FROM= { trait = craven }
}
mult_modifier = {
factor = 0.2
ROOT_FROM = { is_dumb_trigger = yes }
}
mult_modifier = {
factor = 1.5
ROOT_FROM = { trait = brave }
}
mult_modifier = {
factor = 4.0
ROOT_FROM = { trait = ambitious }
}
mult_modifier = {
factor = 5
ROOT_FROM = { same_society_as = ROOT_FROMFROM }
}
mult_modifier = {
factor = 2
ROOT_FROM = {
OR = {
has_opinion_modifier = {
modifier = opinion_evil_tyrant
who = LIEGE
}
has_opinion_modifier = {
modifier = opinion_tyrant
who = LIEGE
}
}
}
}
mult_modifier = {
factor = 2
ROOT_FROM = {
OR = {
has_opinion_modifier = {
modifier = opinion_evil_tyrant
who = LIEGE
}
has_opinion_modifier = {
modifier = opinion_tyrant
who = LIEGE
}
}
liege = {
government = chinese_imperial_government
}
}
}
mult_modifier = {
factor = 0.25
ROOT_FROM = {
liege = {
has_character_modifier = mandate_of_heaven_4
ROOT_FROM = {
can_have_confucian_bureaucracy_and_eastern_imperial_trigger = yes
culture_group = PREV
}
}
}
}
mult_modifier = {
factor = 0.1
ROOT_FROM = {
liege = {
has_character_modifier = mandate_of_heaven_5
ROOT_FROM = {
can_have_confucian_bureaucracy_and_eastern_imperial_trigger = yes
culture_group = PREV
}
}
}
}
### Try to keep people from supporting someone that'd switch to a weird government
# We desire a Japanese government
mult_modifier = {
factor = 0.001
ROOT_FROM = {
could_have_japanese_government_trigger = yes
liege = {
has_japanese_government_trigger = yes
}
}
ROOT_FROMFROM = {
NOT = {
dynasty = ROOT_FROM
}
could_have_japanese_government_trigger = no
could_have_chinese_government_trigger = no
}
}
mult_modifier = {
factor = 0.01
ROOT_FROM = {
could_have_japanese_government_trigger = yes
liege = {
has_japanese_government_trigger = yes
}
}
FROMFROM = {
NOT = {
dynasty = ROOT_FROM
}
could_have_japanese_government_trigger = no
could_have_chinese_government_trigger = yes
}
}
# We desire a Chinese government
mult_modifier = {
factor = 0.001
ROOT_FROM = {
can_have_chinese_imperial_trigger = yes
liege = {
government = chinese_imperial_government
}
}
ROOT_FROMFROM = {
NOT = {
dynasty = ROOT_FROM
}
could_have_chinese_government_trigger = no
could_have_japanese_government_trigger = no
}
}
mult_modifier = {
factor = 0.01
ROOT_FROM = {
can_have_chinese_imperial_trigger = yes
liege = {
government = chinese_imperial_government
}
}
ROOT_FROMFROM = {
NOT = {
dynasty = ROOT_FROM
}
can_have_chinese_imperial_trigger = no
OR = {
could_have_chinese_government_trigger = yes
could_have_japanese_government_trigger = yes
}
}
}
mult_modifier = {
factor = 0.01
ROOT_FROM = {
can_have_chinese_imperial_trigger = yes
liege = {
government = chinese_imperial_government
}
}
ROOT_FROMFROM = {
dynasty = ROOT_FROM
could_have_chinese_government_trigger = no
could_have_japanese_government_trigger = no
}
}
mult_modifier = {
factor = 0.1
ROOT_FROM = {
can_have_chinese_imperial_trigger = yes
liege = {
government = chinese_imperial_government
}
}
ROOT_FROMFROM = {
dynasty = ROOT_FROM
can_have_chinese_imperial_trigger = no
OR = {
could_have_chinese_government_trigger = yes
could_have_japanese_government_trigger = yes
}
}
}
mult_modifier = {
factor = 0.001
ROOT_FROM = {
could_have_chinese_government_trigger = yes
liege = {
has_chinese_government_trigger = yes
NOT = {
government = chinese_imperial_government
}
}
}
ROOT_FROMFROM = {
NOT = {
dynasty = ROOT_FROM
}
could_have_chinese_government_trigger = no
could_have_japanese_government_trigger = no
}
}
mult_modifier = {
factor = 0.01
ROOT_FROM = {
could_have_chinese_government_trigger = yes
liege = {
has_chinese_government_trigger = yes
NOT = {
government = chinese_imperial_government
}
}
}
ROOT_FROMFROM = {
NOT = {
dynasty = ROOT_FROM
}
could_have_chinese_government_trigger = no
could_have_japanese_government_trigger = yes
}
}
mult_modifier = {
factor = 0.01
ROOT_FROM = {
could_have_chinese_government_trigger = yes
liege = {
has_chinese_government_trigger = yes
NOT = {
government = chinese_imperial_government
}
}
}
ROOT_FROMFROM = {
dynasty = ROOT_FROM
could_have_chinese_government_trigger = no
could_have_japanese_government_trigger = no
}
}
mult_modifier = {
factor = 0.1
ROOT_FROM = {
could_have_chinese_government_trigger = yes
liege = {
has_chinese_government_trigger = yes
NOT = {
government = chinese_imperial_government
}
}
}
ROOT_FROMFROM = {
dynasty = ROOT_FROM
could_have_chinese_government_trigger = no
could_have_japanese_government_trigger = yes
}
}
# We desire some other kind of feudalism
mult_modifier = {
factor = 0.001
ROOT_FROM = {
could_have_chinese_government_trigger = no
could_have_japanese_government_trigger = no
liege = {
has_chinese_government_trigger = no
has_japanese_government_trigger = no
}
}
ROOT_FROMFROM = {
NOT = {
dynasty = ROOT_FROM
}
OR = {
could_have_chinese_government_trigger = yes
could_have_japanese_government_trigger = yes
}
}
}
mult_modifier = {
factor = 0.01
ROOT_FROM = {
could_have_chinese_government_trigger = no
could_have_japanese_government_trigger = no
liege = {
has_chinese_government_trigger = no
has_japanese_government_trigger = no
}
}
ROOT_FROMFROM = {
dynasty = ROOT_FROM
OR = {
could_have_chinese_government_trigger = yes
could_have_japanese_government_trigger = yes
}
}
}
mult_modifier = {
factor = 10
ROOT_FROM = {
has_religion_feature = religion_feature_ryukyuan_three_mountains
}
ROOT_FROMFROM = {
character = ROOT_FROM
}
}
mult_modifier = {
factor = 0.1 # Overthrowing a CI dynasty is better than putting someone ROOT_FROM the same dynasty on the throne...
ROOT_FROM = {
liege = {
NOT = {
dynasty = ROOT_FROM
}
ROOT_FROMFROM = {
dynasty = ROOT_FROM
}
government = chinese_imperial_government
OR = {
has_character_modifier = mandate_of_heaven_2
has_character_modifier = mandate_of_heaven_1
}
}
}
}
mult_modifier = {
factor = 0.001
ROOT_FROMFROM = {
trait = former_eoc_trait
NOT = {
dynasty = ROOT_FROM
}
}
ROOT_FROM = {
could_have_chinese_government_trigger = yes
}
}
mult_modifier = {
factor = 0.25
ROOT_FROM = {
liege = {
has_character_modifier = hwarang_faction_discouragement
}
}
}
}
}
}
The AI, however, seems to do something weird. Here's a snippet from game.log:
[effectimplementation.cpp:18398]: EVENT [1066.9.17]:Countess Richilde of Hainaut started a claimant faction for 's claim on Lower Lorraine, currently held by Duke Gottfried 'the Bearded'!
[effectimplementation.cpp:18398]: EVENT [1066.9.17]:Countess Richilde of Hainaut started a claimant faction for 's claim on Lower Lorraine, currently held by Duke Gottfried 'the Bearded'!
[effectimplementation.cpp:18398]: EVENT [1066.9.18]:Countess Richilde of Hainaut started a claimant faction for 's claim on Lower Lorraine, currently held by Duke Gottfried 'the Bearded'!
[effectimplementation.cpp:18398]: EVENT [1066.9.19]:Countess Richilde of Hainaut started a claimant faction for 's claim on Lower Lorraine, currently held by Duke Gottfried 'the Bearded'!
[effectimplementation.cpp:18398]: EVENT [1066.9.20]:Countess Richilde of Hainaut started a claimant faction for 's claim on Lower Lorraine, currently held by Duke Gottfried 'the Bearded'!
[effectimplementation.cpp:18398]: EVENT [1066.9.21]:Countess Richilde of Hainaut started a claimant faction for 's claim on Lower Lorraine, currently held by Duke Gottfried 'the Bearded'!
[effectimplementation.cpp:18398]: EVENT [1066.9.22]:Countess Richilde of Hainaut started a claimant faction for 's claim on Lower Lorraine, currently held by Duke Gottfried 'the Bearded'!
[effectimplementation.cpp:18398]: EVENT [1066.9.23]:Countess Richilde of Hainaut started a claimant faction for 's claim on Lower Lorraine, currently held by Duke Gottfried 'the Bearded'!
[effectimplementation.cpp:18398]: EVENT [1066.9.24]:Countess Richilde of Hainaut started a claimant faction for 's claim on Lower Lorraine, currently held by Duke Gottfried 'the Bearded'!
[effectimplementation.cpp:18398]: EVENT [1066.9.25]:Countess Richilde of Hainaut started a claimant faction for 's claim on Lower Lorraine, currently held by Duke Gottfried 'the Bearded'!
[effectimplementation.cpp:18398]: EVENT [1066.9.26]:Countess Richilde of Hainaut started a claimant faction for 's claim on Lower Lorraine, currently held by Duke Gottfried 'the Bearded'!
[effectimplementation.cpp:18398]: EVENT [1066.9.27]:Countess Richilde of Hainaut started a claimant faction for 's claim on Lower Lorraine, currently held by Duke Gottfried 'the Bearded'!
[effectimplementation.cpp:18398]: EVENT [1066.9.28]:Countess Richilde of Hainaut started a claimant faction for 's claim on Lower Lorraine, currently held by Duke Gottfried 'the Bearded'!
[effectimplementation.cpp:18398]: EVENT [1066.9.29]:Countess Richilde of Hainaut started a claimant faction for 's claim on Lower Lorraine, currently held by Duke Gottfried 'the Bearded'!
[effectimplementation.cpp:18398]: EVENT [1066.9.30]:Countess Richilde of Hainaut started a claimant faction for 's claim on Lower Lorraine, currently held by Duke Gottfried 'the Bearded'!
[Similar stuff for a bunch of other characters and titles (all of them missing a claimant), with Richilde trying again exactly three months later, as would be expected from the ai_check_interval]
Countess Richilde of Hainaut is a vassal of Gottfried "the Bearded" of Lower Lorraine (I don't think he has the nickname in vanilla), so her factioning against him makes sense in theory... but she doesn't seem to pick a character to back and the faction thus doesn't start. Moreover, there's exactly two claimants to Lower Lorraine in the Stamford Bridge start, both of them female, and the title is Agnatic, so neither should be valid for the decision, which can be confirmed by loading in as Richilde.
I'm rather confused as to why the AI is trying to press fifteen non-existent claimants' claims, particularly when it has more restrictions on using the decision than the player (see the third_party_allow, which the player ignores).
All current Validator errors for the file that contains the decision (there are no errors in any of the laws or scripted_triggers checked in the file); as best I can tell, all but the missing localisation are false positives (vanilla has no title_decisions with third_party characters, and for a targeted_decision ROOT would be a character scope), particularly as you can see claimants with proper third_party_scores when checking the decision as someone that has claimants that are valid to support (I've verified that that works):
--- Error 3127 of 3977 ---
At <mod>\decisions\tianxia_faction_claimant_workaround.txt [title_decisions\faction_claimant_workaround\effect\custom_tooltip\text] (Line 1286, column 5):
"start_claimant_faction" is not a valid LocalizationKey.
--- Error 3128 of 3977 ---
At <mod>\decisions\tianxia_faction_claimant_workaround.txt [title_decisions\faction_claimant_workaround\third_party_allow\trigger_if\trigger_if\limit\ROOT\holder_scope] (Line 629, column 8):
Invalid node "holder_scope" in scope CharTrigger (value is: <a complex type>)
--- Error 3129 of 3977 ---
At <mod>\decisions\tianxia_faction_claimant_workaround.txt [title_decisions\faction_claimant_workaround\third_party_allow\trigger_if\trigger_if\limit\holder_scope] (Line 658, column 7):
Invalid node "holder_scope" in scope CharTrigger (value is: <a complex type>)
--- Error 3130 of 3977 ---
At <mod>\decisions\tianxia_faction_claimant_workaround.txt [title_decisions\faction_claimant_workaround\third_party_allow\trigger_if\trigger_if\OR\AND\ROOT\NOT\claimed_by] (Line 678, column 10):
Invalid node "claimed_by" in scope CharTrigger (value is: ROOT_FROM)
--- Error 3131 of 3977 ---
At <mod>\decisions\tianxia_faction_claimant_workaround.txt [title_decisions\faction_claimant_workaround\third_party_allow\trigger_if\ROOT_FROM\trigger_if\limit\ROOT\is_conquered] (Line 591, column 9):
Invalid node "is_conquered" in scope CharTrigger (value is: yes)
--- Error 3132 of 3977 ---
At <mod>\decisions\tianxia_faction_claimant_workaround.txt [title_decisions\faction_claimant_workaround\third_party_potential\FROMFROM\ROOT\trigger_if\limit\holder_scope] (Line 310, column 8):
Invalid node "holder_scope" in scope CharTrigger (value is: <a complex type>)
--- Error 3133 of 3977 ---
At <mod>\decisions\tianxia_faction_claimant_workaround.txt [title_decisions\faction_claimant_workaround\third_party_potential\FROMFROM\ROOT\trigger_if\OR\holder_scope] (Line 315, column 8):
Invalid node "holder_scope" in scope CharTrigger (value is: <a complex type>)
--- Error 3134 of 3977 ---
At <mod>\decisions\tianxia_faction_claimant_workaround.txt [title_decisions\faction_claimant_workaround\third_party_potential\FROMFROM\ROOT\trigger_if\OR\holder_scope] (Line 324, column 8):
Invalid node "holder_scope" in scope CharTrigger (value is: <a complex type>)
--- Error 3135 of 3977 ---
At <mod>\decisions\tianxia_faction_claimant_workaround.txt [title_decisions\faction_claimant_workaround\third_party_potential\FROMFROM\ROOT\claimed_by] (Line 307, column 6):
Invalid node "claimed_by" in scope CharTrigger (value is: ROOT_FROMFROM)
--- Error 3136 of 3977 ---
At <mod>\decisions\tianxia_faction_claimant_workaround.txt [title_decisions\faction_claimant_workaround\third_party_potential\FROMFROM\ROOT\holder_scope] (Line 398, column 6):
Invalid node "holder_scope" in scope CharTrigger (value is: <a complex type>)
--- Error 3137 of 3977 ---
At <mod>\decisions\tianxia_faction_claimant_workaround.txt [title_decisions\faction_claimant_workaround\third_party_potential\ROOT\trigger_if\limit\holder_scope] (Line 413, column 7):
Invalid node "holder_scope" in scope CharTrigger (value is: <a complex type>)
--- Error 3138 of 3977 ---
At <mod>\decisions\tianxia_faction_claimant_workaround.txt [title_decisions\faction_claimant_workaround\third_party_potential\ROOT\trigger_if\OR\ROOT\holder_scope] (Line 421, column 8):
Invalid node "holder_scope" in scope CharTrigger (value is: <a complex type>)
--- Error 3139 of 3977 ---
At <mod>\decisions\tianxia_faction_claimant_workaround.txt [title_decisions\faction_claimant_workaround\third_party_potential\ROOT\trigger_else_if\limit\holder_scope] (Line 441, column 7):
Invalid node "holder_scope" in scope CharTrigger (value is: <a complex type>)
--- Error 3140 of 3977 ---
At <mod>\decisions\tianxia_faction_claimant_workaround.txt [title_decisions\faction_claimant_workaround\third_party_potential\ROOT\trigger_else_if\OR\ROOT\holder_scope] (Line 448, column 8):
Invalid node "holder_scope" in scope CharTrigger (value is: <a complex type>)
--- Error 3141 of 3977 ---
At <mod>\decisions\tianxia_faction_claimant_workaround.txt [title_decisions\faction_claimant_workaround\third_party_potential\ROOT\trigger_else_if\limit\holder_scope] (Line 469, column 7):
Invalid node "holder_scope" in scope CharTrigger (value is: <a complex type>)
--- Error 3142 of 3977 ---
At <mod>\decisions\tianxia_faction_claimant_workaround.txt [title_decisions\faction_claimant_workaround\third_party_potential\ROOT\trigger_else_if\limit\ROOT_FROMFROM\ROOT\holder_scope] (Line 493, column 9):
Invalid node "holder_scope" in scope CharTrigger (value is: <a complex type>)
--- Error 3143 of 3977 ---
At <mod>\decisions\tianxia_faction_claimant_workaround.txt [title_decisions\faction_claimant_workaround\third_party_potential\FROMFROM\ROOT\OR\AND\holder_scope] (Line 525, column 8):
Invalid node "holder_scope" in scope CharTrigger (value is: <a complex type>)
--- Error 3144 of 3977 ---
At <mod>\decisions\tianxia_faction_claimant_workaround.txt [title_decisions\faction_claimant_workaround\third_party_potential\FROMFROM\ROOT\OR\AND\is_primary_holder_title] (Line 533, column 8):
Invalid node "is_primary_holder_title" in scope CharTrigger (value is: yes)
--- Error 3904 of 3977 ---
At <mod>\decisions\tianxia_faction_claimant_workaround.txt [title_decisions\faction_claimant_workaround\effect\custom_tooltip\FROM\start_faction\title] (Line 1299, column 7):
Event target type 'Char' is not any of Title
Relevant stuff from error.log (duplicates removed, some comments added) after running the game for maybe half a year; there are no errors shown for tianxia_faction_claimant_workaround.txt during loading:
effect: <- There was an error here in the Validator, but that was about it thinking the title (ROOT) was a character
[effectimplementation.cpp:21085]: found_faction effect for faction faction_claimant requires both a title and a thirdparty character.
Any thoughts on the issue above would be appreciated, seeing as I've had no luck figuring it out. I'm starting to consider moving the AI to on_yearly_pulse, but as that means updating a lot of scopes again I'd prefer not to do that.
So, I'm continuing a bit with my investigation into whatever is going on with the third_party stuff and the AI, and I'm noticing assorted oddities:
- There's no tooltip on the "Do it!" button. This is how it looks trying to claim France with the decision as William the Bastard (who doesn't have a claim and thus shouldn't be a valid candidate. No text shows up on the "Do it!" button when mousing over it.
Meanwhile, this is how it'd look in Tianxia's version of "Offer Physician [to China]", a targeted_decision with third_party_potential.
The latter has show_only_failed_conditions = yes, while the former does not (it also doesn't have hidden_tooltip or a custom_tooltip). I should be seeing a long list of conditions that I either pass or fail as William, but for whatever reason I do not.
This issue persists even if I add a claim.
- The AI's weird behaviour does not change if the third_party_potential is in the third_party_allow, or the other way around.
- If I use the decision, I get the expected "[effectimplementation.cpp:18398]: EVENT [1066.9.15]: !Duke William 'the Bastard' started a claimant faction for Duke William 'the Bastard''s claim on France, currently held by King Philippe of France!" log entry upon taking the decision (the "!" ahead of Duke mine, to avoid a smiley).
- If I fail the potential or the from_potential, the decision is hidden, as expected.
- Changing the ai_third_party_filter does not seem to make the AI figure out how to involve a third party (tested with "realm" and "home_court").
- Invalid candidates are not possible to select if they are filtered out in the third_party_potential, so it shouldn't be a case of the AI somehow losing
- If I use log_scopes = yes in the effect block right after the start_faction block, the AI has no FROMFROM and no "claimant" event target.
- With log_scopes = yes as above, I have a FROMFROM and "claimant" scope, as expected.
- The decision works fine for me regardless of tier (as long as it is a valid title), regardless of whether I am the claimant or if I back a third party.
- Creating a small "dummy" decision which always should have a valid third party if the hypothetical decision-taker is eligible (see below)
Code:
dummy = {
filter = realm_owned
ai_target_filter = realm_owned
only_playable = yes
is_high_prio = yes
third_party = FROM
show_third_party_potential = yes
third_party_filter = realm_including_me # Same as AI
ai_third_party_filter = realm_including_me # Likely the sanest AI restriction, considering performance
ai_check_interval = 3 # Might be too frequent
from_potential = {
tier = count
}
potential = {
tier = duke
}
allow = {
FROM = {
is_adult = yes
}
}
third_party_potential = {
FROMFROM = {
character = ROOT_FROM
}
}
third_party_allow = {
ROOT = {
holder_scope = {
tier = duke
}
}
}
effect = {
log_scopes = yes
}
ai_will_do = {
factor = 1
}
}
also has the AI fail to figure out the FROMFROM (the Richilde log_scopes was when I took the decision, the Ulrich one is an AI).
[controlcommands.cpp:50]: Human MrHuman unset as primary local
[controlcommands.cpp:58]: Human MrHuman set as primary local
[effectimplementation.cpp:18414]: [1066.9.16] file: decisions/tianxia_faction_claimant_workaround.txt line: 3010:
variables=
{
local_third_party_score=1.000
}
§Yroot§!:
seed=855475395
title=d_salzburg (Salzburg)
§Yfrom§!:
seed=1026631964
char=20287 (Count Ulrich of Bern)
§Yfromfrom§!:
seed=731186446
§Ythis§!:
seed=855475395
title=d_salzburg (Salzburg)
- Removing the "ROOT_" prefix doesn't change anything.
- Vanilla has no title_decisions with a third_party -- it only has targeted_decisions and offmap_decisions with a third_party -- and that it's thus not possible to take such a decision from vanilla and figure out how to break it.
- Vanilla's decisions with a third_party occasionally refer to FROMFROM, FROM, and (de facto) ROOT in the ai_will_do, so all those scopes should be available in that block.
My quick question at this point is this: Has anyone successfully made a title_decision with a third_party that the AI can use? Because, from where I'm standing, it sure is starting to look like the "[third parties] should work with any targeted decision type" dev comment in 00_decisions.info either should be read as "[...] any characteror offmap targeted decision type", "We think [third parties] work with any targeted decision type", or "[...] for the player", and it'd not be the first time script functionality wasn't working as expected or (presumably) intended...
My quick question at this point is this: Has anyone successfully made a title_decision with a third_party that the AI can use? Because, from where I'm standing, it sure is starting to look like the "[third parties] should work with any targeted decision type" dev comment in 00_decisions.info either should be read as "[...] any characteror offmap targeted decision type", "We think [third parties] work with any targeted decision type", or "[...] for the player", and it'd not be the first time script functionality wasn't working as expected or (presumably) intended...
Since a negative response might be helpful here: For my part, the answer is no. (I haven't made a third_party title_decision.)
---
I don't fully understand the debugging you're doing, so I can't comment on that - but I wouldn't be surprised if third_party AI-enabled title_decisions are not working as intended.
I will note, however, that it's pretty common to provide an alternate pathway to the same goal that's optimised for AI. If the decision is working for humans but not for AI, you might need to do that :-/
---
Finally, as per my previous post, I think it's a very good idea to aggressively limit the locations of AI-only logic, as it can be very difficult to keep track of it when you're testing. Eg: Consolidate all AI logic relating to third-parties into third_party_potential (all total exclusions) and third_party_score (preferences).
It can also be useful when debugging to turn all ai=yes into ai=no, so you can see what the AI sees. (In the same way that you might move potential conditions into the allow block if they aren't working the way you expect.) (And ease of debugging is another reason for putting all your complicated AI logic in areas which can be made visible to a debugging developer.)
Is there a fairly straightfoward way (as opposed to defining a scripted_trigger with gender law versions from scratch) to check if a character is near the top of the line of succession (is_primary_heir obviously works for the heir, and is_heir checked for secondary titles may or may not cover some gavelkind spares)? I'm primarily thinking "Would show up as one of the top six candidates" or similarly "First through sixth in line under primo/etc.", but something more extensive would also be fine.
Is there a fairly straightfoward way (as opposed to defining a scripted_trigger with gender law versions from scratch) to check if a character is near the top of the line of succession (is_primary_heir obviously works for the heir, and is_heir checked for secondary titles may or may not cover some gavelkind spares)? I'm primarily thinking "Would show up as one of the top six candidates" or similarly "First through sixth in line under primo/etc.", but something more extensive would also be fine.
The only things that comes to mind are the any_pretender and any_pretender_title scopes, and perhaps the gimped is_pretender trigger. I don't think they're nearly flexible enough for what you want, though. In case they're useful, there are the heir_under_ scopes and the would_be_heir_under_law trigger too.
Having an issue with customizing localization for a custom artifact. I've had this artifact, and the events giving it to the player, active and working for a couple of real-life years at this point, and its localization has always been this, which works fine:
Code:
gm_incredible_item;Incredible Item;;;;;;;;;;;;;x;
It reads out as Incredible Item in the game, as expected.
Recently, I decided to customize the localization for it so that it'd be this instead:
However, in the game, when the event fires to give it to the player, it reads out as 's Incredible Item in the game. After some thought, I changed the code in the event that gives you the artifact from this:
But the result is the same, it reads as 's Incredible Item in the game.
I've double-checked that the artifact does list the current player character as its Original Owner, so I'm stumped. Validator doesn't show any errors either.
Having an issue with customizing localization for a custom artifact. I've had this artifact, and the events giving it to the player, active and working for a couple of real-life years at this point, and its localization has always been this, which works fine:
Code:
gm_incredible_item;Incredible Item;;;;;;;;;;;;;x;
It reads out as Incredible Item in the game, as expected.
Recently, I decided to customize the localization for it so that it'd be this instead:
However, in the game, when the event fires to give it to the player, it reads out as 's Incredible Item in the game. After some thought, I changed the code in the event that gives you the artifact from this:
But the result is the same, it reads as 's Incredible Item in the game.
I've double-checked that the artifact does list the current player character as its Original Owner, so I'm stumped. Validator doesn't show any errors either.
I haven't counted the number of semicolons, but you should probably do that as well - just to be sure.
3. Many features of localisation are not available when you use them directly in script (as per your second attempt).
However, I can't say for sure whether the problem with your second attempt was caused by this limitation or the lack of a Root. prefix. This is simply my personal experience that setting localisation directly from script is janky at the best of times. (This jankiness is probably because you aren't supposed to use localisation in this way - it prevents translation.)
Is there a fairly straightfoward way (as opposed to defining a scripted_trigger with gender law versions from scratch) to check if a character is near the top of the line of succession (is_primary_heir obviously works for the heir, and is_heir checked for secondary titles may or may not cover some gavelkind spares)? I'm primarily thinking "Would show up as one of the top six candidates" or similarly "First through sixth in line under primo/etc.", but something more extensive would also be fine.
The only things that comes to mind are the any_pretender and any_pretender_title scopes, and perhaps the gimped is_pretender trigger. I don't think they're nearly flexible enough for what you want, though. In case they're useful, there are the heir_under_ scopes and the would_be_heir_under_law trigger too.
I also can't see anything obvious that would work.
I initially thought that recursive use of player_heir (or similar) might allow you to build an inheritance tree... but, first, such recursive use on unlanded characters might not work at all; and, more importantly, this doesn't even work in theory because the 2nd-in-line is often not the 1st-in-line's heir. (Eg. Meritocracy when the designated heir has their own children. 2nd-in-line in the tooltip is one of your other children, but the heir of the 1st-in-line is one of their children, ie. one of your grandchildren.)
And this prompts my next thought: Are you trying to replicate the 1st-6th in line as per the tooltip? Or the 1st-6th if the title holder dies immediately after succession? (Or something else?) Because these can be quite different.
I haven't counted the number of semicolons, but you should probably do that as well - just to be sure.
3. Many features of localisation are not available when you use them directly in script (as per your second attempt).
However, I can't say for sure whether the problem with your second attempt was caused by this limitation or the lack of a Root. prefix. This is simply my personal experience that setting localisation directly from script is janky at the best of times. (This jankiness is probably because you aren't supposed to use localisation in this way - it prevents translation.)
Thank you, I added This. into it like you suggested, and it worked like a charm. I hadn't seen OriginalOwner in that list before, and have used other localisation scopes before without needing to add Root or This (mainly saved event targets), so it didn't register to me that I might need to in this case.
As for the extra semicolon, I'm not sure how or why I got started on this, but I saw some example years ago that added the extra semicolon onto the end of localization strings and have been including that ever since. Never had any problems due to it, and Validator never complained that I recall.
And this prompts my next thought: Are you trying to replicate the 1st-6th in line as per the tooltip? Or the 1st-6th if the title holder dies immediately after succession? (Or something else?) Because these can be quite different.
I was primarily curious about heirs at any arbitrary moment before succession (not just on-death) since I noticed on the wiki that one of the factors listed for the AI's marriage offer evaluation is (paraphrased) "For close dynastic relatives that are 1-6 in the line of succession the AI will refuse a matri-marriage with another dynasty".
Obviously, the marriage logic is hardcoded and moving it all to targeted decisions or something would be a mess (and a performance nightmare), but in the cases where a marriage is set up in script without an "Always prefer ROOT's dynasty" implementation and not for a character nowhere close to your line of succession (e.g. an event-spawned female councillor) it might be nice to be able to check some would_not_matri_marry_trigger (and also must_matri_marry_trigger, because there's sometimes the opposite) that matches the normal marriage logic in order to not have those events either be "The AI turns down marriages that it'd be extremely willing to accept if offered the normal way" or "The AI is tricked into a marriage it'd never [excepting obedient = yes, Favours, honouring a previous betrothal, etc.] accept if you offered it".
I was primarily curious about heirs at any arbitrary moment before succession (not just on-death) since I noticed on the wiki that one of the factors listed for the AI's marriage offer evaluation is (paraphrased) "For close dynastic relatives that are 1-6 in the line of succession the AI will refuse a matri-marriage with another dynasty".
Obviously, the marriage logic is hardcoded and moving it all to targeted decisions or something would be a mess (and a performance nightmare), but in the cases where a marriage is set up in script without an "Always prefer ROOT's dynasty" implementation and not for a character nowhere close to your line of succession (e.g. an event-spawned female councillor) it might be nice to be able to check some would_not_matri_marry_trigger (and also must_matri_marry_trigger, because there's sometimes the opposite) that matches the normal marriage logic in order to not have those events either be "The AI turns down marriages that it'd be extremely willing to accept if offered the normal way" or "The AI is tricked into a marriage it'd never [excepting obedient = yes, Favours, honouring a previous betrothal, etc.] accept if you offered it".
It is theoretically possible to recalculate the 1-6 tooltip for gavelkind/primo/etc via extremely-complex triggers. (Although this seems rather unwise given the headaches that would be caused by an old/immortal character with dozens of descendants across multiple generations.)
However, I don't think there's any way to access the characters who are 2nd-6th in line for elective-type successions. (Tanistry is an almost insurmountable problem here, since all candidates are guaranteed to be of the same dynasty. But normal elective could also pose a problem for AI characters in a player realm that has been set up as a "family empire".) From your previous posts, I got the impression that you use elective-type successions a lot in Tianxia, so I think this is a blocking issue for any approach that aims for complete simulation.
---
On the other hand, I think it might be possible to create a set of heuristics which model default AI behaviour well enough, and which lean towards protecting the AI when they make approximations.
Eg:
Always accept normal marriage for male dynasts.
Always accept matri-marriage for female dynasts.
Never accept normal marriage for female close relatives.
Never accept matri-marriage for male close relatives.
Always accept any type of marriage for dynasts who are not close relatives. But:
For male dynasts, normal marriage is preferred if possible.
For female dynasts, matri-marriage is preferred if possible.
Some questions related to Ruler Designer characters, because they are an edge case for some things:
- Is there an easy way to check if a character is such a character at the start of the game? I can't see anything obvious on the wiki, except possibly "Got an event on the second on_chronicle_start on_action".
- While the use case I have in mind -- firing a specific event only for Ruler Designer characters right at the start -- would make sense to fire on_chronicle_start, I very much would not want that event to fire if the on_action is called for any other reason, including the "play <charid>" command. Given that you can use that console command on the very first day of the game, "Check if some flag set right at the start has been set for X days" isn't sufficient to guarantee that the on_chronicle_start indeed fired for a ruler Designer character, and similarly "Check that a flag that's set the second time on_chronicle_start is called isn't set" wouldn't work if you start as one historical character and swaps to another since the flag only would be set after the swap. I can't really figure out a workaround for this problem (unless there's some "was_ruler_designed = yes" I'm missing); any ideas?
- In a multiplayer game, would some "Check for the second on_chronicle_start" option even work for identifying these characters? Does each player get their own chronicle, or would it just be the host that gets one? There could be as many Ruler Designer characters as players, and the host is not guaranteed to be one.
Some questions related to Ruler Designer characters, because they are an edge case for some things:
- Is there an easy way to check if a character is such a character at the start of the game? I can't see anything obvious on the wiki, except possibly "Got an event on the second on_chronicle_start on_action".
- While the use case I have in mind -- firing a specific event only for Ruler Designer characters right at the start -- would make sense to fire on_chronicle_start, I very much would not want that event to fire if the on_action is called for any other reason, including the "play <charid>" command. Given that you can use that console command on the very first day of the game, "Check if some flag set right at the start has been set for X days" isn't sufficient to guarantee that the on_chronicle_start indeed fired for a ruler Designer character, and similarly "Check that a flag that's set the second time on_chronicle_start is called isn't set" wouldn't work if you start as one historical character and swaps to another since the flag only would be set after the swap. I can't really figure out a workaround for this problem (unless there's some "was_ruler_designed = yes" I'm missing); any ideas?
- In a multiplayer game, would some "Check for the second on_chronicle_start" option even work for identifying these characters? Does each player get their own chronicle, or would it just be the host that gets one? There could be as many Ruler Designer characters as players, and the host is not guaranteed to be one.
The following snippet seems to distinguish the two characters for which on_chronicle_start fires:
Code:
on_chronicle_start = {
effect = {
if = {
limit = {
ai = no
historical = no
}
log = "on_chronicle_start player [This.GetID] - [This.GetBestName]"
}
else = {
log = "on_chronicle_start ai [This.GetID] - [This.GetBestName]"
}
}
}
Code:
[effectimplementation.cpp:18398]: EVENT [769.1.1]:on_chronicle_start ai 6392 - King Karl of West Francia
[effectimplementation.cpp:18398]: EVENT [769.1.1]:on_chronicle_start player 2609869 - King Pepin of France