《钢铁雄心4》HOI4秘籍/控制台/事件代码/作弊码

《钢铁雄心4》HOI4秘籍/控制台/事件代码/作弊码3、修改笔记

所属游戏: 钢铁雄心4
英文名称:
相关操作: 收藏 下载地址 扩展
模组作者:MrAntiFun
标签:
最后更新:2018-01-03

修改笔记

BY langziabc +

本修改笔记包含省份修改,国家修改,科技修改,兵种修改,装备修改,修改以“永久中立国”瑞士为例。

本人使用的文本工具为notepad++,编辑游戏文本时推荐在notepad++中将文本类型设置为C语言(其它语言亦可,主要方便使用中括号收缩),推荐收缩快捷键为ALT+2

路径:(我想路径已经够详细了,替换时请注意)

省份修改:Hearts of Iron IVhistorystates

国家修改:Hearts of Iron IVhistorycountries

科技修改:Hearts of Iron IVcommontechnologies

兵种修改:Hearts of Iron IVcommonunits

装备修改:Hearts of Iron IVcommonunitsequipment


省份相关

+

需要进游戏,打开控制台查看省份代码,控制台指令为 “tdebug”。

其中瑞士的国家代码为 SWI ,两个省编号分别为 3 和 151,即Hearts of Iron IVhistorystates中的编号文件

以Hearts of Iron IVhistorystates3-Switzerland.txt为例

state={
        id=3                                           #省份编号
        name="STATE_3"
        
        manpower = 88888888                #省份内人力
        state_category = megalopolis       #省大小:大都市,可能涉及建设槽数
        resources={                                #资源
                oil=888                               #油
                aluminium = 888                 #铝
                rubber = 888                       #合成橡胶
                tungsten = 888                    #钨
                steel = 888                         #钢
                chromium = 888                 #铬
        }


        history={
                owner = SWI                     #目前所属国家
                add_core_of = SWI            #拥有核心的国家
                #add_core_of = GER         #可以如此添加瑞士和德国的核心
                buildings = {                      #建筑,下述皆为最大值
                        infrastructure = 10      #基础设施
                        air_base = 10             #空军基地
                        anti_air_building = 5     #防空炮
                        radar_station = 6         #雷达
                        arms_factory = 15         #军用工厂
                        industrial_complex = 15   #民用工厂
                        
                        636 = { bunker = 10 }         #给省份添加要塞
                        #636 = {                            #瑞士没有海岸线,所以无需添加另外两个
                        #        bunker = 10              #要塞
                        #        naval_base = 10        #海军基地
                        #        coastal_bunker = 10   #海岸炮
                        #}  
                        3612 = { bunker = 10 }
                        6666 = { bunker = 10 }
                        6683 = { bunker = 10 }
                        9587 = { bunker = 10 }
                        9618 = { bunker = 10 }
                        9620 = { bunker = 10 }
                        9622 = { bunker = 10 }
                        9638 = { bunker = 10 }
                        11590 = { bunker = 10 }
                        11604 = { bunker = 10 }
                }
                victory_points = { 9620 88 }           #胜利点地区及胜利点数
                #victory_points = { 3612 88 }         #可如此在一个省添加多个胜利点,推荐不添加,只改数值
        }


        provinces={         #省份下辖的地区,建筑中的数值即根据此
                636 3612 6666 6683 9587 9618 9620 9622 9638 11590 11604 13124 
        }
}

国家相关

+

以Hearts of Iron IVhistorycountriesSWI - Switzerland.txt为例

apital = 3                #国家首都省份
oob = "SWI_1936"
add_political_power = 2000                #开局政治点数
set_research_slots = 8                        #开局研究槽数
set_convoys = 888888                        #开局运输船数
set_national_unity = 1                        #开局国家凝聚力

set_technology = {                                #本级所属为已研究的科技,实在太长,仅举例,其它我放附录供大家下载复制
        ##############START##############
        #########infantry_folder#########步兵科技
        infantry_weapons = 1
        infantry_weapons1 = 1
        。。。。。。
        ##############END################
}

