指令:修订间差异

本页面适用于最新的版本(3.3)。
无编辑摘要
(以“{{Version|3.3}} '''Commands''' or '''effects''' are used in scripting to alter the target that was selected with scopes and conditions. They appear in: * comman…”替换内容)
标签替换
第76行: 第76行:
|any
|any
|clause
|clause
|Activate/deactivate a titular or de jure landed title. Unlike destroyed titles (<code>destroy_landed_title</code>), deactivated titles cannot be re-created by the player or AI, except through special decisions.
|Activate/deactivate a titular or de jure landed title. Unlike destroyed titles (<code>destroy_landed_title</code>), deactivated titles cannot be re-created by the p
|<pre>
activate_title = {
   title = d_hashshashin
   status = no
}
</pre>
|Titles
|-
|add_age
!✓
|character
|int
|Adds or subtracts the given value to the age of the scoped character. This can also accept saved variables. Warning: messing with a character's age may have unintended side effects so use with caution.
|<pre>
add_age = 3
add_age = -3
 
set_variable = {
   which = age_variable
   value = -5
}
add_age = age_variable
</pre>
|Character
|-
|add_alliance
!X
|character
|clause
|Creates an alliance between characters. Also see <code>break_alliance</code>.
|<pre>
add_alliance = {
   who = x
   days/months/years = y
}
</pre>
|Relations
|-
|add_ambition
!✓
|character
|ambition
|
|<code>add_ambition = obj_become_chancellor</code>
|Plots
|-
|add_artifact
!✓
|character
|artifact
|A copy of the named artifact is created and added to the scoped character
|<code>add_artifact = golden_platypus</code>
|Artifacts
|-
|add_betrothal
!X
|character
|
|Warn: buggy behavior
|
|Marriage
|-
|add_bloodline_member
!X
|bloodline
|character
|Add the specified character to the scoped bloodline
|
|Bloodlines
|-
|add_building
!✓
|title
|building
|Construct a building in a holding. Also constructs the buildings it upgrades from, based on upgrades_from.
|<code>add_building = ct_shipyard_1</code>
|Holdings
|-
|add_character_modifier
!✓
|character
|clause
|Adds a [[modifiers|character modifier]]. Specify duration using <code>days</code>, <code>months</code>, <code>years</code>, or <code>duration = -1</code> (non-expiring). Can use optional fields <code>hidden = yes</code> and <code>stacking = yes</code>.
|<pre>
add_character_modifier = {
   name = mod_bloodlust
   months = 6
}
</pre>
|Modifiers
|-
|add_claim
!✓
|character/title
|character/title
|Adds a strong, non-inheritable claim to a character.
|<pre>
# Gives claim on ROOT's primary title to the holder of k_france
k_france = {
  add_claim = ROOT # character
}
 
