灾难是EU4在1.9版本引入的全新系统,用于取代之前用于模拟国家灾难的MTTH事件。
灾难文件
首先要在 /Europa Universalis IV/common/disasters下创建一个新文件。这里以发生在新世界的瘟疫举例:
第一行写上灾难名称:
influenza_epidemic = { }
其他内容都在这个大括号内进行描述。
接下来是对其潜在条件的描述。注意,这只是决定它是否会显示在玩家的“稳定与扩张”界面中(图标仍然是灰色),而非令其进度增加的条件。这里的编写同决议与事件基本一致。
potential = { NOT = { has_country_flag = had_influenza_epidemic } OR = { technology_group = north_american technology_group = mesoamerican technology_group = andean technology_group = south_american } any_country = { technology_group = western has_discovered = ROOT } }
本例中,灾难的潜在条件即是:本国未发生过此灾难、新世界科技组、有西方科技组的国家发现本国。
接下来定义在满足潜在条件后,什么条件可以开启本灾难。满足本条件,并且进度实际增长时,就会在用户界面中弹出红色的警告旗帜。
can_start = { has_any_disaster = no is_year = 1500 }
1.10后,你可以定义什么时候本灾难的进程会中止。本例中,如果本国爆发另一个灾难时,本灾难的进度就会停止。
can_stop = { has_any_disaster = yes }
接下来定义让灾难进度月度增加的条件:
progress = { modifier = { factor = 1 any_country = { technology_group = western has_discovered = ROOT } } modifier = { factor = 2 any_neighbor_country = { technology_group = western } } modifier = { factor = 1 any_neighbor_country = { OR = { has_country_flag = had_influenza_epidemic has_disaster = influenza_epidemic } } } }
这里,如果有西方科技组的国家发现本国,那么它的进度每月+1,如果它与本国相邻,额外+2,如果本国与发生过瘟疫,或者正在发生瘟疫的国家接壤,也会额外+1。
接下来定义让已经爆发的灾难结束的条件:
can_end = { had_country_flag = { flag = flu_epidemic days = 3650 } stability = 2 }
本例中,这个国家必须要拥有某个事件flag10年,且稳定度为+2,灾难才可能结束。
这里定义灾难为国家提供的修正:
modifier = { global_unrest = 3 stability_cost_modifier = 0.5 }
然后定义灾难开启时的事件(一般有一个直接的负面效果,以及一个flag的设定,用于判断何时结束),和结束时的事件(一般给一个正面效果,同时如果不希望它再度发生的话,也要给一个flag用作标记)。
on_start = epidemic.1 on_end = epidemic.2
这里,epidimic.1中给的flag就是flu_epidemic,epidimic.2中的是had_influenza_epidemic。
1.26后,你可以定义灾难开启时的效果。在本例中,附加了一段文本custom_tooltip。
on_start_effect = { custom_tooltip = epidemic_tooltip }
最后决定月度事件的发生:
on_monthly = { events = { } random_events = { 1000 = 0 100 = epidemic.3 100 = epidemic.4 } }
"events" 中的事件会在每月周期中都会触发,而"random_events"中的随机事件何时触发,取决于列表中给每个事件的权重:这里,有5/6的概率不发生事件,发生两个事件的概率各为1/12。 0
本地化
你需要对灾难的名称和描述本地化,也不要忘记相关事件。
influenza_epidemic: "瘟疫爆发" desc_influenza_epidemic: "本国正在遭受白皮恶魔从海洋另一边带来的可怕瘟疫。"
图标
灾难图标的位置在/Europa Universalis IV/gfx/interface/disasters。一个图标文件内要做三个版本的图标:进度增长时的彩色标志、爆发后,带有火光的标志,以及潜在灾难的灰色标志。
最后在/Europa Universalis IV/interface/countrystabilityview.gfx添加如下文字(使用np++打开),以让你的图标出现在稳定与扩张界面中。
spriteType = { name = "GFX_disaster_influenza_epidemic" texturefile = "gfx//interface//disasters//influenza_epidemic.dds" noOfFrames = 3 loadType = "INGAME" }
现在,你已经完成了灾难的制作。
参考资料
灾难代码整理
保留了灾难的前提条件。
castilian_civil_war = { potential = { tag = CAS NOT = { has_country_flag = had_cas_civil_war } is_free_or_tributary_trigger = yes exists = ARA exists = POR ARA = { is_free_or_tributary_trigger = yes } POR = { is_free_or_tributary_trigger = yes } government = monarchy normal_or_historical_nations = yes uses_doom = no } } civil_war = { potential = { num_of_cities = 5 any_owned_province = { base_tax = 5 is_capital = no } government = monarchy is_free_or_tributary_trigger = yes uses_doom = no NOT = { has_country_flag = had_civil_war } } } counts_feud = { potential = { tag = DAN government = monarchy normal_or_historical_nations = yes is_free_or_tributary_trigger = yes uses_doom = no NOT = { has_country_flag = had_counts_feud } } } court_and_country = { potential = { NOT = { has_country_flag = had_court_and_country } is_free_or_tributary_trigger = yes current_age = age_of_absolutism num_of_cities = 8 } } empire_of_china_in_name = { potential = { NOT = { has_country_flag = had_empire_of_china_culture_disaster } is_emperor_of_china = yes has_dlc = "Mandate of Heaven" NOT = { culture_group = east_asian } } } empire_of_china_nomadic_border = { potential = { has_dlc = "Mandate of Heaven" is_emperor_of_china = yes } } english_civil_war = { potential = { OR = { AND = { tag = ENG NOT = { exists = GBR } } tag = GBR } NOT = { has_country_flag = eng_civil_war_happened } has_reform = english_monarchy is_free_or_tributary_trigger = yes is_lesser_in_union = no british_isles_region = { owned_by = ROOT } normal_or_historical_nations = yes } } estate_brahmins_disaster = { potential = { has_dlc = "Dharma" has_estate = estate_brahmins estate_influence = { estate = estate_brahmins influence = 80 } } } estate_burghers_disaster = { potential = { has_estate = estate_burghers estate_influence = { estate = estate_burghers influence = 80 } } } estate_church_disaster = { potential = { has_estate = estate_church estate_influence = { estate = estate_church influence = 80 } } } estate_cossacks_disaster = { potential = { has_estate = estate_cossacks estate_influence = { estate = estate_cossacks influence = 80 } OR = { NOT = { has_country_flag = cossack_estate_triggered } had_country_flag = { flag = cossack_estate_triggered days = 365 } } } } estate_dhimmi_disaster = { potential = { has_estate = estate_dhimmi estate_influence = { estate = estate_dhimmi influence = 80 } OR = { NOT = { has_country_flag = dhimmi_estate_triggered } had_country_flag = { flag = dhimmi_estate_triggered days = 365 } } } } estate_jains_disaster = { potential = { has_dlc = "Dharma" has_estate = estate_jains estate_influence = { estate = estate_jains influence = 80 } } } estate_maratha_disaster = { potential = { has_dlc = "Dharma" has_estate = estate_maratha estate_influence = { estate = estate_maratha influence = 80 } OR = { NOT = { has_country_flag = estate_maratha_triggered } had_country_flag = { flag = estate_maratha_triggered days = 365 } } } } estate_nobility_disaster = { potential = { has_estate = estate_nobles estate_influence = { estate = estate_nobles influence = 80 } } } estate_nomadic_tribes_disaster = { potential = { has_estate = estate_nomadic_tribes estate_influence = { estate = estate_nomadic_tribes influence = 80 } } } estate_rajput_disaster = { potential = { has_dlc = "Dharma" has_estate = estate_rajput estate_influence = { estate = estate_rajput influence = 80 } OR = { NOT = { has_country_flag = estate_rajput_triggered } had_country_flag = { flag = estate_rajput_triggered days = 365 } } } } estate_vaisyas_disaster = { potential = { has_dlc = "Dharma" has_estate = estate_vaisyas estate_influence = { estate = estate_vaisyas influence = 80 } } } french_revolution = { potential = { NOT = { has_country_flag = had_revolution } tag = FRA is_free_or_tributary_trigger = yes uses_doom = no NOT = { revolution_target_exists = yes } government = monarchy NOT = { has_reform = celestial_empire } normal_or_historical_nations = yes } } french_wars_of_religion = { potential = { tag = FRA religion_group = christian NOT = { has_country_flag = had_religious_turmoil } NOT = { has_country_flag = FRA_wars_of_religion_ended } OR = { religion = catholic religion = protestant religion = reformed } is_force_converted = no normal_or_historical_nations = yes } } granada_succession_war = { potential = { OR = { tag = GRA tag = ADU } NOT = { has_country_flag = had_granada_succession_war } num_of_cities = 2 any_owned_province = { is_capital = no is_core = ROOT } government = monarchy is_free_or_tributary_trigger = yes uses_doom = no normal_or_historical_nations = yes NOT = { is_year = 1455 } } } internal_conflicts = { potential = { num_of_cities = 10 is_free_or_tributary_trigger = yes uses_doom = no NOT = { has_country_flag = had_internal_conflicts } is_year = 1500 } } janissary_decadence = { potential = { normal_or_historical_nations = yes has_reform = ottoman_government NOT = { has_country_flag = had_janissary_decadence } } } aspiration_for_liberty = { potential = { NOT = { has_country_flag = had_liberalism } NOT = { current_size_of_parliament = 1 } uses_doom = no num_of_cities = 5 current_age = age_of_revolutions is_free_or_tributary_trigger = yes NOT = { has_reform = revolutionary_republic_reform } NOT = { has_reform = revolutionary_empire_reform } } } ming_crisis = { potential = { tag = MNG NOT = { has_country_flag = ming_crisis_happened } normal_or_historical_nations = yes } } peasant_war = { potential = { OR = { government = monarchy government = theocracy } NOT = { has_reform = celestial_empire } NOT = { has_reform = steppe_horde } uses_doom = no is_free_or_tributary_trigger = yes num_of_cities = 5 NOT = { has_country_flag = had_peasant_war } current_age = age_of_discovery } } religious_turmoil = { potential = { religion_group = christian current_age = age_of_reformation is_free_or_tributary_trigger = yes NOT = { has_country_flag = had_religious_turmoil } OR = { religion = catholic religion = protestant religion = reformed } is_religion_enabled = protestant NOT = { tag = FRA } NOT = { has_country_modifier = counter_reformation } is_force_converted = no } } revolution = { potential = { NOT = { has_country_flag = had_revolution } NOT = { tag = PAP } NOT = { tag = FRA } NOT = { has_reform = celestial_empire } is_free_or_tributary_trigger = yes uses_doom = no capital_scope = { continent = europe } num_of_cities = 30 NOT = { revolution_target_exists = yes } current_age = age_of_revolutions } } the_dacke_feud = { potential = { tag = SWE normal_or_historical_nations = yes is_free_or_tributary_trigger = yes uses_doom = no NOT = { has_country_flag = had_the_dacke_feud } any_owned_province = { OR = { area = norrland_area area = svealand_area area = ostra_svealand_area area = gotaland_area area = vastra_gotaland_area area = skaneland_area } } } } time_of_troubles = { potential = { NOT = { has_country_flag = time_of_troubles } is_free_or_tributary_trigger = yes OR = { AND = { tag = MOS NOT = { exists = RUS } } tag = RUS } normal_or_historical_nations = yes } } war_of_the_roses = { potential = { tag = ENG normal_or_historical_nations = yes government = monarchy is_free_or_tributary_trigger = yes uses_doom = no NOT = { has_country_flag = had_war_of_the_roses } } }
文档 | 效果指令 • 触发条件 • 修正 • 作用域 • 变量 • 本地化 • 可定制的本地化 |
脚本 | 顾问 • 时代 • 书签 • 建筑 • 宣战理由 • 殖民区域 • 新建国家 • 文化 • 决议 • 定义 • 外交行动 • 灾难 • 阶层• 事件 • 派系 • 政府 • 政府互动(1.35) • 伟大工程 • 历史 • 理念组 • 思潮 • 任务树 • 修正 • 自定义国家 • 政策 • 宗教 • 叛军 • 附属国类型 • 科技 • 贸易公司 • 商品 • 单位 • 旗舰 |
地图 | 地图 • Map Modding Quick Reference• 随机新世界 • 贸易节点 |
图形 | 3D模型 • 界面 • 贴图库 • 字体 • 粒子特效 • 着色器 • 兵模 |
音频 | 音乐 • 音效 |
其它 | 控制台指令 • 校验码 • JoroDox模组制作工具 • Mod文件结构 • Mod错误调试 • 验证器 • 运行文件 |
教程 | 添加省份 • 成就修改 • On actions • 模组制作 |