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 创意工坊模组制作教程