• 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.
Hi all,

I have a quick question regarding event modding. If you look at some of the vanilla event scripts, like court_events.txt, many of the events have the line:

is_triggered_only = yes

I understand that this creates a condition in which the event will only fire if triggered by another event. How do you find the event that this line refers to?

For example, in court_events.txt:

#A famous writer proposes to compose your family chronicles
character_event = {
id = 73000
desc = EVTDESC73000
picture = GFX_evt_monk

is_triggered_only = yes

How does the event trigger? In other scripts there is the mean time to fire command. Here is the rest of the script:

min_age = 16
only_playable = yes
prisoner = no

trigger = {
NOT = { trait = proud }
NOT = { trait = humble }
}

weight_multiplier = {
days = 1
modifier = {
factor = 2.0
trait = ambitious

etc.

It seems that the trigger for this event is stated in this script (as above), but the wiki says that "is_triggered_only" requires another event to fire. How do I determine which event fires the one above?

Thanks!
 
is_triggered_only events can be launched either from another event, from a decision, from a war result, or from on_actions (common\on_actions\ folder) on a certain pulse (yearly, once per decade, etc.) or situation (coming of age, losing a battle, being in a besieged province etc.).

If an i_t_o event has a trigger defined, it is usually called from on_actions event, and the trigger serves the purpose of making sure it doesn't fire always but only if the trigger also matches.

If you have to find what launched the event, first search the same event file it's in for its ID (73000 in your example) and if not found there, in on_actions. Your specific example happens to be an on_action event that has a chance of firing for every single character once per year.
 
is_triggered_only events can be launched either from another event, from a decision, from a war result, or from on_actions (common\on_actions\ folder) on a certain pulse (yearly, once per decade, etc.) or situation (coming of age, losing a battle, being in a besieged province etc.).

If an i_t_o event has a trigger defined, it is usually called from on_actions event, and the trigger serves the purpose of making sure it doesn't fire always but only if the trigger also matches.

If you have to find what launched the event, first search the same event file it's in for its ID (73000 in your example) and if not found there, in on_actions. Your specific example happens to be an on_action event that has a chance of firing for every single character once per year.

Thank you for the reply.

I looked in on_actions, and within the corresponding text file, I found this line:

#Court Events
100 = 73000

etc.

Can you please explain this in a little more detail? What is on_action.txt? Is it an event file (kind of)? What does the first number refer to (100)?

Thank you, you've already been a great help!
 
on_actions is divided in sections which fire automatically depending on situation (the pulses I mentioned before).
You have in there both events, which will always fire, and random_events, which have a chance of firing.

73000 is under the on_yearly_pulse block, in the random_events section. This means it will be pulsed for every character once per year, and has a random chance of actually firing.

100 = 73000 means it has a chance of '100' to actually fire, to calculate what the actual chance is you need to add all the chances inside the random block for that pulse. So if for example the total is 100000, event 73000 has a 100/100000 chance of actually firing for any living character once per year, or a 0.1% chance. If the total was 10000 it would have a 1% chance of firing, etc.
 
on_actions is divided in sections which fire automatically depending on situation (the pulses I mentioned before).
You have in there both events, which will always fire, and random_events, which have a chance of firing.

73000 is under the on_yearly_pulse block, in the random_events section. This means it will be pulsed for every character once per year, and has a random chance of actually firing.

100 = 73000 means it has a chance of '100' to actually fire, to calculate what the actual chance is you need to add all the chances inside the random block for that pulse. So if for example the total is 100000, event 73000 has a 100/100000 chance of actually firing for any living character once per year, or a 0.1% chance. If the total was 10000 it would have a 1% chance of firing, etc.

Awesome! Thank you so much!
 
How do I give someone a temporary title at the beginning of a start date? I'm trying to make a character an adventurer

Create an on_startup event that triggers the adventure and make sure it only fires for that particular start date.
 
A technical question likely impossible to be known by fellow forumites, so I am bothering the devs directly.
@blackninja9939 (or some other dev who has time):
  • Could it be that in on_actions, "on_yearly_childhood_pulse" does fire events in the category "events" (not "random_events") only for characters age 6 and up, and not for age 2-16, as would be expected?
Because I have setup a mod that should execute immediately after the child turns 2, yet testing shows it reproducibly only fires once the child is over the age of 6.
It should remove a trait given on_birth, so I can visibly follow whether the event has executed or not. The event itself works fine once the child is 6, and it is simple enough to verify no errors on my part should be the cause for this behavior (I can post the code if you want). Which is why I have started to suspect this, especially since vanilla does not have any events in "events" (i.e. non-random) there.
Without access to the engine it's probably hard to verify my suspicion (let alone fix it if confirmed), that's why I am bothering a dev directly.
 
A technical question likely impossible to be known by fellow forumites, so I am bothering the devs directly.
@blackninja9939 (or some other dev who has time):
  • Could it be that in on_actions, "on_yearly_childhood_pulse" does fire events in the category "events" (not "random_events") only for characters age 6 and up, and not for age 2-16, as would be expected?
Because I have setup a mod that should execute immediately after the child turns 2, yet testing shows it reproducibly only fires once the child is over the age of 6.
It should remove a trait given on_birth, so I can visibly follow whether the event has executed or not. The event itself works fine once the child is 6, and it is simple enough to verify no errors on my part should be the cause for this behavior (I can post the code if you want). Which is why I have started to suspect this, especially since vanilla does not have any events in "events" (i.e. non-random) there.
Without access to the engine it's probably hard to verify my suspicion (let alone fix it if confirmed), that's why I am bothering a dev directly.
on_yearly_childhood_pulse fires if the character is over the age of NCharacter::AGE_CHILDHOOD_PULSE and is not an adult. The description in the on action is incorrect, will fix that text for the next version.
 
on_yearly_childhood_pulse fires if the character is over the age of NCharacter::AGE_CHILDHOOD_PULSE and is not an adult. The description in the on action is incorrect, will fix that text for the next version.
Ah, I totally overlooked that define!
Thanks, then I can simply change it to start earlier.
 
I have a decision that adds a certain type of courtier to a court, but all too often I find them leaving soon after arriving or being silently killed off by the engine because my court is already full.

Is there some way to check how many courtiers are already in a given court, a 'num_of_courtiers' as you will? That way I could simply add it to the trigger (allow).
 
Good evening gents and ladies. I'm making a soundtrack mod and wanted to know how to tie a song to a government, I know how to tie it to a culture but I wanted to tie a song to Merchant Republics.
Thank you for the help.
 
Good evening gents and ladies. I'm making a soundtrack mod and wanted to know how to tie a song to a government, I know how to tie it to a culture but I wanted to tie a song to Merchant Republics.
Thank you for the help.

Don#t know how to tie it to governments, but in the case of merchant republics, just do it as in Songs of Prosperity (DLC#023) ?
Code:
song = {
    name = "florence.ogg"
    song_name = "Florence"
    
    chance = {
        factor = 2
        modifier = {
            factor = 0
            is_patrician = no
        }       
    }
    volume = 0.45
}

Just my 2cents. ;)
 
I am working on a huge mod that has (at last count) around 30 custom decisions for the character to change their culture upon payment of a fixed amount of prestige and piety, and only if they meet certain conditions, ie right region, same culture is already adjacent etc. The decisions brings up an event with some custom text ("So you've decided to convert to XXX . . ." and the option to back out.

What I would like to do is cut down some of the masses of events and localisations I have to do, so here's what I want to do. From what I can tell at the very least I need one decision for each conversion option, as the criteria for each decision are all slightly different. But ideally I would like each decision to send the culture to be converted to (the "target culture") to the one event, along with the prestige and piety cost. This event would then deduct the cost and make the culture change and bring up one of 10 different localisations depending upon the culture "tech levels". Thus if you wish to convert to culture A then you get the event with its associated cost and culture change, along with the custom localisations for the event and its options, associated with Culture A.

My guess is that I can set the data in the decision, so that before the event is called I do something like set_variable = { name = target_culture value = XXX }, then the same for prestige and piety cost, then call these in the event. For the localization I just have a triggerto spit out the relevant texts, eg

EVTDESCdawn.102 = {
trigger = {
OR = {
target_culture = XXX
target_culture = YYY
etc
}
text = EVTDESCdawn.102.1

and so on.

Quesitons -
Is it possible to save a culture as a variable. In other words if I make the decision set target_culture to say "greek" would it then work in the event to say culture = target_culture?
Is the above the right syntax for setting variables?
Does this save anything on the processor load ?
Will this work or should I just make 30 custom events with 30 custom localisations?
 
Can anyone tell me if there are any flaws in this text?

Code:
song = {
    name = "tourofvenice.ogg"
    song_name = "Tour of Venice"
    
    chance = {
        factor = 2
        modifier = {
            factor = 0
            is_patrician = no
        }       
    }
    volume = 0.45
}
song = {
    name = "sanctuary.ogg"
    song_name = "Sanctuary"
    
    chance = {
        factor = 2
        modifier = {
            factor = 0
            is_patrician = no
        }       
    }
    volume = 0.45
}
song = {
    name = "themadman.ogg"
    song_name = "The Madman"
    
    chance = {
        factor = 2
        modifier = {
            factor = 0
               NOT = { culture_group = latin }
        }       
    }
    volume = 0.45
}
song = {
    name = "cityofrome.ogg"
    song_name = "City of Rome"
    
    chance = {
        factor = 2
        modifier = {
            factor = 0
               NOT = { religion_group = christian }
        }       
    }
    volume = 0.45
}
song = {
    name = "echoesoftheromanruins.ogg"
    song_name = "Echoes of the Roman Ruins"
    
    chance = {
        factor = 2
        modifier = {
            factor = 0
               NOT = { religion_group = christian }
        }       
    }
    volume = 0.45
}
song = {
    name = "welcometoconstantinople.ogg"
    song_name = "Welcome to Constantinople"
    
    chance = {
        factor = 2
        modifier = {
            factor = 0
               NOT = { culture_group = byzantine }
            NOT = { culture = turkish }
        }       
    }
    volume = 0.45
}
song = {
    name = "thecrossroadsoftheworld.ogg"
    song_name = "The Crossroads of the World"
    
    chance = {
        factor = 2
        modifier = {
            factor = 0
               NOT = { culture_group = byzantine }
            NOT = { culture_group = arabic }
            NOT = { culture = turkish }
        }       
    }
    volume = 0.45
}
song = {
    name = "byzantium.ogg"
    song_name = "Byzantium"
    
    chance = {
        factor = 2
        modifier = {
            factor = 0
               NOT = { culture_group = byzantine }
        }       
    }
    volume = 0.45
}
song = {
    name = "istanbul.ogg"
    song_name = "Istanbul"
    
    chance = {
        factor = 2
        modifier = {
            factor = 0
               NOT = { culture_group = byzantine }
            NOT = { culture = turkish }
        }       
    }
    volume = 0.45
}

Thank you in advance!
 
Can anyone tell me if there are any flaws in this text?

Code:
song = {
    name = "tourofvenice.ogg"
    song_name = "Tour of Venice"
   
    chance = {
        factor = 2
        modifier = {
            factor = 0
            is_patrician = no
        }      
    }
    volume = 0.45
}
song = {
    name = "sanctuary.ogg"
    song_name = "Sanctuary"
   
    chance = {
        factor = 2
        modifier = {
            factor = 0
            is_patrician = no
        }      
    }
    volume = 0.45
}
song = {
    name = "themadman.ogg"
    song_name = "The Madman"
   
    chance = {
        factor = 2
        modifier = {
            factor = 0
               NOT = { culture_group = latin }
        }      
    }
    volume = 0.45
}
song = {
    name = "cityofrome.ogg"
    song_name = "City of Rome"
   
    chance = {
        factor = 2
        modifier = {
            factor = 0
               NOT = { religion_group = christian }
        }      
    }
    volume = 0.45
}
song = {
    name = "echoesoftheromanruins.ogg"
    song_name = "Echoes of the Roman Ruins"
   
    chance = {
        factor = 2
        modifier = {
            factor = 0
               NOT = { religion_group = christian }
        }      
    }
    volume = 0.45
}
song = {
    name = "welcometoconstantinople.ogg"
    song_name = "Welcome to Constantinople"
   
    chance = {
        factor = 2
        modifier = {
            factor = 0
               NOT = { culture_group = byzantine }
            NOT = { culture = turkish }
        }      
    }
    volume = 0.45
}
song = {
    name = "thecrossroadsoftheworld.ogg"
    song_name = "The Crossroads of the World"
   
    chance = {
        factor = 2
        modifier = {
            factor = 0
               NOT = { culture_group = byzantine }
            NOT = { culture_group = arabic }
            NOT = { culture = turkish }
        }      
    }
    volume = 0.45
}
song = {
    name = "byzantium.ogg"
    song_name = "Byzantium"
   
    chance = {
        factor = 2
        modifier = {
            factor = 0
               NOT = { culture_group = byzantine }
        }      
    }
    volume = 0.45
}
song = {
    name = "istanbul.ogg"
    song_name = "Istanbul"
   
    chance = {
        factor = 2
        modifier = {
            factor = 0
               NOT = { culture_group = byzantine }
            NOT = { culture = turkish }
        }      
    }
    volume = 0.45
}

Thank you in advance!
Looks fine.
 
Did you tried to use event with on_action trigger? You only need to make an "is_triggered_only = yes" event which give the trait to the child only if any parent have that trait, and put ID of the event into list in file in common\on_actions...

Sorry I forgot to thanks you guy!