Government modding

本頁面部分全部內容上次核對於3.0版本

The following guide contains information related to modding empire's government and things contained inside related folder.

Governments[編輯 | 編輯原始碼]

Governments are automatically picked based on various factors for a flavor. They have few actual effects on gameplay. Vanilla uses civics, authorities and ethics to determine it. Governments are defined at "common/governments/xxx.txt".

Data Structure[編輯 | 編輯原始碼]

Property Description
ruler_title
ruler_title_female
Localisation keys to determine the ruler title, such as "President" or "King". If the female title is undefined, the title will never differ by gender.
heir_title
heir_title_female
Localisation keys to determine the heir title, such as "Prince". If the female title is undefined, the title will never differ by gender.
use_regnal_names = <yes/no> If yes, the auto-generated ruler names will use regnal last names if the namelist of this species defined any.
dynastic_last_names = <yes/no> If yes, the heirs will inherit the last word of the ruler's name for a last name. For example, a King named "Ohma Zi-O" may have an heir named "Grand Zi-O".
should_force_rename - <yes/no> Force the empire that reformed into this government to randomize its empire name. AI only.
possible A block of Conditions to determine if this government type can be applied to an empire. (Country scope)
weight If an empire is eligible to multiple government types, one with the highest weight wins. Common government forms like Military Dictatorship should have lower weight than specific government forms like Blood Court.
leader_class = <governor/scientist/admiral/general> If the first ruler of the empire is elected out, that ruler will become a leader of specified class, rather than just disappear. Electoral governments only.
election_candidates A section to specify who should and how likely they should participate the ruler election. Not required; if not specified, all leaders can participate. Electoral governments only.

Vanilla governments usually give the current ruler 100 weight and give weight to certain leader classes depending on the government itself, like Militarist governments usually allow only Admirals and Generals and Materialist governments usually allow only Scientists.

Empire Random Names[編輯 | 編輯原始碼]

All vanilla empire random names are directly linked to Government Types, meaning that new random names must be defined for the new government types, or the randomly generated AI empires using your new government will NOT receive a name and the game might crash.

Empire random names are defined at "common/random_names/xxx.txt".

Authorities[編輯 | 編輯原始碼]

An Authority is how the empire distribute the internal political powers. An empire can only have one Authority. Authorities are defined at "common/governments/authorities/xxx.txt".

Data Structure[編輯 | 編輯原始碼]

Property 民主制 Democratic Democratic-like 寡頭制 Oligarchic企業政府 Corporate Oligarchic-like 獨裁制 Dictatorial Dictatorial-like 帝制 Imperial Imperial-like 蜂巢思維 Hive Mind機械智能 Machine Intelligence Immortal Ruler Authorities
playable A block of Conditions executed under global scope to determine should this Authority appear in the GUI. Vanilla game uses this to hide DLC Authorities from being played by people who didn't buy relevant DLC. Since this doesn't affect the AI, it's better to use together with random_weight.
possible A block of Special Requirement Syntax that determines is this Authority compatible. Ethics, country types and species classes can be checked here. If evaluated false, this Authority will be grayed out from the empire creation menu and government reform window. Tooltips is generated only if this statement evaluated false.
random_weight Defines how likely this is to be picked randomly if it's valid.
election_type election_type = democratic

Election candidates will include the current ruler and every faction leader and randomly generated fillers if necessary.

election_type = oligarchic

Election candidates will only include hired leaders.

No.png
re_election_allowed = <yes/no> Vanilla Democratic authority has yes for this field and all other authorities have this field undefined. Allows the current Ruler to run again and possibly be re-elected. No.png
has_heir = <yes/no> No.png has_heir = yes No.png
can_have_emergency_elections = <yes/no>
emergency_election_cost = <int>
No.png can_have_emergency_elections = yes

This empire can initiate an emergency election at a cost of a number of 影響力 Influence 影響力Influence equal to emergency_election_cost.

