作用域:修订间差异

本页面所适用的版本可能已经过时,最后更新于1.9
无编辑摘要
(文本替换 - 替换“[[Category:”为“[[分类:”)
 
(未显示1个用户的5个中间版本)
第9行: 第9行:
</pre>
</pre>


 但是不是所有后面有大括号的东西都是作用域:有一些是功能模块(<code>option</code>, <code>trigger</code>, <code>mean_time_to_happen</code>,...),[[operator]] (<code>AND</code>), 流控制语句 (<code>if</code>, <code>limit</code>),或者是复杂[[条件]]或者[[指令]]的分句。
 但是 不是所有后面有大括号的东西都是作用域:有一些是功能模块(<code>option</code>, <code>trigger</code>, <code>mean_time_to_happen</code>,...),[[operator]] (<code>AND</code>), 流控制语句 (<code>if</code>, <code>limit</code>),或者是复杂[[条件]]或者[[指令]]的分句。


===作用域转换类型===
===作用域转换类型===
第37行: 第37行:
'''请注意以下内容:'''
'''请注意以下内容:'''


:If a scope has trigger set to '''✓''', then you may test it against a condition.
: 如果一个作用域的触发器一栏为'''✓''' ,那么你可以检查它的条件。
:If a scope has effect set to '''✓''', then you may run a command on it.
: 如果一个作用域的效果一栏为'''✓''' ,那么你可以对它施加指令。


{| class="wikitable sortable"
{| class="wikitable sortable"
|-
|-
!Scope!!Description!!Example||Trigger||Effect||From Scope||To Scope||Game Version
! 作用域!! 描述!! 样例|| 触发器|| 效果|| 来自作用域|| 改变作用域到|| 加入的游戏版本
|-
|-
|all_unit_leader||Check if all unit leaders owned by the current country scope meet the trigger.||all_unit_leader = { ... }||✓||X||Country||Unit Leader||1.5
|all_unit_leader|| 检查是否当前国家作用域的'''所有'''将领满足了条件。||all_unit_leader = { ... }||✓||X|| 国家|| 将领||1.5
|-
|-
|any_unit_leader||Check if any unit leader meets the trigger.
|any_unit_leader|| 检查是否当前国家作用域有'''任意'''将领满足了条件。||any_unit_leader = { ... }||✓||X|| 国家|| 将领||1.5
||any_unit_leader = { ... }||✓||X||Country||Unit Leader||1.5
|-
|-
|all_army_leader||Check if all army unit leaders owned by the current country scope meet the trigger||all_unit_leader = { ... }||✓||X||Country||Unit Leader||1.5
|all_army_leader|| 检查是否当前国家作用域的'''所有'''陆军将领满足了条件。||all_unit_leader = { ... }||✓||X|| 国家|| 将领||1.5
|-
|-
|any_army_leader||Check if any army unit leader owned by the current country scope meets the trigger||all_unit_leader = { ... }||✓||X||Country||Unit Leader||1.5
|any_army_leader|| 检查是否当前国家作用域有'''任意'''陆军将领满足了条件。||all_unit_leader = { ... }||✓||X|| 国家|| 将领||1.5
|-
|-
|all_navy_leader||Check if all navy unit leaders owned by the current country scope meet the trigger||all_navy_leader = { ... }||✓||X||Country||Unit Leader||1.5
|all_navy_leader|| 检查是否当前国家作用域的'''所有'''海军将领满足了条件。||all_navy_leader = { ... }||✓||X|| 国家|| 将领||1.5
|-
|-
|any_navy_leader||Check if any navy unit leader owned by the current country scope meets the trigger.||all_navy_leader = { ... }||✓||X||Country||Unit Leader||1.5
|any_navy_leader|| 检查是否当前国家作用域有'''任意'''海军将领满足了条件。||all_navy_leader = { ... }||✓||X|| 国家|| 将领||1.5
|-
|-
|random_unit_leader||Targets a random unit leader owned by the current country scope||random_unit_leader = { ... }||X||✓||Country||Unit Leader||1.5
|random_unit_leader|| 指向当前国家作用域的'''一个随机'''将领。||random_unit_leader = { ... }||X||✓|| 国家|| 将领||1.5
|-
|-
|every_unit_leader||Targets every unit leader owned by the current country scope||every_unit_leader = { ... }||X||✓||Country||Unit Leader||1.5
|every_unit_leader|| 指向当前国家作用域的'''每一个'''将领。||every_unit_leader = { ... }||X||✓|| 国家|| 将领||1.5
|-
|-
|random_army_leader||Targets a random army unit leader owned by the current country scope||random_army_leader = { ... }||X||✓||Country||Unit Leader||1.5
|random_army_leader|| 指向当前国家作用域的'''一个随机'''陆军将领。||random_army_leader = { ... }||X||✓|| 国家|| 将领||1.5
|-
|-
|every_army_leader||Targets every army unit leader owned by the current country scope||every_army_leader = { ... }||X||✓||Country||Unit Leader||1.5
|every_army_leader|| 指向当前国家作用域的'''每一个'''陆军将领。||every_army_leader = { ... }||X||✓|| 国家|| 将领||1.5
|-
|-
|random_navy_leader||Targets a random naval unit leader owned by the current country scope||random_navy_leader = { ... }||X||✓||Country||Unit Leader||1.5
|random_navy_leader|| 指向当前国家作用域的'''一个随机'''海军将领。||random_navy_leader = { ... }||X||✓|| 国家|| 将领||1.5
|-
|-
|every_navy_leader||Targets every naval unit leader owned by the current country scope||every_navy_leader = { ... }||X||✓||Country||Unit Leader||1.5
|every_navy_leader|| 指向当前国家作用域的'''每一个'''海军将领。||every_navy_leader = { ... }||X||✓|| 国家|| 将领||1.5
|-
|-
|global_every_army_leader||Targets every army leader for every country in the world (Better to use every_army_leader if you know the country)||global_every_army_leader = { ... }||X||✓||Country||Unit Leader||1.5
|global_every_army_leader|| 指向世界上所有国家的'''每一个'''陆军将领。(如果你知道国家的话最好用every_army_leader)||global_every_army_leader = { ... }||X||✓|| 国家|| 将领||1.5
|-
|-
|OVERLORD||Targets the overlord of the current scope, if current scope is a subject||RAJ = { OVERLORD = { ... } }||✓||✓||Country||Country||1.3
|OVERLORD|| 指向当前作用域的宗主国,如果当前作用域是附属国。||RAJ = { OVERLORD = { ... } }||✓||✓|| 国家|| 国家||1.3
|-
|-
|TAG||Targets a specific country by tag||FRA = { ... }||✓||✓||Anywhere||Country||1.0
|TAG|| 指向tag对应的特定国家。||FRA = { ... }||✓||✓||'''任意'''|| 国家||1.0
|-
|-
|any_country||Targets any country in the world (including the current scope, see any_other_country)||any_country = { ... }||✓||X||Anywhere||Country||1.0
|any_country|| 检查世界上的'''任意'''国家。(包括当前作用域,如果不想包含的话参见any_other_country)||any_country = { ... }||✓||X||'''任意'''|| 国家||1.0
|-
|-
|any_country_with_original_tag||Targets any country with current scope's original tag||any_country_with_original_tag = { ... }||✓||X||Anywhere||Country||1.9
|any_country_with_original_tag||Targets any country with current scope's original tag||any_country_with_original_tag = { ... }||✓||X||'''任意'''|| 国家||1.9
|-
|-
|any_neighbor_country||Targets any neighboring country of the current scope||any_neighbor_country = { ... }||✓||X||Country||Country||1.0
|any_neighbor_country|| 检查当前作用域的'''任意'''相邻国家。||any_neighbor_country = { ... }||✓||X|| 国家|| 国家||1.0
|-
|-
|any_home_area_neighbor_country||Targets any country that shares a border with the current scope's home area (cored states)||any_home_area_neighbor_country = { ... }||✓||X||Anywhere||Country||1.0
|any_home_area_neighbor_country|| 检查与当前作用域本土(核心地区)相邻的'''任意'''国家。||any_home_area_neighbor_country = { ... }||✓||X||'''任意'''|| 国家||1.0
|-
|-
|any_guaranteed_country||Targets any country with current scoped country guarantees||any_guaranteed_country = { ... }||✓||X||Country||Country||1.9
|any_guaranteed_country|| 检查当前作用域保障独立的'''任意'''国家。||any_guaranteed_country = { ... }||✓||X|| 国家|| 国家||1.9
|-
|-
|any_allied_country||Targets any allied country of the current scope||any_allied_country = { ... }||✓||X||Country||Country||1.0
|any_allied_country|| 检查当前作用域结盟的'''任意'''国家。||any_allied_country = { ... }||✓||X|| 国家|| 国家||1.0
|-
|-
|any_other_country||Targets any other country in the world (not including the current scope)||any_other_country = { ... }||✓||X||Country||Country||1.0
|any_other_country|| 检查世界上的'''任意'''其他国家(不包括当前作用域)。||any_other_country = { ... }||✓||X|| 国家|| 国家||1.0
|-
|-
|any_enemy_country||Targets any enemy country of the current scope||any_enemy_country = { ... }||✓||X||Country||Country||1.0
|any_enemy_country|| 检查当前作用域的'''任意'''敌对国家。||any_enemy_country = { ... }||✓||X|| 国家|| 国家||1.0
|-
|-
|any_occupied_country||Targets any occupied country by the current scope||any_occupied_country = { ... }||✓||X||Country||Country||1.9
|any_occupied_country|| 检查被当前作用域占领的'''任意'''国家。||any_occupied_country = { ... }||✓||X|| 国家|| 国家||1.9
|-
|-
|all_neighbor_country||Targets all neighboring countries of the current scope||all_neighbor_country = { ... }||✓||X||Country||Country/ies||1.0
|all_neighbor_country|| 检查当前作用域的'''所有'''相邻国家。||all_neighbor_country = { ... }||✓||X|| 国家|| 国家||1.0
|- 
|- 
|all_country||Targets all countries in the world||all_country = { ... }||✓||X||Anywhere||Country/ies||1.0
|all_country|| 检查世界上的'''所有'''国家。||all_country = { ... }||✓||X||'''任意'''|| 国家||1.0
|-
|-
|all_country_with_original_tag||Targets all country with current scope's original tag||all_country_with_original_tag = { ... }||✓||X||Anywhere||Country/ies||1.9
|all_country_with_original_tag||Targets all country with current scope's original tag||all_country_with_original_tag = { ... }||✓||X||'''任意'''|| 国家||1.9
|-
|-
|all_allied_country||Targets all allied countries of the current scope||all_allied_country = { ... }||✓||X||Country||Country/ies||1.9
|all_allied_country|| 检查当前作用域结盟的'''所有'''国家。||all_allied_country = { ... }||✓||X|| 国家|| 国家||1.9
|-
|-
|all_guaranteed_country||Targets every country with current scoped country guarantees||all_guaranteed_country = { ... }||✓||X||Country||Country/ies||1.9
|all_guaranteed_country|| 检查当前作用域保障独立的'''所有'''国家。||all_guaranteed_country = { ... }||✓||X|| 国家|| 国家||1.9
|-
|-
|all_enemy_country||Targets all enemy countries of the current scope||all_enemy_country = { ... }||✓||X||Country||Country/ies||1.0
|all_enemy_country|| 检查当前作用域的'''所有'''敌对国家。||all_enemy_country = { ... }||✓||X|| 国家|| 国家||1.0
|-
|-
|all_occupied_country||Targets all occupied countries||all_occupied_country = { ... }||✓||X||Country||Country/ies||1.9
|all_occupied_country|| 检查被当前作用域占领的'''所有'''国家。||all_occupied_country = { ... }||✓||X|| 国家|| 国家||1.9
|-
|-
|state_id||Targets a specific state by id number||145 = { ... }||✓||✓||Anywhere||State||1.0
|state_id|| 指向地区id对应的特定地区。||145 = { ... }||✓||✓||'''任意'''|| 地区||1.0
|-
|-
|any_state||Targets any state in the world||any_state = { ... }||✓||X||Anywhere||State||1.0
|any_state|| 检查世界上的'''任意'''地区。||any_state = { ... }||✓||X||'''任意'''|| 地区||1.0
|-
|-
|any_controlled_state||Targets any of the states controlled by the scope country||any_controlled_state = { ... }||✓||X||Country||State||1.9
|any_controlled_state|| 检查当前作用域控制的'''任意'''地区。||any_controlled_state = { ... }||✓||X|| 国家|| 地区||1.9
|-
|-
|any_owned_state||Targets any owned state of the current scope||any_owned_state = { ... }||✓||X||Country||State||1.0
|any_owned_state|| 检查当前作用域拥有的'''任意'''地区。||any_owned_state = { ... }||✓||X|| 国家|| 地区||1.0
|-
|-
|any_neighbor_state||Targets any neighboring state of the current scope||any_neighbor_state = { ... }||✓||X||State||State||1.0
|any_neighbor_state|| 检查与当前作用域相邻的'''任意'''地区。||any_neighbor_state = { ... }||✓||X|| 地区|| 地区||1.0
|-
|-
|all_state||Targets all states in the world||all_state = { ... }||✓||X||Anywhere||State/s||1.0
|all_state|| 检查世界上的'''所有'''地区。||all_state = { ... }||✓||X||'''任意'''|| 地区||1.0
|-
|-
|all_owned_state||Targets all owned states of the current scope||all_owned_state = { ... }||✓||X||Country||State/s||1.0
|all_owned_state|| 检查当前作用域拥有的'''所有'''地区。||all_owned_state = { ... }||✓||X|| 国家|| 地区||1.0
|-
|-
|all_neighbor_state||Targets all neighboring states of the current scope||all_neighbor_state = { ... }||✓||X||State||State/s||1.0
|all_neighbor_state|| 检查与当前作用域相邻的'''所有'''地区。||all_neighbor_state = { ... }||✓||X|| 地区|| 地区||1.0
|-
|-
|all_owned_state||Targets all owned states of the current scope||all_owned_state = { ... }||✓||X||Country||State/s||1.0
|all_owned_state|| 检查当前作用域拥有的'''所有'''地区。||all_owned_state = { ... }||✓||X|| 国家|| 地区||1.0
|-
|-
|all_controlled_state||Targets all of the states controlled by the scope country||all_controlled_state = { ... }||✓||X||Country||State/s||1.9
|all_controlled_state|| 检查当前作用域控制的'''所有'''地区。||all_controlled_state = { ... }||✓||X|| 国家|| 地区||1.9
|-
|-
|every_country||Targets every country in the world (including the current scope, see every_other_country)||every_country = { ... }||X||✓||Anywhere||Country/ies||1.0
|every_country|| 指向世界上的'''每一个'''国家。(包括当前作用域,如果不想包含的话参见every_other_country)||every_country = { ... }||X||✓||'''任意'''|| 国家||1.0
|-
|-
|every_country_with_original_tag||Targets every country with original tag||every_country_with_original_tag = { original_tag_to_check = TAG limit = { ... } ... }||X||✓||Anywhere||Country/ies||1.9
|every_country_with_original_tag|| ||every_country_with_original_tag = { original_tag_to_check = TAG limit = { ... } ... }||X||✓||'''任意'''|| 国家||1.9
|-
|-
|every_other_country||Targets every other country in the world (not including the current scope)||every_other_country = { ... }||X||✓||Country||Country/ies||1.0
|every_other_country|| 指向世界上的'''每一个'''其他国家(不包括当前作用域)。||every_other_country = { ... }||X||✓|| 国家|| 国家||1.0
|-
|-
|every_neighbor_country||Targets every neighboring country of the current scope||every_neighbor_country = { ... }||X||✓||Country||Country/ies||1.0
|every_neighbor_country|| 指向当前作用域的'''每一个'''邻国。||every_neighbor_country = { ... }||X||✓|| 国家|| 国家||1.0
|-
|-
|every_enemy_country||Targets every enemy country of the current scope||every_enemy_country = { ... }||X||✓||Country||Country/ies||1.0
|every_enemy_country|| 指向当前作用域的'''每一个'''敌对国家。||every_enemy_country = { ... }||X||✓|| 国家|| 国家||1.0
|-
|-
|every_occupied_country||Targets every occupied country of the current scope||every_occupied_country = { ... }||X||✓||Country||Country/ies||1.9
|every_occupied_country|| 指向当前作用域占领的'''每一个'''国家。||every_occupied_country = { ... }||X||✓|| 国家|| 国家||1.9
|-
|-
|random_country||Targets a random country in the world (including the current scope)||random_country = { ... }||X||✓||Anywhere||Country||1.0
|random_country|| 指向世界上的'''一个随机'''国家。(包括当前作用域)||random_country = { ... }||X||✓||'''任意'''|| 国家||1.0
|-
|-
|random_country_with_original_tag||Targets a random country with original tag||random_country_with_original_tag = { original_tag_to_check = TAG limit = {...} ... }||X||✓||Anywhere||Country||1.9
|random_country_with_original_tag||Targets a random country with original tag||random_country_with_original_tag = { original_tag_to_check = TAG limit = {...} ... }||X||✓||'''任意'''|| 国家||1.9
|-
|-
|random_neighbor_country||Targets a random neighboring country of the current scope||random_neighbor_country = { ... }||X||✓||Country||Country/ies||1.0
|random_neighbor_country|| 指向当前作用域的'''一个随机'''邻国。||random_neighbor_country = { ... }||X||✓|| 国家|| 国家||1.0
|-
|-
|random_enemy_country||Targets a random enemy country of the current scope||random_enemy_country = { ... }||X||✓||Country||Country||1.0
|random_enemy_country|| 指向当前作用域的'''一个随机'''敌对国家。||random_enemy_country = { ... }||X||✓|| 国家|| 国家||1.0
|-
|-
|random_occupied_country||Targets a random occupied country of the current scope||random_occupied_country = { ... }||X||✓||Country||Country||1.9
|random_occupied_country|| 指向当前作用域占领的'''一个随机'''国家。||random_occupied_country = { ... }||X||✓|| 国家|| 国家||1.9
|-
|-
|random_state||Targets a random state in the world||random_state = { ... }||X||✓||Anywhere||State||1.0
|random_state|| 指向'''一个随机'''地区。||random_state = { ... }||X||✓||'''任意'''|| 地区||1.0
|-
|-
|random_owned_state||Targets a random owned state of the current scope||random_owned_state = { ... }||X||✓||Country||State||1.0
|random_owned_state|| 指向当前作用域拥有的'''一个随机'''地区。||random_owned_state = { ... }||X||✓|| 国家|| 地区||1.0
|-
|-
|random_controlled_state||Targets a random controlled state of the current scope||random_controlled_state = { prioritize = { <stateID> <stateID> } to pick those states first if they fulfill the limit ... }||X||✓||Country||State||1.9
|random_controlled_state|| 指向当前作用域控制的'''一个随机'''地区。||random_controlled_state = { prioritize = { <stateID> <stateID> } to pick those states first if they fulfill the limit ... }||X||✓|| 国家|| 地区||1.9
|-
|-
|random_owned_controlled_state||Targets a random owned and controlled state for the current scope||random_owned_controlled_state = { ... }||X||✓||Country||State||1.3
|random_owned_controlled_state|| 指向当前作用域拥有并控制的'''一个随机'''地区。||random_owned_controlled_state = { ... }||X||✓|| 国家|| 地区||1.3
|-
|-
|random_neighbor_state||Targets a random neighboring state of the current scope||random_neighbor_state = { ... }||X||✓||State||State||1.0
|random_neighbor_state|| 指向与当前作用域相邻的'''一个随机'''地区。||random_neighbor_state = { ... }||X||✓|| 地区|| 地区||1.0
|-
|-
|every_state||Targets every state in the world||every_state = { ... }||X||✓||State||State/s||1.0
|every_state|| 指向世界上的'''每一个'''地区。||every_state = { ... }||X||✓|| 地区|| 地区||1.0
|-
|-
|every_controlled_state||Targets every controlled state of the current scope||every_controlled_state = { ... }||X||✓||Country||State/s||1.9
|every_controlled_state|| 指向当前作用域控制的'''每一个'''地区。||every_controlled_state = { ... }||X||✓|| 国家|| 地区||1.9
|- 
|- 
|every_owned_state||Targets every owned state of the current scope||every_owned_state = { ... }||X||✓||Country||State/s||1.0
|every_owned_state|| 指向当前作用域拥有的'''每一个'''地区。||every_owned_state = { ... }||X||✓|| 国家|| 地区||1.0
|- 
|- 
|every_neighbor_state||Targets every neighboring state of the current scope||every_neighbor_state = { ... }||X||✓||State||State/s||1.0
|every_neighbor_state|| 指向与当前作用域相邻的'''每一个'''地区。||every_neighbor_state = { ... }||X||✓|| 地区|| 地区||1.0
|-
|-
|capital_scope||Targets the capital state of the current scope||capital_scope = { ... }||✓||✓||Country||State||1.0
|capital_scope|| 指向当前作用域的首都地区。||capital_scope = { ... }||✓||✓|| 国家|| 地区||1.0
|-
|-
|owner scope||Targets the owner of a state||owner = { ... }||X||✓||State||Country||1.0
|owner scope|| 指向当前作用域的拥有者。||owner = { ... }||X||✓|| 地区|| 国家||1.0
|-
|-
|controller scope||Targets the controller of a state||controller = { ... }||X||✓||State||Country||1.0
|controller scope|| 指向当前作用域的控制者。||controller = { ... }||X||✓|| 地区|| 国家||1.0
|-
|-
|all_operative_leader||Targets all operatives of the current scope||all_operative_leader = { ... }||✓||X||Country/Operation||Operatives||1.9
|all_operative_leader|| 检查当前作用域的'''所有'''特工。||all_operative_leader = { ... }||✓||X|| 国家/Operation|| 特工||1.9
|-
|-
|any_operative_leader||Targets any operative of the current scope||any_operative_leader = { ... }||✓||X||Country/Operation||Operative||1.9
|any_operative_leader|| 检查当前作用域的'''任意'''特工。||any_operative_leader = { ... }||✓||X|| 国家/Operation|| 特工||1.9
|-
|-
|every_operative||Targets every operatives of the current scope||every_operative = { ... }||X||✓||Country/Operation||Operative||1.9
|every_operative|| 指向当前作用域的'''每一个'''特工。||every_operative = { ... }||X||✓|| 国家/Operation|| 特工||1.9
|-
|-
|random_operative||Targets a random operative of the current scope||random_operative = { ... }||X||✓||Country/Operation||Operative||1.9
|random_operative|| 指向当前作用域的'''一个随机'''特工。||random_operative = { ... }||X||✓|| 国家/Operation|| 特工||1.9
|}
|}


'''NOTE:''' Some of these scopes may have no countries/states that match the criteria
'''NOTE:''' Some of these scopes may have no countries/states that match the criteria


===Scope limits===
=== 作用域限制===


It is possible to use the <code>limit</code> block to narrow down scopes using specific conditions. Simply insert the <code>limit</code> block inside a scope (ex. every neighbor country), put in the desired conditions (ex. has more than 5 military factories) and after closing the limit block, put in the commands (ex. give military access) to affect the specified scopes. A short example is available here:
可以使用<code>limit</code> 语句限定条件来缩小作用域的范围。很简单地在一个作用域(如every_neighbor_country)中插入语句,放入所需的条件(如有多于5个军工厂)。然后在写完<code>limit</code> 语句后,放入指令(如给与军事通行权)来影响特定的作用域。这里有一个小例子:
<pre>
<pre>
every_neighbor_country = { # Targets every neighbor country
every_neighbor_country = { # 指向作用域相邻的每一个国家
limit = {
limit = {
num_of_military_factories > 5 # Limit the scope to neighbor countries with more than 5 military factories
num_of_military_factories > 5 # 添加拥有多于5个军工厂的限制
}
}
give_military_access = ROOT # Give military access to neighbor countries with more than 5 military factories
give_military_access = ROOT # 将军事通行权给与拥有多于5个军工厂的每个邻国
}
}
</pre>
</pre>
第292行: 第291行:


{{Modding navbox}}
{{Modding navbox}}
[[Category:Modding]]
[[ 分类:Modding]]

2022年12月5日 (一) 15:57的最新版本

作用域选择实体以检查条件或实施指令

作用域后面一般都会跟着大括号:

<scope_name> = {
	#这个作用域中要实施的东西。
}

但是并不是所有后面有大括号的东西都是作用域:有一些是功能模块(option, trigger, mean_time_to_happen,...),operator (AND), 流控制语句 (if, limit),或者是复杂条件或者指令的分句。

作用域转换类型

有不同的作用域转换运算符。

  • 条件(Condition):条件作用域和其他条件一样返回布尔值。
  • 指令(Command):指令作用域和其他指令一样对新作用域施加效果。
  • 兼容(Both):这种作用域可以有以上两种用途。

大多数通用作用域转换运算符都有四种不同的形式。

名称 描述
all_<name> 条件,所有都必须达到子条件。
any_<name> 条件,至少有一个达到子条件。
every_<name> 指令,施加在所有子作用域上。
random_<name> 指令,施加在某一子作用域上。

作用域列表

请注意以下内容:

如果一个作用域的触发器一栏为,那么你可以检查它的条件。
如果一个作用域的效果一栏为,那么你可以对它施加指令。
作用域 描述 样例 触发器 效果 来自作用域 改变作用域到 加入的游戏版本
all_unit_leader 检查是否当前国家作用域的所有将领满足了条件。 all_unit_leader = { ... } X 国家 将领 1.5
any_unit_leader 检查是否当前国家作用域有任意将领满足了条件。 any_unit_leader = { ... } X 国家 将领 1.5
all_army_leader 检查是否当前国家作用域的所有陆军将领满足了条件。 all_unit_leader = { ... } X 国家 将领 1.5
any_army_leader 检查是否当前国家作用域有任意陆军将领满足了条件。 all_unit_leader = { ... } X 国家 将领 1.5
all_navy_leader 检查是否当前国家作用域的所有海军将领满足了条件。 all_navy_leader = { ... } X 国家 将领 1.5
any_navy_leader 检查是否当前国家作用域有任意海军将领满足了条件。 all_navy_leader = { ... } X 国家 将领 1.5
random_unit_leader 指向当前国家作用域的一个随机将领。 random_unit_leader = { ... } X 国家 将领 1.5
every_unit_leader 指向当前国家作用域的每一个将领。 every_unit_leader = { ... } X 国家 将领 1.5
random_army_leader 指向当前国家作用域的一个随机陆军将领。 random_army_leader = { ... } X 国家 将领 1.5
every_army_leader 指向当前国家作用域的每一个陆军将领。 every_army_leader = { ... } X 国家 将领 1.5
random_navy_leader 指向当前国家作用域的一个随机海军将领。 random_navy_leader = { ... } X 国家 将领 1.5
every_navy_leader 指向当前国家作用域的每一个海军将领。 every_navy_leader = { ... } X 国家 将领 1.5
global_every_army_leader 指向世界上所有国家的每一个陆军将领。(如果你知道国家的话最好用every_army_leader) global_every_army_leader = { ... } X 国家 将领 1.5
OVERLORD 指向当前作用域的宗主国,如果当前作用域是附属国。 RAJ = { OVERLORD = { ... } } 国家 国家 1.3
TAG 指向tag对应的特定国家。 FRA = { ... } 任意 国家 1.0
any_country 检查世界上的任意国家。(包括当前作用域,如果不想包含的话参见any_other_country) any_country = { ... } X 任意 国家 1.0
any_country_with_original_tag Targets any country with current scope's original tag any_country_with_original_tag = { ... } X 任意 国家 1.9
any_neighbor_country 检查当前作用域的任意相邻国家。 any_neighbor_country = { ... } X 国家 国家 1.0
any_home_area_neighbor_country 检查与当前作用域本土(核心地区)相邻的任意国家。 any_home_area_neighbor_country = { ... } X 任意 国家 1.0
any_guaranteed_country 检查当前作用域保障独立的任意国家。 any_guaranteed_country = { ... } X 国家 国家 1.9
any_allied_country 检查当前作用域结盟的任意国家。 any_allied_country = { ... } X 国家 国家 1.0
any_other_country 检查世界上的任意其他国家(不包括当前作用域)。 any_other_country = { ... } X 国家 国家 1.0
any_enemy_country 检查当前作用域的任意敌对国家。 any_enemy_country = { ... } X 国家 国家 1.0
any_occupied_country 检查被当前作用域占领的任意国家。 any_occupied_country = { ... } X 国家 国家 1.9
all_neighbor_country 检查当前作用域的所有相邻国家。 all_neighbor_country = { ... } X 国家 国家 1.0
all_country 检查世界上的所有国家。 all_country = { ... } X 任意 国家 1.0
all_country_with_original_tag Targets all country with current scope's original tag all_country_with_original_tag = { ... } X 任意 国家 1.9
all_allied_country 检查当前作用域结盟的所有国家。 all_allied_country = { ... } X 国家 国家 1.9
all_guaranteed_country 检查当前作用域保障独立的所有国家。 all_guaranteed_country = { ... } X 国家 国家 1.9
all_enemy_country 检查当前作用域的所有敌对国家。 all_enemy_country = { ... } X 国家 国家 1.0
all_occupied_country 检查被当前作用域占领的所有国家。 all_occupied_country = { ... } X 国家 国家 1.9
state_id 指向地区id对应的特定地区。 145 = { ... } 任意 地区 1.0
any_state 检查世界上的任意地区。 any_state = { ... } X 任意 地区 1.0
any_controlled_state 检查当前作用域控制的任意地区。 any_controlled_state = { ... } X 国家 地区 1.9
any_owned_state 检查当前作用域拥有的任意地区。 any_owned_state = { ... } X 国家 地区 1.0
any_neighbor_state 检查与当前作用域相邻的任意地区。 any_neighbor_state = { ... } X 地区 地区 1.0
all_state 检查世界上的所有地区。 all_state = { ... } X 任意 地区 1.0
all_owned_state 检查当前作用域拥有的所有地区。 all_owned_state = { ... } X 国家 地区 1.0
all_neighbor_state 检查与当前作用域相邻的所有地区。 all_neighbor_state = { ... } X 地区 地区 1.0
all_owned_state 检查当前作用域拥有的所有地区。 all_owned_state = { ... } X 国家 地区 1.0
all_controlled_state 检查当前作用域控制的所有地区。 all_controlled_state = { ... } X 国家 地区 1.9
every_country 指向世界上的每一个国家。(包括当前作用域,如果不想包含的话参见every_other_country) every_country = { ... } X 任意 国家 1.0
every_country_with_original_tag every_country_with_original_tag = { original_tag_to_check = TAG limit = { ... } ... } X 任意 国家 1.9
every_other_country 指向世界上的每一个其他国家(不包括当前作用域)。 every_other_country = { ... } X 国家 国家 1.0
every_neighbor_country 指向当前作用域的每一个邻国。 every_neighbor_country = { ... } X 国家 国家 1.0
every_enemy_country 指向当前作用域的每一个敌对国家。 every_enemy_country = { ... } X 国家 国家 1.0
every_occupied_country 指向当前作用域占领的每一个国家。 every_occupied_country = { ... } X 国家 国家 1.9
random_country 指向世界上的一个随机国家。(包括当前作用域) random_country = { ... } X 任意 国家 1.0
random_country_with_original_tag Targets a random country with original tag random_country_with_original_tag = { original_tag_to_check = TAG limit = {...} ... } X 任意 国家 1.9
random_neighbor_country 指向当前作用域的一个随机邻国。 random_neighbor_country = { ... } X 国家 国家 1.0
random_enemy_country 指向当前作用域的一个随机敌对国家。 random_enemy_country = { ... } X 国家 国家 1.0
random_occupied_country 指向当前作用域占领的一个随机国家。 random_occupied_country = { ... } X 国家 国家 1.9
random_state 指向一个随机地区。 random_state = { ... } X 任意 地区 1.0
random_owned_state 指向当前作用域拥有的一个随机地区。 random_owned_state = { ... } X 国家 地区 1.0
random_controlled_state 指向当前作用域控制的一个随机地区。 random_controlled_state = { prioritize = { <stateID> <stateID> } to pick those states first if they fulfill the limit ... } X 国家 地区 1.9
random_owned_controlled_state 指向当前作用域拥有并控制的一个随机地区。 random_owned_controlled_state = { ... } X 国家 地区 1.3
random_neighbor_state 指向与当前作用域相邻的一个随机地区。 random_neighbor_state = { ... } X 地区 地区 1.0
every_state 指向世界上的每一个地区。 every_state = { ... } X 地区 地区 1.0
every_controlled_state 指向当前作用域控制的每一个地区。 every_controlled_state = { ... } X 国家 地区 1.9
every_owned_state 指向当前作用域拥有的每一个地区。 every_owned_state = { ... } X 国家 地区 1.0
every_neighbor_state 指向与当前作用域相邻的每一个地区。 every_neighbor_state = { ... } X 地区 地区 1.0
capital_scope 指向当前作用域的首都地区。 capital_scope = { ... } 国家 地区 1.0
owner scope 指向当前作用域的拥有者。 owner = { ... } X 地区 国家 1.0
controller scope 指向当前作用域的控制者。 controller = { ... } X 地区 国家 1.0
all_operative_leader 检查当前作用域的所有特工。 all_operative_leader = { ... } X 国家/Operation 特工 1.9
any_operative_leader 检查当前作用域的任意特工。 any_operative_leader = { ... } X 国家/Operation 特工 1.9
every_operative 指向当前作用域的每一个特工。 every_operative = { ... } X 国家/Operation 特工 1.9
random_operative 指向当前作用域的一个随机特工。 random_operative = { ... } X 国家/Operation 特工 1.9

NOTE: Some of these scopes may have no countries/states that match the criteria

作用域限制

可以使用limit语句限定条件来缩小作用域的范围。很简单地在一个作用域(如every_neighbor_country)中插入语句,放入所需的条件(如有多于5个军工厂)。然后在写完limit语句后,放入指令(如给与军事通行权)来影响特定的作用域。这里有一个小例子:

every_neighbor_country = { # 指向作用域相邻的每一个国家
	limit = {
		num_of_military_factories > 5 # 添加拥有多于5个军工厂的限制
	}
	give_military_access = ROOT #将军事通行权给与拥有多于5个军工厂的每个邻国
}

作用域之间的移动

有许多能够跨作用域执行效果或检查触发器的链接。所有的链接都可以用于效果或触发器,尽管不是所有指令和条件(即效果和触发器)都接受它们,或者是作用域本身。

链接 描述 样例
ROOT 定位这个效果或触发器所在的根(脚本进入的第一个作用域)国家,无视其它任何作用域。
ENG = {
	FRA = {
		GER = {
			declare_war_on = {
				target = ROOT
				type = annex_everything
			}
		}
	}
} #德国对英国宣战。(假设在前面再没有作用域了)
THIS 定位当前作用域。
random_state = {
    add_resource = {
        type = oil
        amount = 50
        state = THIS
    }
}#资源会加到随机的地区(random_state)。
PREV 定位上一个作用域。
FRA = {
	random_country = {
		GER = {
			declare_war_on = {
				target = PREV
				type = annex_everything
			}
		}
	}
} #德国对随机国家宣战(random_country)。

FROM 决议中,定位到目标决议的目标。

事件中,定位到向你发送这个事件的tag(如适用),例如德国向意大利发送了一个事件。

declare_war_on = {
    target = FROM
    type = annex_everything
}
FROM = {
    load_oob = defend_ourselves
}

FROM和PREV可以向前多次定位作用域,方法是在.后面继续加FROM或PREV。例如,FROM.FROMPREV.PREV.PREV。 In this example of chaining these links, two arms factories are built in two random states of a random country, and PREV.PREV is used to ensure the second state is not the same as the first state.

random_country = { #1st scope [1]
    random_owned_state = { # 2nd scope [1,2]
        add_extra_state_shared_building_slots = 2
        add_building_construction = {
            type = arms_factory
            level = 2
            instant_build = yes
        }
        PREV = { #from random_owned_state(#2nd) to random_country(#1st). [1,2,1]
            random_owned_state = { #new second scope [1,2_old,1,2_new]
                limit = { NOT = { state = PREV.PREV } } # The first PREV scopes back to the country, the second scopes back to the first random state <Value:1,2_old,̶1̶,̶̶̶2̶̶̶_̶̶̶n̶̶̶e̶̶̶w>
                add_extra_state_shared_building_slots = 2 #Note: We used PREV.PREV to get a value, but didn't actually enter that scope. [1,2_old,1,2_new]
                add_building_construction = {
                    type = arms_factory
                    level = 2
                    instant_build = yes
                }
            }
        }
    }
}

References