地区模改

本页面所适用的版本可能已经过时,最后更新于1.8
(重定向自State modding

地区(和地区历史)定义在/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