No.png
max_election_candidates = <int> Vanilla Democratic authority has this undefined, making it to be the fallback -1, which means no limit. Vanilla authorities have 4 for this property, making there to be up to 4 candidates. No.png
election_term_years = <int>
election_term_variance = <int>
Determines how many years between elections. Actual election term is election_term_years +/- election_term_variance. No.png
uses_mandates = <yes/no> Default no.

If an authority has election_type = democratic but doesn't use mandates, this authority doesn't work properly.

See Mandates and Mandate modding for details.

No.png
has_agendas = <yes/no> No.png Default no.

If this is toggled yes while the ruler is some sort of immortal, the empire will then have a permanent Agenda that can't be changed for the rest of the game.

See Agendas and Agenda modding for details.

tags = { xxx yyy zzz } A set of localisation keys to briefingly describe the mechanics and effects of this authority other than modifiers.
country_modifier A block of Modifiers to be applied to the Empire.
traits = { trait_xxx trait_yyy } A list of species trait keys to be added to the primary species of this empire. In the empire creation menu, these traits can't be removed, but more can be added if there is enough trait points and trait picks. Government reforming doesn't add or remove these traits.
can_reform = <yes/no> Default yes. If no, empires can't reform into/out of this authority.
has_factions = <yes/no> Default yes. If no, this Empire can't have factions. However, vanilla factions also exclude the ethic 格式塔意識 Gestalt Consciousness 格式塔意識Gestalt Consciousness, making it unclear will this property do what it says.
valid_for_released_vassal = <yes/no> Default yes. If no, a released vessal will never pick this Authority.
localization_postfix If specified as "_popopopo", a localisation key called "locacacaca" will be translated into "locacacaca_popopopo".
l_english:
 locacacaca:0 "How can you be sure that you are not just an advanced chatbot?"
 locacacaca_popopopo:0 "I AM ADVANCED CHATBOT YOU LOSE"

If there is somewhere that should display the former, it will now display the later.

Other effects an Authority might also have, such as immortal rulers, are heavily integrated into other vanilla files as well as events. Use has_authority = auth_xxx to check the Authority of an Empire.

Civics and Origins市政與起源[編輯 | 編輯原始碼]

Civics are additional bonuses to the government of variable effects, some can even affect the playstyle. An empire can have any number of Civics (up to 3 if vanilla).

市政是政府的額外獎勵的變量效果,有些甚至可以影響遊戲體驗。理論上一個帝國可以擁有任意數量的市政(原版最多3個)。

Origins are Civics with is_origin = yes statement. Since an empire can only have one origin and it can't be changed mid-game, some of the fields for civics are irrelevant to Origins. Also, they have additional fields.

起源是帶有is_origin=yes語句的文明效果。由於一個帝國只能有一個起源,並且不能在遊戲中途改變,因此市政與起源有一些不同的字段定義。

They are defined at "common/governments/civics/xxx.txt".

它們的定義見 "common/governments/civics/xxx.txt".

Data Structure數據結構[編輯 | 編輯原始碼]

Property特性 Civics市政 Origins起源
is_origin = <yes/no> No.png For obvious reason, this have to be set as is_origin = yes.

如果要製作起源,就要輸入這個代碼 is_origin = yes.

playable A block of Conditions executed under global scope to determine should this Civic or Origin appear in the empire creator and government reforming view. Vanilla uses this to hide DLC contents from being played by people who didn't buy relevant DLC. Since this doesn't affect the AI, it's better to use together with random_weight.

在全局範圍內執行的一組條件,以確定這個市政或起源是否出現在帝國創建者和政府改革的可選範圍內。原版利用這一點來隱藏DLC內容,以免未購買相關DLC的人播放。由於這不會影響AI,因此最好與random_weight一起使用。


icon = <path of dds file> Specifies an icon for this. Default icon path is gfx/interface/icons/governments/civics/xxx.dds.

指定使用圖標,圖標庫的路徑為gfx/interface/icons/governments/civics/xxx.dds.

Vanilla Origins always have this specified.

原版起源總要有這個。

picture = <GFX key> No.png Specifies a picture for this Origin that is shown in empire creation menu.

