Resources
File:Ambox outdated info.png | 這部分內容可能已不適合當前版本,最後更新於1.10。 |
The resources used by the game are found in /Hearts of Iron IV/common/resources/00_resources.txt.
The resource file follows this format:
resources = { <resource> = { icon_frame = <frame> cic = <float> convoys = <float> } }
Icon frame
File:Ambox outdated info.png | 這部分內容可能已不適合當前版本,最後更新於1.10。 |
Icon frame controls which frame from the resource image strip is used for the resource icon. A 'frame' is the 27 by 27 pixel square the icon occupies in the image.
The resource image strip is defined by the GFX_resources_strip spritetype, which points to /Hearts of Iron IV/gfx/interface/resources_strip.dds by default. By default 1 will refer to the Oil icon, 2 to Aluminium, etc.
The icons are defined in /Hearts of Iron IV/interface/general_stuff.gfx. Their definition must be changed if you're adding or removing resources:
spriteType = { name = "GFX_resources_strip" texturefile = "gfx/interface/resources_strip.dds" noOfFrames = X #X being the number of resources you have, } spriteType = { name = "GFX_missing_resources_strip" texturefile = "gfx/interface/missing_resources_strip.dds" noOfFrames = X }
The number of frames strictly corresponds to the amount of resources.
CIC
File:Ambox outdated info.png | 這部分內容可能已不適合當前版本,最後更新於1.5。 |
CIC defines the amount of resources needed to trade for 1 Civilian Factory. By default, this is 0.125, meaning 8 units of that resource are traded for 1 factory. Value can not be larger than 1.
Convoys
File:Ambox outdated info.png | 這部分內容可能已不適合當前版本,最後更新於1.5。 |
Convoys controls the maximum amount of this resource a single convoy carries. By default, this is 0.1, meaning a convoy can carry 10 of the resource.
Localization
File:Ambox outdated info.png | 這部分內容可能已不適合當前版本,最後更新於1.9。 |
Localisation is defined in /Hearts of Iron IV/localisation/*_l_<language>.yml with the following localization keys:
PRODUCTION_MATERIALS_<RESOURCE>:0 "Name of resource" <resource>_desc:0 "Description of resource"
Interface
File:Ambox outdated info.png | 這部分內容可能已不適合當前版本,最後更新於1.5。 |
If implementing different resources, you will need to edit the interface so the game understands how to display the new resource. /Hearts of Iron IV/interface/countryproductionlineview.gui is the relevant file here.
Each resource is utilised two GUI elements: <resource>_icon and <resource>_value, which are found under the resources windowtype.
buttonType = { name = "<resource>_icon" position = { x=0 y=2 } spriteType = "GFX_resources_strip" frame = 1 # Which icon is used from the spriteType image referred to above. } instantTextboxType = { name = "<resource>_value" position = { x = 31 y = 5 } textureFile = "" font = "hoi_18mbs" borderSize = {x = 0 y = 0} text = "999" maxWidth = 50 maxHeight = 20 format = left }
Additional notes
A fuel can also correspond to the fuel dynamic, however only one resource at a time can do that. This is decided by the FUEL_RESOURCE define.
Infrastructure's bonus on resource gain is decided by the INFRASTRUCTURE_RESOURCE_BONUS define and applies to all resources the same.
文件 | 效果 • 條件 • 定義 • 修正 • 修正列表 • 作用域 • 本地化 • on action • 數據結構 (標記, 臨時標記, 國家別名, 變量, 數組) |
腳本 | 成就修改 • AI修改 • AI focuses • 自治領修改 • 權力平衡修改 • 劇本/標籤 (遊戲規則)• 建築修改 • 人物修改 • 修飾性TAG修改 • 國家創建 • 軍隊修改 • 決議製作 • 裝備修改 • 事件修改 • Idea修改 • 意識形態修改 • 軍工商修改 • 國策製作 • 資源修改 • Scripted GUI • 科技製作 • 單位修改 |
地圖 | 地圖 • 省份 • 補給區域 • 戰略區域 |
圖形圖像 | 界面 • 圖形資產 • 實體模型 • 後期特效 • 離子效果 • 字體 |
裝飾性 | 肖像 • 命名列表 • 音樂 • 音效 |
其他 | 控制台指令 • 故障排除 • 模組結構 • 成就代碼分析 • Mod相關 • Nudger修改 |