地区模改:修订间差异

本页面所适用的版本可能已经过时,最后更新于1.8
(merge from offical wiki)
 
无编辑摘要
第1行: 第1行:
{{Version|1.8}}
{{Version|1.8}}
States (and their history) are defined in {{path|history/states/*.txt}}.
地区(和地区历史)定义在{{path|history/states/*.txt}}


Each state is typically stored in its own file, although you can store multiple state definitions within the same file, as the ID is defined within the state definition, rather than the file title (as in Europa Universalis 4).
一般来说每一个地区都定义在自己的文件中,尽管你也可以在一个文件中定义多个地区,因为地区id是在文件内的代码中定义的,而不是文件名(与欧陆风云4一样)。


Here is a generic example of a state:
这是一个地区定义代码的通用样例:
<pre>
<pre>
state = {
state = {
第39行: 第39行:
</pre>
</pre>


* '''id''' defines the numerical id used by the state. The state IDs must be added sequentially, skipping numbers will cause crashes.
* '''id''' 定义了地区使用的数字id。地区id必须连续添加,否则会导致游戏崩溃。


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


* '''manpower''' defines the manpower provided to the owner of the state. Typically values are as low as 10,000 in wasteland type states, and as high as 2,000,000 in highly populated states.
* '''manpower''' 定义了地区提供的人力。一般来说在荒地地区会低至10,000 ,在人口密集的地区会高至2,000,000


* '''state_category''' defines the state category used by the state. These categories are found in {{path|common/state_category/*.txt}}.
* '''state_category''' 定义了地区类型。地区类型可以在{{path|common/state_category/*.txt}} 中找到。


* '''provinces''' scope defines which provinces belong to the state.
* '''provinces''' 定义了属于这一地区的省份。


* '''resources''' scope defines the resources found in the state and the amount of said resources. Resources are found in {{path|common/resources/*.txt}}.
* '''resources''' 定义了地区拥有的资源类型和数量。资源可以在{{path|common/resources/*.txt}} 中找到。


* '''history''' scope defines the effects to execute when the state is loaded during history setup. Typically this is used to add ownership with '''owner = <tag>''' and '''add_core_of = <tag>'''.
* '''history''' 定义了加载历史文件时在地区实施的[[指令|效果]]。一般来说,这里使用'''owner = <tag>''' '''add_core_of = <tag>''' 来添加拥有者。


* '''victory_points''' scope is nested within the history scope and defines the victory point for a state. Multiple victory points require multiple scopes.
* '''victory_points''' 嵌套在'''history'''中,定义地区的胜利点。多个胜利点需要多条该语句。


* '''buildings''' scope is nested within the history scope, and defines which state buildings are set in the state during history setup. Buildings are found in {{path|common/buildings/*.txt}}. Provincal buildings are added by adding the specific province you want to add the building in as a scope.
* '''buildings''' 嵌套在'''history'''中,定义加载历史文件时在地区设定的建筑。建筑可以在{{path|common/buildings/*.txt}} 找到。省份建筑要在添加时加上属于哪一个省份。


== Building types ==
== 建筑类型 ==
See '''[[Building modding#Types|building types]]''' for different building types in the base game.
See '''[[Building modding#Types|building types]]''' for different building types in the base game.


== State Categories ==
== 地区类型 ==
The base game state categories and their corresponding number of building slots
这是原版游戏中的地区类型及其所对应的建筑槽数。
* '''wasteland''': 0
* '''wasteland''': 0
* '''enclave''': 0
* '''enclave''': 0

2020年9月6日 (日) 15:16的版本

地区(和地区历史)定义在/Hearts of Iron IV/history/states/*.txt

一般来说每一个地区都定义在自己的文件中,尽管你也可以在一个文件中定义多个地区,因为地区id是在文件内的代码中定义的,而不是文件名(与欧陆风云4一样)。

这是一个地区定义代码的通用样例:

state = {
    id = <id>
    name = <localization key>
    manpower = <int>
    state_category = <category>
   
    provinces = {
        <province ids>
    }
    
    resources = {
        <resource> = <int>
    }
    
    history = {
        <effects>
        
        victory_points = {
            <province id> <points>
        }
        
        buildings = {
            <building> = <amount>
            

            <province id> = {
                <building> = <amount>
            }
        }
    }
}
  • id定义了地区使用的数字id。地区id必须连续添加,否则会导致游戏崩溃。
  • name定义了地区使用的本地化键值。你可以使用非本地化的字符串(例如"Paris"),但最好还是使用本地化字符串。
  • manpower定义了地区提供的人力。一般来说在荒地地区会低至10,000,在人口密集的地区会高至2,000,000。
  • state_category定义了地区类型。地区类型可以在/Hearts of Iron IV/common/state_category/*.txt中找到。
  • provinces定义了属于这一地区的省份。
  • resources定义了地区拥有的资源类型和数量。资源可以在/Hearts of Iron IV/common/resources/*.txt中找到。
  • history定义了加载历史文件时在地区实施的效果。一般来说,这里使用owner = <tag>add_core_of = <tag>来添加拥有者。
  • victory_points嵌套在history中,定义地区的胜利点。多个胜利点需要多条该语句。
  • buildings嵌套在history中,定义加载历史文件时在地区设定的建筑。建筑可以在/Hearts of Iron IV/common/buildings/*.txt找到。省份建筑要在添加时加上属于哪一个省份。

建筑类型

See building types for different building types in the base game.

地区类型

这是原版游戏中的地区类型及其所对应的建筑槽数。

  • wasteland: 0
  • enclave: 0
  • tiny_island: 0
  • small_island: 1
  • pastoral: 1
  • rural: 2
  • town: 4
  • large_town: 5
  • city: 6
  • large_city: 8
  • metropolis: 10
  • megalopolis: 12