指定顯示在帝國創建菜單中的此起源的圖片。

starting_colony = <planet class key> Changes the empire's starting colony planet class regardless of the player's choice. This statement doesn't affect climate preference trait.

無論玩家選擇怎樣的星系,都會更改帝國的起始星球。但不影響氣候偏好特徵。

Origins have higher priority than civics.

起源的優先級總比市政高

habitability_preference = <planet class key> Changes the empire's primary species' climate preference trait.

改變了帝國主要物種的氣候偏好特徵。

potential A block of Special Requirement Syntax that determines is this Civic compatible. Incomptible Civics have no effect. If evaluated false, this Civic is hidden from the empire creation menu and government reform window, and if this Civic is already picked, it's rendered invalid without any tooltip. Vanilla use this to hide NPC-only civics and irrelevant civics for/from

一個特殊要求語法,決定這市政是否兼容。不合條件的市政無法起效。如果評估為false,則此市政將從帝國創建菜單和政府改革窗口中隱藏,如果已選中此市政,則在沒有任何工具提示的情況下,它將無效。原版用這個來隱藏NPC專用的市政和無效的市政

蜂巢思維 Hive Mind 蜂巢思維Hive Mind, 機械智能 Machine Intelligence 機械智能Machine Intelligence, and 企業政府 Corporate 企業政府Corporate authorities.

Origins that don't meet the potential requirements will be hidden from the Origin selection view, and if already chosen, the Origin selection will be set to the default origin Prosperous Unification. This field has no effect after the start of the game.

不符合潛在要求的起源將從起源選擇視圖中隱藏,如果已有帝國選擇,其起源選擇將設置為默認起源繁榮統一。這個設置在遊戲開始後沒有任何效果。

possible A block of Special Requirement Syntax that determines is this Civic compatible. Incomptible Civics have no effect. If evaluated false, this Civic is grayed out from the empire creation menu and government reform window. This section will also generate a tooltip to tell the player what's the requirement of this Civic in empire creation menu and government reform window.

一個特殊要求語法,決定這個思域是否兼容。不合條件市政無法起效。如果評估為假,這個市政將在帝國創建菜單和政府改革窗口中灰顯。本節還將生成一個工具提示,告訴玩家這個市政在帝國創建菜單和政府改革窗口中的要求。

Origins that don't meet the possible requirements will still be visible and chosen but such empire design can't be saved. This field has no effect after the start of the game.

不符合要求的起源仍然可以看到和選擇,但這樣的帝國設計無法保存。這個設置在遊戲開始後沒有任何效果。

pickable_at_start = <yes/no> Whether this civic can be selected when you are creating a new empire. If not, it can only be picked by government reforming.

當你正在創建一個新的帝國時,是否可以選擇這個市政。否則,只能通過政府改革來選擇。

No.png
modification = <yes/no> Default yes. If no, an empire can't add or remove this Civic after the start of the game. Used for playstyle restrictive civics like

默認為是。如果沒有,帝國就不能在遊戲開始後添加或刪除這個市政。用於遊戲風格的限制性市政,如 種族潔癖 Fanatic Purifiers 種族潔癖Fanatic Purifiers.

random_weight Defines how likely this is to be picked randomly if it's valid. Civics of stricter requirements tend to have higher random weight. If without this statement, a Civic or Origin will never be randomly selected.

定義在有效的情況下被隨機選取的可能性。要求更嚴格的市政往往具有更高的隨機權重。如果沒有這一設定,市政或起源將永遠不會被隨機選擇。

An Origin of random weight 0 can sometimes still be selected by the AI. A more safe way is to remove the statement entirely.

AI有時仍然可以選擇隨機權重為0的原點。更安全的方法是完全刪除該語句。

modifier A block of Modifiers to be applied to the Empire. If this Civic is considered incompatible, the Modifiers will be ignored.

將應用於帝國的修正。如果這個市政被認為是不兼容的,修正將被忽略。

