Ethics modding

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

This page is about how to modify existing or add new Ethics to the game.

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

Ethics are defined at "common/ethics/xxx.txt".

Ethics[編輯 | 編輯原始碼]

  • playable - A block of Modifiers that determines should this ethic appear in the empire creation view. 格式塔意識 Gestalt Consciousness 格式塔意識Gestalt Consciousness is hidden this way.
  • cost = <int> - Number of ethic points this ethic cost.
  • category = <ethic category key> - Category of this ethic.
  • category_value = <int> - Index of this ethic under its category.
    • If there is an ethic axis called "A - B", so we have FA, A, B, and FB and their "category_value" will be: 0, 1, 3, 4.
    • Vanillas:
      • 極端威權主義 Fanatic Authoritarian威權主義 Authoritarian平等主義 Egalitarian極端平等主義 Fanatic Egalitarian: 0, 1, 3, 4
      • 極端排外主義 Fanatic Xenophobe排外主義 Xenophobe親外主義 Xenophile極端親外主義 Fanatic Xenophile: 0, 1, 3, 4
      • 極端軍國主義 Fanatic Militarist軍國主義 Militarist和平主義 Pacifist極端和平主義 Fanatic Pacifist: 0, 1, 3, 4
      • 極端唯心主義 Fanatic Spiritualist唯心主義 Spiritualist唯物主義 Materialist極端唯物主義 Fanatic Materialist: 0, 1, 3, 4
      • 格式塔意識 Gestalt Consciousness: 0 (not 2)
  • use_for_pops = <yes/no> - Default yes. Should be no if fanatic or gestalt.
  • regular_variant = <ethic key> - Fanatic ethics only. Designates the regular variant of this fanatic ethic.
  • fanatic_variant = <ethic key> - Regular ethics only. Designates the fanatic variant of this ethic.
  • country_modifier - A block of Modifiers that applies to the empire with this ethic.
  • tags - A list of localisation keys for a tooltip of ethic principles.
  • random_weight - The higher the weight, the more likely the randomly generated AI will have this ethic. Random empires will choose ethics at very first.
    • Vanilla fanatic ethics have 150 and regular ethics have 100, except 極端軍國主義 Fanatic Militarist軍國主義 Militarist 軍國主義Militarist have 250/150 and 極端和平主義 Fanatic Pacifist和平主義 Pacifist 和平主義Pacifist have 33/66.
    • 格式塔意識 Gestalt Consciousness 格式塔意識Gestalt Consciousness has 100 for each of the following DLC installed: 烏托邦 Utopia 烏托邦Utopia, 智械黎明故事包 Synthetic Dawn Story Pack 智械黎明故事包Synthetic Dawn Story Pack
  • pop_attraction_tag - An entry that adds tooltip in the faction view to show the player what factors are affecting ethics attraction. Multiple allowed, use_for_pops ethics only.
    • desc = <localisation key> - The text.
    • trigger - A block of Conditions to determine should this attraction tag appear. (Country scope)
  • country_attraction - An entry that modifies the empire wide ethic attraction, use_for_pops ethics only.
    • value = <number> - Default attraction. Vanilla always have 1.
    • modifier - A block of Conditions with a factor = <float> entry. Multiple allowed. (Country scope)
  • pop_attraction - An entry that modifies the ethic attraction for each pop, use_for_pops ethics only.
    • value = <number> - Default attraction. Vanilla always have 1.
    • modifier - A block of Conditions with a factor = <float> entry. Multiple allowed. (Pop scope)

Ethic Categories[編輯 | 編輯原始碼]

There is only one entry that defines ethic categories. New ethic categories can be added to this.

ethic_categories = {
	col = {}

	xen = {}

	mil = {}

	spi = {}

	hive = {}
}

GUI Modding[編輯 | 編輯原始碼]

Empire creation view is "interface/customize_species_editor.gui". There is a window that contains all buttons for ethic options. New ethics can't be made visible without modding this file.

		containerWindowType = {
			name = "ethics"
			size = { width = 230 height = 230 }
			position = { x = 20 y = -25 }

			instantTextBoxType = {
				name = "ethic_points_left"
				position = { x = -130 y = 95 }
				font = "malgun_goth_24"
				maxWidth = 310
				maxHeight = 20
				text = "POINTS_LEFT_ETHICS"
				orientation = center_down
				format = center
				#alwaysTransparent = yes
			}

			### NON-FANATIC ETHICS ###

			buttonType = {
				name = "ethic_militarist"
				spriteType = "GFX_ethics_militarist"
				position = { x = 125 y = 125 }
				clicksound = interface
			}
			
			... (repeat once for each regular ethic)

			### FANATIC ETHICS ###

			buttonType = {
				name = "ethic_fanatic_militarist"
				spriteType = "GFX_ethics_fanatic_militarist"
				position = { x = 125 y = 90 }
				clicksound = interface
			}
			
			... (repeat once for each fanatic ethic)

			buttonType = {
				name = "ethic_gestalt_consciousness"
				spriteType = "GFX_ethics_gestalt_consciousness"
				position = { x = 125 y = 170 }
				clicksound = interface
			}
			
			### SELECTED ETHICS ###

			iconType = {
				name = "ethic_col_selected"
				spriteType = "GFX_ethic_selected"
			}

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