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