Ok, I am giving a completely new approach to my Reconquista event. Any discussions I had about it prior to this post are now irrelevant. The following code is meant to work only on_new_holder.
As the wiki says: ROOT = new holder FROM = title FROMFROM = old holder
Trigger checks the following: this hasn't happened already, iberia is christian (basic)
Trigger also checks new holder is christian, old holder is not christian, either the new holder or a vassal is from iberia. (This is to make sure that if an inheritance ends the Reconquista making iberia christian, the event doesn't pop for another title transfer that may happen on the same day. Many title transfers may happen on the day the Reconquista is over, so I want the event to fire only for the right one. More conditions may be added I find them insufficient)
Code:
# End of the Reconquista
narrative_event = {
id = ri.0015
desc = EVTDESC_HF_49452
title = EVTTITLE_HF_49452
picture = GFX_evt_beatification
border = GFX_event_narrative_frame_religion
is_triggered_only = yes
major = yes
trigger = {
NOT = { has_global_flag = reconquista_ended }
NOT = {
any_province = {
county = {
region = world_europe_west_iberia
}
owner = {
OR = {
AND = {
independent = yes
NOT = {
religion_group = christian
}
}
top_liege = {
NOT = {
religion_group = christian
}
}
}
}
}
}
ROOT = { religion_group = christian }
NOT = { FROMFROM = { religion_group = christian } }
ROOT = {
OR = {
capital_scope = {
region = world_europe_west_iberia
}
any_realm_lord = {
capital_scope = {
region = world_europe_west_iberia
}
}
}
}
}
immediate = {
set_global_flag = reconquista_ended
}
option = {
name = EVTOPTA_HF_49452
trigger = {
religion_group = christian
}
}
option = {
name = EVTOPTB_HF_49451
trigger = {
NOT = {
religion_group = christian
}
}
}
}
Start a new game 867 and introduce cheat code "titleowner k_andalusia 1235004". This gives Andalusia to the catholic count of Álava, finishing the Reconquista. This is however the kind of event I get:
View attachment 504730
The event fires on a landless character with no titles. Charinfo reveals that he is somehow ROOT and FROM and there is no FROMFROM. This contradicts the on_new_holder rules I previously explained. It should fire on the count (now king) of Álava
The event will work correctly if the command to switch title is introduced on the first day, when the AI does basically nothing that may interfere