指令:修订间差异

本页面所适用的版本可能已经过时,最后更新于1.7
无编辑摘要
无编辑摘要
第12行: 第12行:


This is noted by '''<variable>''' in an effect's parameters.
This is noted by '''<variable>''' in an effect's parameters.
== New La Resistance Effects ==
==New La Resistance Effects==
{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! style="width: 157px" width="10%" | Name
! style="width: 157px" width="10%" |Name
! style="width: 395px" width="25%" | Parameters
! style="width: 395px" width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| style="width: 157px" | create_intelligence_agency
| style="width: 157px" |create_intelligence_agency
| style="width: 395px" | Allows to create automatically an intelligence agency
| style="width: 395px" |Allows to create automatically an intelligence agency
| <code>create_intelligence_agency = yes</code>
|<code>create_intelligence_agency = yes</code>
| Creates an Intelligence Agency.
|Creates an Intelligence Agency.
| &nbsp;
|&nbsp;
| 1.9
|1.9
|-
|-
| style="width: 157px" | upgrade_intelligence_agency
| style="width: 157px" |upgrade_intelligence_agency
| style="width: 395px" | Allows to unlock automatically an intelligence agency uprgrade
| style="width: 395px" |Allows to unlock automatically an intelligence agency uprgrade
| <code>upgrade_intelligence_agency = upgrade_form_department</code> <code>upgrade_intelligence_agency = <upgrade></code>
|<code>upgrade_intelligence_agency = upgrade_form_department</code> <code>upgrade_intelligence_agency = <upgrade></code>
| Unlocks an Intelligence Agency Upgrade.
|Unlocks an Intelligence Agency Upgrade.
| Upgrades can be found in common/intelligence_agency_upgrades 
|Upgrades can be found in common/intelligence_agency_upgrades
| 1.9
|1.9
|-
|-
| style="width: 157px" | kill_ideology_leader
| style="width: 157px" |kill_ideology_leader
| style="width: 395px" | Allows to kill a country leader from a precise ideology
| style="width: 395px" |Allows to kill a country leader from a precise ideology
| <code>kill_ideology_leader = communism</code> <code>kill_ideology_leader = <ideology></code>
|<code>kill_ideology_leader = communism</code> <code>kill_ideology_leader = <ideology></code>
| Kills the leader of that ideology in that scope.
|Kills the leader of that ideology in that scope.
| &nbsp;
|&nbsp;
| 1.9
|1.9
|-
|-
| style="width: 157px" | transfer_units_fraction
| style="width: 157px" |transfer_units_fraction
| style="width: 395px" | Allows to transfer a precise part of the army and the equipement of a country to any country.
| style="width: 395px" |Allows to transfer a precise part of the army and the equipement of a country to any country.
| <code>transfer_units_fraction= {<br/>&nbsp;&nbsp;&nbsp; target = SPD<br/> &nbsp;&nbsp;&nbsp; size = 0.5<br/>&nbsp;&nbsp;&nbsp; stockpile_ratio = 0.8<br/> &nbsp;&nbsp;&nbsp; army_ratio = 0.8<br/> &nbsp;&nbsp;&nbsp; navy_ratio = 0.5<br/> &nbsp;&nbsp;&nbsp; air_ratio = 0.5<br/> &nbsp;&nbsp;&nbsp; keep_unit_leaders_trigger = {<br/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;has_trait = trait_SPA_nationalist_sympathies<br/> &nbsp;&nbsp;&nbsp;}<br/> }<code>
|<code>transfer_units_fraction= {<br />&nbsp;&nbsp;&nbsp; target = SPD<br /> &nbsp;&nbsp;&nbsp; size = 0.5<br />&nbsp;&nbsp;&nbsp; stockpile_ratio = 0.8<br /> &nbsp;&nbsp;&nbsp; army_ratio = 0.8<br /> &nbsp;&nbsp;&nbsp; navy_ratio = 0.5<br /> &nbsp;&nbsp;&nbsp; air_ratio = 0.5<br /> &nbsp;&nbsp;&nbsp; keep_unit_leaders_trigger = {<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;has_trait = trait_SPA_nationalist_sympathies<br /> &nbsp;&nbsp;&nbsp;}<br /> }<code>
| Transfers a certain equipement, Navy, Air Force, and Land Force ratio to a country. 
|Transfers a certain equipement, Navy, Air Force, and Land Force ratio to a country.
| Unit Leaders can be kept by using triggers with <code>keep_unit_leaders_trigger = {</code>
|Unit Leaders can be kept by using triggers with <code>keep_unit_leaders_trigger = {</code>
| 1.9
|1.9
|-
|-
|}
|}


== New Man the Guns Effects ==
==New Man the Guns Effects==


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! style="width: 157px" width="10%" | Name
! style="width: 157px" width="10%" |Name
! style="width: 395px" width="25%" | Parameters
! style="width: 395px" width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| style="width: 157px" | remove_decision
| style="width: 157px" |remove_decision
| style="width: 395px" | Allows to remove specified decision without running remove_effect.
| style="width: 395px" |Allows to remove specified decision without running remove_effect.
| <code>remove_decision = GER_MEPO</code>
|<code>remove_decision = GER_MEPO</code>
| Removes a decision.
|Removes a decision.
| &nbsp;
|&nbsp;
| 1.6
|1.6
|-
|-
| style="width: 157px" | swap_ruler_traits
| style="width: 157px" |swap_ruler_traits
| style="width: 395px" | Similar to swap_ideas. Removes one trait and adds another.
| style="width: 395px" |Similar to swap_ideas. Removes one trait and adds another.
| <code>swap_ruler_traits = { remove = <trait> add = <trait> }</code>
|<code>swap_ruler_traits = { remove = <trait> add = <trait> }</code>
| Swaps traits.
|Swaps traits.
| &nbsp;
|&nbsp;
| 1.6
|1.6
|-
|-


| style="width: 157px" | 
| style="width: 157px" |
remove_exile_tag
remove_exile_tag


| style="width: 395px" | Remove the exile tag on a army leader, making them no longer be considered exile leaders.
| style="width: 395px" |Remove the exile tag on a army leader, making them no longer be considered exile leaders.
| <code>remove_exile_tag = { USA = "Arturo Rawson" }</code>
|<code>remove_exile_tag = { USA = "Arturo Rawson" }</code>
| Removes a leaders exile tag.
|Removes a leaders exile tag.
| &nbsp;
|&nbsp;
| 1.6
|1.6
|-
|-
| style="width: 157px" | add_legitimacy
| style="width: 157px" |add_legitimacy
| style="width: 395px" | Adds legitimacy to a government in exile.
| style="width: 395px" |Adds legitimacy to a government in exile.
| <code>add_legitimacy = 10</code>
|<code>add_legitimacy = 10</code>
| Adds legitimacy.
|Adds legitimacy.
| &nbsp;
|&nbsp;
| 1.6
|1.6
|-
|-
| style="width: 157px" | 
| style="width: 157px" |
set_legitimacy
set_legitimacy


| style="width: 395px" | Sets the legitimacy of governments in exile.
| style="width: 395px" |Sets the legitimacy of governments in exile.
| <code>set_legitimacy= { POL = 1.0 }</code>
|<code>set_legitimacy= { POL = 1.0 }</code>
| Sets legitimacy.
|Sets legitimacy.
| &nbsp;
|&nbsp;
| 1.6
|1.6
|-
|-
| style="width: 157px" | become_exiled_in
| style="width: 157px" |become_exiled_in
| style="width: 395px" | Makes a country a government in exile in a set country, with a set starting legitimacy.
| style="width: 395px" |Makes a country a government in exile in a set country, with a set starting legitimacy.
| <code>become_exiled_in = { target = <Host tag> legitimacy = <0-1> starting legitimacy }</code>
|<code>become_exiled_in = { target = <Host tag> legitimacy = <0-1> starting legitimacy }</code>
| Creates a government in exile.
|Creates a government in exile.
| Must be fired from ROOT, the country that should be exiled, or a TAG specification must be used.
|Must be fired from ROOT, the country that should be exiled, or a TAG specification must be used.
| 1.6
|1.6
|-
|-
| style="width: 157px" | end_exile
| style="width: 157px" |end_exile
| style="width: 395px" | Ends a government in exile.
| style="width: 395px" |Ends a government in exile.
| <code>end_exile</code>
|<code>end_exile</code>
| Ends a government in exile.
|Ends a government in exile.
| &nbsp;
|&nbsp;
| 1.6
|1.6
|-
|-
| style="width: 157px" | add_province_modifier
| style="width: 157px" |add_province_modifier
| style="width: 395px" | Adds a province modifier.
| style="width: 395px" |Adds a province modifier.
| <code>add_province_modifier = { 5246 = mud }</code>
|<code>add_province_modifier = { 5246 = mud }</code>
| Adds a province modifier.
|Adds a province modifier.
| New modifiers can be created in the "weather.txt" file.
|New modifiers can be created in the "weather.txt" file.
| 1.6
|1.6
|-
|-
| style="width: 157px" | remove_province_modifier
| style="width: 157px" |remove_province_modifier
| style="width: 395px" | Removes a province modifier.
| style="width: 395px" |Removes a province modifier.
| <code>remove_province_modifier = { 5246 = mud }</code>
|<code>remove_province_modifier = { 5246 = mud }</code>
| Removes a province modifier.
|Removes a province modifier.
| New modifiers can be created in the "weather.txt" file.
|New modifiers can be created in the "weather.txt" file.
| 1.6
|1.6
|-
|-
| style="width: 157px" | set_faction_name
| style="width: 157px" |set_faction_name
| style="width: 395px" | Sets a faction name as the loc name.
| style="width: 395px" |Sets a faction name as the loc name.
| <code>set_faction_name = SOME_LOC_KEY</code>
|<code>set_faction_name = SOME_LOC_KEY</code>
| Changes faction names.
|Changes faction names.
| &nbsp;
|&nbsp;
| 1.6
|1.6
|-
|-
| style="width: 157px" | add_nuclear_bombs
| style="width: 157px" |add_nuclear_bombs
| style="width: 395px" | Adds nuclear bomb to TAG's stockpile.
| style="width: 395px" |Adds nuclear bomb to TAG's stockpile.
| <code>add_nuclear_bombs = 100</code>
|<code>add_nuclear_bombs = 100</code>
| Adds specified number of nukes to the country's stockpile
|Adds specified number of nukes to the country's stockpile
| Needs the Nuke tech to use.
|Needs the Nuke tech to use.
| 1.6
|1.6
|-
|-
| style="width: 157px" | launch_nuke
| style="width: 157px" |launch_nuke
| style="width: 395px" | Nukes a province.
| style="width: 395px" |Nukes a province.
|
<code>launch_nuke = {<br/>&nbsp;&nbsp;&nbsp; province = 42<br/> &nbsp;&nbsp;&nbsp; state = 42<br/>&nbsp;&nbsp;&nbsp; controller = GER<br/> &nbsp;&nbsp;&nbsp; use_nuke = yes<br/> }</code>
<code>launch_nuke = {<br />&nbsp;&nbsp;&nbsp; province = 42<br /> &nbsp;&nbsp;&nbsp; state = 42<br />&nbsp;&nbsp;&nbsp; controller = GER<br /> &nbsp;&nbsp;&nbsp; use_nuke = yes<br /> }</code>


| Nukes a province.
|Nukes a province.


When using state it nukes a random province in said state, with a preference to enemy occupied provinces.
When using state it nukes a random province in said state, with a preference to enemy occupied provinces.


| Requires Nuke tech and nukes. Removes a nuke from stockpile when used.
|Requires Nuke tech and nukes. Removes a nuke from stockpile when used.
| 1.6
|1.6
|-
|-
| style="width: 157px" | inherit_technology
| style="width: 157px" |inherit_technology
| style="width: 395px" | Transfers all of a nations techs to a specified tag.
| style="width: 395px" |Transfers all of a nations techs to a specified tag.
| <code>inherit_technology = CAN</code>
|<code>inherit_technology = CAN</code>
| Transfers tech.
|Transfers tech.
| Useful in civil wars and when countries split. The scoped country inherits the techs from the targeted TAG so be careful with the scope.
|Useful in civil wars and when countries split. The scoped country inherits the techs from the targeted TAG so be careful with the scope.
| 1.6
|1.6
|-
|-
| style="width: 157px" | set_fuel_ratio
| style="width: 157px" |set_fuel_ratio
| style="width: 395px" | Set country's current fuel ratio relative to its capacity.
| style="width: 395px" |Set country's current fuel ratio relative to its capacity.
| <code>set_fuel_ratio</code>
|<code>set_fuel_ratio</code>
| Sets country's current fuel ratio.
|Sets country's current fuel ratio.
| &nbsp;
|&nbsp;
| 1.6
|1.6
|-
|-
| style="width: 157px" | add_mines
| style="width: 157px" |add_mines
| style="width: 395px" | Add mines to a strategic region for the current country.
| style="width: 395px" |Add mines to a strategic region for the current country.
| <code>add_mines = { region = 42 amount = 100 }</code>
|<code>add_mines = { region = 42 amount = 100 }</code>
| Add mines to a strategic region.
|Add mines to a strategic region.
| &nbsp;
|&nbsp;
|
1.6
1.6


|-
|-
| style="width: 157px" | give_resource_rights
| style="width: 157px" |give_resource_rights
| style="width: 395px" | Gives resource rights
| style="width: 395px" |Gives resource rights
| <code>give_resource_rights = { receiver = ENG state = 291 }</code>
|<code>give_resource_rights = { receiver = ENG state = 291 }</code>
| Gives all the resources of a state to the target country
|Gives all the resources of a state to the target country
| see 04_mtg_on_actions
|see 04_mtg_on_actions
| 1.6
|1.6
|-
|-
| style="width: 157px" | remove_resource_rights
| style="width: 157px" |remove_resource_rights
| style="width: 395px" | Removes resource rights
| style="width: 395px" |Removes resource rights
| <code>ENG = { remove_resource_rights = 477 }</code>
|<code>ENG = { remove_resource_rights = 477 }</code>
| Removes given resource rights
|Removes given resource rights
| &nbsp;
|&nbsp;
| 1.6
|1.6
|}
|}


== Any Scope ==
== 任意作用域==


Can be used in '''country''', '''state''' or '''unit leader''' scopes.
Can be used in '''country''', '''state''' or '''unit leader''' scopes.


=== General ===
=== 全局===
{{SVersion|1.5}}
{{SVersion|1.5}}


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
|set_global_flag
|set_global_flag
第304行: 第304行:
|<code><int></code><br>A seed integer.
|<code><int></code><br>A seed integer.
|<code>randomize_weather = 12345</code>
|<code>randomize_weather = 12345</code>
|Randomizes the weather with the specified seed. 
|Randomizes the weather with the specified seed.
|
|
|1.0
|1.0
|-
|-
|set_province_name
|set_province_name
|<code>id = <id></code><br>The id of the province to be changed.
|<code>id = <id></code><br> 要改变名字的省份的id
<code>name = <string></code><br>The name to change the province to.
<code>name = <string></code><br> 省份所要改成的名字
|<pre>
|<pre>
set_province_name = {
set_province_name = {
第317行: 第317行:
}
}
</pre>
</pre>
|Changes the specified province's name to the specified name.
| 把某个的名字改为特定名字
|
|
|1.3
|1.3
|-
|-
|reset_province_name
|reset_province_name
|<code><id></code><br>The id of the province to reset.
|<code><id></code><br> 要重设名字的省份的id
|<pre>
|<pre>
reset_province_name = 325
reset_province_name = 325
</pre>
</pre>
|Resets the specified province's name.
| 重设特定省份的名字
|
|
|1.3
|1.3
|-
|-
|goto_province
|goto_province
|<code><id></code><br>The id of the province go to.
|<code><id></code><br> 要移动到的省份
|<pre>
|<pre>
goto_province = 325
goto_province = 325
</pre>
</pre>
|Moves the camera position over the specified province.
| 把视角移到特定省份
|
|
|1.0
|1.0
|-
|-
|goto_state
|goto_state
|<code><scope> / <variable></code><br>The id of the state go to.
|<code><scope> / <variable></code><br> 要移动到的state的id
|<pre>
|<pre>
goto_state = 1
goto_state = 1
第371行: 第371行:
|}
|}


=== 边境冲突 ===
===边境冲突===


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| start_border_war(发起边境冲突)
|start_border_war(发起边境冲突)
| <code>change_state_after_war = <bool></code><br/> 在边境冲突结束后,该省份是否易手 . 
|<code>change_state_after_war = <bool></code><br /> 在边境冲突结束后,该省份是否易手 . 
'''Attacker scope'''<br/> <code>state = <id> / <variable></code><br/> 发起边境冲突的省份 .<br/> <code>num_provinces = <id></code><br/> 指定发起边境冲突的一方投入多少个该省份下辖小地区,以这些小地区的部队发起边境冲突 .<br/> <code>on_win = <id></code><br/> 发起边境冲突的一方胜利所触发的事件 .<br/> <code>on_lose = <id></code><br/> 发起边境冲突的一方失败所触发的事件 .<br/> <code>on_cancel= <id></code><br/> The event to fire for the attacker on a draw.<br/> '''Defender scope'''<br/> <code>state = <id> / <variable></code><br/> 因边境冲突而受到攻击的省份.<br/> <code>num_provinces = <id></code><br/> The number of provinces used in the state.<br/> <code>on_win = <id></code><br/> The event to fire for the defender on a win.<br/> <code>on_lose = <id></code><br/> The event to fire for the defender on a loss.<br/> <code>on_cancel= <id></code><br/> The event to fire for the defender on a draw.
'''Attacker scope'''<br /> <code>state = <id> / <variable></code><br /> 发起边境冲突的省份 .<br /> <code>num_provinces = <id></code><br /> 指定发起边境冲突的一方投入多少个该省份下辖小地区,以这些小地区的部队发起边境冲突 .<br /> <code>on_win = <id></code><br /> 发起边境冲突的一方胜利所触发的事件 .<br /> <code>on_lose = <id></code><br /> 发起边境冲突的一方失败所触发的事件 .<br /> <code>on_cancel= <id></code><br /> The event to fire for the attacker on a draw.<br /> '''Defender scope'''<br /> <code>state = <id> / <variable></code><br /> 因边境冲突而受到攻击的省份.<br /> <code>num_provinces = <id></code><br /> The number of provinces used in the state.<br /> <code>on_win = <id></code><br /> The event to fire for the defender on a win.<br /> <code>on_lose = <id></code><br /> The event to fire for the defender on a loss.<br /> <code>on_cancel= <id></code><br /> The event to fire for the defender on a draw.