1939.1.1 = { #此为1939年开局的属性,不用修改 }

set_politics = {                #政党设置
        parties = {
                democratic = { popularity = 0 }#民主主义
                fascism = {        popularity = 100 }#法西斯,支持率,三个政党支持率和为100
                communism = { popularity = 0 }#共产主义
        }
        ruling_party = fascism                        #执政党,如此,瑞士不再是中立,瑞士变为“瑞士皇家邦联”
        last_election = "1935.10.27"        #最近的选举日期
        election_frequency = 48                        #选举周期
        elections_allowed = no                        #无选举,可改为“yes”
}

1939.1.1 = { #此为1939年开局的属性,不用修改 }

add_ideas = { limited_conscription }        #增加理念,限制贸易,自带的,无需修改

create_country_leader = {                #以下4个为各执政党领袖头像,推荐用我这个
        name = "Federal Council"
        desc = "POLITICS_FEDERAL_COUNCIL_DESC"
        picture = "Portrait_Switzerland_Federal_council.dds"
        expire = "1965.1.1"
        ideology = conservatism                        #保守主义,好像瑞士独有
        traits = { }
}
create_country_leader = {
        name = "Ernest Béuin"
        desc = "POLITICS_ERNST_BEGUIN_DESC"
        picture = "gfx/leaders/Europe/Portrait_Europe_Generic_2.dds"
        expire = "1965.1.1"
        ideology = centrism                                #中立
        traits = { }
}
create_country_leader = {
        name = "Dr. Max Leo Keller"
        desc = "POLITICS_MAX_LEO_KELLER_DESC"
        picture = "gfx/leaders/Europe/Portrait_Europe_Generic_3.dds" 
        expire = "1965.1.1"
        ideology = nazism                                #纳粹
        traits = { dictator }                        #独裁者特性
}
create_country_leader = {
        name = "Fritz Platten"
        desc = "POLITICS_FRITZ_PLATTEN_DESC"
        picture = "gfx/leaders/Europe/Portrait_Europe_Generic_1.dds"
        expire = "1965.1.1"
        ideology = marxism                                #马克思主义
        traits = { }
}
#因为只有8个头像,所以我就创建了5位陆军将领 + 3位海军将领
create_corps_commander = {                        #创建陆军元帅
        name = "SWI.George S.Patton"        #乔治·巴顿
        portrait_path = "gfx/leaders/Europe/Portrait_Europe_Generic_land_1.dds"
        traits = {                                                 #元帅属性(全)
                trickster                         winter_specialist         trait_engineer         fortress_buster 
                panzer_leader                 commando                         desert_fox                 swamp_fox 
                trait_mountaineer         hill_fighter                 jungle_rat                 urban_assault_specialist 
                ranger 
        }
        skill = 8                                                #技能等级,最大为9,推荐8
}

create_field_marshal = {                                        #下4同,创建陆军上将
        name = "SWI.Gerd von Rundstedt"                          #冯·龙德施泰德
        portrait_path = "gfx/leaders/Europe/Portrait_Europe_Generic_land_2.dds"
        traits = {                                                            #上将技能(全)
                logistics_wizard         offensive_doctrine                 defensive_doctrine                 fast_planner 
                thorough_planner         organisational_leader         inspirational_leader 
        }
        skill = 8
}
create_corps_commander = {
        name = "SWI.Erwin Rommel"                                    #埃尔温·隆美尔
        portrait_path = "gfx/leaders/Europe/Portrait_Europe_Generic_land_3.dds"
        traits = { 
                trickster                         winter_specialist         trait_engineer         fortress_buster 
                panzer_leader                 commando                         desert_fox                 swamp_fox 
                trait_mountaineer         hill_fighter                 jungle_rat                 urban_assault_specialist 
                ranger 
        }
        skill = 8
}
create_corps_commander = {
        name = "SWI.Heinz Wilhelm Guderian"                #海因茨·威廉·古德里安
        portrait_path = "gfx/leaders/Europe/Portrait_Europe_Generic_land_4.dds"
        traits = { 
                trickster                         winter_specialist         trait_engineer         fortress_buster 
                panzer_leader                 commando                         desert_fox                 swamp_fox 
                trait_mountaineer         hill_fighter                 jungle_rat                 urban_assault_specialist 
                ranger 
        }
        skill = 8
}
create_corps_commander = {
        name = "SWI.Erich Von Manstein"                          #埃里希·冯·曼施泰因
        portrait_path = "gfx/leaders/Europe/Portrait_Europe_Generic_land_5.dds"        
        traits = { 
                trickster                         winter_specialist         trait_engineer         fortress_buster 
                panzer_leader                 commando                         desert_fox                 swamp_fox 
                trait_mountaineer         hill_fighter                 jungle_rat                 urban_assault_specialist 
                ranger 
        }
        skill = 8
}

create_navy_leader = {                                 #创建海军上将
        name = "SWI.Karl D?nitz"                #卡尔·邓尼茨
        portrait_path = "gfx/leaders/Europe/Portrait_Europe_Generic_navy_1.dds"
        traits = {                                    #海军技能(全)
                blockade_runner                seawolf                superior_tactician                 spotter 
                fly_swatter                        ironside        air_controller 
        }
        skill = 8
}
create_navy_leader = {
        name = "SWI.Chester W. Nimitz"          #切斯特·威廉·尼米兹
        portrait_path = "gfx/leaders/Europe/Portrait_Europe_Generic_navy_2.dds"
        traits = { 
                blockade_runner                seawolf                superior_tactician                 spotter 
                fly_swatter                        ironside        air_controller 
        }
        skill = 8
}
create_navy_leader = {
        name = "SWI.William Halsey, Jr. "       #小威廉·弗雷德里克·哈尔西
        portrait_path = "gfx/leaders/Europe/Portrait_Europe_Generic_navy_3.dds"
        traits = { 
                blockade_runner                seawolf                superior_tactician                 spotter 
                fly_swatter                        ironside        air_controller 
        }
        skill = 8
}


科技相关

+

科技我改了现代坦克四件套和喷气式截击机III型,需要配合国家修改里的开局科技使用

因为科技文件很长,所以我只将修改的科技列出,诸君找到,替换即可

现代坦克科技:Hearts of Iron IVcommontechnologiesarmor.txt

main_battle_tank = { #E-50
                enable_equipments = { modern_tank_equipment_1 }        #允许生产的装备
                research_cost = 24                #研究基础天数 24*100
                start_year = 2012                #科技超前年数,有很高的研究惩罚
                folder = { 。。。}      #无需更改
                sub_technologies = { 。。。}        #无需更改
                ai_will_do = { factor = 0 }                #电脑研究可能性,此为猜的,不确定
                categories = { 。。。}        #无需更改
        }
        modern_td = {                #与上相同
                enable_equipments = { modern_tank_destroyer_equipment_1 }
                research_cost = 24
                start_year = 2012
                ai_will_do = { factor = 0 }
                categories = { armor }
        }
        modern_art = {                #与上相同
                enable_equipments = { modern_tank_artillery_equipment_1 }
                research_cost = 24
                start_year = 2012
                ai_will_do = { factor = 0 }
                categories = { armor }
        }
        modern_spaa = {             #与上相同
                enable_equipments = { modern_tank_aa_equipment_1 }
                research_cost = 24
                start_year = 2012
                ai_will_do = { factor = 0 }
                categories = { armor }
                
                ########################################################
                #####以下为开局变量修正,本来是放在static_modifiers.txt文件中,我是放在这里的######
                ###################注释里的值忽略即可,我有些懒,只看中文############
                #国家
                political_power_factor = 4                #政治力量 +500%
                justify_war_goal_time = -4      #宣战理由合法化时间 -50%
                research_time_factor = -8      #研究时间 -100%
                #工业
                industrial_capacity_factory = 8                  #工厂产出 +250% (Factory Output)
                production_factory_max_efficiency_factor = 8     #工厂最大产能 +250%
                production_factory_efficiency_gain_factor = 8    #工厂产能增加度 +250%
                line_change_production_efficiency_factor = 8     #换线产能维持度 +250%
                industry_air_damage_factor = -4                                         #工厂受轰炸易损性 -
                consumer_goods_factor = -4                       #消费品需求 -50% (连动民间工厂可用数)
                #陆军
                dig_in_speed_factor = 8                                 #堑壕加固速度 +100%
                enemy_army_bonus_air_superiority_factor = -1        #敌方制空影响 -50% (地面部队遭受较少空对地伤害)
                winter_attrition_factor = -1                          #冬天损耗加成 -50%
                out_of_supply_factor = -1                            #缺乏补给惩罚 -50%
                occupation_cost = -1                                #佔领速度 -50%
                org_loss_when_moving = -1                           #移动时组织度耗损 -50%
                #海军
                naval_strike = 8                                 #海军对舰攻击 +100%
                naval_hit_chance = 8                                   #海军命中率 +100%
                naval_speed_factor = 8                                 #海军航速 +100%
                naval_detection = 8                             #海军侦测能力 +100%
                navy_max_range_factor = 8                              #海军最大航程 +100%
                navy_submarine_detection_factor = 8                 #对潜侦测能力 +100%
                navy_anti_air_attack_factor = 8                        #海军对空迎击能力 +100%
                sortie_efficiency = 8                           #航母舰载机出动架次效率 +100%
                carrier_traffic = 8                             #航母空中交管效率 +100%
                amphibious_invasion = 8                         #两栖登陆速度 +100%
                amphibious_invasion_defence = 8                 #两栖登陆防御 +100%
                naval_invasion_capacity = 8                     #登陆作战上限 +100
                invasion_preparation = -4                        #登陆准备时间 -50%
                #空军
                air_detection = 1                               #空军索敌能力 +100%
                air_mission_efficiency = 1                      #空军任务执行效率 +100%
                air_ace_generation_chance_factor = 8              #空战王牌生成率 +100%
                air_bombing_targetting = 1                             #飞机轰炸准度 +100%
                naval_strike_targetting_factor = 1              #飞机对舰攻击准度 +100%
                air_superiority_detect_factor = 1               #空优任务索敌效率 +100%
                air_superiority_efficiency = 1                  #空优任务效率 +100%
                army_bonus_air_superiority_factor = 1                #制空对地面部队加成 +100%
                air_night_penalty = -1                            #空军夜间飞行惩罚 -50%
                air_weather_penalty = -1                         #空军恶劣天气影响 -50%
                #经验值
                experience_gain_factor = 8                         #将领经验获取加成 +500% (影响特性获取率)
                experience_gain_army_unit_factor = 8        #陆军单位经验获取 +250%
                experience_gain_navy_unit_factor = 8        #海军单位经验获取 +250%
                experience_gain_air_unit_factor = 8         #海军单位经验获取 +250%
                experience_gain_army = 25                        #陆军每日经验获取 +100
                experience_gain_navy = 25                         #海军每日经验获取 +100
                experience_gain_air = 25                        #空军每日经验获取 +100
                #颠覆活动
                enemy_partisan_effect = -4                  #地区反抗组织影响 -50% (影响反抗度)
                foreign_subversive_activites = -4                #国际颠覆活动效率 -50% (对我方影响)
                local_intel_to_enemies = -4                  #地区情报被获取率 -50% (影响反抗度)
                local_factory_sabotage = -4                  #地区建筑被破坏率 -50% (影响反抗度)
                #世界紧张局势
                generate_wargoal_tension = -0.88        #製造宣战目的所需世界紧张局势 -50%
                guarantee_tension = -0.88                     #保证独立所需世界紧张局势 -50%
                join_faction_tension = -0.88                  #加入阵营所需世界紧张局势 -50%
                send_volunteers_tension = -0.88         #派遣志愿军所需世界紧张局势 -50%
                lend_lease_tension = -0.88                    #租借所需世界紧张局势 -50%
        }

喷气式截击机III科技:

Hearts of Iron IVcommontechnologieselectronic_mechanical_engineering

       advanced_rocket_engines = {

                show_equipment_icon = yes
                enable_equipments = {。。。}        #无需更改
                research_cost = 24                #与上相同
                start_year = 2012                #与上相同
                folder = {。。。}        #无需更改
                ai_will_do = { factor = 0 }                #与上相同
                categories = {。。。} #无需更改
        }

兵种相关

+

喷气式截击机III型:Hearts of Iron IVcommonunitsair.txt

 rocket_interceptor = {            #此处主要修改飞机的type,包含了6大亦或7大属性,制空、轰炸、运输等
                sprite = light_plane
                priority = 1
                active = yes
                type = {  cas  fighter  interceptor  tactical_bomber  air_transport  strategic_bomber  naval_bomber  }      
                need = { rocket_interceptor_equipment = 1 }
        }

现代坦克:Hearts of Iron IVcommonunitsmodern_armor.txt

 modern_armor = {
                sprite = "medium_armor"
                map_icon_category = armored
                priority = 2510
                active = yes
                type = {armor}
                group = armor
                categories = {
                        category_tanks
                        category_front_line
                        category_all_armor
                        category_army
                }
                #######此处向下四种坦克我设置的都一样,诸君看着修改即可,我直接省略了#####
                need = {modern_tank_equipment = 100        }  #需要的装备数,这个随意
                combat_width = 0.25         #战斗宽度
                
                #Size Definitions
                manpower = 1000                        #需要的人力,我组的是8000人一直,每种坦克2个
                max_organisation = 2048        #最大组织度
                max_strength = 256                #最大HP
                default_morale = 256        #恢复速度(组织度)
                training_time = 1                #训练时间,1天集训玩
                
                #Misc Abilities
                weight = 0.25                                #运输重量
                supply_consumption = 0.01        #补给消耗
                can_be_parachuted = yes                #是否可空投
                
                #Offensive Abilities
                suppression = 256                        #镇压能力
                
                # Important Ability
                entrenchment = 32                        #堑壕        
                recon = 256                        #侦查能力
                casualty_trickleback = 1        #伤兵复原
                experience_loss_factor = -1        #经验损失
                initiative = 1                                #主动性
                reliability_factor = 1                #可靠性
                
                forest = {                        #地形影响,下同
                    movement = 1        #移动
                        attack = 1                #攻击
                        defence = 1                #防御
                }
                hills =         {
                    movement = 1
                        attack = 1
                        defence = 1
                }
                mountain =         {
                    movement = 1
                        attack = 1
                        defence = 1
                }
                jungle = {
                    movement = 1
                        attack = 1
                        defence = 1
                }
                marsh = {
                    movement = 1
                        attack = 1
                        defence = 1
                }
                plains = {
                        movement = 1
                        attack = 1
                        defence = 1
                }
                desert = {
                        movement = 1
                        attack = 1
                        defence = 1
                }
                urban = {
                        movement = 1
                        attack = 1
                        defence = 1
                }
                fort = {
                        movement = 1
                        attack = 1
                        defence = 1
                }
                river = { 
                        movement = 1
                        attack = 1
                        defence = 1
                }
                amphibious = { 
                        movement = 1
                        attack = 1
                        defence = 1
                }
        }
}

现代自行火炮:Hearts of Iron IVcommonunitssp_artillery_brigade.txt中 modern_sp_artillery_brigade = {}里,修改方法与上同

现代自行防空炮:Hearts of Iron IVsp_anti-air_brigade.txt 中 modern_sp_anti_air_brigade = {}里,修改方法与上同

现代自行反坦克炮:Hearts of Iron IVcommonunitstank_destroyer_brigade.txt中 modern_tank_destroyer_brigade = {}里,修改方法与上同

装备相关

+

喷气式截击机III型: 

Hearts of Iron IVcommonunitsequipmentsingle_engine_airframe.txt中 rocket_interceptor_equipment_3 = {}里

		# Advanced Rocket Interceptor
        rocket_interceptor_equipment_3 = {
                archetype = rocket_interceptor_equipment        #属性继承于。。无需更改
                parent = rocket_interceptor_equipment_2                #上一级科技树。。无需更改
                priority = 80                                #优先权,无需更改
                type = air_transport                 #无需更改
                sprite = medium_plane                #个人喜好,感觉中型比较中庸
                carrier_capable = yes                #可以做运输机,不确定,请添上
                
                manpower = 10                #花费人力,随意
                # Transport
                interface_overview_category_index = 256        #不清楚作用,推荐加上,可能为运输基数的倍率
                air_range = 240000                        #作战半径
                maximum_speed = 10000                #最大速度
                air_defence = 256                        #空中防御
                air_attack = 256                        #对空攻击
                air_agility = 256                        机动
                air_superiority = 256                #空优,个人理解为1架相当于256架,推荐改小
                naval_strike_attack = 256        #对海攻击
                naval_strike_targetting = 256        #对海瞄准
                air_bombing = 256                        #战略轰炸
                air_ground_attack = 256                #对地攻击
                reliability = 8                                #可靠性800%
                build_cost_ic = 1                        #建造花费
                resources = {                                #生产资源,随意
                        aluminium = 1
                        tungsten = 1
                        rubber = 1
                }
        }

现代坦克:

Hearts of Iron IVcommonunitsequipmenttank_modern.txt中 modern_tank_equipment = {}里

 modern_tank_equipment = {
                is_archetype = yes
                is_buildable = no
                type = armor
                group_by = archetype
                interface_category = interface_category_armor
                upgrades = {
                        tank_reliability_upgrade
                        tank_engine_upgrade
                        tank_armor_upgrade
                        tank_gun_upgrade
                }
                
                ########以上无需更改,以下四种坦克一样#########
                #Misc Abilities
                maximum_speed = 256                #最大速度
                reliability = 1                        #可靠性
                
                #Defensive Abilities
                defense = 256                        #防御
                breakthrough = 256                #突破
                hardness = 1                        #装甲率
                armor_value = 2048                #装甲厚度

                #Offensive Abilities
                soft_attack = 256                #人员杀伤
                hard_attack = 256                #装甲杀伤
                ap_attack = 2048                #穿甲深度
                air_attack = 256                #对空攻击

                #Space taken in convoy
                lend_lease_cost = 0.01        #运输需求
                
                build_cost_ic = 1                #建造花费
                resources = {                        #生产资源,随意
                        oil = 1                                
                        steel = 1
                        chromium = 1
                }
        }

现代自行火炮:Hearts of Iron IVcommonunitsequipmenttank_modern.txt中 modern_tank_artillery_equipment_1 = {},修改方法与上同

现代自行防空炮:Hearts of Iron IVcommonunitsequipmenttank_modern.txt中 modern_tank_aa_equipment = {}里,修改方法与上同

现代自行反坦克炮:Hearts of Iron IVcommonunitsequipmenttank_modern.txt中 modern_tank_destroyer_equipment_1 = {}里,修改方法与上同