A block of Modifiers to be applied to the Empire. These will always apply regardless of the Origin requirements.

將應用於帝國的修正。無論原本要求如何,這些都將始終啟用。

description = <localisation key> A localisation key for effects description. This will be displayed before the modifier tooltips.

效果描述的本地化密鑰。這將顯示在修正工具提示之前。

traits = { trait = trait_xxx trait = trait_yyy } A list of species trait keys to be added to the primary species of this empire. In the empire creation menu, these traits can't be removed, but more can be added if there is enough trait points and trait picks. Government reforming doesn't add or remove these traits.

要添加到這個帝國的主要物種中的物種特徵。在帝國創建菜單中,這些特徵不能刪除,但如果有足夠的特徵點和特徵選擇,可以添加更多的特徵。一般政府改革並沒有增加或消除這些特徵。

has_secondary_species This Civic or Origin requires a secondary species. It's unclear what if more than one Civics that require a secondary species is selected at the same time. An Origin with a secondary species will override the secondary species for a Civic.

這個市政或起源需要一個次級物種。目前尚不清楚如果同時選擇一個以上需要次要物種的文明會怎樣。擁有次級物種的起源將凌駕於市政的次級物種之上。

  • title
A localisation key for the title of the secondary species.

次要物種名稱的定位鍵。

協同進化 Syncretic Evolution 協同進化Syncretic Evolution calls it "Syncretic Species".

  • traits = { trait = trait_xxx trait = trait_yyy }
A list of species trait keys to be added to the secondary species. In the empire creation menu, these traits can't be removed, but more can be added if there is enough trait points and trait picks.

要添加到這個帝國的主要物種中的物種特徵。在帝國創建菜單中,這些特徵不能刪除,但如果有足夠的特徵點和特徵選擇,可以添加更多的特徵。

can_build_ruler_ship Default no. If set to yes, this empire can build old-school oversized ships for each ruler. Vanilla unused.

默認否。如果設置為「是」,這個帝國可以為每個統治者建造老式的超大船隻。原版未使用。

No.png
cost How many civic points this will cost. Defaults to 1. Must be a positive integer.

這將花費多少市政點數。默認值為1。必須是正整數。

swap_type An entry that swaps civic name, flavor text and effect tooltip under certain condition.

在特定條件下交換市政名稱、風格文本和效果工具提示的條目。

噬殺蜂群 Devouring Swarm 噬殺蜂群Devouring Swarm uses this to swap into Terravore. Unlike Traditions, the primary modifier block is NOT overwritten and there is NOT any local modifier block of swaps.

  • name = <localistion key>
Changes the name and flavor text of this civic.

更改此市政的名稱和風格文本。

  • description = <localisation key>
Changes the effect tooltip of this civic.

更改此市政的效果工具提示。

  • trigger
A block of Conditions to check if this Civic swap should apply. Vanilla use "local_human_species_class = LITHOID" to swap Devouring Swarm for Lithoids. (Global scope)

觸發器,用於檢查此市政是否應該適用。原版使用「local_human_species_class=LITHOID」將吞噬蜂群換成石質(這個可能指的是石頭人物種的蜂群?)。(全局範圍)

advanced_start No.png Default no. If set to no, the empire can't have advanced starts.

默認否。如果設置為否,則帝國無法進行高級啟動。

preferred_planet_class_neighbor Default yes. If set to no, the guaranteed habitable worlds will not be guaranteed to match the empire's climate preference.

默認為是。如果設置為「否」,那麼保證可居住的世界將無法保證與帝國的氣候偏好相匹配。

non_colonizable_planet_class_neighbor Default no. If set to yes, the empire can't have guaranteed habitable worlds regardless of the galaxy settings.

默認否。如果設置為「是」,那麼無論銀河系的環境如何,帝國都無法保證有適合居住的世界。

initializers = { xxx yyy zzz } A list of keys of solar_system_initializer. The solar system initializer the player picked for this empire in the empire creation menu will be ignored. If specified, the empire won't have guaranteed habitable worlds anyway unless the initializer creates some based on the galaxy settings.


