Decision modding

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


This page is about how to modify existing and how to create new Decisions.

Decisions are defined at common/decisions/xxx.txt.

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

  • owned_planets_only = <yes/no> - If yes, this decision can only be enacted on colonized planets. If no, this decision can be enacted on uncolonized planets within the empire's border.
  • sound - A reference to a sound effect entry that plays when this decision is enacted.
  • icon - A reference to a GFX entry or filename (without path and file extension if under gfx/interface/icons/decisions) that determines the icon of this decision.
  • enactment_time = <int> - Days until this decision is enacted. Default 0. If greater than 0, this decision will go through the planetary construction queue and can be canceled by removing from the queue. Otherwise, this decision will be immediately applied, bypassing the construction queue.
  • resources - An Economy Unit that determines the cost of this decision. Only the "cost" field is wanted.
  • prerequisites = { tech_xxx } - A list of Technology keys that determines the technology prerequisites of this decision.
  • potential - A block of Conditions that determines should this planet have this decision displayed. (Planet scope)
  • allow - A block of Conditions that determines can this decision be enacted on this planet. (Planet scope)
  • effect - A block of Effects to be executed on this planet when this decision is enacted. (Planet scope)
  • ai_weight - The higher it is, the more likely the AI will try to enact this decision.

Decisions do not have modifier fields containing Modifiers. Vanilla decisions implement this by adding Static Modifiers to and removing them from the planet.

Example[編輯 | 編輯原始碼]

This is the decision "prospect".

decision_prospect = {
	owned_planets_only = yes

	enactment_time = 180
	resources = {
		category = decisions
		cost = {
			influence = 25
			energy = 500
		}
	}

	potential = {
		habitable_structure = no
		NOT = { is_planet_class = pc_machine }
		NOT = { is_planet_class = pc_hive }
		NOT = { is_planet_class = pc_city }
		owner = {
			has_swapped_tradition = tr_adaptability_finish
		}
		NOT = { has_planet_flag = planet_prospected }
	}

	effect = {
		custom_tooltip = decision_prospect_effects_short
		hidden_effect = {
			set_planet_flag = planet_prospected
			add_random_non_blocker_deposit = yes
			create_message = {
				type = MESSAGE_TYPE_PLANET_PROSPECTED
				localization = MESSAGE_PLANET_PROSPECTED
				days = 30
				target = this
				variable = {
					type = name
					localization = PLANET
					scope = this
				}
				variable = {
					type = name
					localization = DEPOSIT
					scope = last_added_deposit
				}
			}
		}
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 0
			num_pops < 20
		}
	}
}

habitable_structure = no is a Scripted Trigger. See Dynamic modding for details.

Decisions On Uncolonized Planets[編輯 | 編輯原始碼]

A decision with owned_planets_only = no can be enacted on any planet within the empire's border, not just those colonized.

Note that they would better have enactment_time = 0, or it could be a trouble: uncolonized planets do NOT have construction queues displayed in the UI and the player can't get informed of the enactment progress as well as they can't cancel the decision.

# this decision turns a barren planet into a terraforming candidate
decisions_on_uncolonized_planets_example = {
	owned_planets_only = no
	enactment_time = 0

	resources = {
		category = decisions
		cost = {
			energy = 10000
		}
	}

	potential = {
		# you would better make this strict enough or this can literally appear on every planet
		OR = {
			is_planet_class = pc_barren
			is_planet_class = pc_barren_cold
		}
		NOT = { has_modifier = terraforming_candidate }
	}

	effect = {
		add_modifier = {
			modifier = terraforming_candidate
			days = -1
		}
	}
}


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