国策制作:修订间差异

本页面所适用的版本可能已经过时,最后更新于1.8
(merge from offical wiki)
 
无编辑摘要
第1行: 第1行:
{{Version|1.8}}
{{Version|1.8}}
The definitions of [[national focus]]es are found in {{path|common/national_focus/*.txt}}.
[[ 国策]] 的定义在{{path|common/national_focus/*.txt}}


== Focus ==
== 国策==
{{SVersion|1.8}}
{{SVersion|1.8}}
Individual national focuses are tied to a focus tree (see below).
单个国策被捆绑于国策树上。
=== Attributes ===
=== 属性===
==== id ====
==== id ====
(Type: string) A unique identifier for the focus.
( 变量类型: 字符串string) 国策的独一无二的标识符。
==== text ====
==== text ====
(Type: string, default: id) An alternative text identifier. This allows multiple focuses to use the same display name and description.
( 变量类型: 字符串string, 默认: id) 一个可替换的文本标识符。这允许多个国策使用同一个名称和描述。
==== dynamic ====
==== dynamic ====
(Type: boolean, default: no) If true, the localized strings can contain placeholders, for example to change focus names depending on ideology.
( 变量类型: 布尔boolean, 默认: no) 如果为真,本地化的字符串可以包括占位符,例如可以允许国策名字根据意识形态改变。
==== cost ====
==== cost ====
(Type: number (three decimal places precision), default: 0) How much progress the focus needs in multiples of {{hover|NFocus.FOCUS_POINT_DAYS|7}} days.
( 变量类型: number (three decimal places precision), 默认: 0) 国策将要花费多长时间(乘以{{hover|NFocus.FOCUS_POINT_DAYS|7}} 天)。
==== allow_branch ====
==== allow_branch ====
(Type: AND trigger, default: <code>{ }</code>) If this trigger is non-empty it decides exclusively whether a focus is available. If it is false, the focus and all its dependants will be unavailable and invisible.
( 变量类型: AND trigger, 默认: <code>{ }</code>) If this trigger is non-empty it decides exclusively whether a focus is available. If it is false, the focus and all its dependants will be unavailable and invisible.


==== prerequisite ====
==== 前提条件(prerequisite) ====
Defines a set of focuses, at least one of which needs to be completed to make this focus available. The IDs of the prerequisite focuses can be provided with <code>focus</code> and <code>OR</code>. Can appear multiple times, in which case each of the <code>prerequisite</code>s needs to be fulfilled. Example:
定义一系列作为该国策前提条件的国策(至少一个)。前提国策的id可以由<code>focus</code> <code>OR</code> 给出。可以出现多次,在这种情况下每一个<code>prerequisite</code> 都需要满足。例如:
<pre>prerequisite = { focus = GER_kdf_wagen OR = GER_synthetic_rubber }
<pre>prerequisite = { focus = GER_kdf_wagen OR = GER_synthetic_rubber }
prerequisite = { focus = GER_important_focus }</pre>
prerequisite = { focus = GER_important_focus }</pre>
In this example, the focus fulfills its prerequisites if at least one of <code>GER_kdf_wagen</code> and <code>GER_synthetic_rubber</code> is completed, but <code>GER_important_focus</code> needs to be completed as well. The first line can be equivalently written as <code>prerequisite = { focus = GER_kdf_wagen focus = GER_synthetic_rubber }</code>.
在上面的例子中,<code>GER_kdf_wagen</code> <code>GER_synthetic_rubber</code> 中的一个完成了,就是满足了国策的第一个前提条件,但是<code>GER_important_focus</code> 也需要完成。第一行也可以等效地写成<code>prerequisite = { focus = GER_kdf_wagen focus = GER_synthetic_rubber }</code>.
==== mutually_exclusive ====
==== 互斥(mutually_exclusive) ====
Defines a set of focuses, each of which is mutually exclusive to this focus. The syntax is the same as for <code>prerequisites</code>. Can be provided multiple times, to make the focus part of multiple sets of mutually exclusive focuses.
定义一系列国策,每个国策都和该国策互斥。语法规则和<code>prerequisites</code> 相同。 Can be provided multiple times, to make the focus part of multiple sets of mutually exclusive focuses.
==== available ====
==== available ====
(Type: AND trigger, default: <code>{ }</code>) In the absence of <code>allow_branch</code>, a focus will not be available if this trigger is false.
( 变量类型: AND trigger, 默认: <code>{ }</code>) In the absence of <code>allow_branch</code>, a focus will not be available if this trigger is false.
==== available_if_capitulated ====
==== available_if_capitulated ====
(Type: boolean, default: no) If false, the focus is unavailable to countries that are capitulated, and if currently active, it will cancel when the country capitulates.
( 变量类型: 布尔boolean, 默认: no) If false, the focus is unavailable to countries that are capitulated, and if currently active, it will cancel when the country capitulates.
==== cancelable ====
==== cancelable ====
(Type: boolean, default: yes) If set to false, the focus may not be cancelled explicitly.
( 变量类型: 布尔boolean, 默认: yes) If set to false, the focus may not be cancelled explicitly.
==== cancel ====
==== cancel ====
(Type: AND trigger, default: <code>{ }</code>) When a focus is in progress and the cancel trigger becomes true, the progress will get canceled. In contrast to normal AND triggers, an empty trigger is treated as false.
( 变量类型: AND trigger, 默认: <code>{ }</code>) When a focus is in progress and the cancel trigger becomes true, the progress will get canceled. In contrast to normal AND triggers, an empty trigger is treated as false.
==== cancel_if_invalid ====
==== cancel_if_invalid ====
(Type: boolean, default: yes) If true, the active focus will cancel when <code>available</code> becomes false.
( 变量类型: 布尔boolean, 默认: yes) If true, the active focus will cancel when <code>available</code> becomes false.
==== continue_if_invalid ====
==== continue_if_invalid ====
(Type: boolean, default: no) If true, <code>cancel</code> and <code>cancel_if_invalid</code> get ignored
( 变量类型: 布尔boolean, 默认: no) If true, <code>cancel</code> and <code>cancel_if_invalid</code> get ignored
==== select_effect ====
==== select_effect ====
(Type: [[Commands|effect]]) When the focus gets selected, this effect will be executed.
( 变量类型: [[Commands|effect]]) When the focus gets selected, this effect will be executed.
==== completion_reward ====
==== completion_reward ====
(Type: effect) When the focus completes, this effect will be executed.
( 变量类型: effect) 当国策完成时,效果将会实施。
==== complete_tooltip ====
==== complete_tooltip ====
(Type: effect) The focus' tooltip will show this effect instead of the actual <code>completion_reward</code>.
( 变量类型: effect) The focus' tooltip will show this effect instead of the actual <code>completion_reward</code>.
==== bypass ====
==== 跳过(bypass) ====
(Type: AND trigger, default: <code>{ }</code>) Any focus that is currently running or available will bypass if this trigger is true. In contrast to normal AND triggers, an empty trigger is treated as false. Bypassing ignores the <code>available</code> trigger. If a focus has a mutually exclusive choice, the player needs to bypass it explicitly, otherwise the bypass happens automatically as soon as the conditions are fulfilled.
( 变量类型: AND trigger, 默认: <code>{ }</code>) Any focus that is currently running or available will bypass if this trigger is true. In contrast to normal AND triggers, an empty trigger is treated as false. Bypassing ignores the <code>available</code> trigger. If a focus has a mutually exclusive choice, the player needs to bypass it explicitly, otherwise the bypass happens automatically as soon as the conditions are fulfilled.
==== icon ====
==== icon ====
(Type: string) Graphical icon name, normally defined in {{path|interface/goals.gfx}}.
( 变量类型: 字符串string) Graphical icon name, normally defined in {{path|interface/goals.gfx}}.
==== x ====
==== x ====
(Type: integer, default: 0) Horizontal visual position of the focus, in grid columns.
( 变量类型: 整数integer, 默认: 0) Horizontal visual position of the focus, in grid columns.
==== y ====
==== y ====
(Type: integer, default: 0) Vertical visual position of the focus, in grid rows.
( 变量类型: 整数integer, 默认: 0) Vertical visual position of the focus, in grid rows.
==== offset ====
==== offset ====
An additional shift of the <code>x</code> and <code>y</code> attributes, conditioned on a <code>trigger</code>. The <code>x</code> and <code>y</code> attributes are integers, <code>trigger</code> is an AND trigger. Example:
An additional shift of the <code>x</code> and <code>y</code> attributes, conditioned on a <code>trigger</code>. The <code>x</code> and <code>y</code> attributes are 整数integers, <code>trigger</code> is an AND trigger. Example:
<pre>offset = {
<pre>offset = {
x = -1
x = -1
第60行: 第60行:
}</pre>
}</pre>
==== relative_position_id ====
==== relative_position_id ====
(Type: string) The graphical coordinates of this focus will be taken relative to the referenced focus. Usually this is one of the prerequisites, allowing an entire branch to moved around by just moving the root focus.
( 变量类型: 字符串string) The graphical coordinates of this focus will be taken relative to the referenced focus. Usually this is one of the prerequisites, allowing an entire branch to moved around by just moving the root focus.
==== historical ====
==== historical ====
(Type: boolean, default: no) unused
( 变量类型: 布尔boolean, 默认: no) unused
==== historical_ai ====
==== historical_ai ====
(Type: AND trigger, default: <code>{ }</code>) If historical AI focus is enabled, the AI will only pick the focus if this trigger is true.
( 变量类型: AND trigger, 默认: <code>{ }</code>) If historical AI focus is enabled, the AI will only pick the focus if this trigger is true.
==== ai_will_do ====
==== ai_will_do ====
(Type: MTTH, default: <code>{ base = 1 }</code>) Defines the probability of the AI picking this focus. The value is further modified by {{hover|NAI.FOCUS_TREE_CONTINUE_FACTOR|+50%}} if the focus is not at the root of a branch, proportionately reduced if a mutually exclusive choice, as well as multiplied by any <code>focus_factor</code>s in [[AI strategy plan]]s. For each available focus, the AI generates a random number between 0 and the calculated value. It chooses the focus with the highest resulting number.
( 变量类型: MTTH, 默认: <code>{ base = 1 }</code>) Defines the probability of the AI picking this focus. The value is further modified by {{hover|NAI.FOCUS_TREE_CONTINUE_FACTOR|+50%}} if the focus is not at the root of a branch, proportionately reduced if a mutually exclusive choice, as well as multiplied by any <code>focus_factor</code>s in [[AI strategy plan]]s. For each available focus, the AI generates a random number between 0 and the calculated value. It chooses the focus with the highest resulting number.


For example if two focuses are available with calculated values of 1.5 and 3 respectively, the former has a chance of 1-in-6 to be picked and the latter 5-in-6.
For example if two focuses are available with calculated values of 1.5 and 3 respectively, the former has a chance of 1-in-6 to be picked and the latter 5-in-6.
==== will_lead_to_war_with ====
==== will_lead_to_war_with ====
(Type: country tag) The specified country will receive a warning that war goals are being justified against it while the focus is running. Can appear multiple times.
( 变量类型: country tag) The specified country will receive a warning that war goals are being justified against it while the focus is running. Can appear multiple times.
=== Localization ===
=== Localization ===
The localization keys of focuses are prefixed with its <code>id</code> (or <code>text</code>). Given a focus with <code>id = XYZ</code>, the localization keys are
The localization keys of focuses are prefixed with its <code>id</code> (or <code>text</code>). Given a focus with <code>id = XYZ</code>, the localization keys are
* XYZ: name
* XYZ: name
* XYZ_desc: description
* XYZ_desc: description
== National focus tree ==
== 国策树 ==
{{SVersion|1.8}}
{{SVersion|1.8}}
Each [[country]] is assigned a focus tree, which is a collection of national focuses. It can get amended by continuous focuses and shared focuses.
Each [[country]] is assigned a focus tree, which is a collection of national focuses. It can get amended by continuous focuses and shared focuses.
=== Attributes ===
=== Attributes ===
==== id ====
==== id ====
(Type: string) A unique identifier for the focus tree.
( 变量类型: 字符串string) A unique identifier for the focus tree.
==== country ====
==== country ====
(Type: [[MTTH]], default: <code>{ base = 1 }</code>) A score for the fit of this tree for the given tag. A country uses the national focus tree with the highest score. To assign a tree to a particular country, the score should be zero by default and modified to a high value for just that country.
( 变量类型: [[MTTH]], 默认: <code>{ base = 1 }</code>) A score for the fit of this tree for the given tag. A country uses the national focus tree with the highest score. To assign a tree to a particular country, the score should be zero by 默认 and modified to a high value for just that country.
==== default ====
==== 默认 ====
(Type: boolean, default <code>no</code>) If set to <code>yes</code>, this focus tree will be used for all countries that did not get a score greater than 0 on any focus tree. Only one focus tree should be set to be the default, generic_focus in the base game.
( 变量类型: 布尔boolean, 默认 <code>no</code>) If set to <code>yes</code>, this focus tree will be used for all countries that did not get a score greater than 0 on any focus tree. Only one focus tree should be set to be the 默认, generic_focus in the base game.
==== reset_on_civil_war ====
==== reset_on_civil_war ====
(Type: boolean, default: <code>yes</code>) If set to <code>no</code>, if the newly spawned tag in a civil war gets the same focus tree, it will copy the progress unlocked by the original country. Otherwise it starts the focus tree from the beginning.
( 变量类型: 布尔boolean, 默认: <code>yes</code>) If set to <code>no</code>, if the newly spawned tag in a civil war gets the same focus tree, it will copy the progress unlocked by the original country. Otherwise it starts the focus tree from the beginning.
==== continuous_focus_position ====
==== continuous_focus_position ====
(Type: point, default: <code>{ x = 0, y = 0 }</code>) The visual location of the continuous focus palette.
( 变量类型: point, 默认: <code>{ x = 0, y = 0 }</code>) The visual location of the continuous focus palette.
==== focus ====
==== focus ====
(Type: national focus) Defines a national focus as described above that is added to this tree. Can appear multiple times.
( 变量类型: national focus) Defines a national focus as described above that is added to this tree. Can appear multiple times.
==== shared_focus ====
==== shared_focus ====
(Type: string) Causes the referenced shared focus and its dependants to be inserted in this tree. Can appear multiple times. A shared focus is declared outside of any focus tree using <code>shared_focus</code>. It otherwise has the same semantics as a normal national focus.
( 变量类型: 字符串string) Causes the referenced shared focus and its dependants to be inserted in this tree. Can appear multiple times. A shared focus is declared outside of any focus tree using <code>shared_focus</code>. It otherwise has the same semantics as a normal national focus.


== Example ==
== 例子 ==
<pre>shared_focus = {
<pre>shared_focus = {
    id = shared_1
    id = shared_1

2020年8月15日 (六) 23:39的版本

国策的定义在/Hearts of Iron IV/common/national_focus/*.txt

国策

单个国策被捆绑于国策树上。

属性

id

(变量类型: 字符串string) 国策的独一无二的标识符。

text

(变量类型: 字符串string, 默认: id) 一个可替换的文本标识符。这允许多个国策使用同一个名称和描述。

dynamic

(变量类型: 布尔boolean, 默认: no) 如果为真,本地化的字符串可以包括占位符,例如可以允许国策名字根据意识形态改变。

cost

(变量类型: number (three decimal places precision), 默认: 0) 国策将要花费多长时间(乘以7天)。

allow_branch

(变量类型: AND trigger, 默认: { }) If this trigger is non-empty it decides exclusively whether a focus is available. If it is false, the focus and all its dependants will be unavailable and invisible.

前提条件(prerequisite)

定义一系列作为该国策前提条件的国策(至少一个)。前提国策的id可以由focusOR给出。可以出现多次,在这种情况下每一个prerequisite都需要满足。例如:

prerequisite = { focus = GER_kdf_wagen OR = GER_synthetic_rubber }
prerequisite = { focus = GER_important_focus }

在上面的例子中,GER_kdf_wagenGER_synthetic_rubber中的一个完成了,就是满足了国策的第一个前提条件,但是GER_important_focus也需要完成。第一行也可以等效地写成prerequisite = { focus = GER_kdf_wagen focus = GER_synthetic_rubber }.

互斥(mutually_exclusive)

定义一系列国策,每个国策都和该国策互斥。语法规则和prerequisites相同。 Can be provided multiple times, to make the focus part of multiple sets of mutually exclusive focuses.

available

(变量类型: AND trigger, 默认: { }) In the absence of allow_branch, a focus will not be available if this trigger is false.

available_if_capitulated

(变量类型: 布尔boolean, 默认: no) If false, the focus is unavailable to countries that are capitulated, and if currently active, it will cancel when the country capitulates.

cancelable

(变量类型: 布尔boolean, 默认: yes) If set to false, the focus may not be cancelled explicitly.

cancel

(变量类型: AND trigger, 默认: { }) When a focus is in progress and the cancel trigger becomes true, the progress will get canceled. In contrast to normal AND triggers, an empty trigger is treated as false.

cancel_if_invalid

(变量类型: 布尔boolean, 默认: yes) If true, the active focus will cancel when available becomes false.

continue_if_invalid

(变量类型: 布尔boolean, 默认: no) If true, cancel and cancel_if_invalid get ignored

select_effect

(变量类型: effect) When the focus gets selected, this effect will be executed.

completion_reward

(变量类型: effect) 当国策完成时,效果将会实施。

complete_tooltip

(变量类型: effect) The focus' tooltip will show this effect instead of the actual completion_reward.

跳过(bypass)

(变量类型: AND trigger, 默认: { }) Any focus that is currently running or available will bypass if this trigger is true. In contrast to normal AND triggers, an empty trigger is treated as false. Bypassing ignores the available trigger. If a focus has a mutually exclusive choice, the player needs to bypass it explicitly, otherwise the bypass happens automatically as soon as the conditions are fulfilled.

icon

(变量类型: 字符串string) Graphical icon name, normally defined in /Hearts of Iron IV/interface/goals.gfx.

x

(变量类型: 整数integer, 默认: 0) Horizontal visual position of the focus, in grid columns.

y

(变量类型: 整数integer, 默认: 0) Vertical visual position of the focus, in grid rows.

offset

An additional shift of the x and y attributes, conditioned on a trigger. The x and y attributes are 整数integers, trigger is an AND trigger. Example:

offset = {
	x = -1
	y = 0
	trigger = {
		NOT = { has_dlc = "Man the Guns" }
	}
}

relative_position_id

(变量类型: 字符串string) The graphical coordinates of this focus will be taken relative to the referenced focus. Usually this is one of the prerequisites, allowing an entire branch to moved around by just moving the root focus.

historical

(变量类型: 布尔boolean, 默认: no) unused

historical_ai

(变量类型: AND trigger, 默认: { }) If historical AI focus is enabled, the AI will only pick the focus if this trigger is true.

ai_will_do

(变量类型: MTTH, 默认: { base = 1 }) Defines the probability of the AI picking this focus. The value is further modified by +50% if the focus is not at the root of a branch, proportionately reduced if a mutually exclusive choice, as well as multiplied by any focus_factors in AI strategy plans. For each available focus, the AI generates a random number between 0 and the calculated value. It chooses the focus with the highest resulting number.

For example if two focuses are available with calculated values of 1.5 and 3 respectively, the former has a chance of 1-in-6 to be picked and the latter 5-in-6.

will_lead_to_war_with

(变量类型: country tag) The specified country will receive a warning that war goals are being justified against it while the focus is running. Can appear multiple times.

Localization

The localization keys of focuses are prefixed with its id (or text). Given a focus with id = XYZ, the localization keys are

  • XYZ: name
  • XYZ_desc: description

国策树

Each country is assigned a focus tree, which is a collection of national focuses. It can get amended by continuous focuses and shared focuses.

Attributes

id

(变量类型: 字符串string) A unique identifier for the focus tree.

country

(变量类型: MTTH, 默认: { base = 1 }) A score for the fit of this tree for the given tag. A country uses the national focus tree with the highest score. To assign a tree to a particular country, the score should be zero by 默认 and modified to a high value for just that country.

默认

(变量类型: 布尔boolean, 默认 no) If set to yes, this focus tree will be used for all countries that did not get a score greater than 0 on any focus tree. Only one focus tree should be set to be the 默认, generic_focus in the base game.

reset_on_civil_war

(变量类型: 布尔boolean, 默认: yes) If set to no, if the newly spawned tag in a civil war gets the same focus tree, it will copy the progress unlocked by the original country. Otherwise it starts the focus tree from the beginning.

continuous_focus_position

(变量类型: point, 默认: { x = 0, y = 0 }) The visual location of the continuous focus palette.

focus

(变量类型: national focus) Defines a national focus as described above that is added to this tree. Can appear multiple times.

shared_focus

(变量类型: 字符串string) Causes the referenced shared focus and its dependants to be inserted in this tree. Can appear multiple times. A shared focus is declared outside of any focus tree using shared_focus. It otherwise has the same semantics as a normal national focus.

例子

shared_focus = {
    id = shared_1
    x = 10
    offset = {
        x = 10
        trigger = {
            tag = LIT
        }
    }
    completion_reward = {
        army_experience = 10
    }
}
focus_tree = {
    id = lithuania_focus
    country = {
        base = 0
        modifier = {
            add = 10
            tag = LIT
        }
    }
    shared_focus = shared_1

    focus = {
        id = LIT_focus_1
        x = 10
        completion_reward = {
            navy_experience = 10
        }
    }
    focus = {
        id = LIT_focus_2
        prerequisite = { focus = LIT_focus_1 }
        relative_position_id = LIT_focus_1
        y = 10
        completion_reward = {
            navy_experience = 10
        }
    }
}
focus_tree = {
    id = basic_focus
    country = {
        base = 1
    }
    shared_focus = shared_1
}