政体模组制作

本页面所适用的版本可能已经过时,最后更新于2.8
(重定向自Government modding


政府是在2.4版本中引入的,与角色相关。

他们允许将持有的地产类型与实际政府类型分离开来,这在2.4版本以前是有效的。

出于性能原因,政府只在头衔获得/移除、领主关系改变和宗教信仰改变时才会发生政府类型改变的判定[1]


政府组

政府组织为硬编码:总共5组:

  • feudal_governments, for which is_feudal = yes
  • republic_governments, for which is_republic = yes
  • theocracy_governments, for which is_theocracy = yes
  • tribal_governments, for which is_tribal = yes
  • nomadic_governments, for which is_nomadic = yes

Government

Here is the list of flags available for governments:[2]

变量名称 变量类别 变量说明 代码实例
color rgb 政府map mode中更改政府类型的颜色
title_prefix string 头衔本地化的前缀(比如temple_count). title_prefix = "temple_"
frame_suffix string 要使用的角色边框的gfx名称后缀 frame_suffix = "_tribal"
potential character triggers 角色选择此政府类型的条件。在游戏开始时,若有多种政府符合条件,则会选择第一个符合条件的政府(注:似乎首先评估封建制政府)
potential = {
	NOT = {	religion_group = muslim	}
	is_patrician = no
}
merchant_republic bool 使用merchant republic机制:产生家庭宫殿和贵族,并允许建立沿海贸易战。 merchant_republic = yes
uses_bride_price bool 启用商业共和国中的彩礼机制(结婚时用) uses_bride_price = yes
uses_decadence bool 如果一个角色在政府和宗教中被scripted,将使用decadence机制。 uses_decadence = yes
uses_jizya_tax bool uses_jizya_tax = yes
uses_piety_for_law_change bool 字面意思:改变法律花费虔诚
uses_prestige_for_law_change bool 字面意思:改变法律花费威望
allows_matrilineal_marriage bool 字面意思:允许入赘婚姻
allow_title_revokation bool 字面意思:允许回收头衔
allow_looting bool 字面意思:允许劫掠
can_imprison_without_reason bool 字面意思:允许无理由抓捕犯人
can_revoke_without_reason bool 字面意思:允许无理由回收头衔
ignores_de_jure_laws bool 字面意思:忽略法理法
dukes_called_kings bool 字面意思:公爵宣称王位
barons_need_dynasty bool 如果值为yes,男爵获得土地后都会获得生成随机家族 barons_need_dynasty = yes
can_create_empires bool 这个政府的人能否建立自定义帝国,默认为yes can_create_empires = no
can_create_kingdoms bool 这个政府的人能否建立自定义王国,默认为yes can_create_kingdoms = no
can_usurp_kingdoms_and_empires bool 字面意思:可以篡夺公国头衔和王国头衔
have_gender_laws bool 令该政府允许性别法,影响某些界面。 have_gender_laws = no
can_build_holdings bool
can_build_forts bool
can_build_castle bool 字面意思:允许建设城堡
can_build_city bool 字面意思:允许建设城市
can_build_temple bool 字面意思:允许建设寺庙
can_build_tribal bool 字面意思:允许建设部落
can_grant_kingdoms_and_empires_to_other_government bool 能否把王国头衔和帝国头衔授予另一个政府类型的角色,默认为yes
can_grant_kingdoms_and_empires_to_other_government_group bool 能否把王国头衔和帝国头衔授予另一个政府类型的角色,默认为no
can_be_granted_kingdoms_and_empires_by_other_government bool 这个政府类型的人能否从另一个政府类型的人那里得到王国和帝国头衔,默认为yes
can_be_granted_kingdoms_and_empires_by_other_government_group bool 这个政府类型的人能否从另一个政府集团的人那里得到王国和帝国头衔,默认为no
free_retract_vassalage bool 字面意思:免费收回封臣头衔
free_levies_in_offensive_war bool 在进攻性质的战争中,提高税收而不惹怒封臣 free_levies_in_offensive_war = yes
max_consorts int 字面意思:老婆和小妾之和最大值
max_liege_levy 用以代替王权法(字面:最大领主征兵)
max_liege_tax 用以代替王权法(字面:最大领主税)
aggression double 改变x20%的宣战意愿,以及AI可能的宣战速度。1为默认值,不会造成任何更改。任何低于1的数值会降低AI的宣战可能系,0则AI永远不会宣战(脚本除外)。负值则视为无效,不应使用。
unit_modifier modifiers 工作效果类似religion modding
unit_home_modifier modifiers 工作效果类似religion modding
character_modifier modifiers 工作效果类似religion modding
preferred_holdings List<holding>
allowed_holdings

allowed_holdings_culture
allowed_holdings_religion
allowed_holdings_culture_and_religion

List<holding> Will not get the wrong government type penalty
 # 不会因为同一文化的部落收到错误的政府类型惩罚
allowed_holdings_culture = {
  TRIBAL​
}
builds_with_prestige List<holding> 决定用黄金还是声望建设新的定居点。 builds_with_prestige = yes
builds_with_piety List<holding> 决定用黄金还是声望建设新的定居点。 builds_with_piety = yes
accepts_liege_governments

accepts_liege_governments_culture
accepts_liege_governments_religion
accepts_liege_governments_culture_and_religion

List<government> 列表中的政府类型是有效的,不会受到错误的政府负面意见修正。
# Gets the wrong religion modifier instead
accepts_liege_governments = { 
  muslim_government​
}
free_revoke_on_governments

free_revoke_on_governments_culture
free_revoke_on_governments_religion
free_revoke_on_governments_culture_and_religion

List<government> 领主可以自由撤销与特定政府类型的封臣
# 其他宗教的部落服用可以被免费吊销头衔
free_revoke_on_governments_religion = { 
  tribal_government​
}
free_revoke_on_tiers

free_revoke_on_tiers_culture
free_revoke_on_tiers_religion
free_revoke_on_tiers_culture_and_religion

List<tier> 被取消头衔的附庸不会触发任何负面意见修正
free_revoke_on_tiers = { count duke }
ignore_in_vassal_limit_calculation List<government> 具有指定政体的封臣不会计入你的封臣上限限制。
ignore_in_vassal_limit_calculation = {
  tribal_government​
}​
vassal_call_to_arms List<government>
no_vassal_tax List<government>
forced_contract List<government> 无论封臣意见如何,有特定政府类型的封臣将上交最大征召兵和最高领主税。对这些封臣的暴君行动可以不受其他政府类型封臣的反对。
commander_limit 字面意思:指挥官上限
capital_move_delay 字面意思:迁都最短间隔
can_change_to_nomad_on_start bool 游牧领主(同一文化)的部落统治者将成为游牧统治者,除非对该人物或者该人物的头衔另有规定。它只是为了在游戏开始前评估政府类型。
gets_religion_opinion_penalties bool 该政府类型持有者关心人们是否信仰不同宗教,默认yes
gives_religion_opinion_penalties bool 其他人关心该政府类型持有者是否信仰不同宗教,默认yes
vassal_government_opinion_penalties bool 因为"accepts_liege_governments"(接受领主政府)或类似事件而获得负面意见修正,默认yes
offmap_power offmap 使用succ_offmap_succession时为文化和宗教使用什么offmap power。
can_demand_religious_conversion bool 民众是否可以利用该政府类型的需求铂铱该宗教,宗教设定上的对应变量也必须允许该行为。该变量默认为yes
can_inherit bool 该政府类型的人能否继承头衔,默认为yes
men_can_take_consorts bool 如果有,男人可以选择女性配偶。默认yes,若max_cousorts=0,则该变量不起作用。
women_can_take_consorts bool 如果有,女人可以选择男性配偶。默认yes,若max_cousorts=0,则该变量不起作用。
marriage_ignore_religion bool 如果设置了,AI在考虑结婚时会忽略宗教信仰,默认no。

图案

为了给政府类型添加自定义图形,需要一些interface修改。创建一个后缀为.gfx的文件放在interface文件夹。在gfx文件中,你可以为政府图标添加一个spriteType块。以及为5个字符框架图像图像添加5个。所有的6个spriteTypes必须在一个spriteTypes区块内。所有这些spriteTypes的名字都必须以你在government txt文件中的frame_suffix结尾。你可以在\interface\generalstuff.gfx中找到代码。

实际的图形文件放在gfx\interface folder,所有的6个文件都要以.dds格式保存。

例如,如果要为世俗政府添加自定义图形,用frame_suffix = _secular :

spriteTypes = {
	
	### character stuff
	spriteType = {
		name = "GFX_charframe_150_secular"
		texturefile = "gfx\\interface\\charframe_150_secular.tga"
		noOfFrames = 6
		allwaystransparent = yes
	}
	spriteType = {
		name = "GFX_charframe_100_secular"
		texturefile = "gfx\\interface\\charframe_100_secular.tga"
		noOfFrames = 6
		allwaystransparent = yes
	}
	spriteType = {
		name = "GFX_charframe_75_secular"
		texturefile = "gfx\\interface\\charframe_75_secular.tga"
		noOfFrames = 6
		allwaystransparent = yes
	}
	spriteType = {
		name = "GFX_charframe_50_secular"
		texturefile = "gfx\\interface\\charframe_50_secular.tga"
		noOfFrames = 6
		allwaystransparent = yes
	}
	spriteType = {
		name = "GFX_charframe_34_secular"
		texturefile = "gfx\\interface\\charframe_34_secular.tga"
		noOfFrames = 6
		allwaystransparent = yes
	}
	
	### government icons
	spriteType = {
		name = "GFX_icon_secular_government"
		texturefile = "gfx\\interface\\government_icon_secular.dds"
	}

}

本地化

别忘了把你的新政府本地化,它的工作原理与其他本地化类似:

secular_government;Secular;;;;;;;;;;;;;x
secular_government_desc;No religions allowed!;;;;;;;;;;;;;x

请注意,政府的功能列表(比如不受惩罚持有城堡、神庙)是自动生成的(基于你txt文件中的内容)。这部分位于政府说明文本(_government_desc)下。如果你不想解释这些变量带来的政府属性,可以把_government_desc的属性留空


参考