Autonomy state modding:修订间差异

本页面所适用的版本可能已经过时,最后更新于1.10
无编辑摘要
无编辑摘要
 
第1行: 第1行:
{{Version|1.10}}
{{Version|1.10}}
{{需要翻译|译者=霜泽图书馆}}
{{需要翻译|译者=霜泽图书馆}}
Different levels of the [[Puppet#Autonomy_system|autonomy system]] are defined in {{path|common/autonomous_states/*.txt}}, and new ones can be created.
[[Puppet#Autonomy_system| 附庸系统]] 不同变种在{{path|common/autonomous_states/*.txt}} 路径下定义,允许自定义新变种。
== Arguments ==
== 参数 ==
* '''id''' is the ID of the autonomy state, unique to each one. It is necessary to define to distinguish it from other autonomy states.
* '''id''' 是附庸状态的键值,不能重复。所有附庸状态的键值均不可和另一附庸状态的键值重复。
* '''default''': If true, the game will attempt to make the 'puppet' option in peace deals as well as the 'puppet' effect use this autonomy state among other default autonomy states. By default, set to no.
* '''default''': 如果为真,则游戏将尝试使和平谈判中的 ' 傀儡' 选项以及 ' 傀儡' 效果在其他默认附庸状态中使用此附庸状态。默认状态下为 no
* '''is_puppet''' decides whether the subject is a puppet or not, making is_puppet and is_puppet_of triggers true in that case. By default, set to no.
* '''is_puppet''' 用来检测该国是否是傀儡国。若需要该国为傀儡国,则<code>is_puppet</code>或者<code>is_puppet_of</code>条件将会返还真值。默认状态下为 no
* '''use_overlord_color''' makes the subject have the same country color as the overlord.
* '''use_overlord_color''' 使附庸国使用和宗主国相同的颜色。
* '''min_freedom_level''' decides the order in which autonomy states are placed. The autonomy states with lower freedom levels have less autonomy than those with higher when the game places the autonomy states for the subject to lose or gain a level. This also decides how many autonomy points the subject needs to gain or lose a level, calculated by the difference between freedom levels multiplied by {{hover|NCountry.AUTONOMOUS_TOTAL_SCORE|5000}}. As such, it would take 500 points to go from an autonomous state with the min_freedom_level of 0.1 to being annexed.
* '''min_freedom_level''' 决定了自治领的等级。当游戏使自治领作为一个降级或升级时的主体时,级别较低的自治领的自治程度,比级别较高的自治领的自治程度低。这同样也决定了主体提升或降低等级所需的多少自治点数,即等级间的差值乘以{{hover|NCountry.AUTONOMOUS_TOTAL_SCORE|5000}}. 如前所述,吞并一个<code>min_freedom_level</code>为0.1 的自治领需要花费500点数。
* '''manpower_influence''' decides how large of a portion of the subject's manpower the overlord can use in colonial divisions. Requires the {{icon|tfv|1}} DLC.
* '''manpower_influence''' 附庸国人力要求,决定了宗主国的殖民地军队中能使用多大比例的殖民地人力。 需要{{icon|tfv|1}} DLC.
* '''rule''' sets the game rules for the subject to either yes or no.
* '''rule''' 给主体设定“是”或“否”的游戏规则
{| class="wikitable mw-collapsible"
{| class="wikitable mw-collapsible"
!Game rule list
! 游戏规则列表
|-
|-
|The following game rules exist as possible options:
| 以下游戏规则作为可选择选项:
{| class="wikitable sortable"
{| class="wikitable sortable"
!Internal name
! 内部名
!Localised name
! 本地化名
!Notes
! 中文名
!备注
|-
|-
|can_access_market
|can_access_market
|Can access International Market (Puppets and Overlords can always access each other's market)
|Can access International Market
|市场准入(傀儡国和宗主国总是互有市场准入)
|
|
|-
|-
|can_be_spymaster
|can_be_spymaster
|Can be Spy Master
|Can be Spy Master 
|可以成为间谍主管
|
|
|-
|-
|can_boost_other_ideologies
|can_boost_other_ideologies
|Can boost popularity of other ideologies
|Can boost popularity of other ideologies
|可以提高其他意识形态的支持率。
|
|
|-
|-
|can_boost_own_ideology
|can_boost_own_ideology
|Can boost own party popularity in other countries
|Can boost own party popularity in other countries
|可以在其他国家提升本党派支持率
|
|
|-
|-
|can_create_collaboration_government
|can_create_collaboration_government
|Can create collaboration governments
|Can create collaboration governments
|可以建立合作政府
|
|
|-
|-
|can_create_factions
|can_create_factions
|Can Create Factions
|Can Create Factions
|可以创建阵营
|
|
|-
|-
|can_declare_war_on_same_ideology
|can_declare_war_on_same_ideology
|Can declare war on country with the same ideology group without a war goal
|Can declare war on country with the same ideology group without a war goal
|可以无需战争目标向同一意识形态组的国家宣战
|
|
|-
|-
|can_declare_war_without_wargoal_when_in_war
|can_declare_war_without_wargoal_when_in_war
|Can declare war on a neighbor without a wargoal when at war with a major
|Can declare war on a neighbor without a wargoal when at war with a major
|与主要国家交战时可以无需战争目标向邻国宣战
|
|
|-
|-
|can_decline_call_to_war
|can_decline_call_to_war
|Can decline call to war
|Can decline call to war
|可以拒绝战争召唤
|
|
|-
|-
|can_force_government
|can_force_government
|Can force government of another country to adopt the same ideology
|Can force government of another country to adopt the same ideology
|可以强迫他国政府接受本国意识形态
|
|
|-
|-
|can_generate_female_aces
|can_generate_female_aces
|Women in your country are allowed to become military pilots
|Women in your country are allowed to become military pilots
|在你的国家女性可以成为军事飞行员
|
|
|-
|-
|can_generate_female_country_leaders
|can_generate_female_country_leaders
|Can generate female country leaders
|Can generate female country leaders
|可以拔擢女性国家领导人
|
|
|-
|-
|can_generate_female_unit_leaders
|can_generate_female_unit_leaders
|Can generate female unit leaders
|Can generate female unit leaders
|可以拔擢女性作为单位将领
|
|
|-
|-
|can_guarantee_other_ideologies
|can_guarantee_other_ideologies
|Can guarantee other ideologies
|Can guarantee other ideologies
|可以对其他意识形态的国家保障独立
|
|
|-
|-
|can_join_factions
|can_join_factions
|Can join factions
|Can join factions
|可以加入阵营
|
|
|-
|-
|can_join_factions_not_allowed_diplomacy
|can_join_factions_not_allowed_diplomacy
|Country's name is not allowed to join factions
|{{red|Country's name}} is not allowed to join factions
|{{red|国家}}无法加入阵营
|
|
|-
|-
|can_join_opposite_factions
|can_join_opposite_factions
|Can Join Factions led by another Ideology
|Can Join Factions led by another Ideology
|可以加入由不同意识形态领导的阵营
|
|
|-
|-
|can_lower_tension
|can_lower_tension
|Lowers World Tension with Guarantees
|Lowers World Tension with Guarantees
|通过保障独立降低全球紧张度
|
|
|-
|-
|can_not_build_buildings
|can_not_build_buildings
|CAN_NOT_BUILD_BUILDINGS
|CAN_NOT_BUILD_BUILDINGS
|Doesn't seem to work.
| 不能修建建筑
|其似乎不能奏效
|-
|-
|can_not_declare_war
|can_not_declare_war
|Can not declare wars
|Can not declare wars
|Prevents generating wargoals, but not using existing ones.
| 无法宣战
|阻止制造战争目标,但不阻止使用现有战争目标
|-
|-
|can_occupy_non_war
|can_occupy_non_war
|Can hold territory owned by a country they are not at war with
|Can hold territory owned by a country they are not at war with
|可以持有未与我们交战的国家所拥有的领土
|
|
|-
|-
|can_only_justify_war_on_threat_country
|can_only_justify_war_on_threat_country
|Can justify war goals against a country that have not generated world tension
|Can justify war goals against a country that have not generated world tension
|可以对没有引起全球紧张度增长的国家正当化战争目标
|
|
|-
|-
|can_puppet
|can_puppet
|Can puppet a country
|Can puppet a country
|可以傀儡其他国家
|
|
|-
|-
|can_send_volunteers
|can_send_volunteers
|Can send volunteer forces
|Can send volunteer forces
|可以派遣志愿军
|
|
|-
|-
|can_use_kamikaze_pilots
|can_use_kamikaze_pilots
|Can use kamikaze pilots
|Can use kamikaze pilots
|可以让飞行员执行自杀性攻击
|
|
|-
|-
|contributes_operatives
|contributes_operatives
|Contributes Operatives to Spy Master: Yes
|Contributes Operatives to Spy Master: Yes
|Only has an effect for subjects.
| 可以为间谍主管贡献特工
|仅对附属国本身有影响。
|-
|-
|units_deployed_to_overlord
|units_deployed_to_overlord
|Control over deployed units go to overlord
|Control over deployed units go to overlord
|Only has an effect for subjects.
| 已部署部队的控制权属于宗主国
|仅对附属国本身有影响。
|}
|}
|}
|}
* '''modifier''' sets the modifier for the subject. All country [[modifiers]] can apply.
* '''modifier''' :给附庸国添加[[modifiers|修正]] 所有国家修正均可以应用。
* '''ai_subject_wants_higher''' decides whether or not the AI subject focuses on gaining a higher autonomy. If set to 0, AI will never gain an autonomy level through the autonomy system.
* '''ai_subject_wants_higher''' :决定了ai国家是否专注于获得更高的自治程度。如果设置为0,AI永远不会在自治度系统中提升自治等级。
* '''ai_overlord_wants_lower''' decides whether or not the AI overlord focuses on gaining a lower autonomy for the subject. If set to 0, AI will never decrease the autonomy level through the autonomy system.
* '''ai_overlord_wants_lower''' :决定了AI宗主国是否专注于降低附庸国的自治等级。如果设置为0,AI永远不会在自治度系统中降低自治等级。
* '''ai_overlord_wants_garrison''' decides the triggers when the AI overlord garrisons the subject's territory as if it was their own land.
* '''ai_overlord_wants_garrison''' : 决定了AI宗主国是否愿意像卫戍自己的领土一样给附庸国的领土派遣卫戍部队
* '''allowed''' are the necessary triggers the subject must meet for the autonomy state to apply. The OVERLORD scope can be used to scope into the overlord.
* '''allowed''' : 所对应主体必须满足必要的触发条件,以使游戏中的自治状态生效。可以使用 OVERLORD 作用域来作用于 overlord (宗主国)。
* '''use_for_peace_conference_weight''' decides the chance for a potential overlord to puppet the country in the peace deal, where ROOT is the subject and FROM is the overlord.
* '''use_for_peace_conference_weight''' :决定了潜在的宗主国在和平谈判中附庸某国家的机会。此处ROOT是附庸国,FROM是宗主国。
* '''can_take_level''' sets the necessary triggers the subject must meet to be able to gain a level through the autonomy system.
* '''can_take_level''' :决定了附庸国能够在自治度系统中提升等级所必须满足的条件。
* '''can_lose_level''' sets the necessary triggers the subject must meet for the overlord to be able to decrease the autonomy level through the autonomy system.
* '''can_lose_level''' :决定了只有附庸国满足了一些条件,宗主国才能够在自治度系统中降低附庸国等级。
* '''peace_conference_initial_freedom''' is the initial freedom level of the country that gets set to this autonomy after a peace conference on a scale from 0 to 1. If not specified, assumed to be 0.5.
* '''peace_conference_initial_freedom''' :是和平会议后给自治领设定的初始自治等级,其范围是0到1。如果不特别指明,则设定为0.5
* '''allowed_levels_filter''' decides which autonomy levels a country with this autonomous state can change to, alongside autonomy_free. If not specified, all levels will be allowed.
* '''allowed_levels_filter''' :决定一个自治领能到达哪些自治等级。如果不特别指明,所有的等级都是可以的。


== Icon ==
== 图标 ==
{| class="wikitable mw-collapsible"
{| class="wikitable mw-collapsible"
!General sprite overview
!Sprite系统概述
|-
|-
|For loading GFX, the game uses the sprite system. Sprites are code definitions that attach a name to an image file, as well as optionally adding additional information, such as animation, the amount of frames, the way that the image will be loaded, and so on. This means '''placing an image into the gfx folder isn't enough for it to work''', a sprite has to use that image file as well.
| 游戏使用Sprite类代码加载图形文件(如.GFX )。Sprite是指那些将名称附加到图像文件的定义类代码,同时还可以选择性地添加额外的信息,例如动画、帧数、图像的加载方式等等。综上所述,''' 仅仅将所使用的图像文件放入gfx文件夹中是不够的''' ,还必须有图像对应的sprite代码来调用它。
Sprites are defined in any /Hearts of Iron IV/interface/*.gfx file (this is separate from gfx/interface/), opened with a text editor. To create a new .gfx file, a text file can be created and renamed to change the extension (on Windows, the Windows Explorer needs to show the extensions, which it doesn't by default). In particular, sprites are defined within a <code>spriteTypes = { ... }</code> block, as to separate from fonts and map arrows also defined in that folder, while the simplest sprite with the least mandatory properties is a <code>spriteType = { ... }</code>. The simplest sprite definition looks like the following:
Sprite类代码可在任意{{path|interface/*.gfx}}文件中进行定义(这与{{path|gfx/interface/}}是不同的), 并可以通过文本编辑器打开。若要建一个新的<code>.gfx</code>文件,可以新建一个<code>.txt</code>文件然后改后缀为<code>.gfx</code>(在 Windows 文件管理器中需设置显示扩展名后方能进行后缀更改)。需要注意的是,为了与文件夹中定义好的字体和地图箭头分开,需要在<code>spriteTypes = { ... }</code> 代码块中定义对应代码,符合必需要求的最简单代码是<code>spriteType = { ... }</code>. 最简单的sprite定义如下:
  spriteTypes = {
  spriteTypes = {
    spriteType = {
    spriteType = {
第156行: 第184行:
    }
    }
  }
  }
In this case, this creates a sprite with the name of <code>GFX_first_sprite</code> and attaches the /Hearts of Iron IV/gfx/interface/folder/filename.dds image to it, and a second sprite similarly. The second sprite will be split into 2 frames: this is decided by having the left half of the image as the first frame and the right half as the second frame (more frames would further split the image horizontally). This doesn't make the sprite animated, just turns on the option to switch between the two halves as needed. <code>GFX_second_sprite:1</code> serves as a reference to the first frame, and GUI can be set up to change the shown frame depending on context, such as with radio stations.
在这种情况下,系统会生成一个名为<code>GFX_first_sprite</code> 的sprite,并将图像{{path|gfx/interface/folder/filename.dds}}附加到它。第二个sprite类似,会分为两个frame:左半部分是第一个frame,右半部分是第二个。(如果需要,可以将它们进一步细分。)虽然当前Sprite代码块没有动画效果,但可以在这两个图像块之间切换。 <code>GFX_second_sprite:1</code> 用于引用第一个frame,可以通过GUI由不同的内容需求来切换显示中的图像,例如游戏中的电台。


In order to add animation, a frameAnimatedSpriteType is used.
若想添加动画效果,需要使用frameAnimatedSpriteType


'''It's never mandatory to copy a base game file to change a sprite'''. If there are duplicate definitions of a sprite with the same name in different files, the game will prioritise the one that would be evaluated later, based on the filename, and the older sprite will be ignored in entirety. This can be ensured by beginning the replacement file's name with a symbol late in the ASCII character table. Typically the lowercase letter 'z' is used for this purpose. For example, to change the amount of frames in <code>GFX_idea_traits_strip</code> to 10, it is possible to define a sprite with that name with 10 frames in the mod's modname/interface/zz_replace.gfx file instead of copying over the base game file.
''' 如需对sprite类文件小改不必复制原版游戏文件''' 。倘若因相同名字的sprite在不同文件中导致了重复定义,游戏将会根据文件名称优先调用后面被定义的Sprite,旧定义会被无视。可以通过重命名文件以ASCII表靠后的字符开头来确保正确调用新的自定义内容,通常情况下使用小写字母“z”开头来实现这一点。例:要将<code>GFX_idea_traits_strip</code> 的帧数更改为10,可在模组的 {{path
|modname/interface/zz_replace.gfx}}文件中定义一个同名且包含10帧的Sprite文件,而不必复制原版游戏文件。


Since most .gfx files define integral parts of the user interface, copying them over can lead to the mod's loaded files missing sprites upon a major game update, which would appear in-game as the default image, which is the error dog by default. As to ease the burden of needing to check the interface files, it's best to never copy over .gfx files, unless more additions would be actively harmful to the mod, such as with interface/subuniticons.gfx
由于大多数 .gfx 文件定义了用户界面的关键部分,复制它们可能会导致模组在游戏大更新后缺失新版本的sprite类代码,进而显示为错误图像,通常是“错误小狗”的图标。除非在某些迫不得已的时候,(例:添加的文件可能会对模组功能造成损害,如{{path|interface/subuniticons.gfx}})为了减少检查文件的麻烦,尽可能不要复制<code>.gfx</code>文件,
|}
|}


For the icon, the game will use a sprite named in the format of <code>GFX_<autonomy state>_icon</code>. An {{path|interface/*.gfx}} file containing such a definition may look like the following:<pre>
游戏将使用格式为<code>GFX_<autonomy state>_icon</code> 的sprite类作为图标。包含此类定义的一个 {{path|interface/*.gfx}} 文件可能是这样的:<pre>
spriteTypes = {
spriteTypes = {
    spriteType = {
    spriteType = {
第177行: 第206行:
}</pre>
}</pre>


== Localisation ==
== 本地化 ==
The localisation is set in an .yml file in the localisation/ folder. Using the prior example of autonomy_mod_new, a localisation entry will look like <code>autonomy_mod_new:0 "Mod's new autonomy state"</code>
本地化文件位置在{{path|localisation/}} 文件夹的 <code>.yml</code> 文件中。对前面的例子<code>autonomy_mod_new</code>而言,文件本地化样式大概是 <code>autonomy_mod_new:0 "Mod's new autonomy state"</code>


It is possible to set a country-specific entry. An entry with <code>GER_autonomy_mod_new:0 "New mod Germany"</code> will make Germany have that name if its autonomy level is autonomy_mod_new. Similarly, <code>ENG_FRA_autonomy_mod_new:0 "New mod French UK"</code> will make the United Kingdom have that name if its overlord is France and the autonomy state is autonomy_mod_new.
我们可以设置关于一个特定国家的项目,如<code>GER_autonomy_mod_new:0 "New mod Germany"</code> 将使德国的名字在其自治水平为 <code>autonomy_mod_new</code>时变成它。相似的,<code>ENG_FRA_autonomy_mod_new:0 "New mod French UK"</code> 会使不列颠在其宗主国为法国且在自治状态为 <code>autonomy_mod_new</code> 时拥有这个名字。
== Example ==
== 代码示例 ==
<pre>autonomy_state = {
<pre>autonomy_state = {
id = autonomy_example
id = autonomy_example
第264行: 第293行:
}
}
}</pre>
}</pre>
== Related defines ==
== 相关定义 ==
Certain [[Defines]] affect the autonomy system in a certain way. These are:
一些[[Defines|定义]] 通过特殊的方式影响自治领系统,它们是:
* '''RESOURCE_SENT_AUTONOMY_DAILY_BASE''' Base autonomy gain from the overlord purchasing the subject's resources through trade.
* '''RESOURCE_SENT_AUTONOMY_DAILY_BASE''' 这是宗主国购买资源时自治领获得的基础独立倾向增长。
* '''RESOURCE_SENT_AUTONOMY_DAILY_FACTOR''' Autonomy gain multiplier from the overlord purchasing the subject's resources through trade.
* '''RESOURCE_SENT_AUTONOMY_DAILY_FACTOR''' 这是宗主国购买资源时自治领获得的独立增益因子。(用于调整自治增长速度)
* '''WAR_SCORE_AUTONOMY_BASE''' Base autonomy gain from the subject gaining war score in a war.
* '''WAR_SCORE_AUTONOMY_BASE''' 自治领在战争中获得战争积分所带来的基础独立倾向增长。
* '''WAR_SCORE_AUTONOMY_FACTOR''' Autonomy gain multiplier from the subject gaining war score in a war.
* '''WAR_SCORE_AUTONOMY_FACTOR''' 自治领在战争中获得战争积分所带来的独立增益因子。(用于调整其自治增长速度)
* '''LL_TO_OVERLORD_AUTONOMY_DAILY_BASE''' Base autonomy gain from the subject lend-leasing to the overlord.
* '''LL_TO_OVERLORD_AUTONOMY_DAILY_BASE''' 自治领向宗主国起草租借法案所获得的基础独立倾向增益。
* '''LL_TO_OVERLORD_AUTONOMY_DAILY_FACTOR''' Autonomy gain multiplier from the subject lend-leasing to the overlord.
* '''LL_TO_OVERLORD_AUTONOMY_DAILY_FACTOR''' 自治领向宗主国起草租借法案的独立增益因子。(用于调整自治增长速度)
* '''LL_TO_PUPPET_AUTONOMY_DAILY_BASE''' Base autonomy gain from the overlord lend-leasing to the subject. Must be negative in order to lose autonomy.
* '''LL_TO_PUPPET_AUTONOMY_DAILY_BASE''' 宗主国向自治领起草租借法案所获得的基础独立倾向压制。(基础独立压制必须为负值才能减少自治增长)
* '''LL_TO_PUPPET_AUTONOMY_DAILY_BASE''' Autonomy gain multiplier from the overlord lend-leasing to the subject. Must be negative in order to lose autonomy.
* '''LL_TO_PUPPET_AUTONOMY_DAILY_BASE''' 宗主国向自治领起草租借法案所获得的独立压制因子。(基础独立压制必须为负值才能减少自治增长)
* '''AUTONOMY_FREEDOM_FROM_CAPITULATE''' Upon the overlord capitulating, the subject receives a large gain to the autonomy progress.
* '''AUTONOMY_FREEDOM_FROM_CAPITULATE''' 在宗主国投降后,自治领的独立倾向将大幅上升。
* '''ATTACHE_TO_SUBJECT_EFFECT''' Base autonomy gain from the overlord sending an attache to the subject. Must be negative in order to lose autonomy.
* '''ATTACHE_TO_SUBJECT_EFFECT''' 宗主国向自治领派遣军事顾问所获得的基础独立倾向压制。(基础独立倾向压制必须为负值才能减少自治增长)
* '''ATTACHE_TO_OVERLORD_EFFECT''' Base autonomy gain from the subject sending an attache to the overlord.
* '''ATTACHE_TO_OVERLORD_EFFECT''' 宗主国向自治领派遣军事顾问所获得的独立压制因子。(基础独立倾向压制必须为负值才能减少自治增长)
* '''AUTONOMY_LEVEL_CHANGE_PP_COST_BASE''' The cost in political power to change between autonomy states.
* '''AUTONOMY_LEVEL_CHANGE_PP_COST_BASE''' 在不同自治状态下进行转换所需要的政治点数。
* '''AUTONOMY_LEVEL_CHANGE_PP_ANNEX''' The cost in political power to annex a subject.
* '''AUTONOMY_LEVEL_CHANGE_PP_ANNEX''' 宗主国吞并半吞并傀儡国所需要花费的政治点数。
* '''AUTONOMY_LEVEL_CHANGE_PP_FREE''' The cost in political power to gain independence as a subject.
* '''AUTONOMY_LEVEL_CHANGE_PP_FREE''' 作为附庸获得独立所需要的政治点数。
* '''MAX_SCORE_DIFF_TO_CHANGE_AUTONOMY''' The maximum difference between the current freedom score and the cap for the next or previous level allowed for changing.
* '''MAX_SCORE_DIFF_TO_CHANGE_AUTONOMY''' 自治领当前独立点数与升级或降级点数的最大差值。
* '''MASTER_BUILD_AUTONOMY_FACTOR''' Autonomy gain multiplier from the overlord building in the subject's states. Must be negative in order to lose autonomy.
* '''MASTER_BUILD_AUTONOMY_FACTOR''' 宗主国向自治领进行援建所获得的独立倾向压制因子。(基础独立倾向压制必须为负值才能减少自治增长)
* '''AUTONOMOUS_TOTAL_SCORE''' The total amount of autonomy points between the country's annexation and independence.
* '''AUTONOMOUS_TOTAL_SCORE''' 自治领国家被吞并与独立间的总自治点数。
* '''AUTONOMOUS_SPILLOVER''' The amount that can be saved between levels.
* '''AUTONOMOUS_SPILLOVER''' 各自治等级间可保存的自治点数上限。
== Additional notes ==
== 额外说明 ==
When setting the autonomy level in the country's history file, it is possible that it will overwrite the party popularities and the ruling party of the subject. In order to prevent that to happening, it is recommended to scope into the overlord as <pre>TAG = {
在对国家历史文件中的自治等级进行设置时,可能会使对应国家的政党受支持度和当前执政党等数据遭到覆盖后丢失。以防万一,建议将作用域(scope)设置为宗主国,如 <pre>TAG = {
if = {
if = {
limit = {
limit = {
第298行: 第327行:
puppet = TAG2
puppet = TAG2
}
}
}</pre> in the subject's history file, also putting it before defining the ruling party and popularities. Alternatively, the order of tags in {{path|common/country_tags/}} can be changed so that the overlord is defined earlier than the subject.
}</pre> 在自治领的历史文件中,也可以将其放在定义执政党和对应支持度之前。另一种方法是可以更改 {{path|common/country_tags/}} 中标签的顺序,使得宗主国在自治领之前被定义。


If deciding to create a new autonomy system similar to Japan's [[Puppet#Autonomy_levels_.28Imperial_Japan.29|unique autonomies]], it is necessary to disable the default autonomy states so that they could not be used via <code>allowed = {}</code> in them or via <code>allowed_levels_filter = {}</code> in the new autonomies. Note that if you choose the second option, you would still need to disable the default autonomies so that they do not appear while puppeting.<br/>
若决定创建一个类似于日本[[Puppet#Autonomy_levels_.28Imperial_Japan.29| 独特自治]] 的新自治系统, 则需要禁用默认的自治省份,以防新系统下的自治领中出现调用<code>allowed = {}</code> <code>allowed_levels_filter = {}</code> 的情况。如果选择第二个选项,需注意的是仍需禁用默认的自治省份,以确保它们在新建傀儡国家时不出现。<br/>


If a new autonomy level should only be possible to be manually assigned via the <code>set_autonomy</code> [[effect]], then it's possible to set up allowed as such, using the autonomy state with the id of <code>autonomy_my_state</code>:
新的自治等级应当只能通过 <code>set_autonomy</code> [[effect|效果]] 手动分配,那么可以这样设置允许状态,使用 ID 为 <code>autonomy_my_state</code> 的自治领:
<pre>allowed = {
<pre>allowed = {
    OR = {
    OR = {
第308行: 第337行:
      has_autonomy_state = autonomy_my_state
      has_autonomy_state = autonomy_my_state
    }
    }
}</pre>That makes the autonomy state impossible to achieve through gaining or losing levels, as the <code>allowed</code> block is false if the subject has any other autonomy. This will ensure that <code>set_autonomy</code> will be possible to execute, ''as long as the target country is independent at the time'', and that it wouldn't get cleared after being assigned, while it has that autonomy state.
}</pre> 通过对自治等级进行升降级改动是无法实现目标国际自治状态的,因为若目标国家具有其他自治状态,则<code>allowed</code> 将为假。'''''这确保只要目标国家在被命令执行时是独立的''''',就可以安全执行<code>set_autonomy</code> ,并且一旦被赋予该自治状态,该状态在存在时不会被清除。


When creating autonomy systems, avoid 2 different states having the same min_freedom_level.
在创建自治系统时,避免两个不同的省份具有相同的min_freedom_level。
{{Modding navbox}}
{{Modding navbox}}
[[Category:Modding]]
[[Category:Modding]]

2024年11月3日 (日) 01:09的最新版本

附庸系统不同变种在/Hearts of Iron IV/common/autonomous_states/*.txt路径下定义,允许自定义新变种。

参数

  • id 是附庸状态的键值,不能重复。所有附庸状态的键值均不可和另一附庸状态的键值重复。
  • default: 如果为真,则游戏将尝试使和平谈判中的 '傀儡' 选项以及 '傀儡' 效果在其他默认附庸状态中使用此附庸状态。默认状态下为 no。
  • is_puppet 用来检测该国是否是傀儡国。若需要该国为傀儡国,则is_puppet或者is_puppet_of条件将会返还真值。默认状态下为 no。
  • use_overlord_color 使附庸国使用和宗主国相同的颜色。
  • min_freedom_level 决定了自治领的等级。当游戏使自治领作为一个降级或升级时的主体时,级别较低的自治领的自治程度,比级别较高的自治领的自治程度低。这同样也决定了主体提升或降低等级所需的多少自治点数,即等级间的差值乘以5000. 如前所述,吞并一个min_freedom_level为0.1的自治领需要花费500点数。
  • manpower_influence附庸国人力要求,决定了宗主国的殖民地军队中能使用多大比例的殖民地人力。 需要共赴胜利共赴胜利 DLC.
  • rule 给主体设定“是”或“否”的游戏规则
游戏规则列表
以下游戏规则作为可选择选项:
内部名 本地化名 中文名 备注
can_access_market Can access International Market 市场准入(傀儡国和宗主国总是互有市场准入)
can_be_spymaster Can be Spy Master 可以成为间谍主管
can_boost_other_ideologies Can boost popularity of other ideologies 可以提高其他意识形态的支持率。
can_boost_own_ideology Can boost own party popularity in other countries 可以在其他国家提升本党派支持率
can_create_collaboration_government Can create collaboration governments 可以建立合作政府
can_create_factions Can Create Factions 可以创建阵营
can_declare_war_on_same_ideology Can declare war on country with the same ideology group without a war goal 可以无需战争目标向同一意识形态组的国家宣战
can_declare_war_without_wargoal_when_in_war Can declare war on a neighbor without a wargoal when at war with a major 与主要国家交战时可以无需战争目标向邻国宣战
can_decline_call_to_war Can decline call to war 可以拒绝战争召唤
can_force_government Can force government of another country to adopt the same ideology 可以强迫他国政府接受本国意识形态
can_generate_female_aces Women in your country are allowed to become military pilots 在你的国家女性可以成为军事飞行员
can_generate_female_country_leaders Can generate female country leaders 可以拔擢女性国家领导人
can_generate_female_unit_leaders Can generate female unit leaders 可以拔擢女性作为单位将领
can_guarantee_other_ideologies Can guarantee other ideologies 可以对其他意识形态的国家保障独立
can_join_factions Can join factions 可以加入阵营
can_join_factions_not_allowed_diplomacy Country's name is not allowed to join factions 国家无法加入阵营
can_join_opposite_factions Can Join Factions led by another Ideology 可以加入由不同意识形态领导的阵营
can_lower_tension Lowers World Tension with Guarantees 通过保障独立降低全球紧张度
can_not_build_buildings CAN_NOT_BUILD_BUILDINGS 不能修建建筑 其似乎不能奏效
can_not_declare_war Can not declare wars 无法宣战 阻止制造战争目标,但不阻止使用现有战争目标
can_occupy_non_war Can hold territory owned by a country they are not at war with 可以持有未与我们交战的国家所拥有的领土
can_only_justify_war_on_threat_country Can justify war goals against a country that have not generated world tension 可以对没有引起全球紧张度增长的国家正当化战争目标
can_puppet Can puppet a country 可以傀儡其他国家
can_send_volunteers Can send volunteer forces 可以派遣志愿军
can_use_kamikaze_pilots Can use kamikaze pilots 可以让飞行员执行自杀性攻击
contributes_operatives Contributes Operatives to Spy Master: Yes 可以为间谍主管贡献特工 仅对附属国本身有影响。
units_deployed_to_overlord Control over deployed units go to overlord 已部署部队的控制权属于宗主国 仅对附属国本身有影响。
  • modifier :给附庸国添加修正所有国家修正均可以应用。
  • ai_subject_wants_higher :决定了ai国家是否专注于获得更高的自治程度。如果设置为0,AI永远不会在自治度系统中提升自治等级。
  • ai_overlord_wants_lower :决定了AI宗主国是否专注于降低附庸国的自治等级。如果设置为0,AI永远不会在自治度系统中降低自治等级。
  • ai_overlord_wants_garrison: 决定了AI宗主国是否愿意像卫戍自己的领土一样给附庸国的领土派遣卫戍部队
  • allowed: 所对应主体必须满足必要的触发条件,以使游戏中的自治状态生效。可以使用 OVERLORD 作用域来作用于 overlord(宗主国)。
  • use_for_peace_conference_weight :决定了潜在的宗主国在和平谈判中附庸某国家的机会。此处ROOT是附庸国,FROM是宗主国。
  • can_take_level :决定了附庸国能够在自治度系统中提升等级所必须满足的条件。
  • can_lose_level :决定了只有附庸国满足了一些条件,宗主国才能够在自治度系统中降低附庸国等级。
  • peace_conference_initial_freedom :是和平会议后给自治领设定的初始自治等级,其范围是0到1。如果不特别指明,则设定为0.5。
  • allowed_levels_filter :决定一个自治领能到达哪些自治等级。如果不特别指明,所有的等级都是可以的。

图标

Sprite系统概述
游戏使用Sprite类代码加载图形文件(如.GFX)。Sprite是指那些将名称附加到图像文件的定义类代码,同时还可以选择性地添加额外的信息,例如动画、帧数、图像的加载方式等等。综上所述,仅仅将所使用的图像文件放入gfx文件夹中是不够的,还必须有图像对应的sprite代码来调用它。

Sprite类代码可在任意/Hearts of Iron IV/interface/*.gfx文件中进行定义(这与/Hearts of Iron IV/gfx/interface/是不同的), 并可以通过文本编辑器打开。若要建一个新的.gfx文件,可以新建一个.txt文件然后改后缀为.gfx(在 Windows 文件管理器中需设置显示扩展名后方能进行后缀更改)。需要注意的是,为了与文件夹中定义好的字体和地图箭头分开,需要在spriteTypes = { ... }代码块中定义对应代码,符合必需要求的最简单代码是spriteType = { ... }. 最简单的sprite定义如下:

spriteTypes = {
    spriteType = {
        name = GFX_first_sprite                         # In some cases, beginning with GFX_ is mandatory for it to work.
        texturefile = gfx/interface/folder/filename.dds # The folder and filename don't matter, as long as they are correct
    }                                                   # Only the forward slash '/' (can be doubled as '//') can be used to separate folders.
    spriteType = {                                      # The image doesn't have to be .dds, as .tga and .png are acceptable.
        name = GFX_second_sprite
        texturefile = gfx/interface/folder2/filename2.dds
        noOfFrames = 2 # Splits the image into 2 halves, which may be switched between dynamically in GUI
    }
}

在这种情况下,系统会生成一个名为GFX_first_sprite 的sprite,并将图像/Hearts of Iron IV/gfx/interface/folder/filename.dds附加到它。第二个sprite类似,会分为两个frame:左半部分是第一个frame,右半部分是第二个。(如果需要,可以将它们进一步细分。)虽然当前Sprite代码块没有动画效果,但可以在这两个图像块之间切换。 GFX_second_sprite:1 用于引用第一个frame,可以通过GUI由不同的内容需求来切换显示中的图像,例如游戏中的电台。

若想添加动画效果,需要使用frameAnimatedSpriteType

如需对sprite类文件小改不必复制原版游戏文件。倘若因相同名字的sprite在不同文件中导致了重复定义,游戏将会根据文件名称优先调用后面被定义的Sprite,旧定义会被无视。可以通过重命名文件以ASCII表靠后的字符开头来确保正确调用新的自定义内容,通常情况下使用小写字母“z”开头来实现这一点。例:要将GFX_idea_traits_strip的帧数更改为10,可在模组的 /Hearts of Iron IV/modname/interface/zz_replace.gfx文件中定义一个同名且包含10帧的Sprite文件,而不必复制原版游戏文件。

由于大多数 .gfx 文件定义了用户界面的关键部分,复制它们可能会导致模组在游戏大更新后缺失新版本的sprite类代码,进而显示为错误图像,通常是“错误小狗”的图标。除非在某些迫不得已的时候,(例:添加的文件可能会对模组功能造成损害,如/Hearts of Iron IV/interface/subuniticons.gfx)为了减少检查文件的麻烦,尽可能不要复制.gfx文件,

游戏将使用格式为GFX_<autonomy state>_icon的sprite类作为图标。包含此类定义的一个 /Hearts of Iron IV/interface/*.gfx 文件可能是这样的:

spriteTypes = {
    spriteType = {
        name = "GFX_autonomy_mod_new_icon"
        textureFile = "gfx/interface/autonomy/autonomy_mod_new_icon.dds"
    }
    spriteType = {
        name = "GFX_example_icon"
        texturefile = "another_folder/image_name.dds"
    }
}

本地化

本地化文件位置在/Hearts of Iron IV/localisation/ 文件夹的 .yml 文件中。对前面的例子autonomy_mod_new而言,文件本地化样式大概是 autonomy_mod_new:0 "Mod's new autonomy state"

我们可以设置关于一个特定国家的项目,如GER_autonomy_mod_new:0 "New mod Germany"将使德国的名字在其自治水平为 autonomy_mod_new时变成它。相似的,ENG_FRA_autonomy_mod_new:0 "New mod French UK" 会使不列颠在其宗主国为法国且在自治状态为 autonomy_mod_new 时拥有这个名字。

代码示例

autonomy_state = {
	id = autonomy_example
	
	default = yes					#Will be a possible option for peace deals
	is_puppet = yes
	
	use_overlord_color = yes
	
	min_freedom_level = 0.2				#Puts it as 0.2 on the autonomy level scale, which is the same as an integrated puppet.

	peace_conference_initial_freedom = 0.9		#Close to independence
	
	manpower_influence = 0.9
	
	rule = {
		can_not_declare_war = yes
		can_decline_call_to_war = no
		units_deployed_to_overlord = yes
		can_be_spymaster = no
		contributes_operatives = no
		can_create_collaboration_government = no
	}
	
	modifier = {
		autonomy_manpower_share = 1.0
		can_master_build_for_us = 1
		extra_trade_to_overlord_factor = 1.0
		overlord_trade_cost_factor = -0.9
		cic_to_overlord_factor = 0.75
		mic_to_overlord_factor = 0.75
		research_sharing_per_country_bonus_factor = -0.5
	}
	
	ai_subject_wants_higher = {
		factor = 0.0
	}
	
	ai_overlord_wants_lower = {
		factor = 0.0
	}

	allowed = {
		has_dlc = "Together for Victory"
		OVERLORD = {
			tag = FRA
		}
	}

	allowed_levels_filter = {
		autonomy_example
		autonomy_example_1
		autonomy_example_2
	}

	use_for_peace_conference_weight = {
		base = 0
		modifier = {
			add = 10
			FROM = {
				has_wargoal_against = { target = ROOT type = puppet_wargoal_focus }
			}			# Adds 10 to the chance if the overlord has a wargoal to puppet the country.
		}
		modifier = {
			factor = 2
			tag = ENG	# Multiplies the chance by 2 if the subject is UK.	
		}
	}

	can_take_level = {
		OVERLORD = {
			NOT = {
				controls_state = 123
			}	# If the overlord does not control state 123, the subject can gain a level.
		}
	}

	can_lose_level = {
		OVERLORD = {
			controls_state = 123
		}	# If the overlord controls state 123, it can decrease the subject's autonomy level.
	}
}

相关定义

一些定义通过特殊的方式影响自治领系统,它们是:

  • RESOURCE_SENT_AUTONOMY_DAILY_BASE这是宗主国购买资源时自治领获得的基础独立倾向增长。
  • RESOURCE_SENT_AUTONOMY_DAILY_FACTOR 这是宗主国购买资源时自治领获得的独立增益因子。(用于调整自治增长速度)
  • WAR_SCORE_AUTONOMY_BASE 自治领在战争中获得战争积分所带来的基础独立倾向增长。
  • WAR_SCORE_AUTONOMY_FACTOR 自治领在战争中获得战争积分所带来的独立增益因子。(用于调整其自治增长速度)
  • LL_TO_OVERLORD_AUTONOMY_DAILY_BASE 自治领向宗主国起草租借法案所获得的基础独立倾向增益。
  • LL_TO_OVERLORD_AUTONOMY_DAILY_FACTOR 自治领向宗主国起草租借法案的独立增益因子。(用于调整自治增长速度)
  • LL_TO_PUPPET_AUTONOMY_DAILY_BASE 宗主国向自治领起草租借法案所获得的基础独立倾向压制。(基础独立压制必须为负值才能减少自治增长)
  • LL_TO_PUPPET_AUTONOMY_DAILY_BASE 宗主国向自治领起草租借法案所获得的独立压制因子。(基础独立压制必须为负值才能减少自治增长)
  • AUTONOMY_FREEDOM_FROM_CAPITULATE 在宗主国投降后,自治领的独立倾向将大幅上升。
  • ATTACHE_TO_SUBJECT_EFFECT 宗主国向自治领派遣军事顾问所获得的基础独立倾向压制。(基础独立倾向压制必须为负值才能减少自治增长)
  • ATTACHE_TO_OVERLORD_EFFECT宗主国向自治领派遣军事顾问所获得的独立压制因子。(基础独立倾向压制必须为负值才能减少自治增长)
  • AUTONOMY_LEVEL_CHANGE_PP_COST_BASE 在不同自治状态下进行转换所需要的政治点数。
  • AUTONOMY_LEVEL_CHANGE_PP_ANNEX宗主国吞并半吞并傀儡国所需要花费的政治点数。
  • AUTONOMY_LEVEL_CHANGE_PP_FREE 作为附庸获得独立所需要的政治点数。
  • MAX_SCORE_DIFF_TO_CHANGE_AUTONOMY 自治领当前独立点数与升级或降级点数的最大差值。
  • MASTER_BUILD_AUTONOMY_FACTOR 宗主国向自治领进行援建所获得的独立倾向压制因子。(基础独立倾向压制必须为负值才能减少自治增长)
  • AUTONOMOUS_TOTAL_SCORE 自治领国家被吞并与独立间的总自治点数。
  • AUTONOMOUS_SPILLOVER 各自治等级间可保存的自治点数上限。

额外说明

在对国家历史文件中的自治等级进行设置时,可能会使对应国家的政党受支持度和当前执政党等数据遭到覆盖后丢失。以防万一,建议将作用域(scope)设置为宗主国,如

TAG = {
	if = {
		limit = {
			has_dlc = "Together for Victory"
		}
		set_autonomy = {
			target = TAG2
			autonomy_state = autonomy_mod_new
		}
	}
	else = {
		puppet = TAG2
	}
}

在自治领的历史文件中,也可以将其放在定义执政党和对应支持度之前。另一种方法是可以更改 /Hearts of Iron IV/common/country_tags/中标签的顺序,使得宗主国在自治领之前被定义。

若决定创建一个类似于日本独特自治的新自治系统,则需要禁用默认的自治省份,以防新系统下的自治领中出现调用allowed = {}allowed_levels_filter = {}的情况。如果选择第二个选项,需注意的是仍需禁用默认的自治省份,以确保它们在新建傀儡国家时不出现。

新的自治等级应当只能通过 set_autonomy 效果手动分配,那么可以这样设置允许状态,使用 ID 为 autonomy_my_state的自治领:

allowed = {
    OR = {
        is_subject = no
        has_autonomy_state = autonomy_my_state
    }
}

通过对自治等级进行升降级改动是无法实现目标国际自治状态的,因为若目标国家具有其他自治状态,则allowed 将为假。这确保只要目标国家在被命令执行时是独立的,就可以安全执行set_autonomy ,并且一旦被赋予该自治状态,该状态在存在时不会被清除。

在创建自治系统时,避免两个不同的省份具有相同的min_freedom_level。