• Victoria 3 - Sign up now!

    The journey begins, sign up now and get a special in-game item when the game is released.


  • Crusader Kings III Available Now!

    The realm rejoices as Paradox Interactive announces the launch of Crusader Kings III, the latest entry in the publisher’s grand strategy role-playing game franchise. Advisors may now jockey for positions of influence and adversaries should save their schemes for another day, because on this day Crusader Kings III can be purchased on Steam, the Paradox Store, and other major online retailers.


    Real Strategy Requires Cunning
  • Crusader Kings II Expansion Subscription

    Subscribe to the CK II Expansion and enjoy unlimited access to 13 major expansions and more!


Zarine

Field Marshal
132 Badges
Feb 28, 2007
4.832
683
  • Europa Universalis III Complete
  • Gettysburg
  • Hearts of Iron III
  • Heir to the Throne
  • Europa Universalis III Complete
  • Knights of Pen and Paper +1 Edition
  • Lead and Gold
  • Leviathan: Warships
  • The Kings Crusade
  • Magicka
  • Majesty 2
  • Majesty 2 Collection
  • March of the Eagles
  • For the Motherland
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Rome Gold
  • Semper Fi
  • Sengoku
  • Ship Simulator Extremes
  • Sword of the Stars
  • Supreme Ruler: Cold War
  • The Showdown Effect
  • Victoria 2
  • Victoria 2: A House Divided
  • Stellaris: Necroids
  • Crusader Kings II: Sword of Islam
  • Arsenal of Democracy
  • Hearts of Iron II: Armageddon
  • Cities in Motion
  • Cities in Motion 2
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • A Game of Dwarves
  • Commander: Conquest of the Americas
  • Darkest Hour
  • East India Company Collection
  • Europa Universalis III
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
I got some intel from devs about what makes an event efficient or not. So if you create many events and see that the game is slowing compared to vanilla, you might want to look at what can make it run smoother.

Doomdark said:
Some simple rules though:
* Opinion triggers are very CPU heavy and should be checked after all other triggers
* For regular MTTH events, try to exclude as many characters as possible with the super fast triggers 'only_playable = yes', 'only_men = yes' etc.
Doomdark said:
I should add that triggers checking for flags and character modifiers are also fairly slow.


This might not be clear for everyone, so what does it means:

* For regular MTTH events, try to exclude as many characters as possible with the super fast triggers 'only_playable = yes', 'only_men = yes' etc.
Code:
character_event = {
    only_ruler = yes
    trigger = {
        <other triggers>
    }
}

is better than

Code:
character_event = {
    trigger = {
        is_ruler = yes
        <other triggers>
    }
}

Also means that you should use it as much as possible to restrict the possible targets.
Those are the possible conditions found so far (yes/no and number are variable):
age = 16
is_prisoner = no
is_ruler = yes
max_age = 11
capable_only = yes
min_age = 16
only_capable = yes
only_men = yes
only_playable = yes
only_rulers = yes
only_women = yes
prisoner = no



* Opinion triggers are very CPU heavy and should be checked after all other triggers

Code:
character_event = {
    trigger = {
        <other triggers>
        any_vassal = {
            <other triggers about vassal>
            opinion = { who = ROOT value =  0 }
        }
    }
}

is better than

Code:
character_event = {
    trigger = {
        any_vassal = {
            opinion = { who = ROOT value =  0 }
            <other triggers about vassal>
        }
        <other triggers>
    }
}


* I should add that triggers checking for flags and character modifiers are also fairly slow.
Code:
character_event = {
    trigger = {
        <other triggers>
        has_character_flag = loan_taken
    }
}

is better than

Code:
character_event = {
    trigger = {
        has_character_flag = loan_taken
        <other triggers>
    }
}

AND

Code:
character_event = {
    trigger = {
        <other triggers>
        has_character_modifier = proving_bravery
    }
}

is better than

Code:
character_event = {
    trigger = {
        has_character_modifier = proving_bravery
        <other triggers>
    }
}
 
Last edited:

ash001

friend&foe
10 Badges
Jun 5, 2009
796
0
  • Arsenal of Democracy
  • Hearts of Iron II: Armageddon
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III Complete
  • Rome Gold
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • 500k Club
  • Crusader Kings II: Holy Knight (pre-order)
Thanks for sharing this, Zarine!