solar_system_initializer的密鑰列表。玩家在帝國創建菜單中為這個帝國選擇的母星系初始設定項將被忽略。如果指定,帝國無論如何都不會保證有適合居住的世界,除非初始化器根據星系設置創建一些。(舉例:生命之籽)

flags = { xxx yyy zzz } This empire will have these country flags set at the start of the game.

這個帝國將在遊戲開始時得到這些flags標記。

Implementions of other effects a Civic might also have, such as diplomatic restrictions, are integrated into other vanilla game files. Use has_valid_civic to check Civics.

市政可能具有的其他效果的實現,例如外交限制,被集成到其他原版遊戲文件中。使用has_valid_civic檢查civic。

Most of the other effects an Origin might also have (for example, starting conditions), are implemented through Events. Use has_origin to check Origins.

起源可能具有的大多數其他影響(例如,啟動條件)都是通過事件實現的。使用has_origin檢查Origins。

Examples舉例[編輯 | 編輯原始碼]

Civics市政[編輯 | 編輯原始碼]

Fanatic Purifiers0
civic_fanatic_purifiers = {
	modification = no
	playable = { host_has_dlc = "Utopia" }
	potential = {
		ethics = { NOT = { value = ethic_gestalt_consciousness } }
		authority = { NOT = { value = auth_corporate } }
	}
	possible = {
		ethics = {
			value = ethic_fanatic_xenophobe
			OR = {
				value = ethic_militarist
				value = ethic_spiritualist
			}
		}
		civics = {
			NOR = {
				value = civic_barbaric_despoilers
			}
		}
		origin = {
			NOR = {
				value = origin_syncretic_evolution
				value = origin_common_ground
				value = origin_hegemon
			}
		}
	}
	random_weight = {
		base = 1000
		modifier = {
			factor = 0
			NOT = { host_has_dlc = "Utopia" }
		}
	}

	description = "civic_tooltip_fanatic_purifiers_effects"
	modifier = {
		ship_fire_rate_mult = 0.33
		army_damage_mult = 0.33
		starbase_shipyard_build_cost_mult = -0.15
		country_naval_cap_mult = 0.33
	}
}
Driven Assimilator0
civic_machine_assimilator = {
	potential = { authority = { value = auth_machine_intelligence } }
	possible = {
		civics = {
			NOR = {
				value = civic_machine_servitor
				value = civic_machine_terminator
			}
		}
	}
	modification = no
	random_weight = {
		base = 5
		modifier = {
			factor = 0
			NOT = { host_has_dlc = "Synthetic Dawn Story Pack" }
		}
		modifier = {
			# civic has no effect after galaxy generation, disable for random generation
			factor = 0
			has_global_flag = game_started
		}
	}
	description = civic_tooltip_machine_assimilator_effects
	has_secondary_species = {	# see game_start.11
		title = civic_machine_assimilator_secondary_species
		traits = {
			trait = trait_cybernetic
		}
	}
}
Devouring Swarm0
civic_hive_devouring_swarm = {
	modification = no
	potential = {
		authority = { value = auth_hive_mind }
	}
	possible = {
		origin = {
			NOR = {
				value = origin_common_ground
				value = origin_hegemon
			}
		}
	}
	random_weight = { base = 5 }

	description = "civic_tooltip_devouring_swarm_effects"
	modifier = {
		country_starbase_influence_cost_mult = -0.5
		ship_hull_mult = 0.25
		ship_hull_regen_add_perc = 0.5
		ship_armor_regen_add_perc = 0.5
		army_damage_mult = 0.40
		category_biology_research_speed_mult = 0.20
		starbase_shipyard_build_cost_mult = -0.25
		country_naval_cap_mult = 0.33
	}

	swap_type = {
		name = civic_hive_devouring_swarm_lithoid
		description = "civic_tooltip_devouring_swarm_lithoid_effects"

		trigger = {
			local_human_species_class = LITHOID
		}
	}
}

Origins起源[編輯 | 編輯原始碼]