| <pre>start_border_war = {
|<pre>start_border_war = {
    change_state_after_war = no
    change_state_after_war = no
    attacker = {
    attacker = {
第406行: 第406行:
</pre>
</pre>


| Starts a border war for the specified attacker and defender. The participating countries are the owners of the specified states.
|Starts a border war for the specified attacker and defender. The participating countries are the owners of the specified states.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| set_border_war_data
|set_border_war_data
| <code>attacker = <id> / <variable></code><br/> The attacker state. 
|<code>attacker = <id> / <variable></code><br /> The attacker state. 
<code>defender = <id> / <variable></code><br/> The defender state.<br/> <code>attacker_modifier = <id> / <variable></code><br/> The modifier applied to attacker strength.<br/> <code>defender_modifier = <id> / <variable></code><br/> The modifier applied to attacker strength.<br/> <code>combat_width = <id> / <variable></code><br/> The combat width used in the border war battle.
<code>defender = <id> / <variable></code><br /> The defender state.<br /> <code>attacker_modifier = <id> / <variable></code><br /> The modifier applied to attacker strength.<br /> <code>defender_modifier = <id> / <variable></code><br /> The modifier applied to attacker strength.<br /> <code>combat_width = <id> / <variable></code><br /> The combat width used in the border war battle.


| <pre>set_border_war_data = {
|<pre>set_border_war_data = {
    attacker = 527
    attacker = 527
    defender = 408
    defender = 408
第422行: 第422行:
</pre>
</pre>


| Sets the bonuses or penalties for the attacker and defender in an on-going border war. Used after '''start_border_war'''.
|Sets the bonuses or penalties for the attacker and defender in an on-going border war. Used after '''start_border_war'''.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| cancel_border_war
|cancel_border_war
| <code>attacker = <id> / <variable></code><br/> The attacker state. 
|<code>attacker = <id> / <variable></code><br /> The attacker state. 
<code>defender = <id> / <variable></code><br/> The defender state.<br/> <code>dont_fire_events = <bool></code><br/> Stops the events from '''start_border_war''' from firing.
<code>defender = <id> / <variable></code><br /> The defender state.<br /> <code>dont_fire_events = <bool></code><br /> Stops the events from '''start_border_war''' from firing.


| <pre>cancel_border_war = {
|<pre>cancel_border_war = {
    dont_fire_events = yes
    dont_fire_events = yes
    defender = 408
    defender = 408
第437行: 第437行:
</pre>
</pre>


| Cancels an on-going border war without a winner.
|Cancels an on-going border war without a winner.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| finalize_border_war
|finalize_border_war
| <code>attacker = <id> / <variable></code><br/> The attacker state. 
|<code>attacker = <id> / <variable></code><br /> The attacker state. 
<code>defender = <id> / <variable></code><br/> The defender state.<br/> <code>attacker_win = <bool></code><br/> Makes the attacker the winner.<br/> <code>defender_win = <bool></code><br/> Makes the defender the winner.
<code>defender = <id> / <variable></code><br /> The defender state.<br /> <code>attacker_win = <bool></code><br /> Makes the attacker the winner.<br /> <code>defender_win = <bool></code><br /> Makes the defender the winner.


| <pre>finalize_border_war = {
|<pre>finalize_border_war = {
    attacker_win = yes
    attacker_win = yes
    attacker = 527
    attacker = 527
第452行: 第452行:
</pre>
</pre>


| Ends an on-going border war.
|Ends an on-going border war.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|}
|}


== Country Scope ==
== 国家作用域==


The effects here must be used within a '''country''' scope.
The effects here must be used within a '''country''' scope.


=== General ===
=== 整体===


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| set_country_flag
|set_country_flag
| <code><flag></code><br/> An unique string to identify the country flag with.
|<code><flag></code><br /> An unique string to identify the country flag with.
| <code>set_country_flag = my_flag</code>
|<code>set_country_flag = my_flag</code>
| Defines a country flag.
|Defines a country flag.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| clr_country_flag
|clr_country_flag
| <code><flag></code><br/> The unique string of a country flag to clear.
|<code><flag></code><br /> The unique string of a country flag to clear.
| <code>clr_country_flag = my_flag</code>
|<code>clr_country_flag = my_flag</code>
| Clears a defined country flag.
|Clears a defined country flag.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| modify_country_flag
|modify_country_flag
| <code>flag = <flag></code><br/> The country flag to modify. 
|<code>flag = <flag></code><br /> The country flag to modify. 
<code>value = <value></code><br/> The value to set it to: 0 or 1
<code>value = <value></code><br /> The value to set it to: 0 or 1


| <pre>modify_country_flag = {
|<pre>modify_country_flag = {
    flag = my_flag
    flag = my_flag
    value = 1
    value = 1
第496行: 第496行:
</pre>
</pre>


| Modifies a country flag.
|Modifies a country flag.
| Use [[Variables|variables]] instead.
|Use [[Variables|variables]] instead.
| 1.3
|1.3
|-
|-
| country_event
|country_event
| <code>id = <event></code><br/> The event to fire. 
|<code>id = <event></code><br /> The event to fire. 
<code>days = <event> / <variable></code><br/> Fires the event in the specified number of days. Optional.<br/> <code>hours = <event> / <variable></code><br/> Fires the event in the specified number of hours. Optional.<br/> <code>random = <event></code><br/> Adds a random number (between ''0'' and ''random'', inclusive) of '''hours''' to the scheduled fire time. Optional.
<code>days = <event> / <variable></code><br /> Fires the event in the specified number of days. Optional.<br /> <code>hours = <event> / <variable></code><br /> Fires the event in the specified number of hours. Optional.<br /> <code>random = <event></code><br /> Adds a random number (between ''0'' and ''random'', inclusive) of '''hours''' to the scheduled fire time. Optional.


| <pre>country_event = {
|<pre>country_event = {
    id = my_event.1
    id = my_event.1
    days = 10
    days = 10
第511行: 第511行:
</pre>
</pre>


| Fires the specified event for the current country.
|Fires the specified event for the current country.
| Where triggers do not need to be repeatedly checked <code>random</code> can be a performance light alternative to <code>mean_time_to_happen</code> for scheduling events.
|Where triggers do not need to be repeatedly checked <code>random</code> can be a performance light alternative to <code>mean_time_to_happen</code> for scheduling events.
| 1.0
|1.0
|-
|-
| news_event
|news_event
| <code>id = <event></code><br/> The event to fire. 
|<code>id = <event></code><br /> The event to fire. 
<code>days = <event> / <variable></code><br/> Fires the event in the specified number of days. Optional.<br/> <code>hours = <event> / <variable></code><br/> Fires the event in the specified number of hours. Optional.<br/> <code>random = <event></code><br/> Adds a random number (between ''0'' and ''random'', inclusive) of '''hours''' to the scheduled fire time. Optional.
<code>days = <event> / <variable></code><br /> Fires the event in the specified number of days. Optional.<br /> <code>hours = <event> / <variable></code><br /> Fires the event in the specified number of hours. Optional.<br /> <code>random = <event></code><br /> Adds a random number (between ''0'' and ''random'', inclusive) of '''hours''' to the scheduled fire time. Optional.


| <pre>news_event = {
|<pre>news_event = {
    id = my_event.1
    id = my_event.1
    days = 10
    days = 10
第526行: 第526行:
</pre>
</pre>


| Fires the specified news event for the current country.
|Fires the specified news event for the current country.
| The news event uses a different interface to the country event. 
|The news event uses a different interface to the country event. 
Where triggers do not need to be repeatedly checked <code>random</code> can be a performance light alternative to <code>mean_time_to_happen</code> for scheduling events.
Where triggers do not need to be repeatedly checked <code>random</code> can be a performance light alternative to <code>mean_time_to_happen</code> for scheduling events.


| 1.0
|1.0
|-
|-
| set_cosmetic_tag
|set_cosmetic_tag
| <code><string></code><br/> The cosmetic tag to switch to.
|<code><string></code><br /> The cosmetic tag to switch to.
| <pre>set_cosmetic_tag = SAF_SOV_communism</pre>
|<pre>set_cosmetic_tag = SAF_SOV_communism</pre>


| Makes the current scope use the specified cosmetic tag, changing name and flag.
|Makes the current scope use the specified cosmetic tag, changing name and flag.
| &nbsp;
|&nbsp;
| 1.3
|1.3
|-
|-
| drop_cosmetic_tag
|drop_cosmetic_tag
| <code><bool></code><br/> Boolean.
|<code><bool></code><br /> Boolean.
| <pre>drop_cosmetic_tag = yes</pre>
|<pre>drop_cosmetic_tag = yes</pre>


| Makes the current scope drop the current cosmetic tag they are using.
|Makes the current scope drop the current cosmetic tag they are using.
| &nbsp;
|&nbsp;
| 1.3
|1.3
|-
|-
| set_rule
|set_rule
| <code><rule></code><br/> Boolean.
|<code><rule></code><br /> Boolean.
| <pre>set_rule = {
|<pre>set_rule = {
    can_create_factions = yes
    can_create_factions = yes
}
}
</pre>
</pre>


| Toggles the special game rules for the current scope.
|Toggles the special game rules for the current scope.
| Possible rules: 
|Possible rules: 
*can_be_called_to_war
*can_boost_other_ideologies
*can_create_factions
*can_declare_war_on_same_ideology
*can_declare_war_without_wargoal_when_in_war
*can_decline_call_to_war
*can_force_government
*can_generate_female_aces
*can_guarantee_other_ideologies
*can_join_factions
*can_join_factions_not_allowed_diplomacy
*can_join_opposite_factions
*can_lower_tension
*can_not_declare_war
*can_occupy_non_war
*can_only_justify_war_on_threat_country
*can_use_kamikaze_pilots
*units_deployed_to_overlord (subjects only)


| 1.0
*can_be_called_to_war
*can_boost_other_ideologies
*can_create_factions
*can_declare_war_on_same_ideology
*can_declare_war_without_wargoal_when_in_war
*can_decline_call_to_war
*can_force_government
*can_generate_female_aces
*can_guarantee_other_ideologies
*can_join_factions
*can_join_factions_not_allowed_diplomacy
*can_join_opposite_factions
*can_lower_tension
*can_not_declare_war
*can_occupy_non_war
*can_only_justify_war_on_threat_country
*can_use_kamikaze_pilots
*units_deployed_to_overlord (subjects only)
 
|1.0
|}
|}


=== State ===
=== 地区===


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| add_state_core
|add_state_core
| <code><scope> / <variable></code><br/> The state to add core to.
|<code><scope> / <variable></code><br /> The state to add core to.
| <pre>add_state_core = 345</pre>
|<pre>add_state_core = 345</pre>


| Adds a core for the current scope to the specified state.
|Adds a core for the current scope to the specified state.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| remove_state_core
|remove_state_core
| <code><scope> / <variable></code><br/> The state to remove core from.
|<code><scope> / <variable></code><br /> The state to remove core from.
| <pre>remove_state_core = 345</pre>
|<pre>remove_state_core = 345</pre>


| Removes the core of the current scope from the specified state.
|Removes the core of the current scope from the specified state.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| set_capital
|set_capital
| <code><scope> / <variable></code><br/> The state to make capital.
|<code><scope> / <variable></code><br /> The state to make capital.
| <pre>set_capital = 345</pre>
|<pre>set_capital = 345</pre>


| Makes the specified state the current scope's capital state.
|Makes the specified state the current scope's capital state.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| add_state_claim
|add_state_claim
| <code><scope> / <variable></code><br/> The state to add a claim to.
|<code><scope> / <variable></code><br /> The state to add a claim to.
| <pre>add_state_claim = 345</pre>
|<pre>add_state_claim = 345</pre>


| Adds a claim for the current scope on the specified state.
|Adds a claim for the current scope on the specified state.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| remove_state_claim
|remove_state_claim
| <code><scope> / <variable></code><br/> The state to remove the claim from.
|<code><scope> / <variable></code><br /> The state to remove the claim from.
| <pre>remove_state_claim = 345</pre>
|<pre>remove_state_claim = 345</pre>


| Removes a claim of the current scope from the specified state.
|Removes a claim of the current scope from the specified state.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| set_state_owner
|set_state_owner
| <code><scope> / <variable></code><br/> The state to change ownership of.
|<code><scope> / <variable></code><br /> The state to change ownership of.
| <pre>set_state_owner = 345</pre>
|<pre>set_state_owner = 345</pre>


| Makes the current scope the owner of the specified state.
|Makes the current scope the owner of the specified state.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| set_state_controller
|set_state_controller
| <code><scope> / <variable></code><br/> The state to change controller of.
|<code><scope> / <variable></code><br /> The state to change controller of.
| <pre>set_state_controller = 345</pre>
|<pre>set_state_controller = 345</pre>


| Makes the current scope the controller of the specified state.
|Makes the current scope the controller of the specified state.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| transfer_state
|transfer_state
| <code><scope> / <variable></code><br/> The state to change owner and controller of.
|<code><scope> / <variable></code><br /> The state to change owner and controller of.
| <pre>transfer_state = 345</pre>
|<pre>transfer_state = 345</pre>


| Makes the current scope the owner and controller of the specified state.
|Makes the current scope the owner and controller of the specified state.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| set_province_controller
|set_province_controller
| <code><id></code><br/> The province to change controller of.
|<code><id></code><br /> The province to change controller of.
| <pre>set_province_controller = 2999</pre>
|<pre>set_province_controller = 2999</pre>


| Changes the controller of the specified province to the current scope.
|Changes the controller of the specified province to the current scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|}
|}


=== Powers ===
=== 政治力量===


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| add_political_power
|add_political_power
| <code><int> / <variable></code><br/> The amount to add.
|<code><int> / <variable></code><br /> 数量
| <pre>add_political_power = 100</pre>
|<pre>add_political_power = 100</pre>
<pre>add_political_power = var:my_var</pre>
<pre>add_political_power = var:my_var</pre>


| Adds the specified amount of political power to the current scope.
| 为当前作用域增加特定数量的政治点数
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| set_political_power
|set_political_power
| <code><int> / <variable></code><br/> The amount to add.
|<code><int> / <variable></code><br /> 数量
| <pre>set_political_power = 100</pre>
|<pre>set_political_power = 100</pre>


| Sets the specified amount of political power for the current scope.
| 为当前作用域设定特定数量的政治点数
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| add_stability
|add_stability
| <code><int> / <variable></code><br/> The amount to add.
|<code><int> / <variable></code><br /> 数量
| <pre>add_stability = 0.1</pre>
|<pre>add_stability = 0.1</pre>


| Adds to the current stability value for the current scope.
| 为当前作用域增加特定数量的稳定度
| Stability values are between 0 and 1.
| 稳定度的值在0到1之间
| 1.5
|1.5
|-
|-
| set_stability
|set_stability
| <code><int> / <variable></code><br/> The amount to add.
|<code><int> / <variable></code><br /> The amount to add.
| <pre>set_stability = 0.5</pre>
|<pre>set_stability = 0.5</pre>


| Sets the current stability value for the current scope.
| 为当前作用域设定特定数量的稳定度
| Stability values are between 0 and 1.
| 稳定度的值在0到1之间
| 1.5
|1.5
|-
|-
| add_war_support
|add_war_support
| <code><int> / <variable></code><br/> The amount to add.
|<code><int> / <variable></code><br /> The amount to add.
| <pre>add_war_support = 0.1</pre>
|<pre>add_war_support = 0.1</pre>


| Adds to the current war support value for the current scope.
| 为当前作用域增加特定数量的战争支持度
| War Support values are between 0 and 1.
| 战争支持度的值在0到1之间
| 1.5
|1.5
|-
|-
| set_war_support
|set_war_support
| <code><int> / <variable></code><br/> The amount to set.
|<code><int> / <variable></code><br /> The amount to set.
| <pre>set_war_support = 0.5</pre>
|<pre>set_war_support = 0.5</pre>


| Sets the current war support value for the current scope.
| 为当前作用域设定特定数量的战争支持度
| War Support values are between 0 and 1.
| 战争支持度的值在0到1之间
| 1.5
|1.5
|-
|-
| add_command_power
|add_command_power
| <code><int> / <variable></code><br/> The amount to add.
|<code><int> / <variable></code><br /> The amount to add.
| <pre>add_command_power = 100</pre>
|<pre>add_command_power = 100</pre>


| Adds the specified amount of command power to the current scope.
| 为当前作用域增加特定数量的指挥点数
| &nbsp;
|&nbsp;
| 1.5
|1.5
|}
|}


=== Politics ===
=== 政治===


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| kill_ideology_leader
|kill_ideology_leader
| <code><ideology></code><br/> Ideology.
|<code><ideology></code><br /> Ideology.
| <pre>kill_ideology_leader = communism</pre>
|<pre>kill_ideology_leader = communism</pre>


| Kills the country leader of the designated ideology for the current scope.
|Kills the country leader of the designated ideology for the current scope.
| &nbsp;
|&nbsp;
| 1.9
|1.9
|-
|-
| retire_ideology_leader
|retire_ideology_leader
| <code><ideology></code><br/> Ideology.
|<code><ideology></code><br /> Ideology.
| <pre>retire_ideology_leader = fascism</pre>
|<pre>retire_ideology_leader = fascism</pre>


| Retires and removes the country leader of the ideology party for the current scope.
|Retires and removes the country leader of the ideology party for the current scope.
| &nbsp;
|&nbsp;
| 1.9
|1.9
|-
|-
| kill_country_leader
|kill_country_leader
| <code><bool></code><br/> Boolean.
|<code><bool></code><br /> Boolean.
| <pre>kill_country_leader = yes</pre>
|<pre>kill_country_leader = yes</pre>


| Kills the country leader for the current scope.
|Kills the country leader for the current scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| retire_country_leader
|retire_country_leader
| <code><bool></code><br/> Boolean.
|<code><bool></code><br /> Boolean.
| <pre>retire_country_leader = yes</pre>
|<pre>retire_country_leader = yes</pre>


| Retires and removes the country leader as head of their party for the current scope.
|Retires and removes the country leader as head of their party for the current scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| set_country_leader_ideology
|set_country_leader_ideology
| <code><government></code><br/> The government to set.
|<code><government></code><br /> The government to set.
| <pre>set_country_leader_ideology = socialism</pre>
|<pre>set_country_leader_ideology = socialism</pre>


| Changes the country leader's government type for the current scope.
|Changes the country leader's government type for the current scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| add_country_leader_trait
|add_country_leader_trait
| <code><trait></code><br/> The trait to add.
|<code><trait></code><br /> The trait to add.
| <pre>add_country_leader_trait = nationalist_symbol</pre>
|<pre>add_country_leader_trait = nationalist_symbol</pre>


| Adds the specified trait to the current scope's country leader.
|Adds the specified trait to the current scope's country leader.
| Traits are found in {{path|common/country_leader/*.txt}}.
|Traits are found in {{path|common/country_leader/*.txt}}.
| 1.0
|1.0
|-
|-
| remove_country_leader_trait
|remove_country_leader_trait
| <code><trait></code><br/> The trait to remove.
|<code><trait></code><br /> The trait to remove.
| <pre>remove_country_leader_trait = nationalist_symbol</pre>
|<pre>remove_country_leader_trait = nationalist_symbol</pre>


| Removes the specified trait from the current scope's country leader.
|Removes the specified trait from the current scope's country leader.
| Traits are found in {{path|common/country_leader/*.txt}}.
|Traits are found in {{path|common/country_leader/*.txt}}.
| 1.0
|1.0
|-
|-
| hold_election
|hold_election
| <code><scope></code><br/> The country to hold an election for.
|<code><scope></code><br /> The country to hold an election for.
| <pre>hold_election = ROOT</pre>
|<pre>hold_election = ROOT</pre>


| Executes the events in the '''on_new_term_election''' on action for the current scope.
|Executes the events in the '''on_new_term_election''' on action for the current scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| add_popularity
|add_popularity
| <code>ideology = <ideology></code><br/> The party to change. 
|<code>ideology = <ideology></code><br /> The party to change. 
<code>popularity = <int> / <variable></code><br/> The amount of popularity to change.
<code>popularity = <int> / <variable></code><br /> The amount of popularity to change.


| <pre>add_popularity = {
|<pre>add_popularity = {
    ideology = fascism
    ideology = fascism
    popularity = -0.5
    popularity = -0.5
第817行: 第818行:
</pre>
</pre>


| Adjusts the popularity for the specified party in the current scope.
|Adjusts the popularity for the specified party in the current scope.
| Values used are 0 to 1.
|Values used are 0 to 1.
| 1.0
|1.0
|-
|-
| set_politics
|set_politics
| <code>ruling_party = <ideology></code><br/> The party to set. 
|<code>ruling_party = <ideology></code><br /> The party to set. 
<code>elections_allowed = <bool></code><br/> Whether elections are allowed. Optional.<br/> <code>last_election = <date></code><br/> When the last election was. Optional.<br/> <code>election_frequency = <int></code><br/> How often in months an election occurs. Optional.<br/>
<code>elections_allowed = <bool></code><br /> Whether elections are allowed. Optional.<br /> <code>last_election = <date></code><br /> When the last election was. Optional.<br /> <code>election_frequency = <int></code><br /> How often in months an election occurs. Optional.<br />


| <pre>set_politics = {
|<pre>set_politics = {
ruling_party = neutrality
ruling_party = neutrality
}
}
</pre>
</pre>


| Sets the political party setup for the current scope.
|Sets the political party setup for the current scope.
| &nbsp;
|&nbsp;
Previously included the "parties" parameter, which has been deprecated by the "set_popularities" command. The "parties" parameter no longer works as of version 1.7
Previously included the "parties" parameter, which has been deprecated by the "set_popularities" command. The "parties" parameter no longer works as of version 1.7
| 1.0 (Updated 1.7)
|1.0 (Updated 1.7)
|-
|-
| set_popularities
|set_popularities
| <code><ideology> = <int>/<variable></code><br/> The popularity to set. 
|<code><ideology> = <int>/<variable></code><br /> The popularity to set.
| <pre>set_popularities = {
|<pre>set_popularities = {
democratic = 50
democratic = 50
neutrality = 15
neutrality = 15
第845行: 第846行:
</pre>
</pre>


| Sets the political party popularities for the current scope.
|Sets the political party popularities for the current scope.
| &nbsp;
|&nbsp;
The popularities must add up to 100, otherwise the command will have no effect.
The popularities must add up to 100, otherwise the command will have no effect.
| 1.7
|1.7
|-
|-
| set_political_party
|set_political_party
| <code>ideology = <ideology></code><br/> The party to change. 
|<code>ideology = <ideology></code><br /> The party to change. 
<code>popularity = <int></code><br/> The amount of popularity to set.
<code>popularity = <int></code><br /> The amount of popularity to set.


| <pre>set_political_party = {
|<pre>set_political_party = {
    ideology = fascism
    ideology = fascism
    popularity = 50
    popularity = 50
第860行: 第861行:
</pre>
</pre>


| Sets the popularity for the specified political party in the current scope.
|Sets the popularity for the specified political party in the current scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| set_party_name
|set_party_name
| <code>ideology = <ideology></code><br/> The party to change. 
|<code>ideology = <ideology></code><br /> The party to change. 
<code>long_name = <string></code><br/> The new full name for the party.<br/> <code>name = <string></code><br/> The new short name for the party.
<code>long_name = <string></code><br /> The new full name for the party.<br /> <code>name = <string></code><br /> The new short name for the party.


| <pre>set_party_name = { 
|<pre>set_party_name = { 
    ideology = neutrality 
    ideology = neutrality 
    long_name = GER_neutrality_party_kaiserreich_long 
    long_name = GER_neutrality_party_kaiserreich_long 
第875行: 第876行:
</pre>
</pre>


| Changes the name of the specified political party for the current scope.
|Changes the name of the specified political party for the current scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| create_country_leader
|create_country_leader
| <code>name = <string></code><br/> The name of the leader. 
|<code>name = <string></code><br /> The name of the leader. 
<code>desc = <string></code><br/> The description of the leader.<br/> <code>picture = <string></code><br/> The graphical reference to the leader portrait.<br/> <code>expire = <string></code><br/> When the leader dies in history.<br/> <code>ideology = <string></code><br/> The ideology government the leader belongs to.<br/> '''Traits scope'''<br/> <code><trait></code><br/> The trait to add. Can add multiple.
<code>desc = <string></code><br /> The description of the leader.<br /> <code>picture = <string></code><br /> The graphical reference to the leader portrait.<br /> <code>expire = <string></code><br /> When the leader dies in history.<br /> <code>ideology = <string></code><br /> The ideology government the leader belongs to.<br /> '''Traits scope'''<br /> <code><trait></code><br /> The trait to add. Can add multiple.


| <pre>create_country_leader = {
|<pre>create_country_leader = {
name = "Mohammed Zahir Shah"
name = "Mohammed Zahir Shah"
desc = "POLITICS_MOHAMMED_ZAHIR_SHAH_DESC"
desc = "POLITICS_MOHAMMED_ZAHIR_SHAH_DESC"
第895行: 第896行:
</pre>
</pre>


| &nbsp;
|&nbsp;
| The portrait string can include the full path (i.e. ''gfx/leaders/my_folder/custom_pic.dds'') or just the name of the image (i.e. custom_pic.dds). 
|The portrait string can include the full path (i.e. ''gfx/leaders/my_folder/custom_pic.dds'') or just the name of the image (i.e. custom_pic.dds). 
With just the name, the image must be in a folder that matches the tag of the current scope, for example {{path|gfx/leaders/GER/custom_pic.dds}}.
With just the name, the image must be in a folder that matches the tag of the current scope, for example {{path|gfx/leaders/GER/custom_pic.dds}}.


| 1.0
|1.0
|}
|}


=== Diplomacy ===
=== 外交===


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| set_major
|set_major
| <code><bool></code><br/> Boolean.
|<code><bool></code><br /> Boolean.
| <pre>set_major = yes</pre>
|<pre>set_major = yes</pre>


| Makes the current scope a major country.
| 使当前作用域成为主要国家
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| create_faction
|create_faction
| <code><string></code><br/> The name of the faction.
|<code><string></code><br /> The name of the faction.
| <pre>create_faction = MY_FACTION_NAME</pre>
|<pre>create_faction = MY_FACTION_NAME</pre>


| Creates a faction with the specified name for the current scope. The current scope and any subjects automatically join the faction.
|Creates a faction with the specified name for the current scope. The current scope and any subjects automatically join the faction.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| add_to_faction
|add_to_faction
| <code><TAG></code><br/> The TAG of the nation to add to the faction of the current scope.
|<code><TAG></code><br /> The TAG of the nation to add to the faction of the current scope.
| <pre>FACTION_LEADER_TAG = { add_to_faction = TAG_TO_ADD }</pre>
|<pre>FACTION_LEADER_TAG = { add_to_faction = TAG_TO_ADD }</pre>


| Adds the TAG_TO_ADD to the faction of the FACTION_LEADER_TAG.
|Adds the TAG_TO_ADD to the faction of the FACTION_LEADER_TAG.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| leave_faction
|leave_faction
| <code><bool></code><br/> Boolean.
|<code><bool></code><br /> Boolean.
| <pre>leave_faction = yes</pre>
|<pre>leave_faction = yes</pre>


| Removes the current scope from the faction they are part of.
|Removes the current scope from the faction they are part of.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| remove_from_faction
|remove_from_faction
| <code><string></code><br/> The name of the faction.
|<code><string></code><br /> The name of the faction.
| <pre>remove_from_faction = MY_FACTION_NAME</pre>
|<pre>remove_from_faction = MY_FACTION_NAME</pre>


| Removes the current scope from the specified faction.
|Removes the current scope from the specified faction.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| dismantle_faction
|dismantle_faction
| <code><bool></code><br/> Boolean.
|<code><bool></code><br /> Boolean.
| <pre>dismantle_faction = yes</pre>
|<pre>dismantle_faction = yes</pre>


| Dismantles the faction of the current scope.
|Dismantles the faction of the current scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| puppet
|puppet
| <code><scope></code><br/> The target country.
|<code><scope></code><br /> The target country.
| <pre>puppet = GER</pre>
|<pre>puppet = GER</pre>


| Makes the specified country the puppet of the current scope.
|Makes the specified country the puppet of the current scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| end_puppet
|end_puppet
| <code><scope></code><br/> The target country.
|<code><scope></code><br /> The target country.
| <pre>end_puppet = GER</pre>
|<pre>end_puppet = GER</pre>


| Removes the puppet status between the target and the current scope.
|Removes the puppet status between the target and the current scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| release
|release
| <code><scope></code><br/> The target country.
|<code><scope></code><br /> The target country.
| <pre>release = GER</pre>
|<pre>release = GER</pre>


| Releases the specified subject or core-only country as a free nation.
|Releases the specified subject or core-only country as a free nation.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| release_puppet
|release_puppet
| <code><scope></code><br/> The target country.
|<code><scope></code><br /> The target country.
| <pre>release_puppet = GER</pre>
|<pre>release_puppet = GER</pre>


| Releases the specified subject or core-only country as a puppet for the current scope.
|Releases the specified subject or core-only country as a puppet for the current scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| give_guarantee
|give_guarantee
| <code><scope></code><br/> The target country.
|<code><scope></code><br /> The target country.
| <pre>give_guarantee = GER</pre>
|<pre>give_guarantee = GER</pre>


| Makes the current scope guarantee the specified country.
|Makes the current scope guarantee the specified country.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| give_military_access
|give_military_access
| <code><scope></code><br/> The target country.
|<code><scope></code><br /> The target country.
| <pre>give_military_access = GER</pre>
|<pre>give_military_access = GER</pre>


| Makes the specified country grant the current scope military access to their country.
|Makes the specified country grant the current scope military access to their country.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| recall_attache
|recall_attache
| <code><scope></code><br/> The target country with an attache.
|<code><scope></code><br /> The target country with an attache.
| <pre>recall_attache = GER</pre>
|<pre>recall_attache = GER</pre>


| Recalls the current scope's attache from the specified country.
|Recalls the current scope's attache from the specified country.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| diplomatic_relation
|diplomatic_relation
| <code>country = <scope></code><br/> The target country to alter the relationship with ROOT. 
|<code>country = <scope></code><br /> The target country to alter the relationship with ROOT. 
<code>relation = <type></code><br/> The relation to change.<br/> <code>active = <bool></code><br/> Whether the relation is started or broken.
<code>relation = <type></code><br /> The relation to change.<br /> <code>active = <bool></code><br /> Whether the relation is started or broken.


| <pre>diplomatic_relation = {
|<pre>diplomatic_relation = {
    country = SOV
    country = SOV
    relation = guarantee
    relation = guarantee
第1,028行: 第1,029行:
</pre>
</pre>


| Used to define a diplomatic relation between the current scope and target scope country.
|Used to define a diplomatic relation between the current scope and target scope country.
| Possible relations: 
|Possible relations: 
*non_aggression_pact 
 
*guarantee 
*non_aggression_pact
*puppet 
*guarantee
*military_access 
*puppet
*military_access
*docking_rights
*docking_rights


| 1.0
|1.0
|-
|-
| add_opinion_modifier
|add_opinion_modifier
| <code>target = <scope></code><br/> The target country. 
|<code>target = <scope></code><br /> The target country. 
<code>modifier = <modifier></code><br/> The opinion modifier to add.
<code>modifier = <modifier></code><br /> The opinion modifier to add.


| <pre>add_opinion_modifier = {
|<pre>add_opinion_modifier = {
    target = GER
    target = GER
    modifier = faction_traitor
    modifier = faction_traitor
第1,048行: 第1,050行:
</pre>
</pre>


| Adds the specified opinion modifier for the current scope '''towards''' the specified scope.
|Adds the specified opinion modifier for the current scope '''towards''' the specified scope.
| Opinion modifiers are found in {{path|common/opinion_modifiers/*.txt}}.
|Opinion modifiers are found in {{path|common/opinion_modifiers/*.txt}}.
| 1.0
|1.0
|-
|-
| remove_opinion_modifier
|remove_opinion_modifier
| <code>target = <scope></code><br/> The target country. 
|<code>target = <scope></code><br /> The target country. 
<code>modifier = <modifier></code><br/> The opinion modifier to remove.
<code>modifier = <modifier></code><br /> The opinion modifier to remove.


| <pre>remove_opinion_modifier = {
|<pre>remove_opinion_modifier = {
    target = GER
    target = GER
    modifier = faction_traitor
    modifier = faction_traitor
第1,062行: 第1,064行:
</pre>
</pre>


| Removes the specified opinion modifier for the current scope '''towards''' the specified scope.
|Removes the specified opinion modifier for the current scope '''towards''' the specified scope.
| Opinion modifiers are found in {{path|common/opinion_modifiers/*.txt}}.
|Opinion modifiers are found in {{path|common/opinion_modifiers/*.txt}}.
| 1.0
|1.0
|-
|-
| reverse_add_opinion_modifier
|reverse_add_opinion_modifier
| <code>target = <scope></code><br/> The target country. 
|<code>target = <scope></code><br /> The target country. 
<code>modifier = <modifier></code><br/> The opinion modifier to add.
<code>modifier = <modifier></code><br /> The opinion modifier to add.


| <pre>reverse_add_opinion_modifier = {
|<pre>reverse_add_opinion_modifier = {
    target = GER
    target = GER
    modifier = faction_traitor
    modifier = faction_traitor
第1,076行: 第1,078行:
</pre>
</pre>


| Adds the specified opinion modifier for the specified scope '''towards''' the current scope.
|Adds the specified opinion modifier for the specified scope '''towards''' the current scope.
| Opinion modifiers are found in {{path|common/opinion_modifiers/*.txt}}.
|Opinion modifiers are found in {{path|common/opinion_modifiers/*.txt}}.
| 1.0
|1.0
|-
|-
| add_relation_modifier
|add_relation_modifier
| <code>target = <scope></code><br/> The target country. 
|<code>target = <scope></code><br /> The target country. 
<code>modifier = <modifier></code><br/> The relation modifier to add.
<code>modifier = <modifier></code><br /> The relation modifier to add.


| <pre>add_relation_modifier = {
|<pre>add_relation_modifier = {
    target = SWE
    target = SWE
    modifier = HUN_dynastic_ties_license
    modifier = HUN_dynastic_ties_license
第1,090行: 第1,092行:
</pre>
</pre>


| Adds the specified relation modifier for the current scope '''towards''' the specified scope.
|Adds the specified relation modifier for the current scope '''towards''' the specified scope.
| Relation modifiers are found in {{path|common/modifiers/*.txt}}.
|Relation modifiers are found in {{path|common/modifiers/*.txt}}.
| 1.4
|1.4
|-
|-
| remove_relation_modifier
|remove_relation_modifier
| <code>target = <scope></code><br/> The target country. 
|<code>target = <scope></code><br /> The target country. 
<code>modifier = <modifier></code><br/> The relation modifier to remove.
<code>modifier = <modifier></code><br /> The relation modifier to remove.


| <pre>remove_relation_modifier = {
|<pre>remove_relation_modifier = {
    target = SWE
    target = SWE
    modifier = HUN_dynastic_ties_license
    modifier = HUN_dynastic_ties_license
第1,104行: 第1,106行:
</pre>
</pre>


| Removes the specified relation modifier for the current scope '''towards''' the specified scope.
|Removes the specified relation modifier for the current scope '''towards''' the specified scope.
| Relation modifiers are found in {{path|common/modifiers/*.txt}}.
|Relation modifiers are found in {{path|common/modifiers/*.txt}}.
| 1.4
|1.4
|}
|}


=== Subjects ===
=== 附属国===


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| add_autonomy_ratio
|add_autonomy_ratio
| <code>value = <float></code><br/> The freedom score to add. 
|<code>value = <float></code><br /> The freedom score to add. 
<code>localization = <string></code><br/> The localization key for the modifier.
<code>localization = <string></code><br /> The localization key for the modifier.


| <pre>add_autonomy_ratio = {
|<pre>add_autonomy_ratio = {
    value = 0.1
    value = 0.1
    localization = AST_adopt_westminster
    localization = AST_adopt_westminster
第1,130行: 第1,132行:
</pre>
</pre>


| Adds a freedom score ratio modifier to the current scope.
|Adds a freedom score ratio modifier to the current scope.
| Used in the subject.
|Used in the subject.
| 1.3
|1.3
|-
|-
| add_autonomy_score
|add_autonomy_score
| <code>value = <float></code><br/> The freedom score to add. 
|<code>value = <float></code><br /> The freedom score to add. 
<code>localization = <string></code><br/> The localization key for the modifier.
<code>localization = <string></code><br /> The localization key for the modifier.


| <pre>add_autonomy_ratio = {
|<pre>add_autonomy_ratio = {
    value = 10
    value = 10
    localization = EXAMPLE
    localization = EXAMPLE
第1,144行: 第1,146行:
</pre>
</pre>


| Adds an exact freedom score modifier to the current scope.
|Adds an exact freedom score modifier to the current scope.
| Used in the subject.
|Used in the subject.
| 1.3
|1.3
|-
|-
| set_autonomy
|set_autonomy
| <code>target = <scope> / <variable></code><br/> The subject country. 
|<code>target = <scope> / <variable></code><br /> The subject country. 
<code>autonomy_state = <type></code><br/> The type of autonomy state to set.<br/> <code>freedom_level = <float></code><br/> The new freedom level value. Optional.
<code>autonomy_state = <type></code><br /> The type of autonomy state to set.<br /> <code>freedom_level = <float></code><br /> The new freedom level value. Optional.


| <pre>set_autonomy = {
|<pre>set_autonomy = {
    target = AST
    target = AST
    autonomy_state = autonomy_free
    autonomy_state = autonomy_free
第1,158行: 第1,160行:
</pre>
</pre>


| Sets the autonomy level for the specified country.
|Sets the autonomy level for the specified country.
| The autonomy states are found in {{path|common/autonomous_states/*.txt}}.
|The autonomy states are found in {{path|common/autonomous_states/*.txt}}.
| 1.3
|1.3
|-
|-
| release_autonomy
|release_autonomy
| <code>target = <scope> / <variable></code><br/> The subject country. 
|<code>target = <scope> / <variable></code><br /> The subject country. 
<code>autonomy_state = <type></code><br/> The type of autonomy state to set.<br/> <code>freedom_level = <float></code><br/> The new freedom level value. Optional.
<code>autonomy_state = <type></code><br /> The type of autonomy state to set.<br /> <code>freedom_level = <float></code><br /> The new freedom level value. Optional.


| <pre>release_autonomy = {
|<pre>release_autonomy = {
    target = VIN
    target = VIN
    autonomy_state = autonomy_puppet
    autonomy_state = autonomy_puppet
第1,173行: 第1,175行:
</pre>
</pre>


| Releases the country and sets the autonomy level for the specified country.
|Releases the country and sets the autonomy level for the specified country.
| The autonomy states are found in {{path|common/autonomous_states/*.txt}}.
|The autonomy states are found in {{path|common/autonomous_states/*.txt}}.
| 1.3
|1.3
|}
|}


=== War ===
=== 战争===


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| add_threat
|add_threat
| <code><int></code><br/> The amount to change by.
|<code><int></code><br /> The amount to change by.
| <pre>add_threat = 10</pre>
|<pre>add_threat = 10</pre>


| Adjusts the level of World Tension.
| 调整全球紧张度
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| add_named_threat
|add_named_threat
| <code>threat = <int></code><br/> The amount to change by. 
|<code>threat = <int></code><br /> The amount to change by. 
<code>name = <string></code><br/> The localization string.
<code>name = <string></code><br /> The localization string.


| <pre>add_named_threat = { 
|<pre>add_named_threat = { 
    threat = 5 
    threat = 5 
    name = GER_rhineland
    name = GER_rhineland
第1,207行: 第1,209行:
</pre>
</pre>


| Adjusts the level of World Tension and adds an entry in the World Tension tooltip.
|Adjusts the level of World Tension and adds an entry in the World Tension tooltip.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| annex_country
|annex_country
| <code>target = <scope></code><br/> Which country to annex. 
|<code>target = <scope></code><br /> Which country to annex. 
<code>transfer_troops = yes</code><br/> Whether to transfer the troops of the annexed country.
<code>transfer_troops = yes</code><br /> Whether to transfer the troops of the annexed country.


| <pre>annex_country = {
|<pre>annex_country = {
    target = GER
    target = GER
    transfer_troops = yes
    transfer_troops = yes
第1,221行: 第1,223行:
</pre>
</pre>


| Annex the specified country for the current scope.
|Annex the specified country for the current scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| add_to_war
|add_to_war
| <code>targeted_alliance = <scope></code><br/> The country to assist. 
|<code>targeted_alliance = <scope></code><br /> The country to assist. 
<code>enemy = <scope></code><br/> The country attacking the ally.<br/> <code>hostility_reason = <string></code><br/> Localization for the reason for joining. Optional.
<code>enemy = <scope></code><br /> The country attacking the ally.<br /> <code>hostility_reason = <string></code><br /> Localization for the reason for joining. Optional.


| <pre>add_to_war = { 
|<pre>add_to_war = { 
    targeted_alliance = PREV 
    targeted_alliance = PREV 
    enemy = HUN 
    enemy = HUN 
第1,236行: 第1,238行:
</pre>
</pre>


| Adds the current scope into the war of their ally against the specified enemy.
|Adds the current scope into the war of their ally against the specified enemy.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| declare_war_on
|declare_war_on
| <code>target = <scope> / <variable></code><br/> The country to attack. 
|<code>target = <scope> / <variable></code><br /> The country to attack. 
<code>type = <wargoal></code><br/> The wargoal to declare with.
<code>type = <wargoal></code><br /> The wargoal to declare with.


| <pre>declare_war_on = {
|<pre>declare_war_on = {
    target = GER
    target = GER
    type = annex_everything
    type = annex_everything
第1,250行: 第1,252行:
</pre>
</pre>


| Makes the current scope declare war on the specified country with the specified wargoal.
|Makes the current scope declare war on the specified country with the specified wargoal.
| Wargoals are found in {{path|common/wargoals/*.txt}}.
|Wargoals are found in {{path|common/wargoals/*.txt}}.
| 1.0
|1.0
|-
|-
| white_peace
|white_peace
| <code><scope> / <variable></code><br/> The scope to white peace. 
|<code><scope> / <variable></code><br /> The scope to white peace. 
<code><message></code><br/> The reason for peace.
<code><message></code><br /> The reason for peace.


| <pre>white_peace = GER
|<pre>white_peace = GER
</pre>
</pre>
<pre>white_peace = {
<pre>white_peace = {
第1,266行: 第1,268行:
</pre>
</pre>


| Makes the current scope white peace the specified scope.
|Makes the current scope white peace the specified scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| set_truce
|set_truce
| <code>target = <scope></code><br/> The scope to truce with. 
|<code>target = <scope></code><br /> The scope to truce with. 
<code>days = <int></code><br/> The duration of the truce.
<code>days = <int></code><br /> The duration of the truce.


| <pre>set_truce = {
|<pre>set_truce = {
    target = GER
    target = GER
    days = 90
    days = 90
第1,280行: 第1,282行:
</pre>
</pre>


| Makes the current scope truce with the specified scope.
|Makes the current scope truce with the specified scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| create_wargoal
|create_wargoal
| <code>target = <scope> / <variable></code><br/> The country to target. 
|<code>target = <scope> / <variable></code><br /> The country to target. 
<code>type = <wargoal></code><br/> The wargoal to generate.<br/> <code>generator = { <state id> }</code><br/> The states to supply the wargoal (i.e. take_state_focus).
<code>type = <wargoal></code><br /> The wargoal to generate.<br /> <code>generator = { <state id> }</code><br /> The states to supply the wargoal (i.e. take_state_focus).


| <pre>create_wargoal = {
|<pre>create_wargoal = {
    type = puppet_wargoal_focus
    type = puppet_wargoal_focus
    target = ROOT
    target = ROOT
第1,294行: 第1,296行:
</pre>
</pre>


| Grants the current scope a wargoal against the specified country.
|Grants the current scope a wargoal against the specified country.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| start_civil_war
|start_civil_war
| <code>ideology = <ideology></code><br/> The ideology of the breakaway country. 
|<code>ideology = <ideology></code><br /> The ideology of the breakaway country. 
<code>ruling_party = <ideology></code><br/> The ruling party of the original country. Optional.<br/> <code>size = <float></code><br/> The size of the breakaway country and the fraction of the original stockpile and military units it will receive. Optional.<br/> <code>capital = <state></code><br/> The capital of the breakaway country. Optional.<br/> <code>only_own_territory = <bool></code><br/> Limits the breakaway country to only own territory. Optional.<br/> <code>states = { <state> }</code><br/> The states included in the breakway country. Optional.<br/> <code>states_filter = { <triggers> }</code><br/> Filters to apply to the state assignment for the breakaway country. Optional.<br/> <code>keep_unit_leaders = { <unit leader id> }</code><br/> Keep the specified leaders. Optional.<br/> <code>keep_unit_leaders_trigger = { <triggers></code><br/> Keep the specified leaders that meet the triggers. Optional.
<code>ruling_party = <ideology></code><br /> The ruling party of the original country. Optional.<br /> <code>size = <float></code><br /> The size of the breakaway country and the fraction of the original stockpile and military units it will receive. Optional.<br /> <code>capital = <state></code><br /> The capital of the breakaway country. Optional.<br /> <code>only_own_territory = <bool></code><br /> Limits the breakaway country to only own territory. Optional.<br /> <code>states = { <state> }</code><br /> The states included in the breakway country. Optional.<br /> <code>states_filter = { <triggers> }</code><br /> Filters to apply to the state assignment for the breakaway country. Optional.<br /> <code>keep_unit_leaders = { <unit leader id> }</code><br /> Keep the specified leaders. Optional.<br /> <code>keep_unit_leaders_trigger = { <triggers></code><br /> Keep the specified leaders that meet the triggers. Optional.


| <pre>start_civil_war = {
|<pre>start_civil_war = {
    ruling_party = communism
    ruling_party = communism
    ideology = ROOT
    ideology = ROOT
第1,317行: 第1,319行:
</pre>
</pre>


| Starts a civil war for the current scope with the specified parameters.
|Starts a civil war for the current scope with the specified parameters.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|}
|}


=== Resources ===
=== 资源===


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| add_resource
|add_resource
| <code>type = <resource></code><br/> The resource to add.
|<code>type = <resource></code><br /> 要添加的资源
<code>amount = <int></code><br/> The amount of resource to add.<br/> <code>state = <id></code>Which state to add the resource to. Variables can be used.
<code>amount = <int></code><br /> 要添加资源的数量<br /> <code>state = <id></code> 要添加资源的地区。 可以使用变量


| <pre>add_resource = {
|<pre>add_resource = {
    type = oil
    type = oil
    amount = 50
    amount = 50
第1,344行: 第1,346行:
</pre>
</pre>


| Adds the specified resource in the specified amount to the specified state.
| 在特定地区添加特定数量的特定资源
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| destroy_resource 
|destroy_resource
| <code>type = <resource></code><br/> The resource to add.
|<code>type = <resource></code><br /> 要添加的资源
<code>amount = <int></code><br/> The amount of resource to add.<br/> <code>state = <id></code>Which state to add the resource to. Variables can be used.
<code>amount = <int></code><br /> 要添加资源的数量<br /> <code>state = <id></code> 要添加资源的地区。 可以使用变量


| <pre>destroy_resource = {
|<pre>destroy_resource = {
    type = oil
    type = oil
    amount = 50
    amount = 50
第1,359行: 第1,361行:
</pre>
</pre>


| Destroys specified resource in the specified amount to the specified state.
| 在特定地区摧毁特定数量的特定资源
| &nbsp;
|&nbsp;
| 1.9
|1.9
|-
|-
| create_import
|create_import
| <code>resource = <resource></code><br/> The resource to import. 
|<code>resource = <resource></code><br /> The resource to import. 
<code>amount = <int></code><br/> The amount of resource to import.<br/> <code>exporter = <id></code>Which country exports the resource.
<code>amount = <int></code><br /> The amount of resource to import.<br /> <code>exporter = <id></code>Which country exports the resource.


| <pre>create_import = {
|<pre>create_import = {
    resource = steel
    resource = steel
    amount = 100
    amount = 100
第1,374行: 第1,376行:
</pre>
</pre>


| Creates an import for the current scope with the specified resource and from the specified exporter.
|Creates an import for the current scope with the specified resource and from the specified exporter.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|}
|}


=== Buildings ===
=== 建筑===


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| add_offsite_building
|add_offsite_building
| <code>type = <building></code><br/> The building to add. 
|<code>type = <building></code><br /> The building to add. 
<code>level = <level> / <variable></code><br/> The maximum level to add.
<code>level = <level> / <variable></code><br /> The maximum level to add.


| <pre>add_offsite_building = { type = arms_factory level = 1 }
|<pre>add_offsite_building = { type = arms_factory level = 1 }
</pre>
</pre>


| Adds an off-map building for the current scope that produces its effects without being present in a state.
|Adds an off-map building for the current scope that produces its effects without being present in a state.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| modify_building_resources
|modify_building_resources
| <code>building = <building></code><br/> The building to modify. 
|<code>building = <building></code><br /> The building to modify. 
<code>resource = <resource></code><br/> The resource to add.<br/> <code>amount = <amount></code><br/> The amount of resource to add.
<code>resource = <resource></code><br /> The resource to add.<br /> <code>amount = <amount></code><br /> The amount of resource to add.


| <pre>modify_building_resources = {
|<pre>modify_building_resources = {
    building = synthetic_refinery
    building = synthetic_refinery
    resource = oil
    resource = oil
第1,412行: 第1,414行:
</pre>
</pre>


| Modifies the resource output of the specified building for the current scope.
|Modifies the resource output of the specified building for the current scope.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|}
|}


=== National Focus ===
=== 国策===


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| load_focus_tree
|load_focus_tree
| <code><string></code><br/> The focus tree to load.<br/>Alternatively, as an effect block:<br/><code>tree = <string></code><br/><code>keep_completed = yes/no</code>
|<code><string></code><br /> The focus tree to load.<br />Alternatively, as an effect block:<br /><code>tree = <string></code><br /><code>keep_completed = yes/no</code>
| <pre>load_focus_tree = china_communist_focus</pre><br/><pre>load_focus_tree = { tree = british_focus keep_completed = yes }</pre>
|<pre>load_focus_tree = china_communist_focus</pre><br /><pre>load_focus_tree = { tree = british_focus keep_completed = yes }</pre>


| Loads a new focus tree for the current scope, retaining any shared focuses.
|Loads a new focus tree for the current scope, retaining any shared focuses.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| unlock_national_focus
|unlock_national_focus
| <code><focus></code><br/> The focus to unlock.
|<code><focus></code><br /> The focus to unlock.
| <pre>unlock_national_focus = my_focus</pre>
|<pre>unlock_national_focus = my_focus</pre>


| Bypasses the specified focus for the current scope (marks as complete without firing <code>complete_effect</code> of the focus).
|Bypasses the specified focus for the current scope (marks as complete without firing <code>complete_effect</code> of the focus).
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| complete_national_focus
|complete_national_focus
| <code><focus></code><br/> The focus to complete.
|<code><focus></code><br /> The focus to complete.
| <pre>complete_national_focus = my_focus</pre>
|<pre>complete_national_focus = my_focus</pre>


| Completes the specified focus for the current scope.
|Completes the specified focus for the current scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|}
|}


=== Decisions ===
=== 决议===


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| activate_decision
|activate_decision
| <code><decision></code><br/> The decision to activate.
|<code><decision></code><br /> The decision to activate.
| <pre>activate_decision = my_decision</pre>
|<pre>activate_decision = my_decision</pre>


| Activates the specified decision for the current scope, ignoring triggers for the decision.
|Activates the specified decision for the current scope, ignoring triggers for the decision.
| Decisions are found in {{path|common/decisions/*.txt}}
|Decisions are found in {{path|common/decisions/*.txt}}
| 1.0
|1.0
|-
|-
| activate_targeted_decision
|activate_targeted_decision
| <code>target = <scope></code><br/> The country to target. 
|<code>target = <scope></code><br /> The country to target. 
<code>decision = <decision></code><br/> The decision to activate.
<code>decision = <decision></code><br /> The decision to activate.


| <pre>activate_targeted_decision = {
|<pre>activate_targeted_decision = {
    target = GER
    target = GER
    decision = my_decision
    decision = my_decision
第1,482行: 第1,484行:
</pre>
</pre>


| Activates the specified targeted decision for the specified target for the current scope.
|Activates the specified targeted decision for the specified target for the current scope.
| Decisions are found in {{path|common/decisions/*.txt}}
|Decisions are found in {{path|common/decisions/*.txt}}
| 1.5
|1.5
|-
|-
| remove_targeted_decision
|remove_targeted_decision
| <code><decision></code><br/> The decision to remove.
|<code><decision></code><br /> The decision to remove.
| <pre>remove_targeted_decision = {
|<pre>remove_targeted_decision = {
    target = FROM
    target = FROM
    decision = my_decision
    decision = my_decision
第1,494行: 第1,496行:
</pre>
</pre>


| Removes the specified targeted decision for the current scope.
|Removes the specified targeted decision for the current scope.
| Decisions are found in {{path|common/decisions/*.txt}}
|Decisions are found in {{path|common/decisions/*.txt}}
| 1.5
|1.5
|-
|-
| unlock_decision_tooltip
|unlock_decision_tooltip
| <code><decision></code><br/> The decision to display.
|<code><decision></code><br /> The decision to display.
| <pre>unlock_decision_tooltip = my_decision</pre>
|<pre>unlock_decision_tooltip = my_decision</pre>


| Displays a special tooltip for the specified decision in the effect tooltip.
|Displays a special tooltip for the specified decision in the effect tooltip.
| Decisions are found in {{path|common/decisions/*.txt}}
|Decisions are found in {{path|common/decisions/*.txt}}
| 1.5
|1.5
|-
|-
| unlock_decision_category_tooltip
|unlock_decision_category_tooltip
| <code><category></code><br/> The decision category to display.
|<code><category></code><br /> The decision category to display.
| <pre>unlock_decision_category_tooltip = my_category</pre>
|<pre>unlock_decision_category_tooltip = my_category</pre>


| Displays a special tooltip for the specified decision category in the effect tooltip.
|Displays a special tooltip for the specified decision category in the effect tooltip.
| Decision categories are found in {{path|common/decisions/catergories/*.txt}}
|Decision categories are found in {{path|common/decisions/catergories/*.txt}}
| 1.5
|1.5
|}
|}


=== Missions ===
=== 任务===


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| activate_mission
|activate_mission
| <code><mission></code><br/> The mission to activate.
|<code><mission></code><br /> The mission to activate.
| <pre>activate_mission = my_mission</pre>
|<pre>activate_mission = my_mission</pre>


| Activates the specified mission for the current scope, ignoring any triggers for the decision.
|Activates the specified mission for the current scope, ignoring any triggers for the decision.
| Missions are found in {{path|common/decisions/*.txt}}
|Missions are found in {{path|common/decisions/*.txt}}
| 1.5
|1.5
|-
|-
| activate_mission_tooltip
|activate_mission_tooltip
| <code><mission></code><br/> The mission to display.
|<code><mission></code><br /> The mission to display.
| <pre>activate_mission_tooltip = my_mission</pre>
|<pre>activate_mission_tooltip = my_mission</pre>


| Displays a special tooltip for the specified mission in the effect tooltip.
|Displays a special tooltip for the specified mission in the effect tooltip.
| Missions are found in {{path|common/decisions/*.txt}}
|Missions are found in {{path|common/decisions/*.txt}}
| 1.5
|1.5
|-
|-
| remove_mission
|remove_mission
| <code><mission></code><br/> The mission to remove.
|<code><mission></code><br /> The mission to remove.
| <pre>remove_mission = my_mission</pre>
|<pre>remove_mission = my_mission</pre>


| Removes the specified mission for the current scope.
|Removes the specified mission for the current scope.
| Missions are found in {{path|common/decisions/*.txt}}
|Missions are found in {{path|common/decisions/*.txt}}
| 1.5
|1.5
|}
|}


=== Technology ===
=== 科技===


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| add_research_slot
|add_research_slot
| <code><int></code><br/> The number of slots to add or remove.
|<code><int></code><br /> The number of slots to add or remove.
| <pre>add_research_slot = 1</pre>
|<pre>add_research_slot = 1</pre>


| Adjusts the number of research slots the current scope has. Can remove slots.
|Adjusts the number of research slots the current scope has. Can remove slots.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| set_research_slots
|set_research_slots
| <code><int></code><br/> The number of slots to set.
|<code><int></code><br /> The number of slots to set.
| <pre>set_research_slots = 4</pre>
|<pre>set_research_slots = 4</pre>


| Sets the number of research slots the current scope has.
|Sets the number of research slots the current scope has.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| add_tech_bonus
|add_tech_bonus
| <code>bonus = <float></code><br/> The bonus to technology given. 
|<code>bonus = <float></code><br /> The bonus to technology given. 
<code>uses = <int></code><br/> The amount of times the bonus can be used.<br/> <code>ahead_reduction = <float></code><br/> The cost reduction if ahead of time.<br/> <code>category = <string></code><br/> Which technology category the bonus applies to. Multiple can be defined.<br/> <code>technology = <string></code><br/> Which technology the bonus applies to. Multiple can be defined.
<code>uses = <int></code><br /> The amount of times the bonus can be used.<br /> <code>ahead_reduction = <float></code><br /> The cost reduction if ahead of time.<br /> <code>category = <string></code><br /> Which technology category the bonus applies to. Multiple can be defined.<br /> <code>technology = <string></code><br /> Which technology the bonus applies to. Multiple can be defined.


| <pre>add_tech_bonus = {
|<pre>add_tech_bonus = {
    bonus = 0.5
    bonus = 0.5
    uses = 1
    uses = 1
第1,589行: 第1,591行:
</pre>
</pre>


| Grants a research bonus to the current scope with the specified parameters.
|Grants a research bonus to the current scope with the specified parameters.
| Research bonus categories are found in <code>Hearts of Iron IV/common/technology_tags/*.txt</code>
|Research bonus categories are found in <code>Hearts of Iron IV/common/technology_tags/*.txt</code>
| 1.0
|1.0
|-
|-
| set_technology
|set_technology
| <code><technology> = <int></code><br/> The technology to add.<br><code>popup = no</code><br/> To not show the popup after adding technology
|<code><technology> = <int></code><br /> The technology to add.<br><code>popup = no</code><br /> To not show the popup after adding technology
| <pre>set_technology = {
|<pre>set_technology = {
    suicide_craft = 1
    suicide_craft = 1
}
}
</pre>
</pre>


| Grants the specified technology to the current scope.
|Grants the specified technology to the current scope.
| A value of 1 sets the technology. A value of 0 removes the technology, but if it is a researchable technology, the duration to research isn't reset, meaning it can be researched in 1 day.
|A value of 1 sets the technology. A value of 0 removes the technology, but if it is a researchable technology, the duration to research isn't reset, meaning it can be researched in 1 day.
| 1.0
|1.0
|-
|-
| add_to_tech_sharing_group
|add_to_tech_sharing_group
| <code><string></code><br/> The group to add the current scope to.
|<code><string></code><br /> The group to add the current scope to.
| <pre>add_to_tech_sharing_group = us_research</pre>
|<pre>add_to_tech_sharing_group = us_research</pre>


| Adds the current scope to the specified technology sharing group.
|Adds the current scope to the specified technology sharing group.
| &nbsp;
|&nbsp;
| 1.3
|1.3
|-
|-
| remove_from_tech_sharing_group
|remove_from_tech_sharing_group
| <code><string></code><br/> The group to remove the current scope from.
|<code><string></code><br /> The group to remove the current scope from.
| <pre>remove_from_tech_sharing_group = us_research</pre>
|<pre>remove_from_tech_sharing_group = us_research</pre>


| Removes the current scope from the specified technology sharing group.
|Removes the current scope from the specified technology sharing group.
| &nbsp;
|&nbsp;
| 1.3
|1.3
|-
|-
| modify_tech_sharing_bonus
|modify_tech_sharing_bonus
| <code>id = <string></code><br/> The group to modify. 
|<code>id = <string></code><br /> The group to modify. 
<code>bonus = <float></code><br/> The new bonus.
<code>bonus = <float></code><br /> The new bonus.


| <pre>modify_tech_sharing_bonus = {
|<pre>modify_tech_sharing_bonus = {
    id = us_research
    id = us_research
    bonus = 0.5
    bonus = 0.5
第1,630行: 第1,632行:
</pre>
</pre>


| Modifies the specified technology sharing group.
|Modifies the specified technology sharing group.
| &nbsp;
|&nbsp;
| 1.3
|1.3
|}
|}


=== Ideas ===
=== 国家精神===


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| add_ideas
|add_ideas
| <code><idea></code><br/> The idea to add.
|<code><idea></code><br /> The idea to add.
| <pre>add_ideas = my_idea</pre>
|<pre>add_ideas = my_idea</pre>
<pre>add_ideas = {
<pre>add_ideas = {
    my_idea_1
    my_idea_1
第1,655行: 第1,657行:
</pre>
</pre>


| Adds the specified ideas to the current scope.
|Adds the specified ideas to the current scope.
| Can be used as a scope to add multiple at once.
|Can be used as a scope to add multiple at once.
| 1.0
|1.0
|-
|-
| add_timed_idea
|add_timed_idea
| <code>idea = <idea></code><br/> The idea to add. 
|<code>idea = <idea></code><br /> The idea to add. 
<code>days = <int> / <variable></code><br/> The number of days to add the idea for.
<code>days = <int> / <variable></code><br /> The number of days to add the idea for.


| <pre>add_timed_idea = {
|<pre>add_timed_idea = {
    idea = my_idea
    idea = my_idea
    days = 180
    days = 180
第1,669行: 第1,671行:
</pre>
</pre>


| Adds the specified ideas to the current scope for the specified number of days.
|Adds the specified ideas to the current scope for the specified number of days.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| modify_timed_idea
|modify_timed_idea
| <code>idea = <idea></code><br/> The idea to modify. 
|<code>idea = <idea></code><br /> The idea to modify. 
<code>days = <int> / <variable></code><br/> The number of days to add to the idea.
<code>days = <int> / <variable></code><br /> The number of days to add to the idea.


| <pre>modify_timed_idea = {
|<pre>modify_timed_idea = {
    idea = my_idea
    idea = my_idea
    days = 60
    days = 60
第1,683行: 第1,685行:
</pre>
</pre>


| Extends the duration of the timed idea by the specified amount.
|Extends the duration of the timed idea by the specified amount.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| swap_ideas
|swap_ideas
| <code>add_idea = <idea></code><br/> The idea to add. 
|<code>add_idea = <idea></code><br /> The idea to add. 
<code>remove_idea = <idea></code><br/> The idea to remove.
<code>remove_idea = <idea></code><br /> The idea to remove.


| <pre>swap_ideas = {
|<pre>swap_ideas = {
    remove_idea = my_idea_1
    remove_idea = my_idea_1
    add_idea = my_idea_2
    add_idea = my_idea_2
第1,697行: 第1,699行:
</pre>
</pre>


| Switches two ideas with a tooltip displaying any modifier differences between them.
|Switches two ideas with a tooltip displaying any modifier differences between them.
| &nbsp;
|&nbsp;
| 1.3
|1.3
|-
|-
| remove_ideas
|remove_ideas
| <code><idea></code><br/> The idea to remove.
|<code><idea></code><br /> The idea to remove.
| <pre>remove_ideas = my_idea</pre>
|<pre>remove_ideas = my_idea</pre>
<pre>remove_ideas = {
<pre>remove_ideas = {
    my_idea_1
    my_idea_1
第1,710行: 第1,712行:
</pre>
</pre>


| Removes the specified idea from the current scope.
|Removes the specified idea from the current scope.
| Can be used as a scope to remove multiple at once.
|Can be used as a scope to remove multiple at once.
| 1.0
|1.0
|-
|-
| remove_ideas_with_trait
|remove_ideas_with_trait
| <code><trait></code><br/> The trait to target.
|<code><trait></code><br /> The trait to target.
| <pre>remove_ideas_with_trait = motorized_equipment_manufacturer
|<pre>remove_ideas_with_trait = motorized_equipment_manufacturer
</pre>
</pre>


| Removes all ideas for the current scope that use the specified trait.
|Removes all ideas for the current scope that use the specified trait.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| show_ideas_tooltip
|show_ideas_tooltip
| <code><idea></code><br/> The idea to display.
|<code><idea></code><br /> The idea to display.
| <pre>show_ideas_tooltip = my_idea</pre>
|<pre>show_ideas_tooltip = my_idea</pre>


| Displays the specified idea in the tooltip for the current effect scope. Does not add the idea.
|Displays the specified idea in the tooltip for the current effect scope. Does not add the idea.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|}
|}


=== Unit ===
=== 单位===


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| load_oob
|load_oob
| <code><oob></code><br/> The OOB to load.
|<code><oob></code><br /> The OOB to load.
| <pre>load_oob = "GER_default"</pre>
|<pre>load_oob = "GER_default"</pre>


| Loads the specified OOB for the current scope, applying the effects within.
|Loads the specified OOB for the current scope, applying the effects within.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| division_template
|division_template
| <code>name</code><br/> The name of the division. <pre>regiments = {
|<code>name</code><br /> The name of the division. <pre>regiments = {
    <unit> = { x = 0 y = 0 }
    <unit> = { x = 0 y = 0 }
}
}
第1,762行: 第1,764行:
The composition of the division.
The composition of the division.


| <pre>division_template = {
|<pre>division_template = {
    name = "Test"
    name = "Test"
    regiments = {
    regiments = {
第1,776行: 第1,778行:
</pre>
</pre>


| Creates and adds the specified division template to the current scope.
|Creates and adds the specified division template to the current scope.
| The ''x'' and ''y'' attributes represent the rows and columns in the division designer.
|The ''x'' and ''y'' attributes represent the rows and columns in the division designer.
| 1.0
|1.0
|-
|-
| set_division_template_lock
|set_division_template_lock
| <code>division_template = <string></code><br/> The name of the division template. 
|<code>division_template = <string></code><br /> The name of the division template. 
<code>is_locked = <bool></code><br/> Whether the division is locked or not.
<code>is_locked = <bool></code><br /> Whether the division is locked or not.


| <pre>set_division_template_lock = {
|<pre>set_division_template_lock = {
    division_template = "Infantry Division"
    division_template = "Infantry Division"
    is_locked = yes
    is_locked = yes
第1,790行: 第1,792行:
</pre>
</pre>


| Toggles the locked status on a division template for the current scope, which prevents editing or deletion.
|Toggles the locked status on a division template for the current scope, which prevents editing or deletion.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| delete_unit_template_and_units
|delete_unit_template_and_units
| <code>division_template = <string></code><br/> The name of the division template.
|<code>division_template = <string></code><br /> The name of the division template.
| <pre>delete_unit_template_and_units = {
|<pre>delete_unit_template_and_units = {
    division_template = "Infantry Division"
    division_template = "Infantry Division"
    disband = yes #will refund equipment and manpower
    disband = yes #will refund equipment and manpower
}
}
</pre>
</pre>
| Deletes the specified division template and all units using it for the current scope.
|Deletes the specified division template and all units using it for the current scope.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| delete_unit
|delete_unit
| <code>state = <number id></code><br/> The id number of the state.
|<code>state = <number id></code><br /> The id number of the state.
| <pre> ENG = { delete_unit = { 
|<pre> ENG = { delete_unit = { 
        state = 787        
        state = 787        
        disband = yes #will refund equipment and manpower
        disband = yes #will refund equipment and manpower
         }}
         }}
</pre>
</pre>
| Deletes all units within the specified state using the country scope.
|Deletes all units within the specified state using the country scope.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|}
|}


=== Equipment ===
=== 装备===


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| set_equipment_fraction
|set_equipment_fraction
| <code><float> / <variable></code><br/> The fraction of equipment to remove.
|<code><float> / <variable></code><br /> The fraction of equipment to remove.
| <pre>set_equipment_fraction = 0.5</pre>
|<pre>set_equipment_fraction = 0.5</pre>


| Reduces the overall equipment stockpile by the specified fraction.
|Reduces the overall equipment stockpile by the specified fraction.
| This should '''not''' be used in civil wars to simulate stockpile splitting. <code>start_civil_war</code> now automatically divides stockpiles according to the respective size.
|This should '''not''' be used in civil wars to simulate stockpile splitting. <code>start_civil_war</code> now automatically divides stockpiles according to the respective size.
| 1.0
|1.0
|-
|-
| add_equipment_to_stockpile
|add_equipment_to_stockpile
| <code>type = <equipment></code><br/> The equipment to add. Can be archetype. 
|<code>type = <equipment></code><br /> The equipment to add. Can be archetype. 
<code>amount = <int></code><br/> The amount to add.<br/> <code>producer = <scope></code><br/> Defines who produced the equipment. Optional.
<code>amount = <int></code><br /> The amount to add.<br /> <code>producer = <scope></code><br /> Defines who produced the equipment. Optional.


| <pre>add_equipment_to_stockpile = {
|<pre>add_equipment_to_stockpile = {
    type = infantry_equipment
    type = infantry_equipment
    amount = 100
    amount = 100
第1,847行: 第1,849行:
</pre>
</pre>


| Adds the specified equipment to the current scope.
|Adds the specified equipment to the current scope.
| Note that removal will only remove equipment with the same producer defined in the effect.
|Note that removal will only remove equipment with the same producer defined in the effect.
| 1.0
|1.0
|-
|-
| send_equipment
|send_equipment
| <code>type = <equipment></code><br/> The equipment to add. Can be archetype. 
|<code>type = <equipment></code><br /> The equipment to add. Can be archetype. 
<code>amount = <int> / <variable></code><br/> The amount to add.<br/> <code>target = <scope> / <variable></code><br/> Which country receives the equipment.
<code>amount = <int> / <variable></code><br /> The amount to add.<br /> <code>target = <scope> / <variable></code><br /> Which country receives the equipment.


| <pre>send_equipment = {
|<pre>send_equipment = {
    equipment = infantry_equipment
    equipment = infantry_equipment
    amount = 100
    amount = 100
第1,862行: 第1,864行:
</pre>
</pre>


| Sends the specified amount of equipment to the specified target, removing said equipment from the current scope.
|Sends the specified amount of equipment to the specified target, removing said equipment from the current scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| create_production_license
|create_production_license
| <code>target = <scope></code><br/> Which country receives the license. 
|<code>target = <scope></code><br /> Which country receives the license. 
<code>cost_factor = <float></code><br/> Modifies the production cost.<br/> '''Equipment scope'''<br/> <code>type = <equipment></code><br/> The equipment the country is licensed to produce. Must be an non-archetype equipment.
<code>cost_factor = <float></code><br /> Modifies the production cost.<br /> '''Equipment scope'''<br /> <code>type = <equipment></code><br /> The equipment the country is licensed to produce. Must be an non-archetype equipment.


| <pre>create_production_license = {
|<pre>create_production_license = {
    target = HUN
    target = HUN
    equipment = {
    equipment = {
第1,879行: 第1,881行:
</pre>
</pre>


| Grants the specified country a licensed to produce the specified equipment from the current scope.
|Grants the specified country a licensed to produce the specified equipment from the current scope.
| &nbsp;
|&nbsp;
| 1.4
|1.4
|-
|-
| create_equipment_variant
|create_equipment_variant
| <code>name = <string></code><br/> The name of the variant 
|<code>name = <string></code><br /> The name of the variant 
<code>type = <equipment></code><br/> The equipment the variant is of.<br/> <code>parent_version = <int></code><br/> Ordering for multiple variants.<br/> '''Upgrade scope'''<br/> <code><upgrade> = <amount></code><br/> The upgrades configuration for the variant.
<code>type = <equipment></code><br /> The equipment the variant is of.<br /> <code>parent_version = <int></code><br /> Ordering for multiple variants.<br /> '''Upgrade scope'''<br /> <code><upgrade> = <amount></code><br /> The upgrades configuration for the variant.


| <pre>create_equipment_variant = { 
|<pre>create_equipment_variant = { 
    name = "Montecuccoli Class" 
    name = "Montecuccoli Class" 
    type = light_cruiser_1 
    type = light_cruiser_1 
第1,899行: 第1,901行:
</pre>
</pre>


| Creates the specified equipment variant for the current scope.
|Creates the specified equipment variant for the current scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| add_equipment_production
|add_equipment_production
| <code>amount = <int></code><br/> The amount to produce. Optional. 
|<code>amount = <int></code><br /> The amount to produce. Optional. 
<code>requested_factories = <int></code><br/> The number of factories to assigned initially. Optional.<br/> <code>progress = <float></code><br/> The initial production progress. Optional.<br/> <code>efficiency = <float></code><br/> The initial production efficiency. Optional.<br/> '''Equipment scope'''<br/> <code>type = <equipment></code><br/> The name of the equipment to produce.<br/> <code>creator = <scope></code><br/> The country which is producing the equipment. Used if root scope isn't producer. Optional.<br/> <code>version_name = <string></code>The name of the variant to produce. Optional.
<code>requested_factories = <int></code><br /> The number of factories to assigned initially. Optional.<br /> <code>progress = <float></code><br /> The initial production progress. Optional.<br /> <code>efficiency = <float></code><br /> The initial production efficiency. Optional.<br /> '''Equipment scope'''<br /> <code>type = <equipment></code><br /> The name of the equipment to produce.<br /> <code>creator = <scope></code><br /> The country which is producing the equipment. Used if root scope isn't producer. Optional.<br /> <code>version_name = <string></code>The name of the variant to produce. Optional.


| <pre>add_equipment_production = {
|<pre>add_equipment_production = {
    equipment = {
    equipment = {
      type = light_cruiser_2
      type = light_cruiser_2
第1,917行: 第1,919行:
</pre>
</pre>


| Starts a production line for the specified equipment for the current scope.
|Starts a production line for the specified equipment for the current scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|}
|}


=== Army ===
=== 陆军===


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| add_manpower
|add_manpower
| <code><int> / <variable></code><br/> The amount to add.
|<code><int> / <variable></code><br /> The amount to add.
| <pre>add_manpower = 100000</pre>
|<pre>add_manpower = 100000</pre>
<pre>add_manpower = var:my_var</pre>
<pre>add_manpower = var:my_var</pre>


| Adds the specified amount of manpower to the current scope.
|Adds the specified amount of manpower to the current scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| army_experience
|army_experience
| <code><float> / <variable></code><br/> The amount to add.
|<code><float> / <variable></code><br /> The amount to add.
| <pre>army_experience = 10</pre>
|<pre>army_experience = 10</pre>


| Adds the specified amount of army experience to the current scope.
|Adds the specified amount of army experience to the current scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| create_corps_commander
|create_corps_commander
| <code>name = <string></code><br/> The name of the leader. 
|<code>name = <string></code><br /> The name of the leader. 
<code>picture = <string></code><br/> The graphical reference of the picture of the leader.<br/> <code>skill = <int></code><br/> The skill of the leader.<br/> <code>attack_skill = <int></code><br/> The attack skill of the leader.<br/> <code>defense_skill = <int></code><br/> The defense skill of the leader.<br/> <code>planning_skill = <int></code><br/> The planning skill of the leader.<br/> <code>logistics_skill = <int></code><br/> The logistics skill of the leader.<br/> <code>traits = { <trait> }</code><br/> The traits the leader spawns with.<br/> <code>female = <bool></code><br/> The gender of the leader.
<code>picture = <string></code><br /> The graphical reference of the picture of the leader.<br /> <code>skill = <int></code><br /> The skill of the leader.<br /> <code>attack_skill = <int></code><br /> The attack skill of the leader.<br /> <code>defense_skill = <int></code><br /> The defense skill of the leader.<br /> <code>planning_skill = <int></code><br /> The planning skill of the leader.<br /> <code>logistics_skill = <int></code><br /> The logistics skill of the leader.<br /> <code>traits = { <trait> }</code><br /> The traits the leader spawns with.<br /> <code>female = <bool></code><br /> The gender of the leader.


| <pre>create_corps_commander = {
|<pre>create_corps_commander = {
name = "Jean de Lattre de Tassigny"
name = "Jean de Lattre de Tassigny"
picture = "Portrait_France_Jean_de_Lattre_de_Tassigny.dds"
picture = "Portrait_France_Jean_de_Lattre_de_Tassigny.dds"
第1,966行: 第1,968行:
</pre>
</pre>


| Creates a commander for the current scope with the specified attributes.
|Creates a commander for the current scope with the specified attributes.
| Traits are found in {{path|common/unit_leader/*.txt}}.
|Traits are found in {{path|common/unit_leader/*.txt}}.
| 1.0
|1.0
|-
|-
| create_field_marshal
|create_field_marshal
| <code>name = <string></code><br/> The name of the leader. 
|<code>name = <string></code><br /> The name of the leader. 
<code>picture = <string></code><br/> The graphical reference of the picture of the leader.<br/> <code>skill = <int></code><br/> The skill of the leader.<br/> <code>attack_skill = <int></code><br/> The attack skill of the leader.<br/> <code>defense_skill = <int></code><br/> The defense skill of the leader.<br/> <code>planning_skill = <int></code><br/> The planning skill of the leader.<br/> <code>logistics_skill = <int></code><br/> The logistics skill of the leader.<br/> <code>traits = { <trait> }</code><br/> The traits the leader spawns with.
<code>picture = <string></code><br /> The graphical reference of the picture of the leader.<br /> <code>skill = <int></code><br /> The skill of the leader.<br /> <code>attack_skill = <int></code><br /> The attack skill of the leader.<br /> <code>defense_skill = <int></code><br /> The defense skill of the leader.<br /> <code>planning_skill = <int></code><br /> The planning skill of the leader.<br /> <code>logistics_skill = <int></code><br /> The logistics skill of the leader.<br /> <code>traits = { <trait> }</code><br /> The traits the leader spawns with.


| <pre>create_field_marshal = {
|<pre>create_field_marshal = {
name = "Maurice Gamelin"
name = "Maurice Gamelin"
picture = "Portrait_France_Maurice_Gamelin.dds"
picture = "Portrait_France_Maurice_Gamelin.dds"
第1,986行: 第1,988行:
</pre>
</pre>


| Creates a field marshal for the current scope with the specified attributes.
|Creates a field marshal for the current scope with the specified attributes.
| Traits are found in {{path|common/unit_leader/*.txt}}.
|Traits are found in {{path|common/unit_leader/*.txt}}.
| 1.0
|1.0
|}
|}


=== Navy ===
=== 海军===


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| navy_experience
|navy_experience
| <code><float> / <variable></code><br/> The amount to add.
|<code><float> / <variable></code><br /> The amount to add.
| <pre>navy_experience = 10</pre>
|<pre>navy_experience = 10</pre>


| Adds the specified amount of navy experience to the current scope.
|Adds the specified amount of navy experience to the current scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| destroy_ships
|destroy_ships
| <code>type = <ship></code><br/> The type of ship to destroy. 
|<code>type = <ship></code><br /> The type of ship to destroy. 
<code>count = <int> or all</code><br/> The amount to destroy.
<code>count = <int> or all</code><br /> The amount to destroy.


| <pre>destroy_ships = {
|<pre>destroy_ships = {
    type = destroyer
    type = destroyer
    count = all
    count = all
第2,020行: 第2,022行:
</pre>
</pre>


| Destroys the specified type and amount of ships controlled by the current scope.
|Destroys the specified type and amount of ships controlled by the current scope.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| transfer_navy
|transfer_navy
| <code>target = <scope></code><br/> The target country.
|<code>target = <scope></code><br /> The target country.
| <pre>transfer_navy = {
|<pre>transfer_navy = {
    target = GER
    target = GER
}</pre>
}</pre>


| Transfers the current scope navy to the specified country.
|Transfers the current scope navy to the specified country.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| transfer_ship
|transfer_ship
| <code>type = <ship></code><br/> The type of ship to transfer.<br <code>target = <scope><br/> The target country.</code> 
|<code>type = <ship></code><br /> The type of ship to transfer.<br <code>target = <scope><br /> The target country.</code> 
<code><code>prefer_name = <string></code><br/> The new name for the ships in the target country. Optional.
<code><code>prefer_name = <string></code><br /> The new name for the ships in the target country. Optional.


| <pre>transfer_ship = {
|<pre>transfer_ship = {
    prefer_name = "HMS Achilles"
    prefer_name = "HMS Achilles"
    type = light_cruiser
    type = light_cruiser
第2,045行: 第2,047行:
</pre>
</pre>


| Transfers the specified type of ship from the current scope to the specified country.
|Transfers the specified type of ship from the current scope to the specified country.
| &nbsp;
|&nbsp;
| 1.4
|1.4
|-
|-
| create_navy_leader
|create_navy_leader
| <code>name = <string></code><br/> The name of the leader. 
|<code>name = <string></code><br /> The name of the leader. 
<code>picture = <string></code><br/> The graphical reference of the picture of the leader.<br/> <code>skill = <int></code><br/> The skill of the leader.<br/> <code>traits = { <trait> }</code><br/> The traits the leader spawns with.
<code>picture = <string></code><br /> The graphical reference of the picture of the leader.<br /> <code>skill = <int></code><br /> The skill of the leader.<br /> <code>traits = { <trait> }</code><br /> The traits the leader spawns with.


| <pre>create_navy_leader = {
|<pre>create_navy_leader = {
name = "François Darlan"
name = "François Darlan"
    picture = "Portrait_France_Francois_Darlan.dds"
    picture = "Portrait_France_Francois_Darlan.dds"
第2,061行: 第2,063行:
</pre>
</pre>


| Creates a naval leader for the current scope with the specified attributes.
|Creates a naval leader for the current scope with the specified attributes.
| Traits are found in {{path|common/unit_leader/*.txt}}.
|Traits are found in {{path|common/unit_leader/*.txt}}.
| 1.0
|1.0
|}
|}


=== Air ===
=== 空军===


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| air_experience
|air_experience
| <code><float> / <variable></code><br/> The amount to add.
|<code><float> / <variable></code><br /> The amount to add.
| <pre>air_experience = 10</pre>
|<pre>air_experience = 10</pre>


| Adds the specified amount of air experience to the current scope.
|Adds the specified amount of air experience to the current scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| add_ace
|add_ace
| <code>name = <string></code><br/> The name of the ace. 
|<code>name = <string></code><br /> The name of the ace. 
<code>surname = <string></code><br/> The surname of the ace.<br/> <code>callsign = <string></code><br/> The callsign of the ace.<br/> <code>type = <type></code><br/> The ace type.<br/> <code>is_female = <bool></code><br/> The gender of the ace.
<code>surname = <string></code><br /> The surname of the ace.<br /> <code>callsign = <string></code><br /> The callsign of the ace.<br /> <code>type = <type></code><br /> The ace type.<br /> <code>is_female = <bool></code><br /> The gender of the ace.


| <pre>add_ace = {
|<pre>add_ace = {
    name = "Amelia"
    name = "Amelia"
    surname = "Earhart"
    surname = "Earhart"
第2,098行: 第2,100行:
</pre>
</pre>


| Adds an ace for the current scope.
|Adds an ace for the current scope.
| Ace types found in {{path|common/aces/*.txt}}.
|Ace types found in {{path|common/aces/*.txt}}.
| 1.0
|1.0
|}
|}


=== AI ===
===AI===


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| add_ai_strategy
|add_ai_strategy
| <code>type = <type></code><br/> The type of strategy. 
|<code>type = <type></code><br /> The type of strategy. 
<code>id = <scope></code><br/> What country the strategy is against.<br/> <code>value = <int></code><br/> The weighting added by the strategy.
<code>id = <scope></code><br /> What country the strategy is against.<br /> <code>value = <int></code><br /> The weighting added by the strategy.


| <pre>add_ai_strategy = {
|<pre>add_ai_strategy = {
    type = alliance
    type = alliance
    id = GER
    id = GER
第2,125行: 第2,127行:
</pre>
</pre>


| Sets an AI strategy for the current scope.
|Sets an AI strategy for the current scope.
| See [[AI_modding|AI Modding]] for more details.
|See [[AI_modding|AI Modding]] for more details.
| 1.0
|1.0
|}
|}


== State Scope ==
== 地区作用域==


The effects here must be used within a '''state''' scope.
The effects here must be used within a '''state''' scope.


=== General ===
=== 整体===


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| state_event
|state_event
| <code>id = <event></code><br/> The event to fire. 
|<code>id = <event></code><br /> The event to fire. 
<code>days = <event> / <variable></code><br/> Fires the event in the specified number of days. Optional.<br/> <code>hours = <event> / <variable></code><br/> Fires the event in the specified number of hours. Optional.<br/> <code>random = <event></code><br/> Adds a random number (between ''0'' and ''random'', inclusive) of '''hours''' to the scheduled fire time. Optional.<br/> <code>trigger_for = <scope></code><br/> Fires event in the specified scope.
<code>days = <event> / <variable></code><br /> Fires the event in the specified number of days. Optional.<br /> <code>hours = <event> / <variable></code><br /> Fires the event in the specified number of hours. Optional.<br /> <code>random = <event></code><br /> Adds a random number (between ''0'' and ''random'', inclusive) of '''hours''' to the scheduled fire time. Optional.<br /> <code>trigger_for = <scope></code><br /> Fires event in the specified scope.


| <pre>state_event = {
|<pre>state_event = {
    id = my_event.1
    id = my_event.1
    days = 10
    days = 10
第2,157行: 第2,159行:
</pre>
</pre>


| Fires the specified event for the current state.
|Fires the specified event for the current state.
| Where triggers do not need to be repeatedly checked <code>random</code> can be a performance light alternative to <code>mean_time_to_happen</code> for scheduling events.
|Where triggers do not need to be repeatedly checked <code>random</code> can be a performance light alternative to <code>mean_time_to_happen</code> for scheduling events.
Using days = <event> / <variable> or hours may still be bugged and will not fire the event.
Using days = <event> / <variable> or hours may still be bugged and will not fire the event.
| 1.0
|1.0
|-
|-
| set_state_flag
|set_state_flag
| <code><flag></code><br/> An unique string to identify the state flag with.
|<code><flag></code><br /> An unique string to identify the state flag with.
| <code>set_state_flag = my_flag</code>
|<code>set_state_flag = my_flag</code>
| Defines a state flag.
|Defines a state flag.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| clr_state_flag
|clr_state_flag
| <code><flag></code><br/> The unique string of a state flag to clear.
|<code><flag></code><br /> The unique string of a state flag to clear.
| <code>clr_state_flag = my_flag</code>
|<code>clr_state_flag = my_flag</code>
| Clears a defined state flag.
|Clears a defined state flag.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| modify_state_flag
|modify_state_flag
| <code>flag = <flag></code><br/> The state flag to modify. 
|<code>flag = <flag></code><br /> The state flag to modify. 
<code>value = <value></code><br/> The value to set it to: 0 or 1
<code>value = <value></code><br /> The value to set it to: 0 or 1


| <pre>modify_state_flag = {
|<pre>modify_state_flag = {
    flag = my_flag
    flag = my_flag
    value = 1
    value = 1
第2,186行: 第2,188行:
</pre>
</pre>


| Modifies a state flag.
|Modifies a state flag.
| Use [[Variables|variables]] instead.
|Use [[Variables|variables]] instead.
| 1.3
|1.3
|-
|-
| set_state_name
|set_state_name
| <code><string></code><br/> Defines the new name.
|<code><string></code><br /> Defines the new name.
| <pre>set_state_name = "Funland"
|<pre>set_state_name = "Funland"
</pre>
</pre>


| Changes the current state's name to the specified name.
|Changes the current state's name to the specified name.
| &nbsp;
|&nbsp;
| 1.3
|1.3
|-
|-


| reset_state_name
|reset_state_name
| <code><bool></code><br/> Boolean.
|<code><bool></code><br /> Boolean.
| <pre>reset_state_name = yes
|<pre>reset_state_name = yes
</pre>
</pre>


| Resets any changes to the current state's name.
|Resets any changes to the current state's name.
| &nbsp;
|&nbsp;
| 1.3
|1.3
|-
|-
| add_claim_by
|add_claim_by
| <code><scope> / <variable></code><br/> The country to add the claim for.
|<code><scope> / <variable></code><br /> The country to add the claim for.
| <pre>add_claim_by = SOV</pre>
|<pre>add_claim_by = SOV</pre>


| Adds a claim for the specified country on the current scope.
|Adds a claim for the specified country on the current scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| remove_claim_by
|remove_claim_by
| <code><scope> / <variable></code><br/> The country to remove the claim for.
|<code><scope> / <variable></code><br /> The country to remove the claim for.
| <pre>remove_claim_by = SOV</pre>
|<pre>remove_claim_by = SOV</pre>


| Removes a claim by the specified country on the current scope.
|Removes a claim by the specified country on the current scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| add_core_of
|add_core_of
| <code><scope> / <variable></code><br/> The country to add the core for.
|<code><scope> / <variable></code><br /> The country to add the core for.
| <pre>add_core_of = SOV</pre>
|<pre>add_core_of = SOV</pre>


| Adds a core for the specified country on the current scope.
|Adds a core for the specified country on the current scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| remove_core_of
|remove_core_of
| <code><scope> / <variable></code><br/> The country to remove the core for.
|<code><scope> / <variable></code><br /> The country to remove the core for.
| <pre>remove_core_of = SOV</pre>
|<pre>remove_core_of = SOV</pre>


| Removes a core for the specified country on the current scope.
|Removes a core for the specified country on the current scope.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| set_demilitarized_zone
|set_demilitarized_zone
| <code><bool></code><br/> Boolean.
|<code><bool></code><br /> Boolean.
| <pre>set_demilitarized_zone = yes
|<pre>set_demilitarized_zone = yes
</pre>
</pre>


| Makes the current scope a demilitarized zone.
|Makes the current scope a demilitarized zone.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| set_state_category
|set_state_category
| <code><category></code><br/> The category to change to.
|<code><category></code><br /> The category to change to.
| <pre>set_state_category = rural
|<pre>set_state_category = rural
</pre>
</pre>


| Changes the current state category to the specified category.
|Changes the current state category to the specified category.
| Categories are found in {{path|common/state_category/*.txt}}
|Categories are found in {{path|common/state_category/*.txt}}
| 1.3
|1.3
|-
|-
| add_state_modifier
|add_state_modifier
| '''Modifier scope''' 
|'''Modifier scope''' 
<code><modifier> = <float></code><br/> Adds a modifier to the state.
<code><modifier> = <float></code><br /> Adds a modifier to the state.


| <pre>add_state_modifier = {
|<pre>add_state_modifier = {
    modifier = {
    modifier = {
      local_resources = 2.0
      local_resources = 2.0
第2,270行: 第2,272行:
</pre>
</pre>


| Adds a [[Modifiers|modifier]] to the current state.
|Adds a [[Modifiers|modifier]] to the current state.
| &nbsp;
|&nbsp;
| 1.3
|1.3
|-
|-
| add_manpower
|add_manpower
| <code><int> / <variable></code><br/> The amount to add.
|<code><int> / <variable></code><br /> The amount to add.
| <pre>add_manpower = 10000</pre>
|<pre>add_manpower = 10000</pre>


| Adds the specified amount of manpower to the current state.
|Adds the specified amount of manpower to the current state.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| add_resource
|add_resource
| <code>type = <resource></code><br/> The resource to add. 
|<code>type = <resource></code><br /> The resource to add. 
<code>amount = <int> / <variable></code><br/> The amount to add.
<code>amount = <int> / <variable></code><br /> The amount to add.


| <pre>add_resource = {
|<pre>add_resource = {
    type = oil
    type = oil
    amount = 100
    amount = 100
第2,292行: 第2,294行:
</pre>
</pre>


| Adds the specified resource in the specified amount to the current state.
|Adds the specified resource in the specified amount to the current state.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| set_border_war
|set_border_war
| <code><bool></code><br/> Boolean.
|<code><bool></code><br /> Boolean.
| <pre>set_border_war = yes</pre>
|<pre>set_border_war = yes</pre>


| Enables Border War status for the current state.
|Enables Border War status for the current state.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| create_unit
|create_unit
| <code>division = <division string></code><br/> The division string. 
|<code>division = <division string></code><br /> The division string. 
<code>owner = <scope></code><br/> The owner of the division.<br/> <code>prioritize_location = <province></code><br/> Prioritize the specified province in the state.
<code>owner = <scope></code><br /> The owner of the division.<br /> <code>prioritize_location = <province></code><br /> Prioritize the specified province in the state.


| <pre>create_unit = {
|<pre>create_unit = {
    division = "name = \"Infantry Division\" division_template = \"Infantry Division\" start_experience_factor = 0.5 start_equipment_factor = 0.5"
    division = "name = \"Infantry Division\" division_template = \"Infantry Division\" start_experience_factor = 0.5 start_equipment_factor = 0.5"
    owner = GER
    owner = GER
第2,314行: 第2,316行:
</pre>
</pre>


| Adds the specified division to the current state.
|Adds the specified division to the current state.
| The division string must be formatted as it is seen in the examples.
|The division string must be formatted as it is seen in the examples.
| 1.3
|1.3
|-
|-
| add_dynamic_modifier
|add_dynamic_modifier
| <code>modifier = <modifier_string></code><br/> The name of the Modifier. 
|<code>modifier = <modifier_string></code><br /> The name of the Modifier.


| add_dynamic_modifier = { modifier = sabotaged_ressources }
|add_dynamic_modifier = { modifier = sabotaged_ressources }
</pre>


| Adds a dynamic modifier to the current scope
|Adds a dynamic modifier to the current scope
| Examples can be found in {{path|common/dynamic_modifiers/*.txt}}
|Examples can be found in {{path|common/dynamic_modifiers/*.txt}}
| 1.9
|1.9
|}
|}


=== Buildings ===
=== 建筑===


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| add_building_construction
|add_building_construction
| <code>type = <string></code><br/> The building to add. 
|<code>type = <string></code><br /> The building to add. 
<code>level = <int> / <variable></code><br/> The level to set the building to.<br/> <code>instant_build = <bool></code><br/> Defines whether the buildings are instantly built.<br/> <code>province = <id></code><br/> Defines the exact province to add provincal buildings in. Can be used as a scope.<br/> '''Province scope'''<br/> <code>all_provinces = <bool></code><br/> Affect all provinces. Used in the province scope.<br/> <code>limit_to_coastal = <bool></code><br/> Affect coastal provinces. Used in the province scope.<br/> <code>limit_to_naval_base = <bool></code><br/> Affect naval base provinces. Used in the province scope.<br/> <code>limit_to_border = <bool></code><br/> Affect border provinces. Used in the province scope.<br/> <code>level = <int></code><br/> Affect only provinces with buildings level below, at or above the specified level. Used in the province scope.<br/> <code>id = <id></code><br/> Affect the specified province. Used in the province scope.
<code>level = <int> / <variable></code><br /> The level to set the building to.<br /> <code>instant_build = <bool></code><br /> Defines whether the buildings are instantly built.<br /> <code>province = <id></code><br /> Defines the exact province to add provincal buildings in. Can be used as a scope.<br /> '''Province scope'''<br /> <code>all_provinces = <bool></code><br /> Affect all provinces. Used in the province scope.<br /> <code>limit_to_coastal = <bool></code><br /> Affect coastal provinces. Used in the province scope.<br /> <code>limit_to_naval_base = <bool></code><br /> Affect naval base provinces. Used in the province scope.<br /> <code>limit_to_border = <bool></code><br /> Affect border provinces. Used in the province scope.<br /> <code>level = <int></code><br /> Affect only provinces with buildings level below, at or above the specified level. Used in the province scope.<br /> <code>id = <id></code><br /> Affect the specified province. Used in the province scope.


| <pre>add_building_construction = {
|<pre>add_building_construction = {
    type = arms_factory
    type = arms_factory
    level = 5
    level = 5
第2,368行: 第2,369行:
</pre>
</pre>


| Starts construction in the current state for the specified building.
|Starts construction in the current state for the specified building.
| You can limit the construction to victory points using : <code>limit_to_victory_point > 5<code> (only build province buildings on province with VP over 5 ) <code>limit_to_victory_point = yes<code> (only build province buildings on province with VP)
|You can limit the construction to victory points using : <code>limit_to_victory_point > 5<code> (only build province buildings on province with VP over 5 ) <code>limit_to_victory_point = yes<code> (only build province buildings on province with VP)
| 1.0
|1.0
|-
|-
| set_building_level
|set_building_level
| <code>type = <string></code><br/> The building to add. 
|<code>type = <string></code><br /> The building to add. 
<code>level = <int> / <variable></code><br/> The level to set the building to.<br/> <code>instant_build = <bool></code><br/> Defines whether the buildings are instantly built.<br/> <code>province = <id></code><br/> Defines the exact province to add provincal buildings in. Can be used as a scope.<br/> '''Province scope'''<br/> <code>all_provinces = <bool></code><br/> Affect all provinces. Used in the province scope.<br/> <code>limit_to_coastal = <bool></code><br/> Affect coastal provinces. Used in the province scope.<br/> <code>limit_to_naval_base = <bool></code><br/> Affect naval base provinces. Used in the province scope.<br/> <code>limit_to_border = <bool></code><br/> Affect border provinces. Used in the province scope.<br/> <code>level = <int></code><br/> Affect only provinces with buildings level below, at or above the specified level. Used in the province scope.<br/> <code>id = <id></code><br/> Affect the specified province. Used in the province scope.
<code>level = <int> / <variable></code><br /> The level to set the building to.<br /> <code>instant_build = <bool></code><br /> Defines whether the buildings are instantly built.<br /> <code>province = <id></code><br /> Defines the exact province to add provincal buildings in. Can be used as a scope.<br /> '''Province scope'''<br /> <code>all_provinces = <bool></code><br /> Affect all provinces. Used in the province scope.<br /> <code>limit_to_coastal = <bool></code><br /> Affect coastal provinces. Used in the province scope.<br /> <code>limit_to_naval_base = <bool></code><br /> Affect naval base provinces. Used in the province scope.<br /> <code>limit_to_border = <bool></code><br /> Affect border provinces. Used in the province scope.<br /> <code>level = <int></code><br /> Affect only provinces with buildings level below, at or above the specified level. Used in the province scope.<br /> <code>id = <id></code><br /> Affect the specified province. Used in the province scope.


| <pre>set_building_level = {
|<pre>set_building_level = {
    type = infrastructure
    type = infrastructure
    level = 10
    level = 10
第2,393行: 第2,394行:
</pre>
</pre>


| Sets the specified building to the current state (or provinces within the state).
|Sets the specified building to the current state (or provinces within the state).
| The province scope is used for provincal level buildings.  You can limit the construction to victory points using : <code>limit_to_victory_point > 5<code> (only build province buildings on province with VP over 5 ) <code>limit_to_victory_point = yes<code> (only build province buildings on province with VP)
|The province scope is used for provincal level buildings.  You can limit the construction to victory points using : <code>limit_to_victory_point > 5<code> (only build province buildings on province with VP over 5 ) <code>limit_to_victory_point = yes<code> (only build province buildings on province with VP)
| 1.4
|1.4
|-
|-
| damage_building
|damage_building
| <code>type = <building></code><br/> The building to damage. 
|<code>type = <building></code><br /> The building to damage. 
<code>damage = <float></code><br/> The amount of damage to inflict.<br/> <code>province = <id></code><br/> The province to target for provincal buildings.
<code>damage = <float></code><br /> The amount of damage to inflict.<br /> <code>province = <id></code><br /> The province to target for provincal buildings.


| <pre>damage_building = {
|<pre>damage_building = {
    type = infrastructure
    type = infrastructure
    damage = 1
    damage = 1
第2,407行: 第2,408行:
</pre>
</pre>


| Damages the specified building in the current state.
|Damages the specified building in the current state.
| The health of buildings is determined by the '''value''' attribute in a building's definition. This is multiplied by their level to get their total health.
|The health of buildings is determined by the '''value''' attribute in a building's definition. This is multiplied by their level to get their total health.
| 1.3
|1.3
|-
|-
| remove_building
|remove_building
| <code>type = <building></code><br/> The building to remove. 
|<code>type = <building></code><br /> The building to remove. 
<code>level = <int> / <variable></code><br/> The levels to remove.
<code>level = <int> / <variable></code><br /> The levels to remove.


| <pre>remove_building = {
|<pre>remove_building = {
    type = arms_factory
    type = arms_factory
    level = 5
    level = 5
第2,421行: 第2,422行:
</pre>
</pre>


| Removes the specified building in the current state. For shared buildings level determines the amount, whereas for the others it is the actual level.
|Removes the specified building in the current state. For shared buildings level determines the amount, whereas for the others it is the actual level.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| add_extra_state_shared_building_slots
|add_extra_state_shared_building_slots
| <code><int> / <variable></code><br/> The amount of slots to add or remove.
|<code><int> / <variable></code><br /> The amount of slots to add or remove.
| <pre>add_extra_state_shared_building_slots = 2</pre>
|<pre>add_extra_state_shared_building_slots = 2</pre>


| Adjusts the number of shared building slots for the current state.
|Adjusts the number of shared building slots for the current state.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|}
|}


== Unit Leader Scope ==
== 部队将领作用域==


The effects here must be used within a '''unit leader''' scope.
The effects here must be used within a '''unit leader''' scope.


=== General ===
=== 整体===


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| unit_leader_event
|unit_leader_event
| <code>id = <event></code><br/> The event to fire. 
|<code>id = <event></code><br /> The event to fire. 
<code>days = <event> / <variable></code><br/> Fires the event in the specified number of days. Optional.<br/> <code>hours = <event> / <variable></code><br/> Fires the event in the specified number of hours. Optional.<br/> <code>random = <event></code><br/> Adds a random number (between ''0'' and ''random'', inclusive) of '''hours''' to the scheduled fire time. Optional.
<code>days = <event> / <variable></code><br /> Fires the event in the specified number of days. Optional.<br /> <code>hours = <event> / <variable></code><br /> Fires the event in the specified number of hours. Optional.<br /> <code>random = <event></code><br /> Adds a random number (between ''0'' and ''random'', inclusive) of '''hours''' to the scheduled fire time. Optional.


| <pre>unit_leader_event = {
|<pre>unit_leader_event = {
    id = my_event.1
    id = my_event.1
    days = 10
    days = 10
第2,460行: 第2,461行:
</pre>
</pre>


| Fires the specified event for the owner of the current unit leader.
|Fires the specified event for the owner of the current unit leader.
| Uses a special interface displaying the current unit leader portrait. 
|Uses a special interface displaying the current unit leader portrait. 
Where triggers do not need to be repeatedly checked <code>random</code> can be a performance light alternative to <code>mean_time_to_happen</code> for scheduling events.
Where triggers do not need to be repeatedly checked <code>random</code> can be a performance light alternative to <code>mean_time_to_happen</code> for scheduling events.


| 1.5
|1.5
|-
|-
| set_unit_leader_flag
|set_unit_leader_flag
| <code><flag></code><br/> An unique string to identify the unit leader flag with.
|<code><flag></code><br /> An unique string to identify the unit leader flag with.
| <code>set_unit_leader_flag = my_flag</code>
|<code>set_unit_leader_flag = my_flag</code>
| Defines a unit leader flag.
|Defines a unit leader flag.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| clr_unit_leader_flag
|clr_unit_leader_flag
| <code><flag></code><br/> The unique string of a unit leader flag to clear.
|<code><flag></code><br /> The unique string of a unit leader flag to clear.
| <code>clr_unit_leader_flag = my_flag</code>
|<code>clr_unit_leader_flag = my_flag</code>
| Clears a defined unit leader flag.
|Clears a defined unit leader flag.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| modify_unit_leader_flag
|modify_unit_leader_flag
| <code>flag = <flag></code><br/> The unit leader flag to modify. 
|<code>flag = <flag></code><br /> The unit leader flag to modify. 
<code>value = <value></code><br/> The value to set it to: 0 or 1
<code>value = <value></code><br /> The value to set it to: 0 or 1


| <pre>modify_unit_leader_flag = {
|<pre>modify_unit_leader_flag = {
    flag = my_flag
    flag = my_flag
    value = 1
    value = 1
第2,490行: 第2,491行:
</pre>
</pre>


| Modifies a unit leader flag.
|Modifies a unit leader flag.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| promote_leader
|promote_leader
| <code><bool></code><br/> Boolean
|<code><bool></code><br /> Boolean
| <pre>promote_leader = yes</pre>
|<pre>promote_leader = yes</pre>


| Promotes the current unit leader to Field Marshal (if Commander.
|Promotes the current unit leader to Field Marshal (if Commander.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| demote_leader
|demote_leader
| <code><bool></code><br/> Boolean
|<code><bool></code><br /> Boolean
| <pre>demote_leader = yes</pre>
|<pre>demote_leader = yes</pre>


| Demotes the current unit leader to Commander (if Field Marshal).
|Demotes the current unit leader to Commander (if Field Marshal).
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| retire
|retire
| <code><bool></code><br/> Boolean>
|<code><bool></code><br /> Boolean>
| <pre>retire = yes</pre>
|<pre>retire = yes</pre>


| Retires the current unit leader (removing them).
|Retires the current unit leader (removing them).
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| remove_unit_leader
|remove_unit_leader
| <code><id></code><br/> The id of the unit leader.
|<code><id></code><br /> The id of the unit leader.
| <pre>remove_unit_leader = 70</pre>
|<pre>remove_unit_leader = 70</pre>


| Removes the specified unit leader by their id.
|Removes the specified unit leader by their id.
| &nbsp;
|&nbsp;
| 1.0
|1.0
|-
|-
| set_nationality
|set_nationality
| <code><scope> / <variable></code><br/> The target country.
|<code><scope> / <variable></code><br /> The target country.
| <pre>set_nationality = GER</pre>
|<pre>set_nationality = GER</pre>


| Switches the current unit leader to the specified country, giving them the leader.
|Switches the current unit leader to the specified country, giving them the leader.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| add_unit_leader_trait
|add_unit_leader_trait
| <code><trait></code><br/> The trait to add.
|<code><trait></code><br /> The trait to add.
| <pre>add_unit_leader_trait = old_guard</pre>
|<pre>add_unit_leader_trait = old_guard</pre>


| Adds the specified trait to the current unit leader.
|Adds the specified trait to the current unit leader.
| Traits are found in {{path|common/unit_leader/*.txt}}.
|Traits are found in {{path|common/unit_leader/*.txt}}.
| 1.0
|1.0
|-
|-
| remove_unit_leader_trait
|remove_unit_leader_trait
| <code><trait></code><br/> The trait to remove.
|<code><trait></code><br /> The trait to remove.
| <pre>remove_unit_leader_trait = old_guard</pre>
|<pre>remove_unit_leader_trait = old_guard</pre>


| Removes the specified trait from the current unit leader.
|Removes the specified trait from the current unit leader.
| Traits are found in {{path|common/unit_leader/*.txt}}.
|Traits are found in {{path|common/unit_leader/*.txt}}.
| 1.0
|1.0
|-
|-
| add_timed_unit_leader_trait
|add_timed_unit_leader_trait
| <code><trait></code><br/> The trait to add. 
|<code><trait></code><br /> The trait to add. 
<code>days = <int></code><br/> The duration of the trait.
<code>days = <int></code><br /> The duration of the trait.


| <pre>add_timed_unit_leader_trait = {
|<pre>add_timed_unit_leader_trait = {
    trait = wounded
    trait = wounded
    days = 90
    days = 90
第2,560行: 第2,561行:
</pre>
</pre>


| Adds the specified trait to the current unit leader for the specified duration.
|Adds the specified trait to the current unit leader for the specified duration.
| Traits are found in {{path|common/unit_leader/*.txt}}.
|Traits are found in {{path|common/unit_leader/*.txt}}.
| 1.5
|1.5
|-
|-
| replace_unit_leader_trait
|replace_unit_leader_trait
| &nbsp;
|&nbsp;
| &nbsp;
|&nbsp;
| &nbsp;
|&nbsp;
| Traits are found in {{path|common/unit_leader/*.txt}}.
|Traits are found in {{path|common/unit_leader/*.txt}}.
| 1.5
|1.5
|}
|}


=== Combat ===
=== 战斗===


{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
|-
|-
! width="10%" | Name
! width="10%" |Name
! width="25%" | Parameters
! width="25%" |Parameters
! width="25%" | Examples
! width="25%" |Examples
! width="20%" | Description
! width="20%" |Description
! width="15%" | Notes
! width="15%" |Notes
! width="5%" | Version Added
! width="5%" |Version Added
|-
|-
| supply_units
|supply_units
| <code><int> / <variable></code><br/> The amount of hours of supply.
|<code><int> / <variable></code><br /> The amount of hours of supply.
| <pre>supply_units = 24</pre>
|<pre>supply_units = 24</pre>


| Adds the specified amount of hours of supply to troops led by the current unit leader.
|Adds the specified amount of hours of supply to troops led by the current unit leader.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| add_max_trait
|add_max_trait
| <code><int></code><br/> The amount to add.
|<code><int></code><br /> The amount to add.
| <pre>add_max_trait = 1</pre>
|<pre>add_max_trait = 1</pre>


| Adds the specified amount of assignable trait slots to the current unit leader.
|Adds the specified amount of assignable trait slots to the current unit leader.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| add_skill_level
|add_skill_level
| <code><int></code><br/> The skill to add.
|<code><int></code><br /> The skill to add.
| <pre>add_skill_level = 1</pre>
|<pre>add_skill_level = 1</pre>


| Adds skill to the current unit leader.
|Adds skill to the current unit leader.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| add_logistics
|add_logistics
| <code><int></code><br/> The skill to add.
|<code><int></code><br /> The skill to add.
| <pre>add_logistics = 1</pre>
|<pre>add_logistics = 1</pre>


| Adds logistics skill to the current unit leader.
|Adds logistics skill to the current unit leader.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| add_planning
|add_planning
| <code><int></code><br/> The skill to add.
|<code><int></code><br /> The skill to add.
| <pre>add_planning = 1</pre>
|<pre>add_planning = 1</pre>


| Adds planning skill to the current unit leader.
|Adds planning skill to the current unit leader.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| add_defense
|add_defense
| <code><int></code><br/> The skill to add.
|<code><int></code><br /> The skill to add.
| <pre>add_defense = 1</pre>
|<pre>add_defense = 1</pre>


| Adds defense skill to the current unit leader.
|Adds defense skill to the current unit leader.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| add_attack
|add_attack
| <code><int></code><br/> The skill to add.
|<code><int></code><br /> The skill to add.
| <pre>add_attack = 1</pre>
|<pre>add_attack = 1</pre>


| Adds attack skill to the current unit leader.
|Adds attack skill to the current unit leader.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| add_temporary_buff_to_units
|add_temporary_buff_to_units
| <code>combat_offense = <float></code><br/> The bonus to grant. Optional. 
|<code>combat_offense = <float></code><br /> The bonus to grant. Optional. 
<code>combat_breakthrough = <float></code><br/> The bonus to grant. Optional.<br/> <code>combat_defense = <float></code><br/> The bonus to grant. Optional.<br/> <code>combat_entrenchment = <float></code><br/> The bonus to grant. Optional.<br/> <code>org_damage_multiplier = <float></code><br/> The bonus to grant. Optional.<br/> <code>str_damage_multiplier = <float></code><br/> The bonus to grant. Optional.<br/> <code>war_support_reduction_on_damage = <float></code><br/> The bonus to grant. Optional.<br/> <code>cannot_retreat_while_attacking = <float></code><br/> The bonus to grant. Optional.<br/> <code>cannot_retreat_while_defending = <float></code><br/> The bonus to grant. Optional.<br/> <code>days = <int></code><br/> The duration of the buff. Optional.<br/> <code>tooltip = <string></code><br/> The tooltip to display for the buff.
<code>combat_breakthrough = <float></code><br /> The bonus to grant. Optional.<br /> <code>combat_defense = <float></code><br /> The bonus to grant. Optional.<br /> <code>combat_entrenchment = <float></code><br /> The bonus to grant. Optional.<br /> <code>org_damage_multiplier = <float></code><br /> The bonus to grant. Optional.<br /> <code>str_damage_multiplier = <float></code><br /> The bonus to grant. Optional.<br /> <code>war_support_reduction_on_damage = <float></code><br /> The bonus to grant. Optional.<br /> <code>cannot_retreat_while_attacking = <float></code><br /> The bonus to grant. Optional.<br /> <code>cannot_retreat_while_defending = <float></code><br /> The bonus to grant. Optional.<br /> <code>days = <int></code><br /> The duration of the buff. Optional.<br /> <code>tooltip = <string></code><br /> The tooltip to display for the buff.


| <pre>add_temporary_buff_to_units = {
|<pre>add_temporary_buff_to_units = {
    combat_offense = 0.25
    combat_offense = 0.25
    combat_breakthrough = 0.25
    combat_breakthrough = 0.25
第2,656行: 第2,657行:
</pre>
</pre>


| Adds the specified combat buff to the current unit leader.
|Adds the specified combat buff to the current unit leader.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|-
|-
| boost_planning
|boost_planning
| <code><float></code><br/> The amount to add.
|<code><float></code><br /> The amount to add.
| <pre>boost_planning = 1</pre>
|<pre>boost_planning = 1</pre>


| Improves the planning of units controlled by the current unit leader.
|Improves the planning of units controlled by the current unit leader.
| &nbsp;
|&nbsp;
| 1.5
|1.5
|}
|}


== Flow Control ==
==Flow Control==


These scopes are used within effect scopes to control the execution of effects.
These scopes are used within effect scopes to control the execution of effects.


=== If, Else If and Else ===
===If, Else If and Else===


These scopes allow effects to be conditionalized, so they only occur when the requisite triggers are met.
These scopes allow effects to be conditionalized, so they only occur when the requisite triggers are met.
第2,706行: 第2,707行:
As you can see, this allows for flexibility in how effects occur and cuts down on duplication.
As you can see, this allows for flexibility in how effects occur and cuts down on duplication.


=== Hidden Effect ===
=== 隐藏效果===


This scope hides the presence of the effects within it in the player's tooltip. This is used to execute effects without the player seeing them. For example, you may want to manipulate some variables in an event. Showing them to the player may confuse them, so it is best to hide the effects within an hidden effect scope, like so:
This scope hides the presence of the effects within it in the player's tooltip. This is used to execute effects without the player seeing them. For example, you may want to manipulate some variables in an event. Showing them to the player may confuse them, so it is best to hide the effects within an hidden effect scope, like so:
第2,714行: 第2,715行:
</pre>
</pre>


=== Random List ===
===Random List===


This scope allows the creation of a random selection of effects. For example, if you wanted an effect to randomly given the player one out of four bonuses, you'd do the following:
This scope allows the creation of a random selection of effects. For example, if you wanted an effect to randomly given the player one out of four bonuses, you'd do the following:
第2,759行: 第2,760行:
The above code would multiply the 25 by the factor thereby making it more or less likely to occur if the trigger condition is fulfilled.
The above code would multiply the 25 by the factor thereby making it more or less likely to occur if the trigger condition is fulfilled.


=== Effect Tooltip ===
===Effect Tooltip===


This scope will display the tooltip information of the effects within, without actually executing the effects. This is useful when you want to show what the effect may look like to the player. Here is an example:
This scope will display the tooltip information of the effects within, without actually executing the effects. This is useful when you want to show what the effect may look like to the player. Here is an example:

2020年8月16日 (日) 00:49的版本


效果(Effects),也叫指令(Commands),用于在特定范围内动态地影响游戏。

效果在整局游戏中作用于不同的范围,最常见的是国策, 事件以及决议.

See Variables for information on the variable effects.

注意某些效果可能会需要变量的值,例如:

add_manpower = var:my_var.

This is noted by <variable> in an effect's parameters.

New La Resistance Effects

Name Parameters Examples Description Notes Version Added
create_intelligence_agency Allows to create automatically an intelligence agency create_intelligence_agency = yes Creates an Intelligence Agency.   1.9
upgrade_intelligence_agency Allows to unlock automatically an intelligence agency uprgrade upgrade_intelligence_agency = upgrade_form_department upgrade_intelligence_agency = <upgrade> Unlocks an Intelligence Agency Upgrade. Upgrades can be found in common/intelligence_agency_upgrades 1.9
kill_ideology_leader Allows to kill a country leader from a precise ideology kill_ideology_leader = communism kill_ideology_leader = <ideology> Kills the leader of that ideology in that scope.   1.9
transfer_units_fraction Allows to transfer a precise part of the army and the equipement of a country to any country. transfer_units_fraction= {
    target = SPD
    size = 0.5
    stockpile_ratio = 0.8
    army_ratio = 0.8
    navy_ratio = 0.5
    air_ratio = 0.5
    keep_unit_leaders_trigger = {
      has_trait = trait_SPA_nationalist_sympathies
   }
}
Transfers a certain equipement, Navy, Air Force, and Land Force ratio to a country. Unit Leaders can be kept by using triggers with keep_unit_leaders_trigger = { 1.9

New Man the Guns Effects

Name Parameters Examples Description Notes Version Added
remove_decision Allows to remove specified decision without running remove_effect. remove_decision = GER_MEPO Removes a decision.   1.6
swap_ruler_traits Similar to swap_ideas. Removes one trait and adds another. swap_ruler_traits = { remove = <trait> add = <trait> } Swaps traits.   1.6

remove_exile_tag

Remove the exile tag on a army leader, making them no longer be considered exile leaders. remove_exile_tag = { USA = "Arturo Rawson" } Removes a leaders exile tag.   1.6
add_legitimacy Adds legitimacy to a government in exile. add_legitimacy = 10 Adds legitimacy.   1.6

set_legitimacy

Sets the legitimacy of governments in exile. set_legitimacy= { POL = 1.0 } Sets legitimacy.   1.6
become_exiled_in Makes a country a government in exile in a set country, with a set starting legitimacy. become_exiled_in = { target = <Host tag> legitimacy = <0-1> starting legitimacy } Creates a government in exile. Must be fired from ROOT, the country that should be exiled, or a TAG specification must be used. 1.6
end_exile Ends a government in exile. end_exile Ends a government in exile.   1.6
add_province_modifier Adds a province modifier. add_province_modifier = { 5246 = mud } Adds a province modifier. New modifiers can be created in the "weather.txt" file. 1.6
remove_province_modifier Removes a province modifier. remove_province_modifier = { 5246 = mud } Removes a province modifier. New modifiers can be created in the "weather.txt" file. 1.6
set_faction_name Sets a faction name as the loc name. set_faction_name = SOME_LOC_KEY Changes faction names.   1.6
add_nuclear_bombs Adds nuclear bomb to TAG's stockpile. add_nuclear_bombs = 100 Adds specified number of nukes to the country's stockpile Needs the Nuke tech to use. 1.6
launch_nuke Nukes a province.

launch_nuke = {
    province = 42
    state = 42
    controller = GER
    use_nuke = yes
}

Nukes a province.

When using state it nukes a random province in said state, with a preference to enemy occupied provinces.

Requires Nuke tech and nukes. Removes a nuke from stockpile when used. 1.6
inherit_technology Transfers all of a nations techs to a specified tag. inherit_technology = CAN Transfers tech. Useful in civil wars and when countries split. The scoped country inherits the techs from the targeted TAG so be careful with the scope. 1.6
set_fuel_ratio Set country's current fuel ratio relative to its capacity. set_fuel_ratio Sets country's current fuel ratio.   1.6
add_mines Add mines to a strategic region for the current country. add_mines = { region = 42 amount = 100 } Add mines to a strategic region.  

1.6

give_resource_rights Gives resource rights give_resource_rights = { receiver = ENG state = 291 } Gives all the resources of a state to the target country see 04_mtg_on_actions 1.6
remove_resource_rights Removes resource rights ENG = { remove_resource_rights = 477 } Removes given resource rights   1.6

任意作用域

Can be used in country, state or unit leader scopes.

全局

Name Parameters Examples Description Notes Version Added
set_global_flag <flag>
An unique string to identify the global flag with.
set_global_flag = my_flag Defines a global flag. 1.0
clr_global_flag <flag>
The unique string of a global flag to clear.
clr_global_flag = my_flag Clears a defined global flag. 1.0
modify_global_flag flag = <flag>
The global flag to modify.

value = <value>
The value to set it to: 0 or 1

modify_global_flag = {
    flag = my_flag
    value = 1
}
Modifies a global flag. Use variables instead. 1.0
custom_effect_tooltip <string>
A localized string to display in the tooltip.
custom_effect_tooltip = my_tooltip_tt Displays a localized key in the effect tooltip. 1.0
log <string>
An string to in the game.log
log = "myVariable: [?myVariable]" Displays a string in the game.log when executed. Accepts all localization commands (i.e. [Root.GetName], etc) 1.5
save_event_target_as <string>
An unique string to identify the event target with.
capital_scope = {
    save_event_target_as = my_state
}
Saves the current scope as a key. Is cleared once execution ends (i.e. end of event). Use event_target:<key> to access the scope.
Do not use in Scripted GUIs.
1.0
save_global_event_target_as <string>
An unique string to identify the global event target with.
random_other_country = {
    save_global_event_target_as = my_country
}
Saves the current scope as a key. Persists after execution until cleared via effect. Use event_target:<key> to access the scope.
Do not use in Scripted GUIs.
1.0
clear_global_event_target <string>
The unique string of the global event target to clear.
clear_global_event_target = my_country Clears a specific global event target. 1.0
clear_global_event_targets yes
Boolean.
clear_global_event_targets = yes Clears all global event targets. 1.0
break None break Stops execution of effects in current scope. 1.0
sound_effect <string>
A sound reference from an .asset file.
sound_effect = "boom" Plays the specified sound once. 1.0
randomize_weather <int>
A seed integer.
randomize_weather = 12345 Randomizes the weather with the specified seed. 1.0
set_province_name id = <id>
要改变名字的省份的id

name = <string>
省份所要改成的名字

set_province_name = {
    id = 325
    name = "Funland"
}
把某个的名字改为特定名字 1.3
reset_province_name <id>
要重设名字的省份的id
reset_province_name = 325
重设特定省份的名字 1.3
goto_province <id>
要移动到的省份
goto_province = 325
把视角移到特定省份 1.0
goto_state <scope> / <variable>
要移动到的state的id
goto_state = 1
goto_state = var:some_state
Moves the camera position over the specified state. 1.0
change_tag_from <scope> / <variable>
The country to change from.
GER = { change_tag_from = ROOT }
GER = { change_tag_from = var:from.country }
Changes the player to the current scope from the target scope. The country the player becomes needs to be the scope in which the command is used. 1.0
add_region_efficiency 1.5

边境冲突

Name Parameters Examples Description Notes Version Added
start_border_war(发起边境冲突) change_state_after_war = <bool>
在边境冲突结束后,该省份是否易手 .

Attacker scope
state = <id> / <variable>
发起边境冲突的省份 .
num_provinces = <id>
指定发起边境冲突的一方投入多少个该省份下辖小地区,以这些小地区的部队发起边境冲突 .
on_win = <id>
发起边境冲突的一方胜利所触发的事件 .
on_lose = <id>
发起边境冲突的一方失败所触发的事件 .
on_cancel= <id>
The event to fire for the attacker on a draw.
Defender scope
state = <id> / <variable>
因边境冲突而受到攻击的省份.
num_provinces = <id>
The number of provinces used in the state.
on_win = <id>
The event to fire for the defender on a win.
on_lose = <id>
The event to fire for the defender on a loss.
on_cancel= <id>
The event to fire for the defender on a draw.

start_border_war = {
    change_state_after_war = no
    attacker = {
        state = 527
        num_provinces = 4
        on_win = japan_border_conflict.2
        on_lose = japan_border_conflict.3
        on_cancel = japan_border_conflict.4
    }
				
    defender = {
        state = 408
        num_provinces = 4
        on_win = japan_border_conflict.3
        on_lose = japan_border_conflict.2
        on_cancel = japan_border_conflict.4
    }
}
Starts a border war for the specified attacker and defender. The participating countries are the owners of the specified states.   1.5
set_border_war_data attacker = <id> / <variable>
The attacker state.

defender = <id> / <variable>
The defender state.
attacker_modifier = <id> / <variable>
The modifier applied to attacker strength.
defender_modifier = <id> / <variable>
The modifier applied to attacker strength.
combat_width = <id> / <variable>
The combat width used in the border war battle.

set_border_war_data = {
    attacker = 527
    defender = 408
    defender_modifier = 0.15
    combat_width = 100
}
Sets the bonuses or penalties for the attacker and defender in an on-going border war. Used after start_border_war.   1.5
cancel_border_war attacker = <id> / <variable>
The attacker state.

defender = <id> / <variable>
The defender state.
dont_fire_events = <bool>
Stops the events from start_border_war from firing.

cancel_border_war = {
    dont_fire_events = yes
    defender = 408
    attacker = 527
}
Cancels an on-going border war without a winner.   1.5
finalize_border_war attacker = <id> / <variable>
The attacker state.

defender = <id> / <variable>
The defender state.
attacker_win = <bool>
Makes the attacker the winner.
defender_win = <bool>
Makes the defender the winner.

finalize_border_war = {
    attacker_win = yes
    attacker = 527
    defender = 408
}
Ends an on-going border war.   1.5

国家作用域

The effects here must be used within a country scope.

整体

Name Parameters Examples Description Notes Version Added
set_country_flag <flag>
An unique string to identify the country flag with.
set_country_flag = my_flag Defines a country flag.   1.0
clr_country_flag <flag>
The unique string of a country flag to clear.
clr_country_flag = my_flag Clears a defined country flag.   1.0
modify_country_flag flag = <flag>
The country flag to modify.

value = <value>
The value to set it to: 0 or 1

modify_country_flag = {
    flag = my_flag
    value = 1
}
Modifies a country flag. Use variables instead. 1.3
country_event id = <event>
The event to fire.

days = <event> / <variable>
Fires the event in the specified number of days. Optional.
hours = <event> / <variable>
Fires the event in the specified number of hours. Optional.
random = <event>
Adds a random number (between 0 and random, inclusive) of hours to the scheduled fire time. Optional.

country_event = {
    id = my_event.1
    days = 10
    random = 50
}
Fires the specified event for the current country. Where triggers do not need to be repeatedly checked random can be a performance light alternative to mean_time_to_happen for scheduling events. 1.0
news_event id = <event>
The event to fire.

days = <event> / <variable>
Fires the event in the specified number of days. Optional.
hours = <event> / <variable>
Fires the event in the specified number of hours. Optional.
random = <event>
Adds a random number (between 0 and random, inclusive) of hours to the scheduled fire time. Optional.

news_event = {
    id = my_event.1
    days = 10
    random = 50
}
Fires the specified news event for the current country. The news event uses a different interface to the country event.

Where triggers do not need to be repeatedly checked random can be a performance light alternative to mean_time_to_happen for scheduling events.

1.0
set_cosmetic_tag <string>
The cosmetic tag to switch to.
set_cosmetic_tag = SAF_SOV_communism
Makes the current scope use the specified cosmetic tag, changing name and flag.   1.3
drop_cosmetic_tag <bool>
Boolean.
drop_cosmetic_tag = yes
Makes the current scope drop the current cosmetic tag they are using.   1.3
set_rule <rule>
Boolean.
set_rule = {
    can_create_factions = yes
}
Toggles the special game rules for the current scope. Possible rules:
  • can_be_called_to_war
  • can_boost_other_ideologies
  • can_create_factions
  • can_declare_war_on_same_ideology
  • can_declare_war_without_wargoal_when_in_war
  • can_decline_call_to_war
  • can_force_government
  • can_generate_female_aces
  • can_guarantee_other_ideologies
  • can_join_factions
  • can_join_factions_not_allowed_diplomacy
  • can_join_opposite_factions
  • can_lower_tension
  • can_not_declare_war
  • can_occupy_non_war
  • can_only_justify_war_on_threat_country
  • can_use_kamikaze_pilots
  • units_deployed_to_overlord (subjects only)
1.0

地区

Name Parameters Examples Description Notes Version Added
add_state_core <scope> / <variable>
The state to add core to.
add_state_core = 345
Adds a core for the current scope to the specified state.   1.0
remove_state_core <scope> / <variable>
The state to remove core from.
remove_state_core = 345
Removes the core of the current scope from the specified state.   1.0
set_capital <scope> / <variable>
The state to make capital.
set_capital = 345
Makes the specified state the current scope's capital state.   1.0
add_state_claim <scope> / <variable>
The state to add a claim to.
add_state_claim = 345
Adds a claim for the current scope on the specified state.   1.0
remove_state_claim <scope> / <variable>
The state to remove the claim from.
remove_state_claim = 345
Removes a claim of the current scope from the specified state.   1.0
set_state_owner <scope> / <variable>
The state to change ownership of.
set_state_owner = 345
Makes the current scope the owner of the specified state.   1.0
set_state_controller <scope> / <variable>
The state to change controller of.
set_state_controller = 345
Makes the current scope the controller of the specified state.   1.0
transfer_state <scope> / <variable>
The state to change owner and controller of.
transfer_state = 345
Makes the current scope the owner and controller of the specified state.   1.0
set_province_controller <id>
The province to change controller of.
set_province_controller = 2999
Changes the controller of the specified province to the current scope.   1.0

政治力量

Name Parameters Examples Description Notes Version Added
add_political_power <int> / <variable>
数量
add_political_power = 100
add_political_power = var:my_var
为当前作用域增加特定数量的政治点数   1.0
set_political_power <int> / <variable>
数量
set_political_power = 100
为当前作用域设定特定数量的政治点数   1.0
add_stability <int> / <variable>
数量
add_stability = 0.1
为当前作用域增加特定数量的稳定度 稳定度的值在0到1之间 1.5
set_stability <int> / <variable>
The amount to add.
set_stability = 0.5
为当前作用域设定特定数量的稳定度 稳定度的值在0到1之间 1.5
add_war_support <int> / <variable>
The amount to add.
add_war_support = 0.1
为当前作用域增加特定数量的战争支持度 战争支持度的值在0到1之间 1.5
set_war_support <int> / <variable>
The amount to set.
set_war_support = 0.5
为当前作用域设定特定数量的战争支持度 战争支持度的值在0到1之间 1.5
add_command_power <int> / <variable>
The amount to add.
add_command_power = 100
为当前作用域增加特定数量的指挥点数   1.5

政治

Name Parameters Examples Description Notes Version Added
kill_ideology_leader <ideology>
Ideology.
kill_ideology_leader = communism
Kills the country leader of the designated ideology for the current scope.   1.9
retire_ideology_leader <ideology>
Ideology.
retire_ideology_leader = fascism
Retires and removes the country leader of the ideology party for the current scope.   1.9
kill_country_leader <bool>
Boolean.
kill_country_leader = yes
Kills the country leader for the current scope.   1.0
retire_country_leader <bool>
Boolean.
retire_country_leader = yes
Retires and removes the country leader as head of their party for the current scope.   1.0
set_country_leader_ideology <government>
The government to set.
set_country_leader_ideology = socialism
Changes the country leader's government type for the current scope.   1.0
add_country_leader_trait <trait>
The trait to add.
add_country_leader_trait = nationalist_symbol
Adds the specified trait to the current scope's country leader. Traits are found in /Hearts of Iron IV/common/country_leader/*.txt. 1.0
remove_country_leader_trait <trait>
The trait to remove.
remove_country_leader_trait = nationalist_symbol
Removes the specified trait from the current scope's country leader. Traits are found in /Hearts of Iron IV/common/country_leader/*.txt. 1.0
hold_election <scope>
The country to hold an election for.
hold_election = ROOT
Executes the events in the on_new_term_election on action for the current scope.   1.0
add_popularity ideology = <ideology>
The party to change.

popularity = <int> / <variable>
The amount of popularity to change.

add_popularity = {
    ideology = fascism
    popularity = -0.5
}
Adjusts the popularity for the specified party in the current scope. Values used are 0 to 1. 1.0
set_politics ruling_party = <ideology>
The party to set.

elections_allowed = <bool>
Whether elections are allowed. Optional.
last_election = <date>
When the last election was. Optional.
election_frequency = <int>
How often in months an election occurs. Optional.

set_politics = {
	ruling_party = neutrality
}
Sets the political party setup for the current scope.  

Previously included the "parties" parameter, which has been deprecated by the "set_popularities" command. The "parties" parameter no longer works as of version 1.7

1.0 (Updated 1.7)
set_popularities <ideology> = <int>/<variable>
The popularity to set.
set_popularities = {
	democratic = 50
	neutrality = 15
	fascism = 30
	communism = 5
}
Sets the political party popularities for the current scope.  

The popularities must add up to 100, otherwise the command will have no effect.

1.7
set_political_party ideology = <ideology>
The party to change.

popularity = <int>
The amount of popularity to set.

set_political_party = {
    ideology = fascism
    popularity = 50
}
Sets the popularity for the specified political party in the current scope.   1.0
set_party_name ideology = <ideology>
The party to change.

long_name = <string>
The new full name for the party.
name = <string>
The new short name for the party.

set_party_name = { 
    ideology = neutrality 
    long_name = GER_neutrality_party_kaiserreich_long 
    name = GER_neutrality_party_kaiserreich 
}
Changes the name of the specified political party for the current scope.   1.0
create_country_leader name = <string>
The name of the leader.

desc = <string>
The description of the leader.
picture = <string>
The graphical reference to the leader portrait.
expire = <string>
When the leader dies in history.
ideology = <string>
The ideology government the leader belongs to.
Traits scope
<trait>
The trait to add. Can add multiple.

create_country_leader = {
	name = "Mohammed Zahir Shah"
	desc = "POLITICS_MOHAMMED_ZAHIR_SHAH_DESC"
	picture = "Portrait_Afghanistan_Mohammed_Zahir_Shah.dds"
	expire = "1965.1.1"
	ideology = despotism
	traits = {
		
	}
}
  The portrait string can include the full path (i.e. gfx/leaders/my_folder/custom_pic.dds) or just the name of the image (i.e. custom_pic.dds).

With just the name, the image must be in a folder that matches the tag of the current scope, for example /Hearts of Iron IV/gfx/leaders/GER/custom_pic.dds.

1.0

外交

Name Parameters Examples Description Notes Version Added
set_major <bool>
Boolean.
set_major = yes
使当前作用域成为主要国家   1.0
create_faction <string>
The name of the faction.
create_faction = MY_FACTION_NAME
Creates a faction with the specified name for the current scope. The current scope and any subjects automatically join the faction.   1.0
add_to_faction <TAG>
The TAG of the nation to add to the faction of the current scope.
FACTION_LEADER_TAG = { add_to_faction = TAG_TO_ADD }
Adds the TAG_TO_ADD to the faction of the FACTION_LEADER_TAG.   1.0
leave_faction <bool>
Boolean.
leave_faction = yes
Removes the current scope from the faction they are part of.   1.5
remove_from_faction <string>
The name of the faction.
remove_from_faction = MY_FACTION_NAME
Removes the current scope from the specified faction.   1.0
dismantle_faction <bool>
Boolean.
dismantle_faction = yes
Dismantles the faction of the current scope.   1.0
puppet <scope>
The target country.
puppet = GER
Makes the specified country the puppet of the current scope.   1.0
end_puppet <scope>
The target country.
end_puppet = GER
Removes the puppet status between the target and the current scope.   1.0
release <scope>
The target country.
release = GER
Releases the specified subject or core-only country as a free nation.   1.0
release_puppet <scope>
The target country.
release_puppet = GER
Releases the specified subject or core-only country as a puppet for the current scope.   1.0
give_guarantee <scope>
The target country.
give_guarantee = GER
Makes the current scope guarantee the specified country.   1.0
give_military_access <scope>
The target country.
give_military_access = GER
Makes the specified country grant the current scope military access to their country.   1.0
recall_attache <scope>
The target country with an attache.
recall_attache = GER
Recalls the current scope's attache from the specified country.   1.5
diplomatic_relation country = <scope>
The target country to alter the relationship with ROOT.

relation = <type>
The relation to change.
active = <bool>
Whether the relation is started or broken.

diplomatic_relation = {
    country = SOV
    relation = guarantee
    active = no
}
Used to define a diplomatic relation between the current scope and target scope country. Possible relations:
  • non_aggression_pact
  • guarantee
  • puppet
  • military_access
  • docking_rights
1.0
add_opinion_modifier target = <scope>
The target country.

modifier = <modifier>
The opinion modifier to add.

add_opinion_modifier = {
    target = GER
    modifier = faction_traitor
}
Adds the specified opinion modifier for the current scope towards the specified scope. Opinion modifiers are found in /Hearts of Iron IV/common/opinion_modifiers/*.txt. 1.0
remove_opinion_modifier target = <scope>
The target country.

modifier = <modifier>
The opinion modifier to remove.

remove_opinion_modifier = {
    target = GER
    modifier = faction_traitor
}
Removes the specified opinion modifier for the current scope towards the specified scope. Opinion modifiers are found in /Hearts of Iron IV/common/opinion_modifiers/*.txt. 1.0
reverse_add_opinion_modifier target = <scope>
The target country.

modifier = <modifier>
The opinion modifier to add.

reverse_add_opinion_modifier = {
    target = GER
    modifier = faction_traitor
}
Adds the specified opinion modifier for the specified scope towards the current scope. Opinion modifiers are found in /Hearts of Iron IV/common/opinion_modifiers/*.txt. 1.0
add_relation_modifier target = <scope>
The target country.

modifier = <modifier>
The relation modifier to add.

add_relation_modifier = {
    target = SWE
    modifier = HUN_dynastic_ties_license
}
Adds the specified relation modifier for the current scope towards the specified scope. Relation modifiers are found in /Hearts of Iron IV/common/modifiers/*.txt. 1.4
remove_relation_modifier target = <scope>
The target country.

modifier = <modifier>
The relation modifier to remove.

remove_relation_modifier = {
    target = SWE
    modifier = HUN_dynastic_ties_license
}
Removes the specified relation modifier for the current scope towards the specified scope. Relation modifiers are found in /Hearts of Iron IV/common/modifiers/*.txt. 1.4

附属国

Name Parameters Examples Description Notes Version Added
add_autonomy_ratio value = <float>
The freedom score to add.

localization = <string>
The localization key for the modifier.

add_autonomy_ratio = {
    value = 0.1
    localization = AST_adopt_westminster
}
Adds a freedom score ratio modifier to the current scope. Used in the subject. 1.3
add_autonomy_score value = <float>
The freedom score to add.

localization = <string>
The localization key for the modifier.

add_autonomy_ratio = {
    value = 10
    localization = EXAMPLE
}
Adds an exact freedom score modifier to the current scope. Used in the subject. 1.3
set_autonomy target = <scope> / <variable>
The subject country.

autonomy_state = <type>
The type of autonomy state to set.
freedom_level = <float>
The new freedom level value. Optional.

set_autonomy = {
    target = AST
    autonomy_state = autonomy_free
}
Sets the autonomy level for the specified country. The autonomy states are found in /Hearts of Iron IV/common/autonomous_states/*.txt. 1.3
release_autonomy target = <scope> / <variable>
The subject country.

autonomy_state = <type>
The type of autonomy state to set.
freedom_level = <float>
The new freedom level value. Optional.

release_autonomy = {
    target = VIN
    autonomy_state = autonomy_puppet
    freedom_level = 0.5
}
Releases the country and sets the autonomy level for the specified country. The autonomy states are found in /Hearts of Iron IV/common/autonomous_states/*.txt. 1.3

战争

Name Parameters Examples Description Notes Version Added
add_threat <int>
The amount to change by.
add_threat = 10
调整全球紧张度   1.0
add_named_threat threat = <int>
The amount to change by.

name = <string>
The localization string.

add_named_threat = { 
    threat = 5 
    name = GER_rhineland
}
Adjusts the level of World Tension and adds an entry in the World Tension tooltip.   1.0
annex_country target = <scope>
Which country to annex.

transfer_troops = yes
Whether to transfer the troops of the annexed country.

annex_country = {
    target = GER
    transfer_troops = yes
}
Annex the specified country for the current scope.   1.0
add_to_war targeted_alliance = <scope>
The country to assist.

enemy = <scope>
The country attacking the ally.
hostility_reason = <string>
Localization for the reason for joining. Optional.

add_to_war = { 
    targeted_alliance = PREV 
    enemy = HUN 
    hostility_reason = asked_to_join
}
Adds the current scope into the war of their ally against the specified enemy.   1.0
declare_war_on target = <scope> / <variable>
The country to attack.

type = <wargoal>
The wargoal to declare with.

declare_war_on = {
    target = GER
    type = annex_everything
}
Makes the current scope declare war on the specified country with the specified wargoal. Wargoals are found in /Hearts of Iron IV/common/wargoals/*.txt. 1.0
white_peace <scope> / <variable>
The scope to white peace.

<message>
The reason for peace.

white_peace = GER
white_peace = {
    tag = GER
    message = EXAMPLE
}
Makes the current scope white peace the specified scope.   1.0
set_truce target = <scope>
The scope to truce with.

days = <int>
The duration of the truce.

set_truce = {
    target = GER
    days = 90
}
Makes the current scope truce with the specified scope.   1.0
create_wargoal target = <scope> / <variable>
The country to target.

type = <wargoal>
The wargoal to generate.
generator = { <state id> }
The states to supply the wargoal (i.e. take_state_focus).

create_wargoal = {
    type = puppet_wargoal_focus
    target = ROOT
}
Grants the current scope a wargoal against the specified country.   1.0
start_civil_war ideology = <ideology>
The ideology of the breakaway country.

ruling_party = <ideology>
The ruling party of the original country. Optional.
size = <float>
The size of the breakaway country and the fraction of the original stockpile and military units it will receive. Optional.
capital = <state>
The capital of the breakaway country. Optional.
only_own_territory = <bool>
Limits the breakaway country to only own territory. Optional.
states = { <state> }
The states included in the breakway country. Optional.
states_filter = { <triggers> }
Filters to apply to the state assignment for the breakaway country. Optional.
keep_unit_leaders = { <unit leader id> }
Keep the specified leaders. Optional.
keep_unit_leaders_trigger = { <triggers>
Keep the specified leaders that meet the triggers. Optional.

start_civil_war = {
    ruling_party = communism
    ideology = ROOT
    size = 0.8
    only_own_territory = no
    capital = 282
    states = { 
        282 533 536 555 529 530 528 
    }
    keep_unit_leaders = {
        750 751 752
    }
}
Starts a civil war for the current scope with the specified parameters.   1.0

资源

Name Parameters Examples Description Notes Version Added
add_resource type = <resource>
要添加的资源

amount = <int>
要添加资源的数量
state = <id>要添加资源的地区。 可以使用变量

add_resource = {
    type = oil
    amount = 50
    state = 88
}
在特定地区添加特定数量的特定资源   1.0
destroy_resource type = <resource>
要添加的资源

amount = <int>
要添加资源的数量
state = <id>要添加资源的地区。 可以使用变量

destroy_resource = {
    type = oil
    amount = 50
    state = 88
}
在特定地区摧毁特定数量的特定资源   1.9
create_import resource = <resource>
The resource to import.

amount = <int>
The amount of resource to import.
exporter = <id>Which country exports the resource.

create_import = {
    resource = steel
    amount = 100
    exporter = GER
}
Creates an import for the current scope with the specified resource and from the specified exporter.   1.0

建筑

Name Parameters Examples Description Notes Version Added
add_offsite_building type = <building>
The building to add.

level = <level> / <variable>
The maximum level to add.

add_offsite_building = { type = arms_factory level = 1 }
Adds an off-map building for the current scope that produces its effects without being present in a state.   1.5
modify_building_resources building = <building>
The building to modify.

resource = <resource>
The resource to add.
amount = <amount>
The amount of resource to add.

modify_building_resources = {
    building = synthetic_refinery
    resource = oil
    amount = 1
}
Modifies the resource output of the specified building for the current scope.   1.5

国策

Name Parameters Examples Description Notes Version Added
load_focus_tree <string>
The focus tree to load.
Alternatively, as an effect block:
tree = <string>
keep_completed = yes/no
load_focus_tree = china_communist_focus

load_focus_tree = { tree = british_focus keep_completed = yes }
Loads a new focus tree for the current scope, retaining any shared focuses.   1.5
unlock_national_focus <focus>
The focus to unlock.
unlock_national_focus = my_focus
Bypasses the specified focus for the current scope (marks as complete without firing complete_effect of the focus).   1.0
complete_national_focus <focus>
The focus to complete.
complete_national_focus = my_focus
Completes the specified focus for the current scope.   1.0

决议

Name Parameters Examples Description Notes Version Added
activate_decision <decision>
The decision to activate.
activate_decision = my_decision
Activates the specified decision for the current scope, ignoring triggers for the decision. Decisions are found in /Hearts of Iron IV/common/decisions/*.txt 1.0
activate_targeted_decision target = <scope>
The country to target.

decision = <decision>
The decision to activate.

activate_targeted_decision = {
    target = GER
    decision = my_decision
}
Activates the specified targeted decision for the specified target for the current scope. Decisions are found in /Hearts of Iron IV/common/decisions/*.txt 1.5
remove_targeted_decision <decision>
The decision to remove.
remove_targeted_decision = {
    target = FROM
    decision = my_decision
}
Removes the specified targeted decision for the current scope. Decisions are found in /Hearts of Iron IV/common/decisions/*.txt 1.5
unlock_decision_tooltip <decision>
The decision to display.
unlock_decision_tooltip = my_decision
Displays a special tooltip for the specified decision in the effect tooltip. Decisions are found in /Hearts of Iron IV/common/decisions/*.txt 1.5
unlock_decision_category_tooltip <category>
The decision category to display.
unlock_decision_category_tooltip = my_category
Displays a special tooltip for the specified decision category in the effect tooltip. Decision categories are found in /Hearts of Iron IV/common/decisions/catergories/*.txt 1.5

任务

Name Parameters Examples Description Notes Version Added
activate_mission <mission>
The mission to activate.
activate_mission = my_mission
Activates the specified mission for the current scope, ignoring any triggers for the decision. Missions are found in /Hearts of Iron IV/common/decisions/*.txt 1.5
activate_mission_tooltip <mission>
The mission to display.
activate_mission_tooltip = my_mission
Displays a special tooltip for the specified mission in the effect tooltip. Missions are found in /Hearts of Iron IV/common/decisions/*.txt 1.5
remove_mission <mission>
The mission to remove.
remove_mission = my_mission
Removes the specified mission for the current scope. Missions are found in /Hearts of Iron IV/common/decisions/*.txt 1.5

科技

Name Parameters Examples Description Notes Version Added
add_research_slot <int>
The number of slots to add or remove.
add_research_slot = 1
Adjusts the number of research slots the current scope has. Can remove slots.   1.0
set_research_slots <int>
The number of slots to set.
set_research_slots = 4
Sets the number of research slots the current scope has.   1.0
add_tech_bonus bonus = <float>
The bonus to technology given.

uses = <int>
The amount of times the bonus can be used.
ahead_reduction = <float>
The cost reduction if ahead of time.
category = <string>
Which technology category the bonus applies to. Multiple can be defined.
technology = <string>
Which technology the bonus applies to. Multiple can be defined.

add_tech_bonus = {
    bonus = 0.5
    uses = 1
    category = radar_tech
}
Grants a research bonus to the current scope with the specified parameters. Research bonus categories are found in Hearts of Iron IV/common/technology_tags/*.txt 1.0
set_technology <technology> = <int>
The technology to add.
popup = no
To not show the popup after adding technology
set_technology = {
    suicide_craft = 1
}
Grants the specified technology to the current scope. A value of 1 sets the technology. A value of 0 removes the technology, but if it is a researchable technology, the duration to research isn't reset, meaning it can be researched in 1 day. 1.0
add_to_tech_sharing_group <string>
The group to add the current scope to.
add_to_tech_sharing_group = us_research
Adds the current scope to the specified technology sharing group.   1.3
remove_from_tech_sharing_group <string>
The group to remove the current scope from.
remove_from_tech_sharing_group = us_research
Removes the current scope from the specified technology sharing group.   1.3
modify_tech_sharing_bonus id = <string>
The group to modify.

bonus = <float>
The new bonus.

modify_tech_sharing_bonus = {
    id = us_research
    bonus = 0.5
}
Modifies the specified technology sharing group.   1.3

国家精神

Name Parameters Examples Description Notes Version Added
add_ideas <idea>
The idea to add.
add_ideas = my_idea
add_ideas = {
    my_idea_1
    my_idea_2
}
Adds the specified ideas to the current scope. Can be used as a scope to add multiple at once. 1.0
add_timed_idea idea = <idea>
The idea to add.

days = <int> / <variable>
The number of days to add the idea for.

add_timed_idea = {
    idea = my_idea
    days = 180
}
Adds the specified ideas to the current scope for the specified number of days.   1.0
modify_timed_idea idea = <idea>
The idea to modify.

days = <int> / <variable>
The number of days to add to the idea.

modify_timed_idea = {
    idea = my_idea
    days = 60
}
Extends the duration of the timed idea by the specified amount.   1.0
swap_ideas add_idea = <idea>
The idea to add.

remove_idea = <idea>
The idea to remove.

swap_ideas = {
    remove_idea = my_idea_1
    add_idea = my_idea_2
}
Switches two ideas with a tooltip displaying any modifier differences between them.   1.3
remove_ideas <idea>
The idea to remove.
remove_ideas = my_idea
remove_ideas = {
    my_idea_1
    my_idea_2
}
Removes the specified idea from the current scope. Can be used as a scope to remove multiple at once. 1.0
remove_ideas_with_trait <trait>
The trait to target.
remove_ideas_with_trait = motorized_equipment_manufacturer
Removes all ideas for the current scope that use the specified trait.   1.0
show_ideas_tooltip <idea>
The idea to display.
show_ideas_tooltip = my_idea
Displays the specified idea in the tooltip for the current effect scope. Does not add the idea.   1.0

单位

Name Parameters Examples Description Notes Version Added
load_oob <oob>
The OOB to load.
load_oob = "GER_default"
Loads the specified OOB for the current scope, applying the effects within.   1.0
division_template name
The name of the division.
regiments = {
    <unit> = { x = 0 y = 0 }
}
support = {
    <unit> = { x = 0 y = 0 }
}

The composition of the division.

division_template = {
    name = "Test"
    regiments = {
        infantry = { x = 0 y = 0 }
        infantry = { x = 0 y = 1 }
        infantry = { x = 0 y = 2 }
        infantry = { x = 0 y = 3 }
    }
    support = { 
        military_police = { x = 0 y = 0 }
    } 
}
Creates and adds the specified division template to the current scope. The x and y attributes represent the rows and columns in the division designer. 1.0
set_division_template_lock division_template = <string>
The name of the division template.

is_locked = <bool>
Whether the division is locked or not.

set_division_template_lock = {
    division_template = "Infantry Division"
    is_locked = yes
}
Toggles the locked status on a division template for the current scope, which prevents editing or deletion.   1.5
delete_unit_template_and_units division_template = <string>
The name of the division template.
delete_unit_template_and_units = {
    division_template = "Infantry Division"
    disband = yes #will refund equipment and manpower
}
Deletes the specified division template and all units using it for the current scope.   1.5
delete_unit state = <number id>
The id number of the state.
 ENG = { delete_unit = { 
            state = 787             
             disband = yes #will refund equipment and manpower
              }}
Deletes all units within the specified state using the country scope.   1.5

装备

Name Parameters Examples Description Notes Version Added
set_equipment_fraction <float> / <variable>
The fraction of equipment to remove.
set_equipment_fraction = 0.5
Reduces the overall equipment stockpile by the specified fraction. This should not be used in civil wars to simulate stockpile splitting. start_civil_war now automatically divides stockpiles according to the respective size. 1.0
add_equipment_to_stockpile type = <equipment>
The equipment to add. Can be archetype.

amount = <int>
The amount to add.
producer = <scope>
Defines who produced the equipment. Optional.

add_equipment_to_stockpile = {
    type = infantry_equipment
    amount = 100
    producer = GER
}
Adds the specified equipment to the current scope. Note that removal will only remove equipment with the same producer defined in the effect. 1.0
send_equipment type = <equipment>
The equipment to add. Can be archetype.

amount = <int> / <variable>
The amount to add.
target = <scope> / <variable>
Which country receives the equipment.

send_equipment = {
    equipment = infantry_equipment
    amount = 100
    target = GER
}
Sends the specified amount of equipment to the specified target, removing said equipment from the current scope.   1.0
create_production_license target = <scope>
Which country receives the license.

cost_factor = <float>
Modifies the production cost.
Equipment scope
type = <equipment>
The equipment the country is licensed to produce. Must be an non-archetype equipment.

create_production_license = {
    target = HUN
    equipment = {
        type = fighter_equipment_1
    }
    cost_factor = 0
}
Grants the specified country a licensed to produce the specified equipment from the current scope.   1.4
create_equipment_variant name = <string>
The name of the variant

type = <equipment>
The equipment the variant is of.
parent_version = <int>
Ordering for multiple variants.
Upgrade scope
<upgrade> = <amount>
The upgrades configuration for the variant.

create_equipment_variant = { 
    name = "Montecuccoli Class" 
    type = light_cruiser_1 
    upgrades = { 
        ship_reliability_upgrade = 3 
        ship_engine_upgrade = 3 
        ship_gun_upgrade = 3 
        ship_anti_air_upgrade = 3 
    }
}
Creates the specified equipment variant for the current scope.   1.0
add_equipment_production amount = <int>
The amount to produce. Optional.

requested_factories = <int>
The number of factories to assigned initially. Optional.
progress = <float>
The initial production progress. Optional.
efficiency = <float>
The initial production efficiency. Optional.
Equipment scope
type = <equipment>
The name of the equipment to produce.
creator = <scope>
The country which is producing the equipment. Used if root scope isn't producer. Optional.
version_name = <string>The name of the variant to produce. Optional.

add_equipment_production = {
    equipment = {
        type = light_cruiser_2
    }
    requested_factories = 1
    progress = 0.95
    amount = 1
}
Starts a production line for the specified equipment for the current scope.   1.0

陆军

Name Parameters Examples Description Notes Version Added
add_manpower <int> / <variable>
The amount to add.
add_manpower = 100000
add_manpower = var:my_var
Adds the specified amount of manpower to the current scope.   1.0
army_experience <float> / <variable>
The amount to add.
army_experience = 10
Adds the specified amount of army experience to the current scope.   1.0
create_corps_commander name = <string>
The name of the leader.

picture = <string>
The graphical reference of the picture of the leader.
skill = <int>
The skill of the leader.
attack_skill = <int>
The attack skill of the leader.
defense_skill = <int>
The defense skill of the leader.
planning_skill = <int>
The planning skill of the leader.
logistics_skill = <int>
The logistics skill of the leader.
traits = { <trait> }
The traits the leader spawns with.
female = <bool>
The gender of the leader.

create_corps_commander = {
	name = "Jean de Lattre de Tassigny"
	picture = "Portrait_France_Jean_de_Lattre_de_Tassigny.dds"
	traits = { trickster brilliant_strategist }
	skill = 4
	attack_skill = 4
	defense_skill = 2
	planning_skill = 4
	logistics_skill = 3
}
Creates a commander for the current scope with the specified attributes. Traits are found in /Hearts of Iron IV/common/unit_leader/*.txt. 1.0
create_field_marshal name = <string>
The name of the leader.

picture = <string>
The graphical reference of the picture of the leader.
skill = <int>
The skill of the leader.
attack_skill = <int>
The attack skill of the leader.
defense_skill = <int>
The defense skill of the leader.
planning_skill = <int>
The planning skill of the leader.
logistics_skill = <int>
The logistics skill of the leader.
traits = { <trait> }
The traits the leader spawns with.

create_field_marshal = {
	name = "Maurice Gamelin"
	picture = "Portrait_France_Maurice_Gamelin.dds"
	traits = { defensive_doctrine }
	skill = 2
	attack_skill = 1
	defense_skill = 3
	planning_skill = 2
	logistics_skill = 1
}
Creates a field marshal for the current scope with the specified attributes. Traits are found in /Hearts of Iron IV/common/unit_leader/*.txt. 1.0

海军

Name Parameters Examples Description Notes Version Added
navy_experience <float> / <variable>
The amount to add.
navy_experience = 10
Adds the specified amount of navy experience to the current scope.   1.0
destroy_ships type = <ship>
The type of ship to destroy.

count = <int> or all
The amount to destroy.

destroy_ships = {
    type = destroyer
    count = all
}
Destroys the specified type and amount of ships controlled by the current scope.   1.5
transfer_navy target = <scope>
The target country.
transfer_navy = {
    target = GER
}
Transfers the current scope navy to the specified country.   1.5
transfer_ship type = <ship>
The type of ship to transfer.<br target = <scope>
The target country.

prefer_name = <string>
The new name for the ships in the target country. Optional.

transfer_ship = {
    prefer_name = "HMS Achilles"
    type = light_cruiser
    target = NZL
}
Transfers the specified type of ship from the current scope to the specified country.   1.4
create_navy_leader name = <string>
The name of the leader.

picture = <string>
The graphical reference of the picture of the leader.
skill = <int>
The skill of the leader.
traits = { <trait> }
The traits the leader spawns with.

create_navy_leader = {
	name = "François Darlan"
    picture = "Portrait_France_Francois_Darlan.dds"
	traits = { superior_tactician }
	skill = 3
}
Creates a naval leader for the current scope with the specified attributes. Traits are found in /Hearts of Iron IV/common/unit_leader/*.txt. 1.0

空军

Name Parameters Examples Description Notes Version Added
air_experience <float> / <variable>
The amount to add.
air_experience = 10
Adds the specified amount of air experience to the current scope.   1.0
add_ace name = <string>
The name of the ace.

surname = <string>
The surname of the ace.
callsign = <string>
The callsign of the ace.
type = <type>
The ace type.
is_female = <bool>
The gender of the ace.

add_ace = {
    name = "Amelia"
    surname = "Earhart"
    callsign = "Revenant"
    type = fighter_genius
    is_female = yes
}
Adds an ace for the current scope. Ace types found in /Hearts of Iron IV/common/aces/*.txt. 1.0

AI

Name Parameters Examples Description Notes Version Added
add_ai_strategy type = <type>
The type of strategy.

id = <scope>
What country the strategy is against.
value = <int>
The weighting added by the strategy.

add_ai_strategy = {
    type = alliance
    id = GER
    value = 200
}
Sets an AI strategy for the current scope. See AI Modding for more details. 1.0

地区作用域

The effects here must be used within a state scope.

整体

Name Parameters Examples Description Notes Version Added
state_event id = <event>
The event to fire.

days = <event> / <variable>
Fires the event in the specified number of days. Optional.
hours = <event> / <variable>
Fires the event in the specified number of hours. Optional.
random = <event>
Adds a random number (between 0 and random, inclusive) of hours to the scheduled fire time. Optional.
trigger_for = <scope>
Fires event in the specified scope.

state_event = {
    id = my_event.1
    days = 10
    random = 50
    trigger_for = controller
}
Fires the specified event for the current state. Where triggers do not need to be repeatedly checked random can be a performance light alternative to mean_time_to_happen for scheduling events.

Using days = <event> / <variable> or hours may still be bugged and will not fire the event.

1.0
set_state_flag <flag>
An unique string to identify the state flag with.
set_state_flag = my_flag Defines a state flag.   1.0
clr_state_flag <flag>
The unique string of a state flag to clear.
clr_state_flag = my_flag Clears a defined state flag.   1.0
modify_state_flag flag = <flag>
The state flag to modify.

value = <value>
The value to set it to: 0 or 1

modify_state_flag = {
    flag = my_flag
    value = 1
}
Modifies a state flag. Use variables instead. 1.3
set_state_name <string>
Defines the new name.
set_state_name = "Funland"
Changes the current state's name to the specified name.   1.3
reset_state_name <bool>
Boolean.
reset_state_name = yes
Resets any changes to the current state's name.   1.3
add_claim_by <scope> / <variable>
The country to add the claim for.
add_claim_by = SOV
Adds a claim for the specified country on the current scope.   1.0
remove_claim_by <scope> / <variable>
The country to remove the claim for.
remove_claim_by = SOV
Removes a claim by the specified country on the current scope.   1.0
add_core_of <scope> / <variable>
The country to add the core for.
add_core_of = SOV
Adds a core for the specified country on the current scope.   1.0
remove_core_of <scope> / <variable>
The country to remove the core for.
remove_core_of = SOV
Removes a core for the specified country on the current scope.   1.0
set_demilitarized_zone <bool>
Boolean.
set_demilitarized_zone = yes
Makes the current scope a demilitarized zone.   1.0
set_state_category <category>
The category to change to.
set_state_category = rural
Changes the current state category to the specified category. Categories are found in /Hearts of Iron IV/common/state_category/*.txt 1.3
add_state_modifier Modifier scope

<modifier> = <float>
Adds a modifier to the state.

add_state_modifier = {
    modifier = {
        local_resources = 2.0
    }
}
Adds a modifier to the current state.   1.3
add_manpower <int> / <variable>
The amount to add.
add_manpower = 10000
Adds the specified amount of manpower to the current state.   1.0
add_resource type = <resource>
The resource to add.

amount = <int> / <variable>
The amount to add.

add_resource = {
    type = oil
    amount = 100
}
Adds the specified resource in the specified amount to the current state.   1.0
set_border_war <bool>
Boolean.
set_border_war = yes
Enables Border War status for the current state.   1.0
create_unit division = <division string>
The division string.

owner = <scope>
The owner of the division.
prioritize_location = <province>
Prioritize the specified province in the state.

create_unit = {
    division = "name = \"Infantry Division\" division_template = \"Infantry Division\" start_experience_factor = 0.5 start_equipment_factor = 0.5"
    owner = GER
}
Adds the specified division to the current state. The division string must be formatted as it is seen in the examples. 1.3
add_dynamic_modifier modifier = <modifier_string>
The name of the Modifier.
add_dynamic_modifier = { modifier = sabotaged_ressources } Adds a dynamic modifier to the current scope Examples can be found in /Hearts of Iron IV/common/dynamic_modifiers/*.txt 1.9

建筑

Name Parameters Examples Description Notes Version Added
add_building_construction type = <string>
The building to add.

level = <int> / <variable>
The level to set the building to.
instant_build = <bool>
Defines whether the buildings are instantly built.
province = <id>
Defines the exact province to add provincal buildings in. Can be used as a scope.
Province scope
all_provinces = <bool>
Affect all provinces. Used in the province scope.
limit_to_coastal = <bool>
Affect coastal provinces. Used in the province scope.
limit_to_naval_base = <bool>
Affect naval base provinces. Used in the province scope.
limit_to_border = <bool>
Affect border provinces. Used in the province scope.
level = <int>
Affect only provinces with buildings level below, at or above the specified level. Used in the province scope.
id = <id>
Affect the specified province. Used in the province scope.

add_building_construction = {
    type = arms_factory
    level = 5
    instant_build = yes
}
add_building_construction = {
    type = bunker
    level = 10
    instant_build = yes
    province = {
        all_provinces = yes
        limit_to_border = yes
    }
}
add_building_construction = {
    type = bunker
    level = 1
    instant_build = yes
    province = 2999
}
Starts construction in the current state for the specified building. You can limit the construction to victory points using : limit_to_victory_point > 5 (only build province buildings on province with VP over 5 ) limit_to_victory_point = yes (only build province buildings on province with VP) 1.0
set_building_level type = <string>
The building to add.

level = <int> / <variable>
The level to set the building to.
instant_build = <bool>
Defines whether the buildings are instantly built.
province = <id>
Defines the exact province to add provincal buildings in. Can be used as a scope.
Province scope
all_provinces = <bool>
Affect all provinces. Used in the province scope.
limit_to_coastal = <bool>
Affect coastal provinces. Used in the province scope.
limit_to_naval_base = <bool>
Affect naval base provinces. Used in the province scope.
limit_to_border = <bool>
Affect border provinces. Used in the province scope.
level = <int>
Affect only provinces with buildings level below, at or above the specified level. Used in the province scope.
id = <id>
Affect the specified province. Used in the province scope.

set_building_level = {
    type = infrastructure
    level = 10
    instant_build = yes
}
set_building_level = {
    type = bunker
    level = 3
    province = {
        all_provinces = yes
        limit_to_border = yes
        level < 3
    }
}
Sets the specified building to the current state (or provinces within the state). The province scope is used for provincal level buildings. You can limit the construction to victory points using : limit_to_victory_point > 5 (only build province buildings on province with VP over 5 ) limit_to_victory_point = yes (only build province buildings on province with VP) 1.4
damage_building type = <building>
The building to damage.

damage = <float>
The amount of damage to inflict.
province = <id>
The province to target for provincal buildings.

damage_building = {
    type = infrastructure
    damage = 1
}
Damages the specified building in the current state. The health of buildings is determined by the value attribute in a building's definition. This is multiplied by their level to get their total health. 1.3
remove_building type = <building>
The building to remove.

level = <int> / <variable>
The levels to remove.

remove_building = {
    type = arms_factory
    level = 5
}
Removes the specified building in the current state. For shared buildings level determines the amount, whereas for the others it is the actual level.   1.0
add_extra_state_shared_building_slots <int> / <variable>
The amount of slots to add or remove.
add_extra_state_shared_building_slots = 2
Adjusts the number of shared building slots for the current state.   1.0

部队将领作用域

The effects here must be used within a unit leader scope.

整体

Name Parameters Examples Description Notes Version Added
unit_leader_event id = <event>
The event to fire.

days = <event> / <variable>
Fires the event in the specified number of days. Optional.
hours = <event> / <variable>
Fires the event in the specified number of hours. Optional.
random = <event>
Adds a random number (between 0 and random, inclusive) of hours to the scheduled fire time. Optional.

unit_leader_event = {
    id = my_event.1
    days = 10
    random = 50
}
Fires the specified event for the owner of the current unit leader. Uses a special interface displaying the current unit leader portrait.

Where triggers do not need to be repeatedly checked random can be a performance light alternative to mean_time_to_happen for scheduling events.

1.5
set_unit_leader_flag <flag>
An unique string to identify the unit leader flag with.
set_unit_leader_flag = my_flag Defines a unit leader flag.   1.5
clr_unit_leader_flag <flag>
The unique string of a unit leader flag to clear.
clr_unit_leader_flag = my_flag Clears a defined unit leader flag.   1.5
modify_unit_leader_flag flag = <flag>
The unit leader flag to modify.

value = <value>
The value to set it to: 0 or 1

modify_unit_leader_flag = {
    flag = my_flag
    value = 1
}
Modifies a unit leader flag.   1.5
promote_leader <bool>
Boolean
promote_leader = yes
Promotes the current unit leader to Field Marshal (if Commander.   1.5
demote_leader <bool>
Boolean
demote_leader = yes
Demotes the current unit leader to Commander (if Field Marshal).   1.5
retire <bool>
Boolean>
retire = yes
Retires the current unit leader (removing them).   1.5
remove_unit_leader <id>
The id of the unit leader.
remove_unit_leader = 70
Removes the specified unit leader by their id.   1.0
set_nationality <scope> / <variable>
The target country.
set_nationality = GER
Switches the current unit leader to the specified country, giving them the leader.   1.5
add_unit_leader_trait <trait>
The trait to add.
add_unit_leader_trait = old_guard
Adds the specified trait to the current unit leader. Traits are found in /Hearts of Iron IV/common/unit_leader/*.txt. 1.0
remove_unit_leader_trait <trait>
The trait to remove.
remove_unit_leader_trait = old_guard
Removes the specified trait from the current unit leader. Traits are found in /Hearts of Iron IV/common/unit_leader/*.txt. 1.0
add_timed_unit_leader_trait <trait>
The trait to add.

days = <int>
The duration of the trait.

add_timed_unit_leader_trait = {
    trait = wounded
    days = 90
}
Adds the specified trait to the current unit leader for the specified duration. Traits are found in /Hearts of Iron IV/common/unit_leader/*.txt. 1.5
replace_unit_leader_trait       Traits are found in /Hearts of Iron IV/common/unit_leader/*.txt. 1.5

战斗

Name Parameters Examples Description Notes Version Added
supply_units <int> / <variable>
The amount of hours of supply.
supply_units = 24
Adds the specified amount of hours of supply to troops led by the current unit leader.   1.5
add_max_trait <int>
The amount to add.
add_max_trait = 1
Adds the specified amount of assignable trait slots to the current unit leader.   1.5
add_skill_level <int>
The skill to add.
add_skill_level = 1
Adds skill to the current unit leader.   1.5
add_logistics <int>
The skill to add.
add_logistics = 1
Adds logistics skill to the current unit leader.   1.5
add_planning <int>
The skill to add.
add_planning = 1
Adds planning skill to the current unit leader.   1.5
add_defense <int>
The skill to add.
add_defense = 1
Adds defense skill to the current unit leader.   1.5
add_attack <int>
The skill to add.
add_attack = 1
Adds attack skill to the current unit leader.   1.5
add_temporary_buff_to_units combat_offense = <float>
The bonus to grant. Optional.

combat_breakthrough = <float>
The bonus to grant. Optional.
combat_defense = <float>
The bonus to grant. Optional.
combat_entrenchment = <float>
The bonus to grant. Optional.
org_damage_multiplier = <float>
The bonus to grant. Optional.
str_damage_multiplier = <float>
The bonus to grant. Optional.
war_support_reduction_on_damage = <float>
The bonus to grant. Optional.
cannot_retreat_while_attacking = <float>
The bonus to grant. Optional.
cannot_retreat_while_defending = <float>
The bonus to grant. Optional.
days = <int>
The duration of the buff. Optional.
tooltip = <string>
The tooltip to display for the buff.

add_temporary_buff_to_units = {
    combat_offense = 0.25
    combat_breakthrough = 0.25
    org_damage_multiplier = -1.0
    str_damage_multiplier = 0.25
    war_support_reduction_on_damage = 0.2
    cannot_retreat_while_attacking = 1.0
				
    days = 7
    tooltip = ABILITY_FORCE_ATTACK_TOOLTIP
}
Adds the specified combat buff to the current unit leader.   1.5
boost_planning <float>
The amount to add.
boost_planning = 1
Improves the planning of units controlled by the current unit leader.   1.5

Flow Control

These scopes are used within effect scopes to control the execution of effects.

If, Else If and Else

These scopes allow effects to be conditionalized, so they only occur when the requisite triggers are met.

For example, if you only have an effect to occur for Germany, you'd do the following:

if = {
    limit = {
        original_tag = GER
    }   
    add_stability = 0.1
}

If you then wanted England to have a similar effect, and everyone else to have something else, you do the following:

if = {
    limit = {
        original_tag = GER
    }   
    add_stability = 0.1
}
else_if = {
    limit = {
        original_tag = ENG
    }
    add_stability = 0.25
}
else = {
    add_stability = 0.05
}

As you can see, this allows for flexibility in how effects occur and cuts down on duplication.

隐藏效果

This scope hides the presence of the effects within it in the player's tooltip. This is used to execute effects without the player seeing them. For example, you may want to manipulate some variables in an event. Showing them to the player may confuse them, so it is best to hide the effects within an hidden effect scope, like so:

hidden_effect = {
    set_variable = { my_var = 100 }
}

Random List

This scope allows the creation of a random selection of effects. For example, if you wanted an effect to randomly given the player one out of four bonuses, you'd do the following:

random_list = {
    25 = {
        add_stability = 0.5
    }
    25 = {
        add_manpower = 10000
    }
    25 = {
        add_war_support = 0.5
    }
    25 = {
        army_experience = 100
    }
}

Note that if you want to create a repeatable decision including a random list, by default the same decision will pick the same random result every time it is triggered in a game. You can reverse this behaviour by including the following line in the decision block:

fixed_random_seed = no

It is also possible to use modifiers to affect the weight of each possible random effect.

random_list = {
    25 = {
        add_stability = 0.5
        modifier = {
            factor = 1.3
            has_country_flag = inward_perfect_flag
        }
    }
    25 = {
        add_manpower = 10000
    }
    25 = {
        add_war_support = 0.5
    }
    25 = {
        army_experience = 100
    }
}

The above code would multiply the 25 by the factor thereby making it more or less likely to occur if the trigger condition is fulfilled.

Effect Tooltip

This scope will display the tooltip information of the effects within, without actually executing the effects. This is useful when you want to show what the effect may look like to the player. Here is an example:

effect_tooltip = {
    every_owned_state = {
        add_manpower = 10000
    }
}