CK2 Dev Diary #18: Optimization and modding

destroy_in_extra_holding = { type = hospital building = leper_colony_1​ }​ - The following effects have been added. They work the same as the equivalent for forts or trade posts: create_hospital destroy_hospital any_hospital​ - Scripted effects in event options will now show the traits and characters they affect - Added a war_participation trigger. Example: any_war = { war_participation = { who = ROOT score = 0.5 } } - Added an is_landed_title_allowed trigger, which checks whether a character fulfills the "allow" section of a specific title. Example: is_landed_title_allowed = e_hre or is_landed_title_allowed = ROOT, where ROOT is a title - Added a "force_host" effect that forcibly changes the host a character. Scope should be the character being moved, target should be the character's new host. Shouldn't be used lightly force_host = ROOT​ - Added join_faction, leave_faction and start_faction effects. - Added faction_exists trigger. - Added export_to_variable effect. - Added while effect. - Title prefix defined in landed_titles.txt should now support localisation variations dependent on the holder of the title. - Added sound_effect effect. - It should now be possible to make baronies independent through history editing. - Added a "character_stats" console command that prints a variety of statistics to the console, such as the # of rulers of each tier, gender breakdown, and total wealth. This also gets written to stats.log - Added a "dynasty_stats" console command that prints a variety of statistics to the console, such as the # of dynasties, number of single-person dynasties, and number of dynasties with only dead characters. This also gets written to stats.log - Added a COURT_PRUNE_SIZE define, which defines when the game will try to find unneeded courtiers to kill off. Lowered to 10 from the original 20 - Added a "de_facto_liege_title" trigger, which checks that the defacto liege title of a character or title is the right-hand side. Example: ROOT = { de_facto_liege_title = e_hre }. Both sides can take a character or a title. If a character is provided, their primary title will be used. A defacto_liege_title scope already existed, but this should make some operations easier - Added an "immortal" trigger, which checks if the character in the current scope is immortal - Added an "is_incapable" trigger, which checks if the character in the current scope has an incapacitating trait - Added an "is_pilgrim" trigger, which checks if the character in the current scope has a pilgrim trait - Added a "same_regnal_name" trigger, which checks if the character in the current scope has the same regnal name as another character, meaning that they'll be considered the same name for the purpose of regnal numbering. Regnal names are currently defined as having the same first first name (E.G., "Gustav" and "Gustav Adolf" are the same regnal name), or the same cultural first first name (E.G., "Alfr_Alf" and "Alf_Alf" are the same regnal name) - "monthly_income" and "yearly_income" can now be used in a holding scope. Before it could only take a character. Example: "b_constantinople = { yearly_income = 15 }" - Added a "has_inheritance_blocker" trigger, which checks if the character in the current scope has a trait that blocks inheritance (cannot_inherit = yes) - Added a "dynastic_prestige" trigger, which checks if the dynasty of the character in the current scope has a prestige of at least the given value. Example: "dynastic_prestige = 100" - Added a "set_preferred_capital" effect, which sets the preferred capital of the title in the current scope (used for a variety of things, such as the AI to determine where to put their capital). Only works for dynamic titles, as static titles base their capital off of the landed_titles folder - Added a "lacks_dlc" event pre-trigger. If the DLC is enabled, the event will not be evaluated - Added a "has_dlc" event pre-trigger. If the DLC is disabled, the event will not be evaluated - Added a "war" event pre-trigger, which takes "yes" or "no", and checks that the character is/isn't at war - Added a "is_married" event pre-trigger, which takes "yes" or "no", and checks that the character is/isn't married - Added a "friends" event pre-trigger, which takes "yes" or "no", and checks that the character does/doesn't have friends - Added a "rivals" event pre-trigger, which takes "yes" or "no", and checks that the character does/doesn't have rivals - Added a "has_global_flag" event pre-trigger, which checks that the given global flag has been set - Added support for an after = { } - effect field in events. It works as a counterpart to immediate and executes after any option is executed. - Replaced the COALITION_PROVINCE_THREAT_RATIO define with COALITION_SCARY_TROOP_STRENGTH_THREAT_RATIO. It is now actually used by the game - Decisions now take the pre-triggers "only_rulers", "only_landed", and "only_independent". It is recommended that they be used when possible so as to reduce the time spent by the AI evaluating the decision. Note that the pre-trigger currently only applies to the AI, not to the player - The "is_occupied" trigger now works in province scope, not just title scope - The "is_occupied" trigger now works for county-level titles, not just baron-level titles - "plot_decisions" are now only checked by characters that lead a plot or faction. Previously there was no functional difference between plot decisions and regular decisions - Added "has_flag" as a quick trigger for province events. It works exactly like the "has_character_flag" quicktrigger, except the scope is the province for the event - Added on_war_ended_invalid and on_crusade_invalid on_actions, that provide the same scopes as the other on_war_ended and on_crusade on_actions - Added a CROWN_LAW_CHANGE_TIMER define. If set to 0, rulers will be restricted to MAX_CROWN_LAW_CHANGES. If set to 1, they'll have a CROWN_LAW_CHANGE_MONTHS cooldown - Added a CROWN_LAW_CHANGE_MONTHS define - Traits can now be hidden. Adding "hidden = yes" will make it invisible in all parts of the UI (except event options, where they can be hidden using hidden_tooltip) - Added define "FAR_CRUSADES_WITHOUT_WEIGHT_MODIFIER" as a weight modifier to starting crusades on titles that are not adjacent to territory of our religion and don't have a crusade weight modifier. Default value is 75%

/r/CrusaderKings Thread Parent Link - forum.paradoxplaza.com