I'm trying my first humble steps in the world of modding and have run into a wall. The following event shows up in the validator as not triggering and it indeed does not seem to do so in the game. I've based it off the event in CK2plus and that one does work.
#A child is born
character_event = {
id = 190000
picture = "GFX_evt_pregnancy"
is_triggered_only = yes
hide_from = yes
trigger = {
NOT = { trait = twin }
mother = { is_alive = yes }
}
desc = "EVTDESC190000"
option = {
name = "EVTOPTA190000"
#check if mother dies
if = {
limit = {
mother = {
health = 6
}
}
random_list = {
10 = { set_character_flag = mother_died set_character_flag = child_died } #both die
10 = { set_character_flag = mother_died } #mother dies
10 = { set_character_flag = child_died } #child dies
70 = { } #nobody dies
}
}
if = {
limit = {
mother = {
NOT = { health = 6 }
health = 4
}
}
random_list = {
10 = { set_character_flag = mother_died set_character_flag = child_died } #both die
15 = { set_character_flag = mother_died } #mother dies
15 = { set_character_flag = child_died } #child dies
60 = { } #nobody dies
}
}
if = {
limit = {
mother = {
NOT = { health = 4 }
health = 2
}
}
random_list = {
10 = { set_character_flag = mother_died set_character_flag = child_died } #both die
20 = { set_character_flag = mother_died } #mother dies
20 = { set_character_flag = child_died } #child dies
50 = { } #nobody dies
}
}
if = {
limit = {
mother = {
NOT = { health = 2 }
}
}
random_list = {
20 = { set_character_flag = mother_died set_character_flag = child_died } #both die
20 = { set_character_flag = mother_died } #mother dies
20 = { set_character_flag = child_died } #child dies
40 = { } #nobody dies
}
}
#handle deaths
if = {
limit = {
has_character_flag = mother_died
}
mother = { character_event = { id = 190001 } }
}
if = {
limit = {
has_character_flag = child_died
}
character_event = { id = 190002 }
}
clr_character_flag = mother_died
clr_character_flag = child_died
}
}
#Mother dies in childbirth
character_event = {
id = 190001
picture = "GFX_evt_illness"
is_triggered_only = yes
desc = "EVTDESC190001"
immediate = {
death = { death_reason = death_dungeon } #actually childbirth
}
option = {
name = "EVTOPTA190001"
}
}
#Child is stillborn
character_event = {
id = 190002
picture = "GFX_evt_illness"
is_triggered_only = yes
desc = "EVTDESC190001"
immediate = {
death = { death_reason = death_dungeon } #actually childbirth
}
option = {
name = "EVTOPTA190001"
}
}
For the event I also added a *.scv file in the localisation folder of my mod.
#CODE;ENGLISH;FRENCH;GERMAN;;SPANISH;;;;;;;;;x;;;
EVTDESC190000;I have been born!;Je suis né!;Ich wurde geboren.;I have been born!;I have been born!;;;;;;;x;;;;;
EVTOPTA190000;Ok;Ok;Einverstanden;Ok;Ok;;;;;;;x;;;;;
EVTDESC190001;The birth was a difficult one. Though the midwife tried her best, [Root.GetName] did not survive.;La naissance fut difficile. Bien que la sage-femme est tout tenté, [Root.GetName] n'a pas survécu.;Die Geburt war schwierig, die Hebammen taten alles wa sie konnten , dennoch starb [Root.GetName];;;;;;;;;x;;;;;
EVTOPTA190001;A tragedy;Une tragédie;Eine Tragödie;A tragedy;A tragedy;;;;;;;x;;;;;
EVTDESC190002;Will I survive my birth?;Survivrais-je à ma naissance?;Werde ich meine Geburt überleben?;Will I survive my birth?;Will I survive my birth?;;;;;;;x;;;;;
EVTOPTA190002;I sure hope so!;J'ai bon espoir que si!;Ich hoffe es sehr !;I sure hope so!;I sure hope so!;;;;;;;x;;;;;
Could anyone please give me a pointer? I've probably missed something incredibly obvious but I've read wikis, faqs and lots of threads and still can't figure it out.
EDIT: Could it be that the trigger should point to the event that lets a child be born?
the reason it isnt triggering is because first of all of "is_triggered_only = yes" - that tells the event to only be fired by either another event or the on_actions. try removing that and see how you get on.
also notice there is no mean_time_to happen because of the placement of "is_triggered_only = yes" you will have to create your own mtth. otherwise it will fire every day.