Syncretic Evolution0
origin_syncretic_evolution = {
	is_origin = yes
	icon = "gfx/interface/icons/origins/origins_syncretic_evolution.dds"
	picture = GFX_origin_syncretic_evolution

	playable = {
		host_has_dlc = "Utopia"
	}

	possible = {
		ethics = { NOT = { value = ethic_gestalt_consciousness } }
		civics = { NOT = { value = civic_fanatic_purifiers } }
	}

	description = civic_tooltip_syncretic_evolution_effects

	has_secondary_species = {	# see game_start.11
		title = civic_syncretic_evolution_secondary_species
		traits = {
			trait = trait_syncretic_proles
		}
	}

	advanced_start = yes

	random_weight = {
		base = 10
	}
}
Life Seeded0
origin_life_seeded = {
	is_origin = yes
	icon = "gfx/interface/icons/origins/origins_life_seeded.dds"
	picture = GFX_origin_life_seeded

	starting_colony = pc_gaia
	habitability_preference = pc_gaia
	preferred_planet_class_neighbor = no

	playable = {
		host_has_dlc = "Apocalypse"
	}

	possible = {
		authority = { NOT = { value = auth_machine_intelligence } }
	}

	description = "civic_tooltip_life_seeded_effects"

	random_weight = {
		base = 5
	}
}

Special Requirement Syntax[編輯 | 編輯原始碼]

The Civics use special requirement syntax and they don't accept regular Conditions. If it was implemented the other way, since incompatible Civics have no effect and a Civic can turn invalid literally anytime, it would be too performance intensive to check all empires for all civics everyday.

All they can check are civics, ethics, authorities, origins, country types and species archetypes. A single row of statement consist of "value = " and the relevant object key. Logical operators, namely NOT, AND, OR, and NOR, can be used to group one or more statements of the same category together, with an optional "text" entry which replaces the auto-generated tooltip for the entire logical block, but they cannot nest with each other and they cannot cross the category.

This is an example of this special syntax.

possible = {
	authority = {
		OR = {
			# text specified here replaces auto-generated tooltips for this block
			text = civic_tooltip_dem_oli_dic
			value = auth_democratic
			value = auth_oligarchic
			value = auth_dictatorial
		}
	}
	ethics = {
		value = ethic_fanatic_pacifist
		NOR = {
			text = civic_tooltip_not_authoritarian
			value = ethic_authoritarian
			value = ethic_fanatic_authoritarian
		}
	}
	origin = {
		NOR = {
			value = origin_common_ground
			value = origin_hegemon
		}
	}
	species_archetype = {
		# Only species archetypes can be specified here
		value = LITHOID
	}
}

Nested logic blocks don't work.

ethics = {
	OR = {
		AND = {
			value = ethic_fanatic_authoritarian
			value = ethic_militarist
		}
		AND = {
			value = ethic_authoritarian
			value = ethic_fanatic_militarist
		}
	}
}

Cross-category logic blocks don't work either.

OR = {
	ethics = {
		value = ethic_materialist
	}
	authority = {
		value = auth_imperial
	}
}


帝國 帝國思潮政府 • 國民理念 • 起源承諾議程傳統 • 飛升天賦法令政策遺珍科技自定義帝國
人口 崗位派系
領袖 領袖領袖特質
物種 物種物種特質
行星 行星行星特徵 • 軌道礦藏建築 • 區劃行星決議
星系 星系恆星基地巨型結構蟲洞 • 星門地圖
艦隊 艦隊艦船 • 部件
地面戰 陸軍轟炸姿態
外交 外交 • 聯邦 • 星海共同體評價修正宣戰理由 • 戰爭目標
事件 事件異常現象特殊項目考古遺址
遊玩 遊玩定義研究 • 經濟遊戲開局
動態修改 動態指令效果觸發條件作用域修正變量AI
媒體/本地化 Maya 導出器圖形肖像旗幟事件圖片界面圖標音樂本地化
Other 控制台命令存檔編輯Steam 創意工坊模組製作教程