災難修改
災難是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: "本國正在遭受白皮惡魔從海洋另一邊帶來的可怕瘟疫。"
圖標
v1.25
災難圖標的位置在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 }
}
}
