Strategic region modding:修订间差异

本页面所适用的版本可能已经过时,最后更新于1.10
(文本替换 - 替换“[[Category:”为“[[分类:”)
无编辑摘要
 
第1行: 第1行:
{{Version|1.5}}
{{Version|1.10}}
[[Strategic_Region| 战略区域]] {{path|map/strategicregions/*.txt}} 中定义。
{{需要翻译|译者=霜泽图书馆}}
[[Strategic_Region|Strategic regions]] are defined in {{path|map/strategicregions/*.txt}}.


一般来说每一个战略区域定义在自己的文件中,尽管你也可以在同一个文件中定义多个战略区域,因为战略区域id是在文件内,而不是用文件名定义的。
Each strategic region is typically stored in it's own file, although you can store multiple strategic region definitions within the same file, as the ID is defined within the strategic region definition, rather than the file title.


这是一个通用的战略区域的代码样例:
Here is a generic example of a strategic region:
<pre>
<pre>
strategic region = {
strategic_region = {
    id = <int>
    id = <int>
    name = <localization key>
    name = <localization key>
第18行: 第19行:
        between = { <min> <max> }
        between = { <min> <max> }
        temperature = { <min> <max> }
        temperature = { <min> <max> }
       temperature_day_night = { <day> <night> }
        no_phenomenon = <weight>
        no_phenomenon = <weight>
        rain_light = <weight>
        rain_light = <weight>
第32行: 第32行:
</pre>
</pre>


* '''id''' 定义了战略区域的数字id。数字必须连续,否则游戏会崩溃。
* '''id''' defines the numerical id used by the strategic region. The strategic region IDs must be added sequentially, skipping numbers will cause crashes.


* '''name''' 定义了战略区域使用的本地化键值。你也可以使用一个不本地化的字符串(例如"Paris" ),但是最好还是使用本地化字符串。
* '''name''' defines the localization key the strategic region uses. You can use a non-localized string (i.e. "Paris"), but it is best practice to use localized strings.


* '''provinces''' 定义了战略地区包括的省份。
* '''provinces''' scope defines which provinces the strategic region is composed over.


* '''weather''' 定义了战略区域包括的省份的天气数据。
* '''weather''' scope determines the weather within the provinces covered by the strategic region.


== 天气 ==
== Weather ==
{{SVersion|1.5}}
{{SVersion|1.10}}


Each strategic region has a '''weather''' scope that determines how the weather changes for provinces within it.
Each strategic region has a '''weather''' scope that determines how the weather changes for provinces within it.
第51行: 第51行:
* '''temperature''' scope determines the minimum and maximum temperature for the weather system.
* '''temperature''' scope determines the minimum and maximum temperature for the weather system.


* '''temperature_day_night''' scope determines the minimum and maximum temperature variability during day and night for the weather system.
* <s>'''temperature_day_night''' scope determines the minimum and maximum temperature variability during day and night for the weather system.</s> (This is no longer used since version 1.11, set all temperature ranges via temperature)


* '''min_snow_level''' scope determines the minimum amount of snow that is always present in the weather system. Typically only used for areas with year-round snow.
* '''min_snow_level''' scope determines the minimum amount of snow that is always present in the weather system. Typically only used for areas with year-round snow.
第57行: 第57行:
Each of the weather states are given a weight, determining how likely the state will occur within the weather system. The weather states can be found in {{path|common/weather.txt}}.
Each of the weather states are given a weight, determining how likely the state will occur within the weather system. The weather states can be found in {{path|common/weather.txt}}.


== 建议 ==
== Tips ==
{{SVersion|1.5}}
{{SVersion|1.10}}
* 在放置战略区域时,省份通常都是相邻的。这就意味着岛屿一般属于'' 海洋'' 战略区域。
* When placing strategic regions, the provinces they are compose of should be contiguous. This means islands are normally part of a ''sea'' strategic region.




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

2024年9月15日 (日) 22:27的最新版本

Strategic regions are defined in /Hearts of Iron IV/map/strategicregions/*.txt.

Each strategic region is typically stored in it's own file, although you can store multiple strategic region definitions within the same file, as the ID is defined within the strategic region definition, rather than the file title.

Here is a generic example of a strategic region:

strategic_region = {
    id = <int>
    name = <localization key>
    
    provinces = {
        <province ids>
    }
    
    weather = {
        period = {
            between = { <min> <max> }
            temperature = { <min> <max> }
            no_phenomenon = <weight>
            rain_light = <weight>
            rain_heavy = <weight>
            snow = <weight>
            blizzard = <weight>
            mud = <weight>
            sandstorm = <weight>
            min_snow_level = <amount>
        }
    }
}
  • id defines the numerical id used by the strategic region. The strategic region IDs must be added sequentially, skipping numbers will cause crashes.
  • name defines the localization key the strategic region uses. You can use a non-localized string (i.e. "Paris"), but it is best practice to use localized strings.
  • provinces scope defines which provinces the strategic region is composed over.
  • weather scope determines the weather within the provinces covered by the strategic region.

Weather

Each strategic region has a weather scope that determines how the weather changes for provinces within it.

Each weather system is defined within a period scope within the weather scope.

  • between scope determines when the weather system occurs, the notation is day.month day.month, i.e. 0.0 30.0 means the weather system occurs between the 1st of January and the 31st, including these days. Note that the first day and the first month are marked as 0, not as 1.
  • temperature scope determines the minimum and maximum temperature for the weather system.
  • temperature_day_night scope determines the minimum and maximum temperature variability during day and night for the weather system. (This is no longer used since version 1.11, set all temperature ranges via temperature)
  • min_snow_level scope determines the minimum amount of snow that is always present in the weather system. Typically only used for areas with year-round snow.

Each of the weather states are given a weight, determining how likely the state will occur within the weather system. The weather states can be found in /Hearts of Iron IV/common/weather.txt.

Tips

  • When placing strategic regions, the provinces they are compose of should be contiguous. This means islands are normally part of a sea strategic region.