We seem to be having issues with Empires that gain de jure land via event are having that reset when loading from a save game. Unsure if it affects de jure drift. Is this a known issue or WAD, as with Duchies not being able to save their de jure status if changed?
I'm sure you're probably aware, but there are definitely a lot of missing random_* effects for corresponding any_* effects. Three that happened to be annoying me just today are the lack of random_attacker (war scope), random_direct_de_jure_vassal_title, and random_de_jure_vassal_title.
Also, on a related note, there are a ton of triggers that do not work as effects (and vice versa) when, by all reasonable interpretations, they absolutely should (either because the effects are just well-known to be bugged-- such as any_demesne_province, or because they just don't exist in the EXE). As a super-simple example, it would be tremendously useful if `any_de_jure_vassal_title` (not the DIRECT version, but all `de_jure_vassal_or_below` titles) was available as a trigger and not just an effect.
If you're interested, me and @Rylock can put together a quick list of the most offending / highest impact violators of the above two classes of problems (we'd already chatted about this briefly in response to your quoted comment). Most, of course, can be worked-around, but some-- all those mentioned except `any_demesne_province` included-- actually make certain classes of problems extremely difficult to solve efficiently or pseudo-elegantly.
namespace = test
character_event = {
id = test.1
is_triggered_only = yes
hide_window = yes
immediate = {
any_title = {
limit = { tier = count }
location = {
province_event = {
id = test.2
}
}
}
}
}
province_event = {
id = test.2
is_triggered_only = yes
hide_window = yes
immediate = {
if = {
limit = {
culture_group = indo_aryan_group
}
random_list = {
50 = { religion = catholic }
50 = { religion = orthodox }
}
}
}
}
Meanwhile the issue is looked at, could someone suggest a workaround to this?
What do you mean? Surely, not code a different event for each province, as in, if I target X provinces, code X different events, right? Because I actually want to target all provinces in the map so...Send a province event to each province, and use the random_list command in that event. Since each is a separate event, the randomizer will function as you expect it to.
What do you mean? Surely, not code a different event for each province, as in, if I target X provinces, code X different events, right? Because I actually want to target all provinces in the map so...
And if that isn't what you mean, I don't understand, since I alrady am using the random_list within the province_event...
character_event = {
id = republic_rev.3
title = EVTNAMErepublic_rev.3
desc = EVTDESCrepublic_rev.3
is_triggered_only = yes
option = {
name = EVTOPTOKrepublic_rev.3
random_realm_character = {
limit = {
is_republic = yes
NOT = { trait = senator }
}
# Let's elevate this character as Senator
character_event = { id = republic_rev.4 }
break = yes
}
random_realm_character = {
limit = {
AND = {
is_feudal = yes
is_landed = yes
is_female = no
}
NOT = { trait = senator }
}
# Let's elevate this character as Senator
character_event = { id = republic_rev.4 }
break = yes
}
random_courtier = {
limit = {
OR = {
has_job_title = job_chancellor
has_job_title = job_marshal
has_job_title = job_treasurer
has_job_title = job_spymaster
has_minor_title = title_quaestor
has_minor_title = title_censor
has_minor_title = title_tribune
has_minor_title = title_aedile
}
NOT = { trait = senator }
# We can not elevate not Nobles to be Senators!
NOT = { dynasty = none }
}
# Let's elevate this character as Senator
character_event = { id = republic_rev.4 }
break = yes
}
# OK there is no elegible character let's create a new one
create_random_steward = { # Always the same character of "Tusculum" dynasty is created!
random_traits = yes
dynasty = random
female = no
}
new_character = {
# Let's elevate this character as Senator
character_event = { id = republic_rev.4 }
break = yes
}
}
}
I've noticed another problem that has arisen since 2.4. Previously the commands join_attacker_wars and join_defender_wars would allow you to add mercenary rulers to another ruler's war. This no longer works, the following code for example does not actually join the targeted mercenary ruler to a war:
random_independent_ruler = {
limit = { primary_title = { mercenary = yes } }
join_attacker_wars = ROOT
}
The event either needs to be deferred (e.g., delayed by a day), or instead of using any_* to fire off events directly, the event should be refactored to be tail-recursive so that it invokes its own next instance (thus providing a new RNG seed) until it runs out of target things to invoke itself upon. At least, that's how randomness currently works with anything rooted in an any_* effect.Sorry. That's what I get for not reading carefully -- you did send a separate event to each province, which I assume would have worked. Clearly not.
The event either needs to be deferred (e.g., delayed by a day), or instead of using any_* to fire off events directly, the event should be refactored to be tail-recursive so that it invokes its own next instance (thus providing a new RNG seed) until it runs out of target things to invoke itself upon. At least, that's how randomness currently works with anything rooted in an any_* effect.
EDIT: Folks, remember to write recursive events / chains with much care unless you like corner cases that cause the stack to explode and CK2 to crash.
In this case too random is not really working (the new character in the end of the event has always the same dynasty! But the dynasty should be random):
Code:character_event = { id = republic_rev.3 title = EVTNAMErepublic_rev.3 desc = EVTDESCrepublic_rev.3 is_triggered_only = yes option = { name = EVTOPTOKrepublic_rev.3 random_realm_character = { limit = { is_republic = yes NOT = { trait = senator } } # Let's elevate this character as Senator character_event = { id = republic_rev.4 } break = yes } random_realm_character = { limit = { AND = { is_feudal = yes is_landed = yes is_female = no } NOT = { trait = senator } } # Let's elevate this character as Senator character_event = { id = republic_rev.4 } break = yes } random_courtier = { limit = { OR = { has_job_title = job_chancellor has_job_title = job_marshal has_job_title = job_treasurer has_job_title = job_spymaster has_minor_title = title_quaestor has_minor_title = title_censor has_minor_title = title_tribune has_minor_title = title_aedile } NOT = { trait = senator } # We can not elevate not Nobles to be Senators! NOT = { dynasty = none } } # Let's elevate this character as Senator character_event = { id = republic_rev.4 } break = yes } # OK there is no elegible character let's create a new one create_random_steward = { # Always the same character of "Tusculum" dynasty is created! random_traits = yes dynasty = random female = no } new_character = { # Let's elevate this character as Senator character_event = { id = republic_rev.4 } break = yes } } }
decisions = {
win_war = {
potential = {
ai = no
war = yes
}
allow = {
is_ruler = yes
}
effect = {
any_war = {
limit = {
attacker = { character = ROOT }
}
end_war = success
}
}
}
}