So you mean that this:

Code:
character_event = {
	id = ffhumours.xx
	desc = "EVTDESCffhumours.xx"
	picture = "GFX_evt_royalcourt"
	
	trigger = {
		age = 16
		NOT = { num_traits = 4 }
		NOT = {
			has_character_flag = genetics_check
		}
	}

could be written as this:

Code:
[B][COLOR="#00FF00"]character_event = {
	id = ffhumours.xx
	desc = "EVTDESCffhumours.xx"
	picture = "GFX_evt_royalcourt"
	age = 16
	NOT = { num_traits = 4 }

	trigger = {
				NOT = {
			has_character_flag = genetics_check
		}
	}[/COLOR][/B]

and this would be more efficient, then?
 

Zarine

Field Marshal
132 Badges
Feb 28, 2007
4.832
683
  • Europa Universalis III Complete
  • Gettysburg
  • Hearts of Iron III
  • Heir to the Throne
  • Europa Universalis III Complete
  • Knights of Pen and Paper +1 Edition
  • Lead and Gold
  • Leviathan: Warships
  • The Kings Crusade
  • Magicka
  • Majesty 2
  • Majesty 2 Collection
  • March of the Eagles
  • For the Motherland
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Rome Gold
  • Semper Fi
  • Sengoku
  • Ship Simulator Extremes
  • Sword of the Stars
  • Supreme Ruler: Cold War
  • The Showdown Effect
  • Victoria 2
  • Victoria 2: A House Divided
  • Stellaris: Necroids
  • Crusader Kings II: Sword of Islam
  • Arsenal of Democracy
  • Hearts of Iron II: Armageddon
  • Cities in Motion
  • Cities in Motion 2
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • A Game of Dwarves
  • Commander: Conquest of the Americas
  • Darkest Hour
  • East India Company Collection
  • Europa Universalis III
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
could be written as this:

Code:
[B][COLOR="#00FF00"]character_event = {
	id = ffhumours.xx
	desc = "EVTDESCffhumours.xx"
	picture = "GFX_evt_royalcourt"
	age = 16
	NOT = { num_traits = 4 }

	trigger = {
				NOT = {
			has_character_flag = genetics_check
		}
	}[/COLOR][/B]

and this would be more efficient, then?

Almost, there is some elements that you can put outside and some that you can't (still don't have a full list...)
And those elements change name when being put outside : age -> min_age (or max_age if you have a NOT in front).
And you can't put a "secondary" character attributs outside the trigger part

In your case, best performance writting should be :

Code:
character_event = {
	id = ffhumours.xx
	desc = "EVTDESCffhumours.xx"
	picture = "GFX_evt_royalcourt"
	min_age = 16

	trigger = {
		NOT = { num_traits = 4 }
		NOT = {
			has_character_flag = genetics_check
		}
	}
}
 

hilal

Captain
20 Badges
Jul 31, 2001
349
0
www.poderdapalavra.com.br
  • Europa Universalis III: Chronicles
  • Europa Universalis IV: Pre-order
  • Crusader Kings II: Holy Knight (pre-order)
  • 500k Club
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
  • Rome Gold
  • Hearts of Iron III Collection
  • Europa Universalis IV
  • Cities in Motion
  • East India Company
  • Deus Vult
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II
Thanks for sharing!
 

ash001

friend&foe
10 Badges
Jun 5, 2009
796
0
  • Arsenal of Democracy
  • Hearts of Iron II: Armageddon
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III Complete
  • Rome Gold
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • 500k Club
  • Crusader Kings II: Holy Knight (pre-order)
Thanks, Zarine!

If you learn more about this (or get a full list that would be workable outside the trigger instead of inside), let us know.
I wish we could hear more from the devs on the modding forum... Yes, I'm aware they are hard at work!:ninja:
it's just that in the end this might work to the benefit of all (modders, devs and players alike)
 

Fawr

Field Marshal
78 Badges
Jan 22, 2003
2.539
104
  • Europa Universalis IV: Common Sense
  • Semper Fi
  • Sengoku
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • 500k Club
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Mount & Blade: Warband
  • Crusader Kings II: Way of Life
  • Magicka 2
  • Europa Universalis IV: Res Publica
  • Crusader Kings II: Horse Lords
  • Knights of Pen and Paper 2
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Leviathans Story Pack
  • Europa Universalis 4: Emperor
  • Europa Universalis IV: Art of War
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Cities in Motion
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • Europa Universalis III Complete
  • Knights of Pen and Paper +1 Edition
  • Magicka
  • Majesty 2
While doing the work behind my events thread I did find a bunch of those performance triggers. This is the section, with my commentry:

Events then have what look to be some sort of trigger conditions, but they don't use the normal trigger syntax that I gave examples of in my first post above. My assumption is that the designers have deliberately put down this smaller list of triggers, which you can't nest to improve efficiency. They aren't required but if you want to use them here are the ones I've seen:
age = 16
is_prisoner = no
is_ruler = yes
max_age = 11
capable_only = yes
min_age = 16
only_capable = yes
only_men = yes
only_playable = yes
only_rulers = yes
only_women = yes
prisoner = no

Hope this helps.
 

Zarine

Field Marshal
132 Badges
Feb 28, 2007
4.832
683
  • Europa Universalis III Complete
  • Gettysburg
  • Hearts of Iron III
  • Heir to the Throne
  • Europa Universalis III Complete
  • Knights of Pen and Paper +1 Edition
  • Lead and Gold
  • Leviathan: Warships
  • The Kings Crusade
  • Magicka
  • Majesty 2
  • Majesty 2 Collection
  • March of the Eagles
  • For the Motherland
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Rome Gold
  • Semper Fi
  • Sengoku
  • Ship Simulator Extremes
  • Sword of the Stars
  • Supreme Ruler: Cold War
  • The Showdown Effect
  • Victoria 2
  • Victoria 2: A House Divided
  • Stellaris: Necroids
  • Crusader Kings II: Sword of Islam
  • Arsenal of Democracy
  • Hearts of Iron II: Armageddon
  • Cities in Motion
  • Cities in Motion 2
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • A Game of Dwarves
  • Commander: Conquest of the Americas
  • Darkest Hour
  • East India Company Collection
  • Europa Universalis III
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
age = 16
is_prisoner = no
is_ruler = yes
max_age = 11
capable_only = yes
min_age = 16
only_capable = yes
only_men = yes
only_playable = yes
only_rulers = yes
only_women = yes
prisoner = no

That the list corresponding to this:
"For regular MTTH events, try to exclude as many characters as possible with the super fast triggers 'only_playable = yes', 'only_men = yes' etc."

The unknown part is if that's all of them or only a part of them.
 

ash001

friend&foe
10 Badges
Jun 5, 2009
796
0
  • Arsenal of Democracy
  • Hearts of Iron II: Armageddon
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III Complete
  • Rome Gold
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • 500k Club
  • Crusader Kings II: Holy Knight (pre-order)
Almost, there is some elements that you can put outside and some that you can't (still don't have a full list...)
And those elements change name when being put outside : age -> min_age (or max_age if you have a NOT in front).
And you can't put a "secondary" character attributs outside the trigger part

In your case, best performance writting should be :

Code:
character_event = {
	id = ffhumours.xx
	desc = "EVTDESCffhumours.xx"
	picture = "GFX_evt_royalcourt"
	min_age = 16

	trigger = {
		NOT = { num_traits = 4 }
		NOT = {
			has_character_flag = genetics_check
		}
	}
}

Hey Zarine,
I don't know.
Ran some tests and it seems once the min_age is outside the trigger, the game engine ignores it.
So, er, well, yeah, it doesn't seem to work for many elements besides the "big ones" (playable, men, etc)
 

Zarine

Field Marshal
132 Badges
Feb 28, 2007
4.832
683
  • Europa Universalis III Complete
  • Gettysburg
  • Hearts of Iron III
  • Heir to the Throne
  • Europa Universalis III Complete
  • Knights of Pen and Paper +1 Edition
  • Lead and Gold
  • Leviathan: Warships
  • The Kings Crusade
  • Magicka
  • Majesty 2
  • Majesty 2 Collection
  • March of the Eagles
  • For the Motherland
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Rome Gold
  • Semper Fi
  • Sengoku
  • Ship Simulator Extremes
  • Sword of the Stars
  • Supreme Ruler: Cold War
  • The Showdown Effect
  • Victoria 2
  • Victoria 2: A House Divided
  • Stellaris: Necroids
  • Crusader Kings II: Sword of Islam
  • Arsenal of Democracy
  • Hearts of Iron II: Armageddon
  • Cities in Motion
  • Cities in Motion 2
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • A Game of Dwarves
  • Commander: Conquest of the Americas
  • Darkest Hour
  • East India Company Collection
  • Europa Universalis III
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
What are the events you tested ?
Because if this doesn't work, this means that 716 vanilla events are not working correctly :rolleyes:
 

RedRooster81

Modding Paladin
34 Badges
Feb 16, 2010
5.673
29
  • Crusader Kings II
  • Rome Gold
  • Heir to the Throne
  • Divine Wind
  • Europa Universalis III Complete
  • Deus Vult
  • Cities in Motion
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Conclave
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV: Dharma
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Golden Century
  • Mount & Blade: Warband
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV: Art of War
  • Europa Universalis IV
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Charlemagne
Did you try running the event in the console? It will tell you what triggers are valid. Of course you probably already know that, Ash.
 

ash001

friend&foe
10 Badges
Jun 5, 2009
796
0
  • Arsenal of Democracy
  • Hearts of Iron II: Armageddon
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III Complete
  • Rome Gold
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • 500k Club
  • Crusader Kings II: Holy Knight (pre-order)
Ok, ok...
My bad.
I was using "age = 16" instead of "min_age = 16", so I guess that explains it. :eek:o

By the way, I did try to call it through the console and it shows the other triggers but not what's outside it - at least, it didn't show the age (like the example that I've posted a few posts above...)
 

Zarine

Field Marshal
132 Badges
Feb 28, 2007
4.832
683
  • Europa Universalis III Complete
  • Gettysburg
  • Hearts of Iron III
  • Heir to the Throne
  • Europa Universalis III Complete
  • Knights of Pen and Paper +1 Edition
  • Lead and Gold
  • Leviathan: Warships
  • The Kings Crusade
  • Magicka
  • Majesty 2
  • Majesty 2 Collection
  • March of the Eagles
  • For the Motherland
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Rome Gold
  • Semper Fi
  • Sengoku
  • Ship Simulator Extremes
  • Sword of the Stars
  • Supreme Ruler: Cold War
  • The Showdown Effect
  • Victoria 2
  • Victoria 2: A House Divided
  • Stellaris: Necroids
  • Crusader Kings II: Sword of Islam
  • Arsenal of Democracy
  • Hearts of Iron II: Armageddon
  • Cities in Motion
  • Cities in Motion 2
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • A Game of Dwarves
  • Commander: Conquest of the Americas
  • Darkest Hour
  • East India Company Collection
  • Europa Universalis III
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
Well, about it not showing when you trigger the event with the console, from my point of view it's normal:


!!! The following is only a guess based on the facts that I'm a software engineer and the elements available to be put out. I might be totally wrong about that or totally correct, but it's a logical explanation from my point of view. !!!

Each character got a list of event that can be triggered. This list is based on the fast check elements which are in fact elements check at each major change in a character life (birth, birthday, title granted, being put in jail...).
At each of those changes, it checks if the outside elements are valid or not.
If it is valid, they add the event to the character list, if it is not valid, they don't.
Now that they have eliminated 80% of the events to check, at each event pulses, they can check all the events that are set as valid and don't even try the already invalid one.

As those elements change maybe 2/3 times a year at most, it is less consumming than check-in them at every event pulse.

Because of this system, you don't get to see the age condition if you put min_age = X because it's only a condition to be in the valid list, not a condition to trigger, which is different even if the effect is the same.
 
Last edited:

Evander

M&T Gimp Wrestler
142 Badges
Nov 19, 2007
903
33
  • Leviathan: Warships
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • Impire
  • Supreme Ruler 2020
  • King Arthur II
  • Knights of Pen and Paper +1 Edition
  • Lead and Gold
  • Europa Universalis IV: Conquest of Paradise
  • The Kings Crusade
  • Magicka
  • March of the Eagles
  • Sword of the Stars II
  • Naval War: Arctic Circle
  • Penumbra - Black Plague
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Rome Gold
  • Semper Fi
  • Sengoku
  • Sword of the Stars
  • Commander: Conquest of the Americas
  • Ancient Space
  • Cities in Motion
  • Cities in Motion 2
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • A Game of Dwarves
  • Darkest Hour
  • Deus Vult
  • Diplomacy
  • Dungeonland
  • East India Company Collection
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV: Art of War
I don't know if I'm saying something new but in "defines.lua" there is the "NEngine" part including only one variable ruling the periodocity of event check. In vanilla it is set to 20 (days) with a comment explaining that reducing this value is CPU heavy (I personally set it to 1 and saw no differences - but I have 16Gb of RAM so it's not representative).

Maybe this variable has something to see with the event lists you're talking about.
 

Arko

Red zone
45 Badges
Jul 1, 2009
7.079
1.106
  • Europa Universalis IV
  • Crusader Kings II: Holy Knight (pre-order)
  • Crusader Kings II
  • Crusader Kings III
  • Deus Vult
  • Cities: Skylines
  • Magicka
how about province events ?

any special tips on them ?
 

Dhop84

Major
4 Badges
Dec 28, 2012
788
0
  • Crusader Kings II
  • 500k Club
  • Cities: Skylines
  • Cities: Skylines Deluxe Edition
I no ive wrote this elsewhere but im not getting the anwsers i need i want to no to write an event based on the death of an ai character what command would i use on_death=yes
religious_head=yes
Would that work to trigger an event from the death of a religious head ???
 

Evander

M&T Gimp Wrestler
142 Badges
Nov 19, 2007
903
33
  • Leviathan: Warships
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • Impire
  • Supreme Ruler 2020
  • King Arthur II
  • Knights of Pen and Paper +1 Edition
  • Lead and Gold
  • Europa Universalis IV: Conquest of Paradise
  • The Kings Crusade
  • Magicka
  • March of the Eagles
  • Sword of the Stars II
  • Naval War: Arctic Circle
  • Penumbra - Black Plague
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Rome Gold
  • Semper Fi
  • Sengoku
  • Sword of the Stars
  • Commander: Conquest of the Americas
  • Ancient Space
  • Cities in Motion
  • Cities in Motion 2
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • A Game of Dwarves
  • Darkest Hour
  • Deus Vult
  • Diplomacy
  • Dungeonland
  • East India Company Collection
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV: Art of War
You may be able to trigger such an event from the on_actions.txt file. In the on_death (or on_assassination or else) you can define to always trigger an event (in events = {}) or to set it to fire randomly differents events (in random_events = {})

So if you have such an event you just have to add its event.id in these sections. To lighten the engine loads, if your event is meant to be triggered for a specific character, set the character id as the first trigger because the engine will check to launch the event each time a character die ...
 

Evander

M&T Gimp Wrestler
142 Badges
Nov 19, 2007
903
33
  • Leviathan: Warships
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • Impire
  • Supreme Ruler 2020
  • King Arthur II
  • Knights of Pen and Paper +1 Edition
  • Lead and Gold
  • Europa Universalis IV: Conquest of Paradise
  • The Kings Crusade
  • Magicka
  • March of the Eagles
  • Sword of the Stars II
  • Naval War: Arctic Circle
  • Penumbra - Black Plague
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Rome Gold
  • Semper Fi
  • Sengoku
  • Sword of the Stars
  • Commander: Conquest of the Americas
  • Ancient Space
  • Cities in Motion
  • Cities in Motion 2
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • A Game of Dwarves
  • Darkest Hour
  • Deus Vult
  • Diplomacy
  • Dungeonland
  • East India Company Collection
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV: Art of War
I'm adding this herebecause I think it could useful :

I've seen some mods (or even vanilla files) still using the 'min_age = 16' check to be sure that events fire only to adult people. But the adulthood age is defined in defines.lua and some mods alter it to set it to 14 or 15. The problem is that leads to have child-event firing to adults and adult events not firing for all adults characters. So I've seen that in some patch, PDS added the 'is_adult = yes' trigger.

So I think this trigger should be much more used since it helps mod compatibilities AND ease the engine by not comparing age values but only checking boolean operators.
 

Dhop84

Major
4 Badges
Dec 28, 2012
788
0
  • Crusader Kings II
  • 500k Club
  • Cities: Skylines
  • Cities: Skylines Deluxe Edition
Thank you what it is that i wana do is have an event triggerd by the death of a religious head or a ruler an ai character not one that im controling myself i want it to inform me of the death then ask if i would like to be invited to the coronation of the new monarch or religious head and obviously get piety n prestige n what have you for saying yes and lose prestige and piety for rejecting the invite .