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 創意工坊模組製作教程