Opinion modifier modding

本页面部分全部内容上次核对于2.5版本

Opinion modifiers are present in the folder common/opinion_modifiers which modify the opinion of AI empires to all other empires. They can apply based on empire policies, actions, or by being activated by triggers. The page responsible for non-modding explanations of the mechanic, its impact, and vanilla modifiers can be found at Diplomacy.

Structure[编辑 | 编辑源代码]

An opinion modifier's structure starts with its name, which is used when applying it via `add_opinion_modifier` and for localization. Each name must be a unique alphanumeric (including underscore) string without spaces. Inside the first block may come one of a few blocks or values which are:

Name Data Type Description
trigger Conditions block For applying an opinion modifier without assigning it explicitly
opinion Opinion block Describes the base value of the opinion modifier that can depend on circumstance
accumulative Boolean (yes/no) Determines whether the opinion modifier can add up upon subsequent assignments
unique Boolean (yes/no) Prevents reapplying of the opinion modifier
monthly Boolean (yes/no) Describes whether decay runs monthly or not
months Integer (+/-) ??
min Integer (+/-) Determines the lowest value the opinion modifier can resolve itself to on its own
max Integer (+/-) Determines the highest value the opinion modifier can resolve itself to on its own
decay Decay block Describes how the opinion modifier's value can change over a period of time, if it reduces the modifier's value back to 0 it automatically removes the opinion modifier, decay disregards surpassing the base value and will still cancel the modifier

Opinion block[编辑 | 编辑源代码]

A block that is used for describing the base value of the opinion modifier, it accepts two types of values. First being base which is a unique base integer value for the opinion modifier when it is applied generally. Otherwise it may accept modifier blocks which can contain a positive or negative add, which adds its value to the base, or factor, which multiplies the base integer value, alongside a list of conditions describing when to augment the modifier. The scope of the block is the empire's opinion being modified, FROM is the one the opinion is targeted at.

Decay block[编辑 | 编辑源代码]

A block that is used for describing the changing value of the opinion modifier, it accepts two types of values. First being base which is a unique base integer value for modifying the modifier's existing value when applied generally. Otherwise it may accept modifier blocks which can contain a positive or negative add that adds to the decay base value alongside a list of conditions describing when to augment the changing value. The scope of the block is the empire's opinion being modified, FROM is the one the opinion is targeted at.

Examples[编辑 | 编辑源代码]

opinion_insult = {
	opinion = {
		base = -200
	}

	unique = yes
	monthly = yes
	decay = {
		base = 2	
	}
}

opinion_demanded_subjectization = {
	opinion = {
		base = -20
		modifier = {
			factor = 10
			is_country_type = awakened_fallen_empire
		}		
	}
	
	decay = {
		base = 1	
	}
	
	accumulative = yes
}

opinion_abandoned_apology = {
	opinion = {
		base = -35
	}
	decay = {
		base = 3
		modifier = {
			add = 1
			has_ethic = "ethic_xenophile"
		}

		modifier = {
			add = 2
			has_ethic = "ethic_fanatic_xenophile"
		}

		modifier = {
			add = -1
			has_ethic = "ethic_xenophobe"
		}

		modifier = {
			add = -2
			has_ethic = "ethic_fanatic_xenophobe"
		}
	}
}

Examples found at Stellaris/common/opinion_modifiers/00_opinion_modifiers.txt

References[编辑 | 编辑源代码]


帝国 帝国思潮政府 • 国民理念 • 起源承诺议程传统 • 飞升天赋法令政策遗珍科技自定义帝国
人口 岗位派系
领袖 领袖领袖特质
物种 物种物种特质
行星 行星行星特征 • 轨道矿藏建筑 • 区划行星决议
星系 星系恒星基地巨型结构虫洞 • 星门地图
舰队 舰队舰船 • 部件
地面战 陆军轰炸姿态
外交 外交 • 联邦 • 星海共同体评价修正宣战理由 • 战争目标
事件 事件异常现象特殊项目考古遗址
游玩 游玩定义研究 • 经济游戏开局
动态修改 动态指令效果触发条件作用域修正变量AI
媒体/本地化 Maya 导出器图形肖像旗帜事件图片界面图标音乐本地化
Other 控制台命令存档编辑Steam 创意工坊模组制作教程