Building modding

建築物是使用省份的民用工廠建造的結構。

建築物

以下是一個通用建築示例:

<building> = {
    base_cost = <int>               # 建设成本。
    base_cost_conversion = <int>    # 要转换为该建筑的成本
    per_level_extra_cost = <int>    # 每次升级建筑的成本。
    
    max_level = <int>               # 建筑的最大等级
    value = <int>                   # 建筑物的基本完好状态。根据所建建筑的等级。
   
    icon_frame = <int>              # GFX_buildings_strip中的建筑图标。
    show_on_map = <int>             # 当建造了一个建筑时要在地图上显示的<building>模型数量 
    show_on_map_meshes = <int>      # 要显示的型号数。
    always_shown = yes              # 是否始终显示<building>模型。
    has_destroyed_mesh = yes         # 是否显示建筑的破坏
    
    shares_slots = yes                          # 确定此建筑是否使用建筑槽。
    infrastructure_construction_effect = yes    # 确定此建筑是否受益于提高施工速度的基础设施。
    provincial = yes                            # 确定此建筑是否为省级建筑。
    damage_factor = <float>                     # 修改轰炸造成的伤害。
    
    only_costal = yes               # 将此建筑仅限于沿海省份/州。
    disabled_in_dmz = yes           # 限制此建筑,在DMZ省份下禁用。
    
    infrastructure = yes            # 确定是否将此建筑视为基础设施。
    air_base = yes                  # 确定此建筑是否被视为空军基地
    is_port = yes                   # 确定是否将此建筑视为港口。
    anti_air = yes                  # 确定是否将此建筑视为防空装置。
    refinery = yes                  # 确定此建筑是否被视为炼油厂。
    radar = yes                     # 确定此建筑是否被视为雷达站。
    nuclear_reactor = yes           # 确定该建筑是否被视为核反应堆。
    military_production = <float>   # Adds X amount of MIC production.
    general_production = <float>    # Adds X amount of CIC production.
    naval_production = <float>      # Adds X amount of NIC production.
    land_fort = <int>               # Adds X amount of land fort.
    naval_fort = <int>              # Adds X amount of naval fort.
    rocket_production = <int>       # Adds X amount of rocket production.
    rocket_launch_capacity = <int>  # Adds X amount of rocket capacity.
 
    local_resources_<resource> = <int>  # Adds resources to state.
    air_defence = <float>               # Adds air defence to the state.
    nuclear_production_factor = <float> # Adds Nuke production factor to owner of state.
}

有關遊戲內建築請參閱建築

本地化

建築遵循以下本地化

<building>: ""
<building>_desc: ""
<building>_plural: ""
modifier_production_speed_<building>: ""
modifier_production_speed_<building>_desc: ""
modifier_production_speed_<building>_factor: ""
modifier_production_speed_<building>_factor_desc: ""

界面

如果添加了新建築,則需要更新建築圖標欄以包含該建築的圖標。此文件位於/Hearts of Iron IV/gfx/interface/buildings/building_icon_strip.dds.

圖標本身需要46像素寬和高。它應該被附加到建築圖標條上,並且noOfFrames應該被更改以匹配新的圖標數量。

以下是建築圖標的GFX定義文件 /Hearts of Iron IV/interface/countrystateview.gfx:

spriteType = {
    name = "GFX_buildings_strip"
    textureFile = "gfx/interface/buildings/building_icon_strip.dds"
    noOfFrames = 14 #每改造一栋建筑增加1
}

建築類型

以下是自1.9.0起遊戲中不同類型的建築(可以在/Hearts of Iron IV/common/buildings/00_buildings.txt找到):

buildings = {
    # STATE BUILDINGS
    infrastructure     = <int> # 0 to 10 | Sets the Infrastructure level.          (STATE)
    air_base           = <int> # 0 to 10 | Sets the Air Base level.                (STATE)
    anti_air_building  = <int> # 0 to 5  | Sets the Anti-Air level.                (STATE)
    radar_station      = <int> # 0 to 5  | Sets the Radar Station level.           (STATE)

    # SHARED BUILDINGS
    arms_factory       = <int> # 0 to 20 | Sets the Military Factory level.        (STATE)
    industrial_complex = <int> # 0 to 20 | Sets the Civilian Factory level.        (STATE)
    dockyard           = <int> # 0 to 20 | Sets the Naval Dockyard level.          (STATE)
    synthetic_refinery = <int> # 0 to 3  | Sets the Synthetic Refinery level.      (STATE)
    fuel_silo          = <int> # 0 to ∞  | Sets the Fuel Silo level.               (STATE)
    rocket_site        = <int> # 0 to 5  | Sets the Rocket Site level.             (STATE)
    nuclear_reactor    = <int> # 0 to 1  | Sets the Nuclear Reactor level.         (STATE)    

    # PROVINCE BUILDINGS
    <province id> = {
        naval_base     = <int> # 0 to 10 | Sets the Naval Base level.              (PROVINCE)
        bunker         = <int> # 0 to 10 | Sets the Land Fort level.               (PROVINCE)
        coastal_bunker = <int> # 0 to 10 | Sets the Coastal Fort level.            (PROVINCE)
    }
}

請注意,目前,工廠的產能似乎為20,而之前的產能是無限的(只要是整數)。