# FROM recieves a claim on k_france
FROM = { # character
   add_claim = k_france
}
</pre>
|Claims
|-
|add_consort
!✓
|character
|character
|Adds the given character as a consort to the scoped character.
|
|Marriage
|-
|add_custom_history
!✓
|wonder
|key
|Adds a history entry to the scoped great work.
|
|Wonders
|-
|add_dynasty_modifier
!✓
|character
|modifier
|Adds a modifier that applies to all members of the scoped character's dynasty.
|<code>add_dynasty_modifier = ruling_in_crusader_kingdom</code>
|Characters
|-
|add_evil_god_name
!✓
|religion
|key
|Adds an evil god name to the scoped religion.
|<code>add_evil_god_name = LOKI</code>
|Religion
|-
|add_favor
!✓
|character
|character
|Makes scoped character be owed a favor toward another character. Also see <code>reverse_add_favor</code>.
|<code>add_favor = ROOT</code>
|
|-
|add_friend
!✓
|character
|character
|
|<code>add_friend = ROOT</code>
|Relations
|-
|add_god_name
!✓
|religion
|key
|Adds a god name to the scoped religion.
|<code>add_god_name = GOD_THE_ALLFATHER_2</code>
|Religion
|-
|add_holding_modifier
!✓
|holding
|modifier
|Adds a [[modifiers|holding modifier]]. Can use optional field <code>stacking = yes</code>.
|<pre>
add_holding_modifier = {
   modifier = nomad_population_boom
   years = 8
   stacking = yes
}
</pre>
|Modifiers
|-
|add_holding_slot
!✓
|province
|int
|Adds N constructible settlement to a province.  Can be negative. <ref>[[forum:606906/page-126#post-23813292]]</ref>
|<code>add_holding_slot = 1</code>
|Holdings
|-
|add_intermarry
!✓
|religion
|anything with a religion
|Allows scoped religion to intermarry with target religion. One-way only, so apply converse intermarry separately, if desired. Also see <code>remove_intermarry</code> and <code>clear_intermarry</code>.
|<pre>
add_intermarry = catholic
add_intermarry = jewish_group
add_intermarry = ROOT
</pre>
|Religion
|-
|add_law
!✓
|title
|law/clause
|Sets the specified law for the scoped title. Can optionally specify to ignore cooldown and opinion effects (i.e. on vassals), defaulting to yes.
|<pre>
add_law = {
   law = ze_administration_laws_2
   cooldown = no
   opinion_effect = no
}
</pre>
|Government
|-
|add_law_w_cooldown
!✓
|title
|law
|
|<code>add_law_w_cooldown = investiture_law_0</code>
|Government
|-
|add_lover
!✓
|character
|character
|
|<code>add_lover = PREV</code>
|Marriage
|-
|add_objective
!X
|character
|objective
|
|<code>add_objective = objective</code>
|Plots
|-
|add_offmap_currency
!✓
|character
|clause
|Adds the specified <code>value</code> of offmap currency for the specified <code>offmap</code> power to the scoped character. Use a negative number to subtract.
|<pre>
add_offmap_currency = {
   offmap = offmap_china
   value = 250
}
</pre>
|Offmap
|-
|add_plot
!✓
|character
|plot ?
|Character starts specified plot - doesn't seem to work
|<code>add_plot = plot_kill_spouse</code>
|Plots
|-
|add_population_scaled
!✓
|character
|double
|Adds or subtracts a portion of the scope's population.
|<code>add_population_scaled = -0.1</code>
|Clans
|-
|add_pressed_claim
!✓
|character/title
|character/title
|Adds a strong, inheritable claim to a character.
|<pre>
# Gives claim on ROOT's primary title to the holder of k_france
k_france = {
  add_pressed_claim = ROOT # character
}
 
# FROM recieves a claim on k_france
FROM = { # character
   add_pressed_claim = k_france
}
</pre>
|Claims
|-
|add_province_modifier
!✓
|province
|clause
|Adds a [[modifiers|province modifier]]
|<pre>
add_province_modifier = {
   name = smugglers_ring
   duration = -1
}
</pre>
|Modifiers
|-
|add_random_education_trait
!✓
|character
|attribute/1/2/3/4/yes
|Adds an education /trait matching specified attribute or level.
|<code>add_random_education_trait = martial</code>
|Character
|-
|add_rival
!✓
|character
|character
|
|
|Relations
|-
|add_society_modifier
!✓
|character
|clause
|Adds a timed modifier to the society of scoped character. Works with days and years.
|<pre>
add_society_modifier = {
   modifier = failed_mission
   years = 2
}
</pre>
|Societies
|-
|add_society_progress
!✓
|society
|float
|Adds a given value to the society's current progress.
|<code>add_society_progress = 10</code>
|Societies
|-
|add_special_interest
!✓
|character
|character
|Adds a character to the list of special interests, on the outliner, found on the right side of the screen.
|<code>add_special_interest = ROOT</code>
|Characters
|-
|add_spouse
!✓
|character
|character
|
|<code>add_spouse = FROM</code>
|Marriage
|-
|add_spouse_matrilineal
!✓
|character
|character
|
|<code>add_spouse_matrilineal = FROM</code>
|Marriage
|-
|add_to_bloodline
!X
|character
|bloodline
|Add the scoped character to the target bloodline.  Note that the target must be an existing bloodline scope, not a bloodline type.
|<pre>
random_bloodline = {
   ROOT = {
add_to_bloodline = PREV
   }
}
</pre>
|Bloodlines
|-
|add_to_crusade_artifact_pot
!✓
|any
|int
|Adds specified amount to crusade artifact pot
|<code>add_to_crusade_artifact_pot = 1</code>
|Wars
|-
|add_to_crusade_gold_pot
!✓
|any
|int
|Adds specified amount to crusade gold pot
|<code>add_to_crusade_gold_pot = 100</code>
|Wars
|-
|add_to_crusade_piety_pot
!✓
|any
|int
|Adds specified amount to crusade artifact pot
|<code>add_to_crusade_piety_pot = 50</code>
|Wars
|-
|add_to_crusade_prestige_pot
!✓
|any
|int
|Adds specified amount to crusade artifact pot
|<code>add_to_crusade_prestige_pot = 250</code>
|Wars
|-
|add_to_extra_holding
!X
|province
|clause
|Construct a building in a special holding (hospital, fort or trade post).
|<pre>
add_to_extra_holding = {
   type = trade_post
   building = tr_port_1
}
</pre>
|Holdings
|-
|add_trait
!✓
|character
|trait
|Adds a trait to the character, using an ID from the traits files. Also see <code>remove_trait</code>.
|<code>add_trait = skilled_tactician</code>
|Traits
|-
|add_weak_claim
!✓
|character/title
|character/title
|Adds a weak, non-inheritable claim to a character.
|<pre>
# Gives claim on ROOT's primary title to the holder of k_france
k_france = {
  add_weak_claim = ROOT # character
}
 
# FROM recieves a claim on k_france
FROM = { # character
   add_weak_claim = k_france
}
</pre>
|Claims
|-
|add_weak_pressed_claim
!✓
|character/title
|character/title
|Adds a weak, inheritable claim to a character.
|<pre>
# Gives claim on ROOT's primary title to the holder of k_france
k_france = {
  add_weak_pressed_claim = ROOT # character
}
 
# FROM recieves a claim on k_france
FROM = { # character
   add_weak_pressed_claim = k_france
}
</pre>
|Claims
|-
|add_wonder
!X
|wonder
|int
|Constructs target wonder in scoped province, at stage 1 complete.
|<code>add_wonder = wonder_wonder_underground_city</code>
|Wonders
|-
|add_wonder_stage
!X
|wonder
|int
|Would add/complete the current stage. If a wonder is at stage 2, it'd add stage 3 completed. If it's in the process of adding a stage, it would ""merely"" complete that one.
|<code>add_wonder_stage = 1</code>
|Wonders
|-
|add_wonder_upgrade
!X
|wonder
|string/bool
|Would add/complete the upgrade specified, or if used in an upgrade scope, complete currently scoped upgrade.
|<code>add_wonder_upgrade = yes/no/<upgrade name></code>
|Wonders
|-
|add_wonder_upgrade_slots
!X
|wonder/upgrade
|int
|Increases the number of available upgrade slots
|<code>add_upgrade_slots = 1</code>
|Wonders
|-
|adjective
!✓
|title
|string/localisation key
|
|<pre>
k_france = { adjective = "" }
primary_title = { adjective = SOME_KEY }
</pre>
|Titles
|-
|adjust_siphon_factor
!✓
|title
|double
|Update the percentage of income that goes to the creator for a dynamic mercenary company.
|<code>primary_title = { adjust_siphon_factor = -0.02 }</code>
|
|-
|ambition_succeeds
!✓
|character
|bool
|
|<code>ambition_succeeds = yes</code>
|Plots
|-
|approve_law
!✓
|character/title
|law/title
|
*<code>approve_law = <law></code> starts a vote on a law for scoped title
*<code>approve_law = title</code> votes in favor of a law for target title
|<code>primary_title = { approve_law = city_tax_0 }</code>
<code>approve_law = FROM</code>
|Government
|-
|back_plot
!✓
|character
|character
|
|<code>ROOT = { back_plot = PREV }</code>
|Plots
|-
|banish
!✓
|character
|bool
|Banish character to random court
|<code>FROM = { banish = yes }</code>
|Characters
|-
|banish_religion
!✓
|character
|religion
|All characters of the targeted religion will be banished to random court
|<code>banish_religion = jewish</code>
|Religion
|-
|become_heretic
!✓
|character
|bool
|Changes character religion to a random heresy of current religion
|<code>become_heretic = yes</code>
|Religion
|-
|become_secret_heretic
!X
|character
|bool
|Changes character religion to a random heresy of their current religion, but still openly practices their current faith (i.e., similar to become_heretic, but in secret rather than openly).
|
|Religion
|-
|break_alliance
!✓
|character
|character
|Remove an alliance. Also see <code>add_alliance</code>
|<code>break_alliance = FROM</code>
|Relations
|-
|break_betrothal
!X
|character
|character
|
|<code>break_betrothal = FROM</code>
|Marriage
|-
|build_holding
!✓
|province
|clause
|Builds a new settlement in the province.
|<pre>
build_holding = {
   title = b_masyaf
   type = castle
   holder = ROOT
}
</pre>
|Holdings
|-
|cancel_ambition
!✓
|character
|bool
|
|<code>cancel_ambition = yes</code>
|Plots
|-
|cancel_job_action
!✓
|character
|job_action
|
|<code>FROM = { cancel_job_action = action_inquisition }</code>
|Jobs
|-
|cancel_objective
!X
|character
|objective
|Outdated, now cancel_objective/cancel_plot
|
|Plots
|-
|cancel_plot
!✓
|character
|plot
|
|<code>cancel_plot = plot_gain_title</code>
|Plots
|-
|cancel_pregnancy
!✓
|character
|bool
|Ends a character's pregnancy instantaneously. Can be called at any time during pregnancy prior to birth. If pregnancy notification is to be avoided, must be called earlier than 2 months pregnancy.
|<code>cancel_pregnancy = yes</code>
|Characters
|-
|capital
!✓
|character
|province/title (barony/county)
|Moves the capital of the currently scope character to the target province/holding/county. Province must be a relative scope - does not accept province IDs and saved event targets.
|<code>capital = b_korrala</code>
|Rulers
|-
|change_diplomacy
!✓
|character
|int
|Changes base diplomacy stat. Negative decreases base diplomacy but will not decrease base diplomacy below 0
|<code>change_diplomacy = 1</code>
|Characters
|-
|change_infamy
!X
|character
|clause
|Add or remove threat from a character.<br />
value : numerical change in infamy/threat (can be a decimal value)<br />
localisation : key for the localisation entry for the character's threat tooltip.
|<pre>
change_infamy = {
   value = x
   localisation = key
}
</pre>
|-
|change_intrigue
!✓
|character
|int
|Changes base intrigue stat. Negative decreases base intrigue but will not decrease base intrigue below 0
|<code>change_intrigue = 1</code>
|Characters
|-
|change_learning
!✓
|character
|int
|Changes base learning stat. Negative decreases base learning but will not decrease base learning below 0
|<code>change_learning = 1</code>
|Characters
|-
|change_martial
!✓
|character
|int
|Changes base martial stat. Negative decreases base martial but will not decrease base martial below 0
|<code>change_martial = 2</code>
|Characters
|-
|change_mercenary_composition
!X
|title
|clause
|Change the composition of a dynamic mercenary title.
|<pre>
change_mercenary_composition = {
   from = <unit>
   type = <unit>
   change = <int>
}
</pre>
|
|-
|change_plot_power
!X
|character
|int
|Add the specified amount of plot power to the plot owned by the scoped characters.
|<code>change_plot_power = 10</code>
|Plots
|-
|change_random_civ_tech
!X
|province
|int
|
|<code>change_random_civ_tech = 2</code>
|Provinces
|-
|change_random_eco_tech
!X
|province
|int
|
|
|Provinces
|-
|change_random_mil_tech
!X
|province
|int
|
|
|Provinces
|-
|change_society_currency
!✓
|character
|int/clause
|Changes the currency of scope character in their society. Can optionally specify parameters for the society to change the currency of and to scale the currency changed by the society influence, reducing the amount of currency consumed (or given, but is intended for the former) by 70% when the society is at 100% influence, going linearly from 0% at 0%.
|<pre>
change_society_currency = 100
 
change_society_currency = {
   society = the_assassins
   value = -200
   scaled_by_influence = yes
}
</pre>
|Characters
|-
|change_stewardship
!✓
|character
|int
|Changes base stewardship stat. Negative decreases base stewardship but will not decrease base stewardship below 0
|<code>change_stewardship = 1</code>
|Characters
|-
|change_tech
!✓
|province
|clause
|Improves technology in the province (referenced in common/technology.txt)
|<pre>
change_tech = {
   technology = TECH_NAVAL
   value = 1}
</pre>
|Province
|-
|change_title_army_size
!✓
|title
|double
|Changes the army size of a mercenary/adventurer title.
|<pre>
primary_title = {
   change_title_army_size = 0.05 # Percentage
}
</pre>
|Titles
|-
|change_variable
!✓
|character/province
|clause
|Increment (or decrement) a variable with specified value, or another variable. Can take another scope from which to pull a second variable.
|<pre>
change_variable = {
   which = bob_saget
   value = 1
}
 
change_variable = {
   which = bob_saget
   which = another_var
   who = FROM
}
</pre>
|Control
|-
|character_event
!✓
|character
|clause
|Fires an event to scoped character. See [[event modding]].
{|class="wikitable"
!Parameter !! Type !! Description
|-
|id || int || Required. Event ID to fire.  May use a [[event modding#ID and namespace|namespace]].
|-
|days || int || Optional. Base number of days to wait before firing the event. May use ''years'' instead. If not specified, event occurs instantly.
|-
|random || int || Optional. Number of days to add randomly for the event occurrence date, closed-ended (''days'' to ''days+random'').
|-
|tooltip || Key || Optional localisation key to show as tooltip.  If not specified, uses the DEFAULT_SENDEVENT_EVENTOPTION_TOOLTIP key ("Character receives an event").
|-
|}
|<pre>
character_event = {
   id = 66010
   days = 17
   tooltip = EVTTOOLTIP66010
}
</pre>
|Control
|-
|chronicle
!✓
|character
|clause
|Parameters: entry, portrait, picture
|<pre>
chronicle = {
   entry = CHRONICLE_FOUNDED_NEW_KINGDOM_OR_EMPIRE
   portrait = [Root.GetID]
}
</pre>
|Rulers
|-
|clan_opinion
!✓
|title
|clause
|
|<pre>
clan_opinion = {
   who = event_target:liege_clan
   modifier = won_tributary_war
   years = 5
}
</pre>
|Opinion
|-
|clan_remove_opinion
!✓
|title
|clause
|
|<pre>
clan_remove_opinion = {
   who = event_target:liege_clan
   name = won_tributary_war
}
</pre>
|Opinion
|-
|clan_reverse_opinion
!✓
|title
|clause
|
|<pre>
clan_reverse_opinion = {
   who = PREVPREVPREV
   name = opinion_built_temple
   years = 20
}
</pre>
|Opinion
|-
|clan_reverse_remove_opinion
!✓
|title
|clause
|
|<pre>
clan_reverse_remove_opinion = {
   who = PREVPREVPREV
   name = opinion_built_temple
}
</pre>
|Opinion
|-
|clear_banish_reasons
!X
|character
|character
|Removes all opinion modifiers allowing the scoped character to banish the given character. Doesn't clear ongoing reasons like excommunication.
|<code>clear_banish_reasons = FROM</code>
|Control
|-
|clear_delayed_event
!✓
|character/province
|clause
|Removes specified event id with a delayed trigger on current scope.
|<code>clear_delayed_event = { id = HL.6500 }</code>
|Control
|-
|clear_education_trait
!✓
|character
|bool
|Removes all traits with the <code>education = yes</code> parameter.
|<code>clear_education_trait = yes</code>
|Traits
|-
|clear_event_target
!✓
|any
|var
|Deletes a previously saved variable
|<code>clear_event_target = target_victim</code>
|Control
|-
|clear_execute_reasons
!X
|character
|character
|Removes all opinion modifiers allowing the scoped character to execute the given character. Doesn't clear ongoing reasons like excommunication.
|<code>clear_execute_reasons = FROM</code>
|Control
|-
|clear_flags_with_prefix
!✓
|character/province
/title/artifact
|flag (prefix)
|Clears all flags of the current scope that begin with the specified prefix
|<code>clear_flags_with_prefix = temple_name_</code>
|Control
|-
|clear_focus
!✓
|character
|bool
|Removes the focus of a character. Also see <code>set_focus</code>.
|<code>clear_focus = yes</code>
|
|-
|clear_global_event_target
!X
|any
|var
|Deletes a previously saved global variable
|
|Control
|-
|clear_global_event_targets
!X
|any
|bool
|Deletes all previously saved global variables
|<code>clear_global_event_targets = yes</code>
|Control
|-
|clear_intermarry
!✓
|religion
|bool
|Resets scoped religions intermarriage options to default. One-way only, so apply converse intermarry separately, if desired. Also see <code>add_intermarry</code> and <code>remove_intermarry</code>.
|<code>clear_intermarry = yes</code>
|Religion
|-
|clear_persistent_event_target
!✓
|province/character/title/<br/>artifact/society/offmap
|var
|Deletes a persistent event target previously saved in the currently scoped object.
|<code>clear_persistent_event_target = london_owner</code>
|Control
|-
|clear_prison_reasons
!✓
|character
|character
|Removes all opinion modifiers allowing the scoped character to imprison the given character. Doesn't clear ongoing reasons like excommunication.
|<code>clear_prison_reasons = FROM</code>
|Control
|-
|clear_secret_religion
!✓
|character
|bool
|Removes the scoped character's secret religion.
|<code>clear_secret_religion = yes</code>
|Religion
|-
|clear_revoke_reasons
!X
|character
|character
|Removes all opinion modifiers allowing the scoped character to revoke the given character's titles. Doesn't clear ongoing reasons like excommunication.
|<code>clear_revoke_reasons = FROM</code>
|Control
|-
|clear_revolt
!✓
|province
|bool
|
|<code>clear_revolt = yes</code>
|Provinces
|-
|clear_wealth
!✓
|character
|bool/character
|Sets wealth of character to 0. Can be used after transfer of money via <code>wealth</code> command. Alternately, consider using <code>transfer_scaled_wealth</code>.
|<code>clear_wealth = yes</code>
|Money
|-
|clr_artifact_flag
!✓
|artifact
|flag
|
|<code>clr_artifact_flag = stolen</code>
|Control
|-
|clr_bloodline_flag
!X
|bloodline
|flag
|Removes a script flag from the scoped bloodline
|
|Bloodlines
|-
|clr_character_flag
!✓
|character
|flag
|
|<code>clr_character_flag = flag_promised_marriage</code>
|Control
|-
|clr_discovered_society
!X
|character
|bool
|Resets the character's revealed society.
|<code>clr_discovered_society = yes</code>
|Societies
|-
|clr_dynasty_flag
!✓
|chararcter
|flag
|
|<code>clr_dynasty_flag = strange_chest</code>
|Control
|-
|clr_flag
!✓
|any with flags
|flag
|Clears the given flag from the current scope. Works for any scope that can store flags, unlike the more specific clr_''scope''_flag commands.
|
|Control
|-
|clr_global_flag
!✓
|any
|flag
|
|<code>clr_global_flag = shepherds_crusade_active</code>
|Control
|-
|clr_offmap_flag
!✓
|offmap
|string
|Wipes the specified flag from the scoped offmap power.
|<code>clr_offmap_flag = china_invaded_player_dynasty</code>
|Offmap
|-
|clr_offmap_tmp_flag
!✓
|offmap
|string
|Wipes the specified temporary flag from the scoped offmap power.
|<code>clr_offmap_tmp_flag = china_force_open_in_progress</code>
|Offmap
|-
|clr_province_flag
!✓
|province
|flag
|
|<code>clr_province_flag = tournament_60_days_furusiyya</code>
|Control
|-
|clr_quest
!✓
|character
|bool/clause
|Removes any quest with that name (and from that society, if the society name is present) belonging to the scoped character. Can optionally specify a failure parameter, considered a success otherwise.
|<pre>
clr_quest = quest_monastic_order_penance
 
clr_quest = {
   id = quest_hermetics_find_text
   failure = yes
}
</pre>
|Societies
|-
|clr_quest_target
!X
|character
|quest_id
|Clears the target of the specified quest belonging to the scoped character. Does not clear the quest itself.
|<code>clr_quest_target = quest_the_assassins_protege</code>
|Societies
|-
|clr_title_flag
!✓
|title
|flag
|
|
|Control
|-
|clr_wonder_flag
!✓
|wonder
|string
|Removes a script flag from the scoped wonder
|<code>clr_wonder_flag = religious_wonder</code>
|Wonders
|-
|clr_wonder_upgrade_flag
!X
|upgrade
|string
|Removes a script flag from the scoped upgrade
|<code>clr_upgrade_flag = broken_upgrade</code>
|Wonders
|-
|conquest_culture
!✓
|character/title
/province
|culture/character
/title/province
|
|<code>conquest_culture = PREVPREV</code>
|Culture
|-
|convert_to
!✓
|title(holding)
|type
|Converts holding to another holding type: castle, city, temple, tribal, nomad
|<code>convert_to = castle</code>
|Holdings
|-
|convert_to_secret_religion
!✓
|character
|bool/character
|Sets the scoped character's public religion to his/her secret religion, or to the target character's secret religion if a scope is used.
|<code>convert_to_secret_religion = yes</code>
|Religion
|-
|copy_artifact_history
!✓
|artifact
|artifact
|Copies the artifact history from the given artifact to the scoped artifact.
|<pre>
new_artifact = {
   copy_artifact_history = event_target:target_artifact
}
</pre>
|Artifacts
|-
|copy_name
!X
|character/title?
|character/title?
|As set_name, but sets name of scope to that of the target scope.
|<code>ROOT = { copy_name = FROM }</code>
|Traits
|-
|copy_random_personality_trait
!✓
|character
|character
|
|<code>ROOT = { copy_random_personality_trait = PREV }</code>
|Traits
|-
|copy_title_history
!✓
|title
|title
|Copies title history from title on the right to title on the left. Also copies de jure assimilation.
|<code>e_spain = { copy_title_history = k_asturias }</code>
|Titles
|-
|copy_title_laws
!✓
|title
|title
|Copies title laws from title on the right to title on the left.
|<code>e_spain = { copy_title_laws = k_asturias }</code>
|Government
|-
|create_bloodline
!✓
|character
|clause
|Scoped characters founds a new bloodline of the specified type
{|class="wikitable"
!Parameter !! Type !! Description
|-
|type || bloodline || Obligatory. Defines the type of bloodline from which to inherit the bloodlines modifier
|-
|religion || religion || Optional. Associates the bloodline with a religion connecting it with the religion view
|-
|society || society || Optional. Associates the bloodline with a society connecting it with the society view
|-
|inheritance || || Optional. Overrides the base type's inheritance rules. Valid entries are all_descendants, matrilineal, patrilineal, or no_inheritance
|-
|allow_bastards || bool || Optional. Overrides the base type's bastard rules
|-
|}
|<pre>
create_bloodline = {
   type = lord_of_outremer
   inheritance = matrilineal
}
</pre>
|Bloodlines
|-
|create_character
!✓
|character/province
|clause
|Creates a random character with specified parameters.
{|class="wikitable"
!Parameter !! Type !! Description
|-
|age || int || age = 0
|-
|name || string ||
|-
|has_nickname || nickname || Use give_nickname in new_character scope instead.
|-
|attributes || clause || martial, intrigue, diplomacy, stewardship, learning
|-
|(add_)trait || trait || trait = bastard
|-
|health || double ||
|-
|fertility || double ||
|-
|random_traits || bool || If omitted, the default is 'no'.
|-
|female || bool/random/int || <code>female = no</code><br/><code>female = random</code><br/><code>female = 40 #40% chance of being female</code>
|-
|employer || title || If omitted, defaults to scoped character, or owner of scoped province.
|-
|religion || religion || religion = ROOT
|-
|culture || culture/random || <code>culture = ROOT</code>
|-
|dynasty || ID/none/random/culture/actually_culture || <code>dynasty = none</code><br/><code>actually_culture</code> picks a random dynasty name from the culture if there's no unused static dynasty to use
|-
|dna || string ||
|-
|flag || flag || Note: does not support dynamic flags.
|-
|genetic_father || character || genetic_father = ROOT, used for portraits, congenital trait inheritance, etc. (Note: the trait inheritance is broken, and has been since Old Gods).
|-
|genetic_mother || character || genetic_mother = PREV
|-
|race || character || race = PREV
|-
|historical || bool || If yes, character won't ever be pruned from the database.
|-
|immortal_age || int || Age at which a character become immortal, if relevant.
|-
|}
|<pre>
create_character = {
   random_traits = no
   name = "Hassan"
   dynasty = random
   religion = ROOT
   culture = persian
   female = no
   age = 40
   health = 6
   fertility = 0.8
  
   attributes = {
martial = 6
diplomacy = 8
stewardship = 9
intrigue = 12
learning = 12
   }
 
   add_trait = elusive_shadow
   add_trait = patient
   add_trait = zealous
   add_trait = scholar
   add_trait = chaste
   add_trait = temperate
}
</pre>
|Characters
|-
|create_family_palace
!✓
|character
|bool
|Creates the patrician family palace
|<code>create_family_palace = yes</code>
|Holdings
|-
|create_feud
!✓
|title
|title
|Create a feud between two clans
|<pre>
clan_title = {
   FROM = {
clan_title = {
   create_feud = PREVPREV
}
   }
}
</pre>
|Clans
|-
|create_fort
!X
|character/title
|province (ID or scope pointing to province)
|Creates a fort in the specified province
|<code>create_fort = 123</code>
|-
|create_hospital
!X
|character/title
|province (ID or scope pointing to province)
|Creates a hospital in the specified province
|<code>create_hospital = 123</code>
|-
|create_random_diplomat
!✓
|character/province
|clause
|Creates a random character with diplomacy education (see <code>create_character</code>).
|<code>create_random_diplomat = { ... }</code>
|Characters
|-
|create_random_intriguer
!✓
|character/province
|clause
|creates a random character with intrigue education (see <code>create_character</code>).
|<code>create_random_intriguer = { ... }</code>
|Characters
|-
|create_random_priest
!✓
|character/province
|clause
|creates a random character with learning education (see <code>create_character</code>).
|<code>create_random_priest = { ... }</code>
|Characters
|-
|create_random_soldier
!✓
|character/province
|clause
|creates a random character with martial education (see <code>create_character</code>).
|<code>create_random_soldier = { ... }</code>
|Characters
|-
|create_random_steward
!✓
|character/province
|clause
|creates a random character with stewardship education (see <code>create_character</code>).
|<code>create_random_steward = { ... }</code>
|Characters
|-
|create_retinue
!X
|character
|retinue_type
|Spawns a fully reinforced retinue type in current character's capital province
|<code>create_retinue = RETTYPE_CUL_HUNG</code>
|Retinues
|-
|create_title
!✓
|title
|clause
|Creates a dynamic title with specified parameters. Landless dynamic titles require a landed home province to both hold prisoners and to act as a fallback if the title gets destroyed. This command should be run from the home province scope, otherwise the whole court will end up stuck in province 0 when the holder dies.
{|class="wikitable"
!Parameter !! Type !! Description
|-
|tier || tier ||
|-
|landless || bool ||
|-
|temporary || bool || Destroyed automatically when at peace. The holder and the courtiers cannot marry or accept most other diplo-actions.
|-
|rebel || bool ||
|-
|culture || culture ||
|-
|name || Key || Localization key for the title name.
|-
|holder || character ||
|-
|custom_created || bool ||
|-
|base_title || title ||
|-
|copy_title_laws || bool ||
|-
|mercenary || bool ||
|-
|adventurer || bool || Adventure titles work just as temporary titles but do not get destroyed automatically when the holder is in peace. Instead, they are destroyed whenever the holder gains another title or when the holder dies.
|-
|ruler || Key || Localization key for the ruler title.
|-
|ruler_female || Key || Localization key for the female ruler title.
|-
|foa || Key ||
|-
|nomad || bool ||
|-
|replace_captain_on_death || bool || Used for dynamic mercenary titles.
|-
|siphons_income_to_creator || double || Percentage of income given to creator for dynamic mercenary titles.
|-
|army_template || composition || Army composition for dynamic mercenary titles.
|-
|short_name || bool ||
|-
|}
|<pre>
create_title = {
   tier = DUKE
   name = SHEPHERDS_CRUSADE
   holder = THIS
} </pre>
|Titles
|-
|create_tradepost
!X
|character/title
|province (ID or scope pointing to province)
|Creates a trade post in the specified province (only works if the character meets requirements such as being under their trade post limit)
|<code>create_tradepost = 123</code>
|-
|culture
!✓
|character/province
/title
|culture/character
/province/title
|
|
|Culture
|-
|culture_techpoints
!✓
|character
|int
|
|<code>culture_techpoints = 50</code>
|Rulers
|-
|cure_illness
!✓
|character
|bool
|
|<code>cure_illness = yes</code>
|Health
|-
|cut_mercenary_creator_relation
!✓
|title
|bool
|Break free the dynamic mercenary title from its creator.
|<code>cut_mercenary_creator_relation = yes</code>
|
|-
|damage_unit
!X
|unit
|clause
|Creates casualties for an army (whole unit or a specific unit type) by either a fixed amount or percentage. They won't be displayed in a combat report.<ref>[[forum:774248/page-32#post-22178309]]</ref><ref>[[forum:1005915/#post-22552273]]</ref>. Using a negative number will heal units instead.
{|class="wikitable"
!Parameter !! Type !! Description
|-
|amount || float
|rowspan=2| Either amount or percentage is required.
|-
|percentage || float
|-
|type || unit_type || Optional. Base unit types (light_infantry, heavy_infantry, pikemen, light_cavalry, knights, archers, special_troops, galleys, light_troops, or heavy_troops).
|-
|}
|
<pre>
damage_unit = {
   amount = 150
}
 
damage_unit = {
   percentage = 0.15
}
</pre>
|Units
|-
|damage_unit_morale
!X
|unit
|float
|Removes morale for the army (or adds morale with negative values). Only takes absolute values.
|<code>damage_unit_morale = 0.6</code>
|Units
|-
|de_jure_liege
!✓
|title
|character/title/0
|Changes the de jure structure
|<pre>
any_direct_de_jure_vassal_title = {
   de_jure_liege = e_roman_empire
}
</pre>
|Vassalage
|-
|death
!✓
|character
|clause
|Kills currently scoped character
|<pre>
death = {
   death_reason = death_execution
   killer = ROOT
}
</pre>
|Health
|-
|decadence
!✓
|character
|int
|
|<code>decadence = -50</code>
|Characters
|-
|decline_law
!✓
|character
|title
|Vote against a proposed low for target title. Also see <code>approve_law</code>.
|<code>decline_law = FROM</code>
|Council
|-
|destroy_artifact
!✓
|character/artifact
|artifact/bool
|Destroy the scoped or specified artifact. If there is no name given, the scope must be an artifact, and the PREV scope must be the owner. If an artifact name is given, the scope should be the owner of the artifact. If they own more than one, only the first one will be destroyed. Cannot be used to destroy indestructible objects; see <code>unsafe_destroy_artifact</code>
|<pre>
any_artifact = { destroy_artifact = yes }
destroy_artifact = prosthetic_hand_gold
</pre>
|Artifact
|-
|destroy_bloodline
!X
|bloodline
|bool
|Removed the scoped bloodline from the game
|<code>destroy_bloodline = yes</code>
|Bloodlines
|-
|destroy_fort
!X
|province
|province
|Destroy the fort in a province.
|<code>destroy_fort = THIS</code>
|Provinces
|-
|destroy_hospital
!X
|character(?)
|province
|Destroys the hospital in the specified province
|<code>destroy_hospital = FROMFROM</code>
|Provinces
|-
|destroy_in_extra_holding
!X
|province
|clause
|Destroy a building in a special holding (hospital, fort or trade post).
|<pre>
destroy_in_extra_holding = {
   type = trade_post
   building = tr_port_1
}
</pre>
|Provinces
|-
|destroy_landed_title
!✓
|title
|title/bool
|Destroys a landed title. It can later be re-created by the player or AI, at the difference of deactivating it via <code>activate_title</code>.
Note: Count-tier titles can currently not be destroyed, even if titular and not connected to a province.
|<pre>
k_asturias = {
   destroy_landed_title = THIS
}
</pre>
|Titles
|-
|destroy_random_building
!✓
|province/holding
|bool/building
|Destroys a random building. If a building is given as the value, then that building will never be picked for destruction (even if it is the only one left).
|<pre>
random_demesne_title = {
   destroy_random_building = yes
}
</pre>
|Holdings
|-
|destroy_settlement
!✓
|title
|title
|Destroys scoped holding. Also see <code>build_holding</code>.
|<code>destroy_settlement = THIS</code>
|Holdings
|-
|destroy_tradepost
!✓
|character
|province
|
|<code>destroy_tradepost = FROMFROM</code>
|Provinces
|-
|destroy_wonder_upgrade
!✓
|wonder/upgrade
|string/bool
|Would destroy/remove the upgrade specified, or if used in an upgrade scope, remove currently scoped upgrade.
|<code>destroy_upgrade = yes/no/<upgrade name></code>
|Wonders
|-
|diplomatic_immunity
!✓
|character
|bool
|
|<code>diplomatic_immunity = yes</code>
|Characters
|-
|diploresponse_event
!X
|character
|clause
|Fires an event to scoped character. Only fired through on_actions in vanilla. See [[event modding]].
{|class="wikitable"
!Parameter !! Type !! Description
|-
|id || int || Required. Event ID to fire.  May use a [[event modding#ID and namespace|namespace]].
|-
|days || int || Optional. Base number of days to wait before firing the event. May use ''years'' instead. If not specified, event occurs instantly.
|-
|random || int || Optional. Number of days to add randomly for the event occurrence date, closed-ended (''days'' to ''days+random'').
|-
|tooltip || Key || Optional localisation key to show as tooltip.  If not specified, uses the DEFAULT_SENDEVENT_EVENTOPTION_TOOLTIP key ("Character receives an event").
|-
|}
|<pre>
diploresponse_event = {
   id = 66010
   days = 17
   tooltip = EVTTOOLTIP66010
}
</pre>
|Control
|-
|disable_council_voting_on_issue
!✓
|title
|votingTopic
|Changes council laws. Also see <code>enable_council_voting_on_issue</code>.
|<code>disable_council_voting_on_issue = grant_landed_title_interaction</code>
|Council
|-
|disable_prepared_invasion
!✓
|character
|religion
|Disable dynamically the <code>allow_viking_invasion</code> characteristic of a religion. Also see <code>enable_prepared_invasion</code>.
|<code>disable_prepared_invasion = norse_pagan</code>
|Religion
|-
|disband_event_forces
!✓
|character
|earmark
|Disbands the levies previously created with the given earmark via <code>spawn_unit = { earmark = xxx }</code>
|<code>disband_event_forces = prepared_invasion</code>
|Wars
|-
|distribute_crusade_pot
!✓
|any
|clause
|Distribute <code>amount</code> times the specified type of Crusade pot to all Crusading rulers.
|<pre>
distribute_crusade_pot = {
   type = gold/prestige/piety/artifact
   amount = 0.2
}
</pre>
|Wars
|-
|distribute_crusade_target_title
!✓
|war
|bool
|Distribute conquered titles among the (beneficiaries of) the most contributing Crusaders.
|<code>distribute_crusade_target_title = yes</code>
|Wars
|-
|divide_variable
!X
|character/province
|clause
|Divide a variable with specified value, or with another variable. Can take another scope from which to take the second variable.
|<pre>
divide_variable = {
   which = var
   value = 2
}
 
divide_variable = {
   which = var
   which = another_var
   who = FROM
}
</pre>
|Control
|-
|dynasty
!✓
|character
|id/character
|Sets the dynasty of scoped character. May need to been chained with <code>recalc_succession = yes</code>, if impacting succession. Use <code>dynasty = father_bastard</code> to generate a cadet dynasty, <code>dynasty = mother_bastard</code> to create a bastard dynasty, or <code>dynasty = none</code> to make the character Lowborn. Special values used in character creation (<code>random</code>, <code>culture</code>, and <code>actually_culture</code>) do ''not'' work here. When setting character dynasty in an event it only works inside of an <code>immediate = { }</code> block.
|<code>dynasty = FROM</code>
|Family
|-
|economy_techpoints
!✓
|character
|int
|
|<code>economy_techpoints = -50</code>
|Rulers
|-
|elective_voting_rules
!✓
|title
|voting_rules
|Applies voting rules to titles with elective succession. These are not automatically set on starting a new game, but require manual setting. Uses any voting rules defined in </code>common/succession_voting</code>.
|<code>elective_voting_rules = tanistry</code>
|Laws
|-
|enable_council_voting_on_issue
!✓
|title
|votingTopic
|Changes council laws. Also see <code>disable_council_voting_on_issue</code>.
|<code>enable_council_voting_on_issue = laws</code>
<code>enable_council_voting_on_issue = declare_war_interaction</code>
|Council
|-
|enable_prepared_invasion
!✓
|any
|religion
|Enables dynamically prepared invasions for that religion with <code>allow_viking_invasion</code> flag. Also see <code>disable_prepared_invasion</code>.
|<code>enable_prepared_invasion = norse_pagan</code>
|Wars
|-
|end_oath
!✓
|title
|title
|Ends a blood oath
|<pre>
clan_title = {
   end_oath = THIS
}
</pre>
|Clans
|-
|end_war
!✓
|war
|string
|Possible war ends: <code>invalid</code>, <code>whitepeace</code>, <code>success</code>, <code>reverse_demand</code>
|<code>end_war = invalid</code>
|Wars
|-
|embargo
!✓
|character
|character
|
|<code>embargo = FROM</code>
|Wars
|-
|excommunicate
!✓
|character
|bool
|
|<code>excommunicate = no</code>
|Religion
|-
|export_to_variable
!X
|character/title/province
|clause
|Used to create (or reset) a [[variable]] to a the value of a trigger. Can take a scope from which to take the variable
|<pre>
export_to_variable = {
   which = myStewardship
   value = stewardship
}
 
export_to_variable = {
   which = yourStewardship
   value = stewardship
   who = FROM
}
</pre>
|Control
|-
|faction
!✓
|character
|faction
|
|<code>faction = faction_lower_crown_authority</code>
|Factions
|-
|fertility
!✓
|character
|double
|
|<code>fertility = 0.4</code>
|Characters
|-
|force_host
!✓
|character
|character
|Similar to <code>move_character</code>, but it bypasses the checks and forces the character to move. Should not be used lightly.
|<code>force_host = ROOT</code>
|Characters
|-
|gain_all_occupied_titles
!✓
|character
|character
|
|<code>gain_all_occupied_titles = FROM</code>
|Titles
|-
|gain_settlements_under_title
!✓
|character
|clause
|Note: Does not work with <code>any_</code> scopes.
|<pre>
gain_settlements_under_title = {
   title = PREV
   enemy = ROOT
}
</pre>
|Titles
|-
|gain_title
!✓
|title
|character/title
|Similar to abdicate_to
|<pre>
random_demesne_title = {
   gain_title = FROM
}
</pre>
|Titles
|-
|gain_title_plus_barony_if_unlanded
!X
|title
|character
|Gives opinion bonus toward the title giver
|<code>gain_title_plus_barony_if_unlanded = ROOT</code>
|Titles
|-
|gender_succ
!✓
|title
|string
|cognatic, agnatic, true_cognatic, enatic_cognatic, or enatic
|<code>gender_succ = cognatic</code>
|Government
|-
|give_job_title
!✓
|character
|job
|
|<code>give_job_title = job_chancellor</code>
|Jobs
|-
|give_minor_title
!✓
|character
|minor_title
|
|<code>give_minor_title = title_chief_qadi</code>
|Characters
|-
|give_nickname
!✓
|character
|nickname
|Gives the character a nickname
|<code>give_nickname = nick_the_great</code>
|Characters
|-
|grant_kingdom_w_adjudication
!✓
|title
|character
|Grants scoped kingdom to target character. Gives claims to current htitleholder. Also gives a random demesne county of current titleholder if target character is unlanded.
|<pre>
random_demesne_title = {
   grant_kingdom_w_adjudication = FROM
}
</pre>
|Titles
|-
|grant_title
!✓
|character/title
|title/character/clause
|Also grants any vassal owning or below current title
|<pre>
random_claim = {
   grant_title = FROM
}
 
grant_title = {
   target = PREV
   type = invasion
}
</pre>
|Titles
|-
|grant_title_no_opinion
!X
|character/title
|title/character
|No claim for the giver and no opinion bonus from the receiver.
|
|Titles
|-
|health
!✓
|character
|double
|Adjusts character's base health
|<code>health = -1</code>
|Health
|-
|hold_election
!X
|character
|true
|For Merchant Republic titles only
|<code>hold_election = yes</code>
|Government
|-
|impregnate
!✓
|character
|character/0
|Scope gets impregnated by the target character (0 sets unknown father).
|<code>impregnate = ROOT</code>
|Marriage
|-
|impregnate_cuckoo
!✓
|character
|character/bool
|
|<code>impregnate_cuckoo = ROOT</code>
|Marriage
|-
|imprison
!✓
|character
|character/bool
|Scoped character will be imprisoned by target, or imprisoned in the correct location if used with boolean <code>yes</code>, or released from the prison with boolean <code>no</code>. Identical to the <code>prisoner</code> command, but preferred since that is also the name of a trigger.
|<code>imprison = ROOT</code>
|Characters
|-
|inherit
!✓
|character
|character
|Scoped character will inherit titles of target character.
|<code>random_courtier = { inherit = ROOT }</code>
|Titles
|-
|insert_title_history
!✓
|title
|title
|Inserts all title history from target title before earliest entry in scoped title. Can also be used in title history inside <code>effect = { }</code> clause.
|<pre>
e_hre = {
   insert_title_history = k_france
}
</pre>
|Titles
|-
|join_attacker_wars
!✓
|character
|character
|
|<code>ROOT = { join_attacker_wars = PREV }</code>
|Wars
|-
|join_defender_wars
!✓
|character
|character
|Only joins one war. Cannot be used by (feudal?) vassals to join liege's war.
|<code>FROM = { join_defender_wars = ROOT }</code>
|Wars
|-
|join_faction
!X
|character
|clause
|Joins the faction led by the faction leader, if it exists. Also supports the optional argument <code>ignore_requirements = yes</code>.
|<pre>
ROOT = {
   join_faction = {
faction = faction_claimant
faction_leader = PREV
   }
}
</pre>
|Factions
|-
|join_society
!✓
|character
|society
|Joins the specified society.
|<code>join_society = the_assassins</code>
|Societies
|-
|law_set_allow_matrilineal_marriage
!✓
|title
|bool
|(Dis)allows title holder to use matrilineal marriage. Not to be confused with <code>set_allows_matrilineal_marriage</code>, which adjusts a religion instead.
|<code>law_set_allow_matrilineal_marriage = yes</code>
|Government
|-
|leave_faction
!X
|character
|faction/all
|
|<code>leave_faction = faction_succ_seniority</code>
|Factions
|-
|leave_plot
!✓
|character
|character
|
|<code>leave_plot = FROM</code>
|Plots
|-
|leave_society
!✓
|character
|bool
|Makes the scoped character leave the society they are currently part of.
|<code>leave_society = yes</code>
|Societies
|-
|lift_embargo
!X
|character
|character
|Scoped character stops embargoing target character. Currently useless, since embargoes are instant instead of ongoing.
|<code>lift_embargo = FROM</code>
|Rulers
|-
|log
!✓
|any
|string
|Logs for debug purposes into [[Troubleshooting#Log files|game.log]]. [[Localisation#Commands|Localisation commands]] can be used normally in the string. Can even be used within event triggers and other places that normally only accept conditionals, such as if limit. Only logs if the game is started with the <code>-scriptlog</code> parameter.
|<code>log = "20: Adultery discovered between [Root.GetTitledName] and [This.GetTitledName]!"</code>
|Control
|-
|log_scopes
!X
|any
|bool
|Logs a list of all event targets set, and what each scope corresponds to into [[Troubleshooting#Log files|game.log]]. Only logs if the game is started with the <code>-scriptlog</code> parameter.
|<code>log_scopes = yes</code>
|Control
|-
|letter_event
!✓
|character
|clause
|Fires an event to scoped character. See [[event modding]].
{|class="wikitable"
!Parameter !! Type !! Description
|-
|id || int || Required. Event ID to fire.  May use a [[event modding#ID and namespace|namespace]].
|-
|days || int || Optional. Base number of days to wait before firing the event. If not specified, event occurs instantly.
|-
|random || int || Optional. Number of days to add randomly for the event occurrence date, closed-ended (''days'' to ''days+random'').
|-
|tooltip || Key || Optional localisation key to show as tooltip.  If not specified, uses the DEFAULT_SENDEVENT_EVENTOPTION_TOOLTIP key ("Character receives an event").
|-
|}
|<pre>
letter_event = {
   id = 88752
   days = 4
   tooltip = EVTTOOLTIP88751
}
</pre>
|Control
|-
|long_character_event
!✓
|character
|clause
|Fires an event to scoped character. Uses a bigger window. See [[event modding]].
{|class="wikitable"
!Parameter !! Type !! Description
|-
|id || int || Required. Event ID to fire.  May use a [[event modding#ID and namespace|namespace]].
|-
|days || int || Optional. Base number of days to wait before firing the event. May use ''years'' instead. If not specified, event occurs instantly.
|-
|random || int || Optional. Number of days to add randomly for the event occurrence date, closed-ended (''days'' to ''days+random'').
|-
|tooltip || Key || Optional localisation key to show as tooltip.  If not specified, uses the DEFAULT_SENDEVENT_EVENTOPTION_TOOLTIP key ("Character receives an event").
|-
|}
|<pre>
long_character_event = {
   id = 107008
   days = 5
   tooltip = EVTTOOLTIP107008
}
</pre>
|Control
|-
|make_capital_holding
!✓
|holding
|bool
|Makes the holding the capital of the province. Also see <code>revoke_capital_holding</code>.
|<code>make_capital_holding = yes</code>
|Holdings
|-
|make_primary_spouse
!✓
|character
|bool
|scoped character will become primary spouse
|<code>FROM = { make_primary_spouse = yes }</code>
|Marriage
|-
|make_primary_title
!✓
|title
|bool
|
|<code>k_leon = { make_primary_title = yes }</code>
|Rulers
|-
|make_tributary
!✓
|character
|clause
|Whoever the command is scoped from becomes the suzerain, WHO becomes the tributary and tributary_type determines what kind of tributary they are. For example, on a targeted_decision, to make the target the tributary of the decision taker, use the first example in the Example column. To make the decision taker the tributary, and the target the suzerain, use the second example. (The suzerain is the boss, the tributary is the servant).  If <code>tributary_type</code> is omitted, it defaults to <code>default</code>
|<pre>
FROM = {
   make_tributary = {
who = PREV
percentage = 0.40
tributary_type = imperial
   }
}
 
make_tributary = {
   who = FROM
   percentage = 0.40
   tributary_type = default
}
</pre>
|Vassalage
|-
|manpower
!✓
|character
|int
|Increase/decrease manpower
|<code>manpower = 250</code>
|Clans
|-
|military_techpoints
!✓
|character
|int
|
|<code>military_techpoints = -50</code>
|Rulers
|-
|modulo_variable
!X
|character/title/province
|clause
|Divides the variable by the specified value or variable, returning the ''remainder'' of the division. Can specify another scope from which to take the second variable.
|<pre>
set_variable = {
   which = fnord
   value = 35
}
 
modulo_variable = {
   which = fnord
   value = 11
}
#fnord is now 2
</pre>
|Control
|-
|morale
!✓
|unit/siege
|double
|Changes the morale of the unit by the amount indicated
|<code>morale = -0.2</code>
|Army
|-
|move_character
!✓
|character
|character
|scoped character will be moved to targeted characters court
|<code>FROM = { move_character = ROOT }</code>
|Characters
|-
|multiply_variable
!✓
|character/province
|clause
|Multiply variable with specified value, or variable. Can specify another scope from which to take the second variable.
|<pre>
multiply_variable = {
   which = var
   value = 2
}
 
multiply_variable = {
   which = var
   which = another_var
   who = FROM
}
</pre>
|Control
|-
|narrative_event
!✓
|character
|clause
|Fires an event to scoped character.  See [[event modding]].
{|class="wikitable"
!Parameter !! Type !! Description
|-
|id || int || Required. Event ID to fire.  May use a [[event modding#ID and namespace|namespace]].
|-
|days || int || Optional. Base number of days to wait before firing the event. If not specified, event occurs instantly.
|-
|random || int || Optional. Number of days to add randomly for the event occurrence date, closed-ended (''days'' to ''days+random'').
|-
|tooltip || Key || Optional localisation key to show as tooltip.  If not specified, uses the DEFAULT_SENDEVENT_EVENTOPTION_TOOLTIP key ("Character receives an event").
|-
|}
|<pre>
narrative_event = {
   id = 88007
   days = 2
}
</pre>
|Control
|-
|objective_succeeds
!X
|character
|character
|Deprecated, use <code>plot_succeeds</code> and <code>ambition_succeeds</code> instead.
|<code>objective_succeeds = yes</code>
|Characters
|-
|occupy_minors_of_occupied_settlements
!✓
|character
|character
|
|<code>occupy_minors_of_occupied_settlements = FROM</code>
|Characters
|-
|opinion
!✓
|character
|clause
|Adds an [[modifiers|opinion modifier]] to the scoped character towards the target character. Duration can be given in <code>months</code> or <code>years</code> (but not "days"), or omitted to use the duration specified in the opinion modifier definition. <code>origin_description</code> can be used to customize localization that appears in tooltip. See also <code>reverse_opinion</code>.
|<pre>
opinion = {
   modifier = dynastic_refused_claim
   who = ROOT
   years = 5
}
</pre>
|Opinion
|-
|participation_scaled_decadence
!✓
|character
|double
|
|
|Wars
|-
|participation_scaled_piety
!✓
|character
|double
|
|<code>participation_scaled_piety = 1000</code>
|Wars
|-
|participation_scaled_prestige
!✓
|character
|double
|
|<code>participation_scaled_prestige = 500</code>
|Wars
|-
|piety
!✓
|character
|int
|
|<code>piety = 10</code>
|Characters
|-
|plot_succeeds
!✓
|character
|bool
|Tells the plot system to end the plot and fire the <code>effect</code> block. Note that it doesn't cause a plot to succeed, it should be used when a plot has already succeeded (<code>success</code> condition block).
|<code>plot_succeeds = yes</code>
|Plots
|-
|population
!✓
|character
|int
|
|<code>population = 120000</code>
|Clans
|-
|press_claim
!✓
|title
|character
|
|<code>press_claim = ROOT</code>
|Claims
|-
|prestige
!✓
|character/title
|int
|
|<code>prestige = -20</code>
|Characters
|-
|prompt_name
!✓
|character/province/landed title/artifact/bloodline
|clause
|Lets the player rename the scoped entity.
{|class="wikitable"
!Parameter !! Type !! Description
|-
|player || character || What player should get the prompt.
|-
|type || Key || What message type to use, as defined in messagetypes.txt.
|-
|portrait || character(?) || Optional. What portrait to show on the right. If not defined, the scoped character (if scope is a character) will be used.
|-
|name_list || Key || Optional. What name list to use. Can also use <code>religion</code> for religious names of the scoped character's religion, or <code>culture</code> for cultural names. If not specified, there will be no "randomize name" button (except for characters, that'll use the standard buttons for newborns).
|}
|<pre>
prompt_name = {
   player = ROOT
   type = BAPTISM
   name_list = religion
}
</pre>
|
|-
|-
|province_capital
!✓
|title
|bool
|
|<code>b_tivoli = { province_capital = yes }</code>
|Provinces
|-
|propagate_bloodline_from
!✓
|bloodline
|character
|Adds target character and descendants to scoped bloodline
|<code>propagate_bloodline_from = FROM</code>
|Bloodlines
|-
|province_event
!✓
|province
|clause
|Fires an event to scoped province. See [[event modding]].
{|class="wikitable"
!Parameter !! Type !! Description
|-
|id || int || Required. Event ID to fire.  May use a [[event modding#ID and namespace|namespace]].
|-
|days || int || Optional. Base number of days to wait before firing the event. If not specified, event occurs instantly.
|-
|random || int || Optional. Number of days to add randomly for the event occurrence date, closed-ended (''days'' to ''days+random'').
|-
|tooltip || Key || Optional localisation key to show as tooltip.
|-
|}
|<pre>
province_event = {
   id = 8512
   days = 1
}
</pre>
|Control
|-
|[[Scripting#Random|random]]
!✓
|any
|clause
|
|<pre>
random = {
   chance = 5
   add_trait = wounded
 
   mult_modifier = {
factor = 2
health < 4
   }
}
</pre>
|Control
|-
||[[Scripting#Random list|random_list]]
!✓
|any
|clause
|
|<pre>
random_list = {
   50 = {
trigger = { }
mult_modifier = { }
# effects
   }
   50 = {
trigger = { }
mult_modifier = { }
# effects
   }
}
</pre>
|Control
|-
|rebel_defection
!✓
|title
|bool
|
|<code>rebel_defection = yes</code>
|Provinces
|-
|recalc_succession
!✓
|any
|bool
|Recalculates the succession for all titles
|<code>recalc_succession = yes</code>
|Government
|-
|reduce_disease
!✓
|province
|double
|
|<pre>
random_demesne_province = {
   reduce_disease = 0.33
}
</pre>
|Health
|-
|refill_holding_levy
!✓
|title
|bool
|
|<pre>
any_demesne_title = {
   limit = { tier = BARON }
   refill_holding_levy = yes
}
</pre>
|Holdings
|-
|religion
!✓
|character/title
/province
|religion/province/title/society/clause
|Changes the (public) religion of scoped character/province/title. Can use a clause to specify which of the scope's religion to use, defaulting to public. See also <code>unsafe_religion</code>.
|<pre>
religion = catholic
 
religion = {
   target_type = true
   target = ROOT
}
</pre>
|Religion
|-
|religion_authority
!✓
|character/province
|double/clause
|Adds a [[modifiers|religion modifier]] to the religion of scoped character/province
|<pre>
religion_authority = {
   modifier = ruler_converted_from
}
</pre>
|Religion
|-
|remove_bloodline_member
!X
|bloodline
|character
|Remove the specified character from the scoped bloodline
|
|Bloodlines
|-
|remove_building
!X
|title
|building
|
|
|Holdings
|-
|remove_character_modifier
!✓
|character
|modifier
|Removes a [[modifiers|character modifier]]
|<code>remove_character_modifier = promised_a_title</code>
|Modifiers
|-
|remove_character_modifiers
!X
|character
|clause
|Removes a number of instances of a [[modifiers|character modifier]] (usually a stackable one).
|<pre>
remove_character_modifiers = {
   modifier = promised_a_title
   amount = 2
}
</pre>
|Modifiers
|-
|remove_claim
!✓
|character/title
|title/character
|
|<pre>
remove_claim = k_papal_state
any_claim = { remove_claim = PREV } # PREV is a character
</pre>
|Claims
|-
|remove_consort
!✓
|character
|character
|Removes the consort/concubine relationship between the scoped and the given characters. Works in either scope.
|<code>consort = { remove_consort = ROOT }</code>
|Marriage
|-
|remove_dynasty_modifier
!✓
|character
|modifier
|Removes a modifier that applies to all members of the scoped character's dynasty.
|<code>remove_dynasty_modifier = ruling_in_crusader_kingdom</code>
|Characters
|-
|remove_evil_god_names
!✓
|religion
|bool
|Removes all evil god names from the scoped religion
|<code>remove_evil_god_names = yes</code>
|Religion
|-
|remove_favor
!X
|character
|character
|Target character no longer owes a favor to the scoped character. Also see <code>reverse_remove_favor</code>.
|
|
|-
|remove_friend
!✓
|character
|character
|
|<code>remove_friend = FROM</code>
|Relations
|-
|remove_from_bloodline
!X
|character
|bloodline
|Remove the scoped character from the specified bloodline. Note that the right-hand side must be a bloodline, not a bloodline type.
|
|Bloodlines
|-
|remove_guardian
!✓
|character
|character
|
|<code>remove_guardian = FROM</code>
|Relations
|-
|remove_god_names
!✓
|religion
|bool
|Removes all god names from the scoped religion
|<code>remove_god_names = yes</code>
|Religion
|-
|remove_holding_modifier
!✓
|title
|modifier
|Removes a [[modifiers|holding modifier]]
|<code>remove_holding_modifier = recently_conquered</code>
|Modifiers
|-
|remove_holding_modifiers
!X
|title
|clause
|Removes a number of instances of a [[modifiers|holding modifier]] (usually a stackable one).
|<pre>
remove_holding_modifiers = {
   modifier = recently_conquered
   amount = 2
}
</pre>
|Modifiers
|-
|remove_holy_site
!X
|title
|religion
|Removes the scoped title from being a holy site of the given religion. Warning: this lets you have less than 5 holy sites which might cause weirdness. Also, removing holy sites to a religion but not its heresies will cause their icons to show up individually on other shared holy sites instead of being hidden like normal.
|<code>c_kent = { remove_holy_site = catholic }</code>
|Religion
|-
|remove_holy_site_with_heresies
!X
|title
|religion
|Removes the scoped title from being a holy site of the given religion and its heresies. Warning: this lets you have less than 5 holy sites which might cause weirdness. Note that if a religion does not have any heresies defined (e.g. Norse), <code>remove_holy_site_with_heresies</code> does nothing. Use <code>remove_holy_site</code> instead.
|<code>c_kent = { remove_holy_site_with_heresies = catholic }</code>
|Religion
|-
|remopve_intermarry
!✓
|religion
|anything with a religion
|Forbids scoped religion to intermarry with target religion. One-way only, so apply converse intermarry separately, if desired. Also see <code>add_intermarry</code> and <code>clear_intermarry</code>.
|<pre>
remove_intermarry = catholic
remove_intermarry = jewish_group
remove_intermarry = ROOT
</pre>
|Religion
|-
|remove_lover
!✓
|character
|character
|Remove scoped character's lover
|<code>remove_lover = yes</code>
|Relations
|-
|remove_nickname
!✓
|character
|bool/nickname
|Remove character's nickname
|<code>remove_nickname = yes</code>
|Characters
|-
|remove_opinion
!✓
|character
|clause
|Removes an [[modifiers|opinion modifier]]
|<pre>
remove_opinion = {
   who = FROM
   modifier = opinion_friend
}
</pre>
|Opinion
|-
|remove_province_modifier
!✓
|province
|modifier
|Removes a [[modifiers|province modifier]]
|<code>remove_province_modifier = thieves_guild</code>
|Modifiers
|-
|remove_province_modifiers
!X
|province
|clause
|Removes a number of instances of a [[modifiers|province modifier]] (usually a stackable one).
|<pre>
remove_province_modifiers = {
   name = thieves_guild
   amount = 2
}
</pre>
|Modifiers
|-
|remove_rival
!✓
|character
|character
|
|
|Relations
|-
|remove_special_character_title
!X
|character
|key
|
|
|Characters
|-
|remove_special_interest
!✓
|character
|character
|Removes a character from the list of special interests, on the outliner, found on the right side of the screen.
|<code>remove_special_interest = ROOT</code>
|Characters
|-
|remove_spouse
!✓
|character
|string/bool/character
|remove scoped character's spouse
|<code>remove_spouse = spouse</code>
|Marriage
|-
|remove_title
!✓
|character
|job/minor_title
|
|<code>remove_title = job_chancellor</code>
|Jobs
|-
|remove_trait
!✓
|character
|trait
|Removes a trait, also see <code>add_trait</code>.
|<code>remove_trait = charitable</code>
|Traits
|-
|remove_tributary
!✓
|character
|character
|Stop a character to be tributary to its suzerain.
|<pre>
suzerain = {
   remove_tributary = PREV
}
</pre>
|Vassalage
|-
|remove_wonder_upgrade_slots
!X
|wonder/upgrade
|int
|Decreases the number of available upgrade slots
|<code>remove_upgrade_slots = 1</code>
|Wonders
|-
|repeat_event
!✓
|any
|clause
|Fires an event, without modifying the [[event chain]] (i.e <code>FROM</code>, <code>FROMFROM</code> and so on remain unchanged). Note that it will fire the specified event, and not necessarily the current event again. See [[event modding]].
'''Warning''': the event will fire for the character/province scope where it is written in, however the scopes of event chain will be weird if you do so (<code>ROOT</code> and default will be different, and <code>FROM</code> will be modified), so this is not recommended.
{|class="wikitable"
!Parameter !! Type !! Description
|-
|id || int || Required. Event ID to fire.  May use a [[event modding#ID and namespace|namespace]].
|-
|days || int || Optional. Base number of days to wait before firing the event. If not specified (or 0), event occurs instantly.
|-
|random || int || Optional. Number of days to add randomly for the event occurrence date, closed-ended (''days'' to ''days+random'').
|-
|tooltip || Key || Optional localisation key to show as tooltip.  If not specified, uses the DEFAULT_SENDEVENT_EVENTOPTION_TOOLTIP key ("Character receives an event").
|-
|}
|<pre>
repeat_event = {
   id = WoL.5002
   days = 30
}
</pre>
|Control
|-
|reset_coa
!✓
|title
|title
|
|<pre>
k_hungary = {
   reset_coa = THIS
}
</pre>
|Titles
|-
|reveal_plot
!✓
|character
|bool/character
|reveal scoped characters plot. The plot discoverer may be specified.
|<pre>
reveal_plot = yes
reveal_plot = ROOT #ROOT discovers the plot
</pre>
|Plots
|-
|reveal_plot_w_message
!✓
|character
|bool
|reveal scoped characters plot
|<code>reveal_plot_w_message = yes</code>
|Plots
|-
|reverse_add_favor
!✓
|character
|character
|Makes scoped character owe a favor to another character. Also see <code>add_favor</code>.
|<code>reverse_add_favor = ROOT</code>
|
|-
|reverse_back_plot
!✓
|character
|character
|
|<code>ROOT = { reverse_back_plot = PREV }</code>
|Plots
|-
|reverse_banish
!✓
|character
|character
|
|<code>random_realm_lord = { reverse_banish = FROM }</code>
|Characters
|-
|reverse_culture
!✓
|character/province
|character/title/province
|Change the target's culture to the one of current scope
|<code>reverse_culture = PREV</code>
|Culture
|-
|reverse_imprison
!✓
|character
|character
|Target character will be imprisoned by the scoped character
|<code>FROM = { reverse_imprison = ROOT }</code>
|Characters
|-
|reverse_leave_plot
!✓
|character
|character
|
|<code>reverse_leave_plot = FROM</code>
|Plots
|-
|reverse_opinion
!✓
|character
|clause
|Adds an [[modifiers|opinion modifier]] to the target character towards scoped character.
|<pre>
reverse_opinion = {
   modifier = opinion_dislike
   who = FROM
   years = 5
}
</pre>
|Opinion
|-
|reverse_religion
!✓
|character/province
|character/title/province/society
/province
|
|<code>reverse_religion = PREV</code>
|Religion
|-
|reverse_remove_favor
!✓
|character
|character
|Scoped character no longer owes a favor to the target character. Also see <code>remove_favor</code>.
|<code>reverse_remove_favor = event_target:pardon_target</code>
|
|-
|reverse_remove_opinion
!✓
|character
|clause
|Removes an [[modifiers|opinion modifier]] of right side of who argument towards scoped character.
|<pre>
reverse_remove_opinion = {
   who = ROOT
   modifier = opinion_friend
}
</pre>
|Opinion
|-
|reverse_set_opinion_levy_raised_days
!✓
|character
|clause
|
|<pre>
reverse_set_opinion_levy_raised_days = {
   who = ROOT
   days = 0
}
</pre>
|Opinion
|-
|reverse_unsafe_war
!✓
|character
|clause
|Works like the <code>reverse_war</code> command, but without ensuring the CB can be used.
|<pre>
reverse_unsafe_war = {
   target = event_target:claimant
   casus_belli = other_claim
   thirdparty = ROOT
}
</pre>
|Wars
|-
|reverse_war
!✓
|character/title
|clause
|Initiate a war, with current character as defender. <code>infamy</code> can be used to override the threat value (for instance <code>infamy = 0</code>).
|<pre>
random_claim = {
   reverse_war = {
target = FROM
casus_belli = other_claim
thirdparty = ROOT
   }
}
</pre>
|Wars
|-
|revoke_capital_holding
!✓
|holding
|bool
|Makes an empty holding slot the county capital. Use on a capital holding. Also see <code>make_capital_holding</code>
|<code>revoke_capital_holding = yes</code>
|Holdings
|-
|revoke_law
!✓
|title
|law
|
|<code>revoke_law = investiture_law_1</code>
|Government
|-
|save_event_target_as
!✓
|any
|var
|Saves a scope into a variable, to be re-used later in an event chain
|<pre>
father_of_unborn = {
   save_event_target_as = target_adulterer
}
</pre>
|Control
|-
|save_global_event_target_as
!X
|any
|var
|Saves a scope into a global variable, to be re-used later
|
|Control
|-
|save_persistent_event_target
!✓
|province/character/title/<br/>artifact/society/offmap
|clause
|Saves a scope into a persistent event target in the current scope to be reused later. <code>name</code> is the name of the event target, <code>scope</code> is the scope to save. Relative scoping works.
|This example saves the owner of the county of London in it:
<pre>
c_london = {
   save_persistent_event_target = {
name = london_owner
scope = owner
   }
}
</pre>
|Control
|-
|save_succession
!✓
|any
|title
|Saves a title's succession law, to be restored later using <code>restore_succession</code>
|<pre>
save_succession = k_france
save_succession = primary_title # in character scope
</pre>
|Control
|-
|scaled_piety
!X
|character
|double/clause
|Modifies piety by percent (1.0 = 100%) of annual piety increase. <code>min</code> increases final cost to <code>min</code> if result would be lower. <code>max</code> reduces the final cost to <code>max</code> if result would be lower.
|<pre>
scaled_piety = -0.15
 
scaled_piety = {
   value = 0.5
   min = 10
}
</pre>
|Characters
|-
|scaled_prestige
!✓
|character
|double/clause
|Modifies prestige by percent (1.0 = 100%) of annual prestige increase. <code>min</code> increases final cost to <code>min</code> if result would be lower. <code>max</code> reduces the final cost to <code>max</code> if result would be lower.
|<pre>
scaled_prestige = -0.15
 
scaled_prestige = {
   value = 0.5
   min = 10
   max = 200
}
</pre>
|Characters
|-
|scaled_wealth
!✓
|character
|double/clause
|Modifies wealth by percent (1.0 = 100%) of annual income. <code>min</code> increases final cost to <code>min</code> if result would be lower. <code>max</code> reduces the final cost to <code>max</code> if result would be lower.
|<pre>
scaled_wealth = -0.15
 
scaled_wealth = {
   value = 0.5
   min = 10
   max = 200
}
</pre>
|Money
|-
|seize_fort
!✓
|title/province
|character
|
|<code>any_neighbor_province = { seize_fort = ROOT }</code>
|Rulers
|-
|seize_trade_post
!✓
|title/province
|character
|
|<code>any_neighbor_province = { seize_trade_post = ROOT }</code>
|Rulers
|-
|send_assassin
!✓
|character
|character
|
|<code>send_assassin = FROMFROM</code>
|Plots
|-
|set_ai_aggression
!✓
|religion
|double
|Sets AI aggression for scoped religion (default: 1)
|<code>set_ai_aggression = 1.5</code>
|Religion
|-
|set_allow_free_duchy_revokation
!✓
|title
|bool
|Crown laws
|<code>set_allow_free_duchy_revokation = yes</code>
|Government
|-
|set_allow_free_infidel_revokation
!✓
|title
|bool
|Crown laws
|<code>set_allow_free_infidel_revokation = yes</code>
|Government
|-
|set_allow_free_revokation
!✓
|title
|bool
|Crown laws
|<code>set_allow_free_revokation = yes</code>
|Government
|-
|set_allow_title_revokation
!✓
|title
|bool
|Crown laws
|
|Government
|-
|set_allow_feminism
!✓
|title
|bool
|
|<code>set_allow_feminism = yes</code>
|Government
|-
|set_allow_free_vice_royalty_revokation
!✓
|title
|bool
|Crown laws
|
|Government
|-
|set_allow_gender_laws
!✓
|title
|bool
|
|<code>set_allow_gender_laws = yes</code>
|Government
|-
|set_allow_looting
!✓
|religion
|bool
|Sets whether or not characters of this religion can raid/loot
|<code>set_allow_looting = yes</code>
|Religion
|-
|set_allow_matrilineal_marriage
!✓
|religion
|bool
|Sets whether or not characters of this religion can marry matrilineally. Not to be confused with <code>law_set_allow_matrilineal_marriage</code>, which determines that on a title level.
|<code>set_allow_matrilineal_marriage = yes</code>
|Religion
|-
|set_allow_rivermovement
!✓
|religion
|bool
|Sets whether or not characters of this religion can move fleets onto major rivers
|<code>set_allow_rivermovement = yes</code>
|Religion
|-
|set_allow_vice_royalties
!✓
|title
|bool/tier
|Crown laws
|<pre>
set_allow_vice_royalties = DUKE
set_allow_vice_royalties = no
</pre>
|Government
|-
|set_appoint_generals
!✓
|title
|bool
|Crown laws
|
|Government
|-
|set_appoint_regents
!✓
|title
|bool
|Crown laws
|
|Government
|-
|set_artifact_flag
!✓
|artifact
|flag
|
|<code>set_artifact_flag = stolen</code>
|Control
|-
|set_artifact_original_owner
!X
|artifact
|character
|Sets the original owner of the artifact
|<code>set_artifact_original_owner = ROOT</code>
|Artifact
|-
|set_autocephaly
!✓
|religion
|bool
|Sets whether or not kingdoms and empires of this religion can have autocephalous religious heads. Implied by <code>set_pentarchy = yes</code>.
|<code>set_autocephaly = yes</code>
|Religion
|-
|set_bloodline_flag
!X
|bloodline
|flag
|Adds a script flag to the scoped bloodline
|
|Bloodlines
|-
|set_branch_tag
!X
|religion
|string
|Sets which special traits to use if religion has no religious head. Branch tag can be defined in [[Traits]].
|<code>set_branch_tag = pagan</code>
|Religion
|-
|set_bs_marriage
!✓
|religion
|bool
|Sets whether or not brother-sister marriage is allowed for characters of the scoped religion
|<code>set_bs_marriage = yes</code>
|Religion
|-
|set_cousin_marriage
!✓
|religion
|bool
|Sets whether or not cousin marriage is allowed for characters of the scoped religion
|<code>set_cousin_marriage = yes</code>
|Religion
|-
|set_can_call_crusade
!✓
|religion
|bool
|Sets whether or not a theocratic or temporal head of religion can call crusades.
|<code>set_can_call_crusade = yes</code>
|Religion
|-
|set_can_excommunicate
!✓
|religion
|bool
|Sets whether or not a theocratic head of religion can excommunicate characters of the same religion
|<code>set_can_excommunicate = yes</code>
|Religion
|-
|set_can_grant_claim
!✓
|religion
|bool
|Sets whether or not a theocratic head of religion can grant title claims to characters of the same religion
|<code>set_can_grant_claim = yes</code>
|Religion
|-
|set_can_grant_divorce
!✓
|religion
|bool
|Sets whether or not a theocratic head of religion can grant divorces to characters of the same religion
|<code>set_can_grant_divorce = yes</code>
|Religion
|-
|set_can_grant_invasion_cb
!✓
|religion
|bool/casus belli
|Sets whether or not a theocratic head of religion can grant an invasion CB on characters of the same religion
|<pre>
set_can_grant_invasion_cb = yes    # religion feature
set_can_grant_invasion_cb = invasion # game script
</pre>
|Religion
|-
|set_can_have_antipopes
!✓
|religion
|bool
|Sets whether or not a religion can have anti-religious heads set up. Incompatible with <code>set_pentarchy = yes</code>.
|<code>set_can_have_antipopes = yes</code>
|Religion
|-
|set_can_retire_to_monastery
!✓
|religion
|bool
|Enables or disables diplomatic interaction to have characters take the vows for characters of scoped religion.
|<code>set_can_retire_to_monastery = yes</code>
|Religion
|-
|set_can_toggle_looting
!✓
|unit
|bool
|
|
|Units
|-
|set_character_flag
!✓
|character
|flag
|
|<code>set_character_flag = decadence_drunkard</code>
|Control
|-
|set_character_modifier
!✓
|religion
|clause
|Sets character modifiers for all characters of this religion
|<pre>
set_character_modifier = { }
 
set_character_modifier = {
   learning = 2
   key = MONASTIC_ATTR_RELIGION
}
</pre>
|Religion
|-
|set_coa
!✓
|title
|title
|Set the coats of arms (flag) of a title to that of another title. An otherwise unused "dummy" title in ''[[Title modding|landed_titles]]'' can be used to define the coats of arms.
|<pre>
e_hre = {
   set_coa = e_byzantium
}
</pre>
|Titles
|-
|set_convert_other_group
!✓
|religion
|int
|Sets AI behavior for converting outside their own religion group.<br/>
0 - never try to convert<br/>
1 - try to convert if ai_zeal is high<br/>
2 - always try to convert<br/>
|<code>set_convert_other_group = 2</code>
|Religion
|-
|set_convert_same_group
!✓
|religion
|int
|Sets AI behavior for converting within their own religion group.<br/>
0 - never try to convert<br/>
1 - try to convert if ai_zeal is high<br/>
2 - always try to convert<br/>
|<code>set_convert_same_group = 2</code>
|Religion
|-
|set_council_discontent
!✓
|character
|bool
|Makes currently scoped character's council discontent for MONTHS_OF_DISCONTENT_COUNCIL months (vanilla value is 24)
|<code>set_council_discontent = yes</code>
|Titles
|-
|set_creation_date
!✓
|artifact
|date
|Changes an artifact's creation date
|<pre>
set_creation_date = 1234.5.6
set_creation_date = -1 #Unknown creation date
</pre>
|Titles
|-
|set_crusader_king
!✓
|any
|character
|Sets recipient of new-style Crusade target title
|<code>set_crusader_king = THIS</code>
|Wars
|-
|set_defacto_liege
!✓
|character/title
|character/title
|Sets the liege of a character. Can be used to make a character become independent via <code>set_defacto_liege = THIS</code>
|<code>set_defacto_liege = FROM</code>
|Vassalage
|-
|set_defacto_vassal
!✓
|character
|character/title
|
|<code>holder_scope = { set_defacto_vassal = PREVPREV }</code>
|Vassalage
|-
|set_defensive_attrition
!✓
|religion
|bool
|Sets whether or not provinces of this religion apply defensive attrition to armies of other religions when hostile.
|<code>set_defensive_attrition = yes</code>
|Religion
|-
|set_description
!✓
|artifact/bloodline
/wonder/upgrade
|string
|Changes the description of the scoped to artifact or bloodline to the given string/localisation key. All custom localisation is resolved when set, so the description will not change once set. Can be reset by setting it to the blank string <code>""</code>.
|<code>set_description = how_to_carry_a_bow_desc</code>
|Artifacts/Bloodlines
|-
|set_discovered_society
!X
|character
|bool/society
|Sets the character to be "revealed" to be part of the specified society, or otherwise their secret society if no society is specified.
|<pre>
set_discovered_society = yes
set_discovered_society = the_assassins
</pre>
|Societies
|-
|set_divine_blood
!✓
|religion
|bool
|Enables/disables divine blood/marriage mechanism for scoped religion
|<code>set_divine_blood = yes</code>
|Religion
|-
|set_dynasty_flag
!✓
|character
|flag
|
|<code>set_dynasty_flag = the_victims</code>
|Control
|-
|set_dynasty_name
!X
|character
|localisation key
|
|<code>set_dynasty_name = "[Root.GetOnlyDynastyName]"</code>
|Control
|-
|set_father
!✓
|character
|character/0
|Change (or remove) the father of a character.
|<pre>
set_father = PREV
set_father = 0
</pre>
|Family
|-
|set_female_temple_holders
!✓
|religion
|bool
|Sets whether or not priests of this religion can be female
|<code>set_female_temple_holders = yes</code>
|Religion
|-
|set_feminist
!✓
|religion
|bool
|Sets whether or not female rulers and rulers with a female heir of this religion suffer negative vassal opinion
|<code>set_feminist = yes</code>
|Religion
|-
|set_flag
!✓
|any with flags
|flag
|Sets a flag in the current scope if it can store flags. Works for any such scope, unlike the more specific <code>set_<scope>_flag</code> commands.
|
|Control
|-
|set_flank_tactic
!X
|flank
|tactic
|Totally ignores the triggers or phases. If the tactic has a phase change part then that part will be acknowledged however.<ref>[[forum:774248/page-32#post-22182285]]</ref>
|
|Units
|-
|set_focus
!✓
|character
|clause
|Sets the focus of a character (bypasses 5 year cooldown period)
|<code>set_focus = focus_war</code>
|Character
|-
|set_gender
!X
|character
|male/female/opposite
|Xets the scoped character's gender to be male or female or the opposite of what they currently are. Warning: messing with a character's gender may have unintended side effects so use with caution.
|<code>set_gender = opposite</code>
|Characters
|-
|set_global_flag
!✓
|any
|flag
|Creates a global [[flag]].
|<code>set_global_flag = west_francia_renamed</code>
|Control
|-
|set_government_type
!✓
|character
|government
|Change the government type of a character. As of 2.8, forces immediate government validation, ensuring the character can enact the target government type.
|<code>set_government_type = feudal_government</code>
|Government
|-
|set_graphical_culture
!X
|character
|culture/character
/province
|Sets the ethnicity of character, based on the default graphical_culture of a culture, or of the culture of another character or province.
Note: it changes the face of the character, but not the clothing.
|<pre>
# Note: will actually set norsegfx
set_graphical_culture = norse
</pre>
|Characters
|-
|set_guardian
!✓
|character
|character
|
|<code>set_guardian = ROOT</code>
|Guardianship
|-
|set_hard_to_convert
!✓
|religion
|bool
|Sets whether or not (provinces of) the scoped religion are hard to convert
|<code>set_hard_to_convert = yes</code>
|Religion
|-
|set_heir_designation
!✓
|religion
|bool
|Sets whether or not characters of this religion can designate their heir. Requires Rajas of India DLC to function.
|<code>set_heir_designation = yes</code>
|Religion
|-
|set_holy_site
!X
|title
|religion/title/province
|Sets the scoped title to be a holy site of the given religion. Warning: this lets you have more than 5 holy sites which might cause weirdness. Also, adding holy sites to a religion but not its heresies will cause their icons to show up individually on other shared holy sites instead of being hidden like normal. If target is a title, uses religion of titleholder. If target is a province, uses province religion.
|<code>c_london = { set_holy_site = catholic }</code>
|Religion
|-
|set_holy_site_with_heresies
!X
|title
|religion
|Sets the scoped title to be a holy site of the given religion and its heresies. Warning: this lets you have more than 5 holy sites which might cause weirdness.
|<code>c_london = { set_holy_site_with_heresies = catholic }</code>
|Religion
|-
|set_high_god_name
!✓
|religion
|key
|Sets the religion's high god's name to the given key.
|<code>set_high_god_name = GOD_QUETZALCOATL</code>
|Religion
|-
|set_ignores_defensive_attrition
!✓
|religion
|bool
|Sets whether or not armies of this religion are affected by defensive attrition of unreformed pagans
|<code>set_ignores_defensive_attrition = yes</code>
|Religion
|-
|set_immune_to_pruning
!X
|character
|bool
|Sets a character as important.  They will neither be removed from AI courts nor be deleted from the saved game to reduce file size. WARNING: This cannot be reversed.
|<code>set_immune_to_pruning = yes</code>
|Characters
|-
|set_interested_society
!✓
|character
|society
|Make a character interested in joining the specified society.
|<code>set_interested_society = the_assassins</code>
|Societies
|-
|set_investiture
!✓
|title
|string
|Crown laws
|<pre>
set_investiture = head
set_investiture = any
</pre>
|Government
|-
|set_jizya_tax
!✓
|religion
|bool
|Enables or disables infidel tax on holdings in provinces of a different religion group
|<code>set_piety_loss_for_attacking_same_religion = yes</code>
|Religion
|-
|set_job_action
!✓
|character
|clause
|Update the current job of a councillor.
|
<pre>
job_spiritual = {
   set_job_action = {
action = action_inquisition
where = event_target:event_ze_5000_province
   }
}
</pre>
|
|-
|set_looter_hostility_days
!✓
|character
|clause
|Sets characters hostile, without requiring a war or looting
|<pre>
set_looter_hostility_days = {
   who = FROM
   days = 30
}
</pre>
|Characters
|-
|set_looting
!✓
|unit
|bool
|Used with <code>set_can_toggle_looting</code>
|<code>set_looting = yes</code>
|Units
|-
|set_male_temple_holders
!✓
|religion
|bool
|Sets whether or not priests of this religion can be male
|<code>set_male_temple_holders = yes</code>
|Religion
|-
|set_max_consorts
!✓
|religion
|int
|Sets how many consorts man and women of this religion can have.
|<code>set_max_consorts = 4</code>
|Religion
|-
|set_max_wives
!✓
|religion
|int
|Sets how many wives men of this religion can have. Does not apply to women.
|<code>set_max_wives = 3</code>
|Religion
|-
|set_men_can_take_consorts
!✓
|religion
|bool
|Sets the religion's <code>men_can_take_consorts</code> attribute to the given value.
|<code>norse_pagan = { set_men_can_take_consorts = no }</code>
|Religion
|-
|set_mercenary_maintenance_modifier
!✓
|title
|modifier
|
|<code>set_mercenary_maintenance_modifier = maintaining_mercenary_band_2</code>
|
|-
|set_mother
!✓
|character
|character
|
|<code>set_mother = PREV</code>
|Family
|-
|set_name
!✓
|character/title
/province/artifact
/bloodline/wonder/upgrade
|string
|Override name of character or title. Using set_name = "" resets the original name. You can also use a scope of the same type as the thing being renamed. Note that for artifacts this will use the name *after* processing localisation, so all custom localisation will become static upon doing so. Custom localisation is resolved when using the <code>set_name</code> effect, so something like <code>set_name = "[This.Religion.GetRandomEvilGodName]"</code> will work.
|<pre>
b_kolbatz = {
   set_name = "Jomsborg"
}
 
spouse = {
   set_name = liege
}
</pre>
|Control
|-
|set_official_crusade_recipient
!✓
|character
|character/none
|Sets the official new-style Crusade recipient. Also see <code>official_crusade_recipient</code> scope.
|<pre>
set_official_crusade_recipient = event_target:fourth_crusade_byzantine_refugee
set_official_crusade_recipient = none
</pre>
|Offmap
|-
|set_offmap_currency
!✓
|character
|clause
|Sets the scoped character's total amount of offmap currency for the specified <code>offmap</code> power to the <code>value</code>.
|<pre>
set_offmap_currency = {
   offmap = offmap_china
   value = 250
}
</pre>
|Offmap
|-
|set_offmap_dislike
!X
|?
|clause
|Sets the dislike of the specified <code>offmap</code> power to the specified <code>type</code>.  May use <code>random</code> to switch to a random dislike.
|<pre>
set_offmap_dislike = {
   offmap = offmap_china
   type = random
}
</pre>
|Offmap
|-
|set_offmap_flag
!✓
|offmap
|flag
|Sets a flag in the scoped offmap
|<code>set_offmap_flag = no_war_news</code>
|Offmap
|-
|set_offmap_holder
!✓
|offmap
|character
|Sets the scoped offmap power's current ruler to the target scope.
|<code>set_offmap_holder = event_target:invasion_of_china_claimant</code>
|Offmap
|-
|set_offmap_like
!X
|?
|clause
|Sets the like of the specified <code>offmap</code> power to the specified <code>type</code>.  May use <code>random</code> to switch to a random like.
|<pre>
set_offmap_like = {
   offmap = offmap_china
   type = likes_arabs
}
</pre>
|Offmap
|-
|set_offmap_name
!✓
|offmap
|string
|Sets the scoped offmap power's name to the localisation key corresponding to the string.
|<code>set_offmap_name = tang_china</code>
|Offmap
|-
|set_offmap_tmp_flag
!✓
|offmap
|string
|Adds the specified script flag to the scoped offmap power (check with has_offmap_tmp_flag or has_offmap_flag).
|<code>set_offmap_tmp_flag = WP_is_not_on_map</code>
|Offmap
|-
|set_opinion_levy_raised_days
!✓
|character
|clause
|
|<pre>
set_opinion_levy_raised_days = {
   who = ROOT
   days = 0
}
</pre>
|Opinion
|-
|set_original_owner
!✓
|artifact
|character
|Changes the original owner of an artifact.
|<code>set_original_owner = FROM</code>
|Artifact
|-
|set_pacifist
!✓
|religion
|bool
|Sets religion pacifist attribute
|<code>set_pacifist = yes</code>
|Religion
|-
|set_parent_religion
!✓
|any
|clause
|Religion becomes an heresy of new parent religion
|<pre>
set_parent_religion = {
   religion = catholic
   parent = orthodox
}
</pre>
|Religion
|-
|set_pc_marriage
!✓
|religion
|bool
|Sets whether or not parent-child marriage is allowed for characters of the scoped religion
|<code>set_pc_marriage = yes</code>
|Religion
|-
|set_peace_piety_gain
!✓
|religion
|double
|Sets monthly piety gain for characters of this religion while at peace
|<code>set_peace_piety_gain = 1</code>
|Religion
|-
|set_peace_prestige_loss
!✓
|religion
|bool
|Enables/disables monthly prestige loss for characters of this religion while at peace for too long
|<code>set_peace_prestige_loss = no</code>
|Religion
|-
|set_pentarch_title
!X
|title
|title/none
|The scoped title becomes under the authority of the specified Pentarch seat
|<pre>
k_aragon = {
   set_pentarch_title = b_jerusalem
}
</pre>
|Religion
|-
|set_pentarchy
!✓
|religion
|bool
|Sets whether or not realms of this religion can follow pentarch seats. Also see <code>set_pentarch_title</code>. Incompatible with <code>set_can_have_antipopes = yes</code>.
|<code>set_pentarchy = yes</code>
|Religion
|-
|set_picture
!✓
|artifact
|gfx
|Sets a different picture to be shown for the scoped artifact
|<code>set_picture = GFX_sword_golden<</code>
|Artifacts
|-
|set_piety_loss_for_attacking_same_religion
!✓
|religion
|bool
|Enables or disables monthly piety loss when characters of scoped religion are at war with same religion characters.
|<code>set_piety_loss_for_attacking_same_religion = yes</code>
|Religion
|-
|set_player_character
!✓
|character
|character
|The player controlling the scoped character starts controlling the given character instead. Does not enforce remaining within the same dynasty. '''WARNING''': It's possible to cause game overs with this, so use with care.
|<code>set_player_character = event_target:new_crusader_king</code>
|Control
|-
|set_policy
!✓
|offmap
|id
|Sets the scoped offmap power's current policy to the specified ID (corresponding to a policy in /common/offmap_powers/policies).
|<code>set_policy = china_open</code>
|Offmap
|-
|set_preferred_capital
!X
|title
|province
|Sets the de jure capital of the scoped title to the specified province/title. If the right-hand side is a barony or county title, sets capital to the corresponding province, for higher tier titles, uses the de jure capital province of that title. Works for both dynamic and static titles since patch 2.8. Also takes relative scopes (FROM, ROOT, PREV etc.) and saved event targets.
|<code>set_preferred_capital = 35/b_oudenaarde/c_brugge/d_normandy/k_brittany/e_italy</code>
|Government
|-
|set_priests_can_inherit
!✓
|religion
|bool
|Sets whether or not priests of this religion can inherit landed titles
|<code>set_priests_can_inherit = yes</code>
|Religion
|-
|set_priests_can_marry
!✓
|religion
|bool
|Sets whether or not priests of this religion can marry
|<code>set_priests_can_marry = yes</code>
|Religion
|-
|set_protected_inheritance
!✓
|title
|bool
|Crown laws: avoid titles leaving the realm upon inheritance
|<code>set_protected_inheritance = yes</code>
|Government
|-
|set_province_flag
!✓
|province
|flag
|
|<code>set_province_flag = home_of_jeanne_darc</code>
|Control
|-
|set_psc_marriage
!✓
|religion
|bool
|Sets whether or not uncle-niece and aunt-nephew marriages are allowed for characters of the scoped religion
|<code>set_psc_marriage = yes</code>
|Religion
|-
|set_quest
!✓
|character
|quest_id/clause
|Creates a quest for the scoped character. Society can be optionally specified.
|<code>set_quest = monastic_orders_temple_construction</code>
|Societies
|-
|set_quest_target
!✓
|character/title/province
|clause
|Creates a quest targeting the current scope or changes the target of an already exist target to the scope.
{|class="wikitable"
!Parameter !! Type !! Description
|-
|id || quest_id || The name of the quest. Dynamic and can be anything (though requires localisation).
|-
|holder || character || The character who receives the quest, or who has it already.
|-
|society || society || Optional, defaults to the character's society. If the society is not set, and the character is not part of a society, this will send an error and nothing will happen.
|-
|}
|<pre>
set_quest_target = {
   id = quest_the_assassins_protege
   holder = FROM
   society = the_assassins
}
</pre>
|Societies
|-
|set_raised_vassal_opinion_loss
!✓
|religion
|bool
|Sets whether or not characters suffer vassal opinion when raising vassal troops
|<code>set_raised_vassal_opinion_loss = yes</code>
|Religion
|-
|set_real_father
!✓
|character
|character
|When a child is denounced (no official father), <code>real_father</code> is used to keep track of it.
|<code>set_real_father = FROM</code>
|Family
|-
|set_reincarnation
!✓
|character
|character/0
|
|<pre>
father_even_if_dead = {
   ROOT = {
set_reincarnation = THIS
   }
}
</pre>
|Family
|-
|set_rel_head_defense
!X
|religion
|bool
|Sets the religion's <code>rel_head_defense</code> attribute to the given value.
|<code>catholic = { set_rel_head_defense = no }</code>
|Religion
|-
|set_religion_head
!✓
|religion
|bool
|Sets the title that controls the religion. Use <code>none</code> to set the religion as not having any controller. If a title already controls the religion when this is called, it will cease to control the religion.
|<code>set_religion_head = k_norway/ROOT/none</code>
|Religion
|-
|set_seafaring
!✓
|religion
|bool
|Sets whether or not AI will prefer raiding coastal provinces
|<code>set_seafaring = yes</code>
|Religion
|-
|set_secret_religion
!✓
|character
|religion/province/title/society/clause
|Sets the secret religion of the character to the right-hand-side (defaulting to secret religion, if applicable). Can be expanded to specify what visibility to use.
|<pre>
set_secret_religion = taoist
 
set_secret_religion = {
   target_type = public
   target = FROM
}
</pre>
|Religion
|-
|set_short_name
!✓
|title
|bool
|Sets the title's <code>short_name</code> parameter to the given value.
|<code>set_short_name = yes</code>
|Titles
|-
|set_short_reign_opinion_year_mult
!✓
|religion
|int
|Sets short reign opinion malus multiplier.
|<pre>
set_short_reign_opinion_year_mult = 2.5
set_short_reign_opinion_year_mult = 0
set_short_reign_opinion_year_mult = -1000
</pre>
|Religion
|-
|set_siphon_factor_to
!✓
|title
|double
|Sets how much income the dynamic mercenary title pays to its creator
|<code>set_siphon_factor_to = 0.10</code>
|Titles
|-
|set_society_grandmaster
!✓
|character
|bool
|Set or unset the scoped character as the grandmaster of their society.
|<code>set_society_grandmaster = yes</code>
|Societies
|-
|set_society_progress
!✓
|society
|float
|Set the society's current progress to a given value.
|<code>set_society_progress = 0</code>
|Societies
|-
|set_special_character_title
!✓
|character
|key
|
|<code>set_special_character_title = GENGHIS_KHAN</code>
|Characters
|-
|set_status
!✓
|offmap
|id
|Sets the scoped offmap power's current status modifier to the specified ID (corresponding to a modifier in /common/offmap_powers/statuses).
|<code>set_status = china_stable</code>
|Offmap
|-
|set_the_kings_full_peace
!✓
|title
|bool
|Crown laws: allow/disallow vassals to wage war
|<code>set_the_kings_full_peace = yes</code>
|Government
|-
|set_the_kings_peace
!✓
|title
|bool
|Crown laws: allow/disallow vassals to wage war between them
|<code>set_the_kings_peace = no</code>
|Government
|-
|set_title_flag
!✓
|title
|flag
|Creates a [[flag]] on a title
|<code>set_title_flag = temporary_landless_title</code>
|Control
|-
|set_title_adventurer
!✓
|title
|clause
|set/unset title as being an adventurer title.
|<pre>
set_title_adventurer = {
   title = THIS
   status = yes
}
</pre>
|Titles
|-
|set_title_landless
!✓
|title
|clause
|set/unset title as being a temporary title.
|<pre>
set_title_landless = {
   title = THIS
   status = yes
}
</pre>
|Titles
|-
|set_title_nomad
!✓
|title
|clause
|set/unset title as being a nomad title.
|<pre>
set_title_nomad = {
   title = THIS
   status = no
}
</pre>
|Titles
|-
|set_trade_route_base_value
!X
|holding title?
|double?
|
|
|Holdings
|-
|set_trade_route_value_multiplier
!X
|holding title?
|double?
|
|
|Holdings
|-
|set_tribal_vassal_levy_control
!✓
|title
|bool
|Whether liege can directly raise tribal vassal levies
|<code>set_tribal_vassal_levy_control = yes</code>
|Laws
|-
|set_tribal_vassal_tax_income
!✓
|title
|bool
|Whether tribal vassals pay taxes to their liege
|<code>set_tribal_vassal_tax_income = yes</code>
|Laws
|-
|set_truce
!✓
|character
|clause
|Gives a temporary truce to the scoped character towards the target character
|<pre>
set_truce = {
   who = FROM
   days/months/years = 5
}
</pre>
|Wars
|-
|set_unit_modifier
!✓
|religion
|clause
|Sets modifiers for all units owned by characters of scoped religion
|<pre>
set_unit_modifier = { }
 
set_unit_modifier = {
   garrison_size = 0.3
   levy_size = 0.2
 
   key = DEF_RELIGION
}
</pre>
|Religion
|-
|set_unit_home_modifier
!✓
|religion
|clause
|Sets modifiers for all units in owned by characters of scoped religion, when in province of matching religion
|<pre>
set_unit_home_modifier = { }
 
set_unit_home_modifier = {
   land_morale = 0.8
   light_infantry_defensive = 0.8
   heavy_infantry_defensive = 0.8
   pikemen_defensive = 0.8
   light_cavalry_defensive = 0.8
   knights_defensive = 0.8
   archers_defensive = 0.8
   horse_archers_defensive = 0.8
   camel_cavalry_defensive = 0.8
   war_elephants_defensive = 0.8
 
   garrison_size = 0.4
 
   key = DEF_RELIGION_HOME_TERRITORY
}
</pre>
|Religion
|-
|set_uses_decadence
!✓
|religion
|double
|Sets whether or not religion uses decadence mechanic
|<code>set_uses_decadence = yes</code>
|Religion
|-
|set_variable
!✓
|character/province
|clause
|Used to create (or reset) a [[variable]] to a value, or to the value of another variable. Can specify another another scope from which to take the second variable.
|<pre>
set_variable = {
   which = bob_saget
   value = 1
}
 
set_variable = {
   which = bob_saget
   which = another_var
   who = FROM
}
</pre>
|Control
|-
|set_women_can_take_consorts
!✓
|religion
|bool
|Sets the religion's <code>women_can_take_consorts</code> attribute to the given value.
|<code>norse_pagan = { set_women_can_take_consorts = yes }</code>
|Religion
|-
|set_wonder_damaged
!✓
|wonder
|bool
|Damages a wonder
|<code>set_wonder_damaged = yes</code>
|Wonders
|-
|set_wonder_flag
!✓
|wonder
|string
|Adds a script flag to the scoped wonder.
|<code>set_wonder_flag = religious_wonder</code>
|Wonders
|-
|set_wonder_upgrade_flag
!✓
|upgrade
|string
|Adds a script flag to the scoped upgrade.
|<code>set_upgrade_flag = broken_upgrade</code>
|Wonders
|-
|society_quest_event
!✓
|character
|clause
|Fires a quest event to scoped character. See [[event modding]].
{|class="wikitable"
!Parameter !! Type !! Description
|-
|id || int || Required. Event ID to fire.  May use a [[event modding#ID and namespace|namespace]].
|-
|days || int || Optional. Base number of days to wait before firing the event. May use ''years'' instead. If not specified, event occurs instantly.
|-
|random || int || Optional. Number of days to add randomly for the event occurrence date, closed-ended (''days'' to ''days+random'').
|-
|tooltip || Key || Optional localisation key to show as tooltip.  If not specified, uses the DEFAULT_SENDEVENT_EVENTOPTION_TOOLTIP key ("Character receives an event").
|-
|}
|<pre>
society_quest_event = {
   id = MNM.3398
   days = 7
   random = 7
}
</pre>
|Control
|-
|society_rank_down
!X
|character
|int/clause
|Rank down a character by the specified number of ranks in their current society, or the society specified if applicable.
|<pre>
society_rank_down = 1
 
society_rank_down = {
   society = the_assassins
   rank = 1
}
</pre>
|Societies
|-
|society_rank_up
!✓
|character
|int/clause
|Rank up a character by the specified number of ranks in their current society, or the society specified if applicable.
|<pre>
society_rank_up = 1
 
society_rank_up = {
   society = the_assassins
   rank = 1
}
</pre>
|Societies
|-
|sound_effect
!✓
|any
|sound
|Plays the specified sound, as defined in interface/sound.sfx
|<code>sound_effect = devil_worshippers_desecrate_temple</code>
|Sounds
|-
|spawn_disease
!✓
|province
|disease
|Spawns a specific disease in the scoped province
|<code>spawn_disease = typhoid_fever</code>
|Health
|-
|spawn_fleet
!✓
|character
|clause
|
{|class="wikitable"
!Parameter !! Type !! Description
|-
|province || province/closest || Closest sea zone
|-
|owner || character ||
|-
|earmark || earmark || ID of the unit, to be able to reference them later.
|-
|troops || clause || Fixed amount of troops in the form <code>troop_type = { <max_value> <starting_value> }</code>. Ex: galleys = { 20 20 }
|-
|match_character || character ||
|-
|match_mult || double || Matches against the total levies of every single holding
|-
|match_min || double ||
|-
|disband_on_peace || bool ||
|-
|cannot_inherit || bool ||
|-
|}
|<pre>
spawn_fleet = {
   province = closest
   owner = ROOT
   disband_on_peace = yes
   earmark = conscripted_merchant_ships
  
   troops = {
galleys = { 20 20 }
   }
}
</pre>
|Wars
|-
|spawn_unit
!✓
|character
|clause
|
{|class="wikitable"
!Parameter !! Type !! Description
|-
|province || province/closest/closest_to_capital || Spawn location
|-
|home || province ||
|-
|owner || character ||
|-
|leader || character/none || Defaults to current character scope.
|-
|earmark || earmark  || ID of the unit, to be able to reference them later. Can be localized via ''earmark''_ARMY and ''earmark''_ARMY_OF.
|-
|troops || clause || Fixed amount of troops in the form <code>troop_type = { <max_value> <starting_value> }</code>. Ex: archers = { 100 100 }
|-
|match_character || character || Character to match against for <code>match_mult</code>
|-
|match_settlement || barony title || Holding to match against for <code>match_mult</code>
|-
|match_mult || double || Proportional amount of troops to <code>match_character</code> total levy size (levies and event troops) or <code>match_settlement</code> (current garrison and levies combined)
|-
|match_max || double ||
|-
|match_min || double ||
|-
|disband_on_peace || bool || Will auto-disband if at peace.
|-
|cannot_inherit || bool || Marked as not inheritable
|-
|attrition || double || Attrition multiplier (1.0 for normal, 0 for attrition-less)
|-
|maintenance_multiplier || double || Will have normal maintenance cost multiplied by this value
|-
|scaled_by_biggest_garrison || double || Scales the army by the given factor * sum of the province's maximum levy and garrison size / 20
|-
|merge || bool || Merge all the regiments in this province together into one army
|-
|can_toggle_looting|| bool ||
|-
|is_looter|| bool ||
|-
|reinforces|| bool || By default spawned units do not reinforce.
|-
|reinforce_rate_multiplier|| double ||
|-
|maintenance|| bool ||
|-
|}
 
|<pre>
spawn_unit = {
   owner = ROOT
   province = ROOT
   home = ROOT
 
   troops = {
archers = { 500 500 }
light_infantry = { 1500 1500 }
heavy_infantry = { 300 300 }
light_cavalry = { 200 200 }
   }
 
   attrition = 1.0
   disband_on_peace = yes
   maintenance_multiplier = 0.5
}
</pre>
|Wars
|-
|start_faction
!X
|character
|clause
|Starts a faction on the liege of the current character scope, if it does not already exist. Different arguments are required depending on the type of the faction being started:
*character: faction
*liege_titles: faction, title
*liege_titles_w_claimant: faction, title, thirdparty
The optional can_join_existing argument controls whether or not the character will join the faction if it already exists, with the default behaviour being no.
|<pre>
start_faction = {
   faction = faction_succ_seniority
   title = event_target:liege_primary_title
   can_join_existing = yes
}
</pre>
|Factions
|-
|start_outbreak
!X
|any
|disease
|Forces an outbreak, but follows the scenarios set up in the disease.txt file.
|
|Health
|-
|start_society_progress
!✓
|society
|bool
|Enables the society's progress bar.
|<code>start_society_progress = yes</code>
|Societies
|-
|stop_society_progress
!✓
|society
|bool
|Disables the society's progress bar.
|<code>stop_society_progress = yes</code>
|Societies
|-
|steal_population_scaled
!✓
|character
|clause
|Steal population from another nomad clan
|<pre>
steal_population_scaled = {
   target = FROM
   percentage = 0.10
}
</pre>
|Jobs
|-
|steal_random_tech
!X
|province
|character/title/province
|Uses de jure capital of target title, uses capital province of target character (or of their liege, if unlanded)
|<code>steal_random_tech = character</code>
|Jobs
|-
|subjugate_or_take_under_title
!✓
|character
|clause
|
|<pre>
subjugate_or_take_under_title = {
   title = PREV
   enemy = FROM
}
</pre>
|Wars
|-
|subtract_variable
!X
|character/province
|clause
|Subtract specified value or another [[variable]] to a variable. Can specify a scope from which to take the second variable.
|<pre>
subtract_variable = {
   which = var
   value = 1
}
 
subtract_variable = {
   which = var
   which = another_var
}
</pre>
|Control
|-
|succession
!✓
|title
|succession/clause
|Either a hard-coded succession type: gavelkind, primogeniture, feudal_elective, seniority, catholic_bishopric, open_elective, turkish_succession, patrician_elective, ultimogeniture, tanistry, appointment, papal_succession, elective_gavelkind
 
Or a clause consisting of an elective <code>base_type</code> (feudal_elective, elective_gavelkind, or tanistry)<!-- this list comes from ChangeLog.txt --> and <code>voting_rules</code> token (defined in common/succession_voting/)
 
The latter can also be set separately using the <code>elective_voting_rules</code> command.
|<code>succession = primogeniture</code>
<pre>
succession = {
   base_type = feudal_elective
   voting_rules = byzantine_elective
}
</pre>
|Government
|-
|succession_w_cooldown
!✓
|title
|succession/clause
|
|<code>succession_w_cooldown = primogeniture</code>
|Government
|-
|transfer_artifact
!✓
|artifact
|clause
|Transfers the artifact from one character to another. If <code>from</code> does not have the artifact, it will not be transferred.
|<pre>transfer_artifact = {
   from = PREV
   to = PREVPREV
}</pre>
|Artifact
|-
|transfer_scaled_wealth
!✓
|character
|clause
|
{|class="wikitable"
!Parameter !! Type !! Description
|-
|from || character|| Either from or to
|-
|to || character|| Either from or to
|-
|value || all/double|| 1 means 1 year of income
|-
|min || double|| min = 5
|-
|max || double|| max = 50
|-
|}
|<pre>
transfer_scaled_wealth = {
   to = FROM
   value = 0.25
   min = 20
   max = 100
}
</pre>
|Money
|-
|treasury
!✓
|character
|int
|Alias of <code>wealth</code>
|<code>treasury = -20</code>
|Money
|-
|trigger_switch
!✓
|any
|clause
|
|<pre>trigger_switch = {
   on_trigger = religion_group
 
   christian = { ... }
   muslim = { ... }
   jewish_group = { ... }
   fallback = { ... } #if does not match any of the above
}
</pre>
|Control
|-
|troops
!✓
|unit/siege
|double
|Changes the size of the unit by the amount indicated
|<code>troops = -0.2</code>
|Army
|-
|unit_event
!X
|character
|clause
|Fires an event to scoped character. Rarely used. See [[event modding]] and [[On_actions]].
{|class="wikitable"
!Parameter !! Type !! Description
|-
|id || int || Required. Event ID to fire.  May use a [[event modding#ID and namespace|namespace]].
|-
|days || int || Optional. Base number of days to wait before firing the event. May use ''years'' instead. If not specified, event occurs instantly.
|-
|random || int || Optional. Number of days to add randomly for the event occurrence date, closed-ended (''days'' to ''days+random'').
|-
|tooltip || Key || Optional localisation key to show as tooltip.  If not specified, uses the DEFAULT_SENDEVENT_EVENTOPTION_TOOLTIP key ("Character receives an event").
|-
|}
|<pre>
unit_event = {
   id = 700
}
</pre>
|Control
|-
|unsafe_destroy_artifact
!✓
|artifact/character
|bool/artifact
|Destroys the artifact, even if indestructible.
|<pre>
unsafe_destroy_artifact = cursed_diamond
 
hidden_effect = {
   unsafe_destroy_artifact = yes
}
</pre>
|Artifacts
|-
|unsafe_destroy_landed_title
!✓
|any
|title
|Bypasses some error-checking in destroy title, allowing to destroy landless titles. Warning: use this effect with care !
|<pre>
d_iconoclast = {
   unsafe_destroy_landed_title = THIS
}
</pre>
|Titles
|-
|unsafe_destroy_landed_title
!✓
|any
|title
|Bypasses some error-checking in destroy title, allowing to destroy landless titles. Warning: use this effect with care !
|<pre>
d_iconoclast = {
   unsafe_destroy_landed_title = THIS
}</pre>
|Titles
|-
|unsafe_give_minor_title
!✓
|character
|minor_title
|Scoped character receives a minor title from liege, ignoring requirements
|<code>unsafe_give_minor_title = title_commander</code>
|Rulers
|-
|unsafe_impregnate
!✓
|character
|character/0
|Scope gets impregnated by the value. This will work even on someone already pregnant.
|<code>unsafe_impregnate = ROOT</code>
|Marriage
|-
|unsafe_impregnate_cuckoo
!X
|character
|character/0
|
|<code>unsafe_impregnate_cuckoo = ROOT</code>
|Marriage
|-
|unsafe_religion
!✓
|character/title
|religion
|Bypasses some error-checking in set religion, allowing to change the religion of the leader of a holy order, a religious head or a rebel leader. '''Warning: Use this effect with care! Seems broken in 3.3.0.'''
|<pre>
d_iconoclast = {
   holder_scope = {
unsafe_religion = orthodox 
   }
}
</pre>
|Religion
|-
|unsafe_war
!✓
|character
|clause
|Works like the war command, but without ensuring the CB can be used.
|<pre>
unsafe_war = {
   target = PREVPREV
   casus_belli = duchy_adventure
   thirdparty_title = PREV
   tier = DUKE
}
</pre>
|Wars
|-
|usurp_title
!✓
|character/title
|title/character/clause
|
|<pre>
c_pest = { usurp_title = ROOT }
 
usurp_title = {
   target = ROOT
   type = invasion
}
</pre>
|Titles
|-
|usurp_title_only
!✓
|title
|character/clause
|Gives strong claim to character being usurped
|<pre>
usurp_title_only = ROOT
 
usurp_title_only = {
   target = PREV
   type = holy_war
}
</pre>
|Titles
|-
|usurp_title_plus_barony_if_unlanded
!✓
|character/title
|title/character/clause
|Gives strong claim to character being usurped.
'''Note''': Command shortened in example to avoid stretching the column.
|<pre>
plot_target_title = {
   <command> = PREV
}
</pre>
|Titles
|-
|usurp_title_plus_barony_if_unlanded
_and_vassals
!✓
|character/title/clause
|title/character
|Targeted character will usurp scoped title
'''Note''': Command shortened in example to avoid stretching the column.
|<pre>
c_byzantion = {
   <command> = PREV
}
</pre>
|Titles
|-
|usurp_title_plus_barony_if_unlanded
_and_vassals_no_adj
!✓
|character/title
|title/character/clause
|Targeted character will usurp scoped title
'''Note''': Command shortened in example to avoid stretching the column.
|<pre>
<command> = {
   target = ROOT
   type = claim
}
</pre>
|Titles
|-
|vassalize_or_take_under_title
!✓
|character
|clause
|'''Note''': Command shortened in example to avoid stretching the column.
|<pre>
<command> = {
   title = PREV
   enemy = FROM
}
</pre>
|Vassalage
|-
|vassalize_or_take_under_title
_destroy_duchies
!✓
|character
|clause
|'''Note''': Command shortened in example to avoid stretching the column.
|<pre>
<command> = {
   title = PREV
   enemy = FROM
}
</pre>
|Vassalage
|-
|war
!✓
|character
|clause
|Initiate a war, with current character as attacker. Also see <code>reverse_war</code>. <code>infamy</code> can be used to override the threat value (for instance <code>infamy = 0</code>).
|<pre>
war = {
   target = PREVPREV
   casus_belli = duchy_adventure
   thirdparty_title = PREV
   tier = DUKE
}
</pre>
|Wars
|-
|wealth
!✓
|character
|double/character
|Modify the wealth of scoped character with the specified amount, or with the wealth of another character.
|<code>wealth = -50</code>
|Money
|-
|}
 
==See also==
*[[Scripted effect]]
*[[Scopes]]
*[[Conditions]]
 
==References==
 
<references/>
 
[[Category:Modding]]
[[Category:列表]]
{{ModdingNavbox}}

2020年5月22日 (五) 14:30的版本


Commands or effects are used in scripting to alter the target that was selected with scopes and conditions.

They appear in:

  • command blocks (the immediate and option sections of events, or similar: effect, creation_effect, gain_effect, success, ...)
  • scripted effects, which can be used to group commands into re-usable macro.

(Scripting) commands are different from console commands: though some console commands have a scripting equivalent, others do not (for instance player console command).

List of commands

Available commands depend on the current scope type.

Command Used in vanilla Used from scope Value type Description Example Category
abandon_heresy character/province bool Converts to the parent religion abandon_heresy = yes Religion
abdicate character bool/clause Abdicate to current heir.
Since 2.7 move = no can be used to ensure that the character keeps the same liege if they end up unlanded.
abdicate = yes

abdicate = { move = no }

Government
abdicate_to character character Abdicate to an arbitrary character.

Note: to also transfer wealth, use the transfer_scaled_wealth command.

holder_scope = { abdicate_to = ROOT } Government
abdicate_to_most_liked_by character character Used in depose_liege CB FROM = { abdicate_to_most_liked_by = ROOT } Government
activate_disease any disease Activate a disease, which can now randomly appear. Note that there's no way to deactivate a disease. activate_disease = syphilis Health
activate_plot character bool For plots activated by decision hidden_effect = { activate_plot = yes } Plots
activate_title any clause Activate/deactivate a titular or de jure landed title. Unlike destroyed titles (destroy_landed_title), deactivated titles cannot be re-created by the p