• 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.
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.
 
Thanks for the reply! I made it triggered only and without mtth because I want it only to run at the birth of a character. I'm beginning to suspect the triggers I'm trying to use are not working for that.

But what trigger would work if I want this to run at a child's birth? Puzzling. The trigger is just the condition that must be fulfilled for the standard activation by random chance to be valid, if you add is_triggered_only it means that instead of just randomly happening when the conditions are fulfilled the event only happens when something else directly activates it. The modder behind CK2+ definately had set something to activate his event. But what?
 
Last edited:
Thanks for the reply! I made it triggered only and without mtth because I want it only to run at the birth of a character. I'm beginning to suspect the triggers I'm trying to use are not working for that.

But what trigger would work if I want this to run at a child's birth? Puzzling. The trigger is just the condition that must be fulfilled for the standard activation by random chance to be valid, if you add is_triggered_only it means that instead of just randomly happening when the conditions are fulfilled the event only happens when something else directly activates it. The modder behind CK2+ definately had set something to activate his event. But what?

Triggers don't let you specifiy when it will run, they are about excluding it from running at other times. The only way you can make events run at particular times if if the triggering action is in the common/on_actions.txt, and there isn't anything in there for "normal" births.

Making an event with a MTTH of a day, and a trigger to stop it runing twice, and stopping it runing for people over a certain age (if you don't want everyone getting that event at the start of the game) may be your best bet, it should run soon after a child is born.
 
Did you add new flags for d_roma and d_piemonte or whatever you're calling them (you could just copy the ones you like and rename the copy to d_roma and d_piemonte). Then delete the gfx folder again and try a launch. That should fix it if I understand the problem.

no, they are still named d_modena and d_ancona in the code. I merely changed the localisation to Piedmont and Roma. I have not touched the /gfx folder Thus, the flags should still be Modena's and Ancona's flags.

I recently had some issues with my north africa mod, it seems a new titular duchy was added in 1.05e (or I never noticed it before) that had the same tag as one of my own duchies and thus there was a duplicate title. Alternatively you may have deleted a .tga or renamed it, or you've added a new title but no new .tga. As for them having appropriate flags, that's just happy coincidence.

I have not touched the /gfx folder. I did not add any titles that did not already exist (merely renamed the localisation)
 
Last edited:
Triggers don't let you specifiy when it will run, they are about excluding it from running at other times. The only way you can make events run at particular times if if the triggering action is in the common/on_actions.txt, and there isn't anything in there for "normal" births.

Making an event with a MTTH of a day, and a trigger to stop it runing twice, and stopping it runing for people over a certain age (if you don't want everyone getting that event at the start of the game) may be your best bet, it should run soon after a child is born.

Ah, thanks. So, then I am thinking about something like this?

trigger = {
NOT = { has_character_flag = born }
NOT = { age = 1 }
}

desc = "EVTDESC190000"

mean_time_to_happen = {
days = 1
}

EDIT: Solved it with help from a good samaritan. There was another event firing when a child was born that also kickstarted this one. Thanks for the help everybody!

Check newevents.txt. There is a special event (id = 300002) for newborn children that rearranges congenital traits and fires chhildbirth events.
 
Last edited:
What is hide_from = yes? That's new to me. :blush:

EDIT: Adding it to the beginning of an event did not seem to have any effect on the startup event that I created. Some special use?
 
All Muslim Dynasties have Christian shields in my game and deleting the gfx folder doesn't solve it; anyone know where the toggle for Christian/Muslim shields for dynasties are?
Already found the toggle for counties, duchies etc.
 
Muslims have normal Christian-style dynasty shields (but random) -- go check.

My question: could someone paste the English Melting Pot event with the trigger edited to only fire if the king of England himself is Norman culture, and not just any duke? (Which I believe is currently the case)
 
Also, what he meant is to not include any line "dynasty = " at all. Both this and "dynasty = 0" should work.
Both don't.

Started a de Normandie game, ran :

character_event = {
id = 190255
desc = "TEST"
picture = "GFX_evt_whispers"

is_triggered_only = yes

option = {
name = "OK"
create_character = {
}
}
}

Joscelin de Normandie was created. Same with dynasty = 0.