Special Project modding

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


The special project game data can be found in these files/folders: common/special_projects

Special Projects file structure[編輯 | 編輯原始碼]

The file consists of a series of special_project = {} entries.

special_project properties
Name Description Values Required Example
key The ID of the project, it is used in events and also in the localisation file (description is expected as e.g. "MYMOD_EXAMPLE_1_PROJECT_DESC"). String Yes key = "MYMOD_EXAMPLE_1_PROJECT"
event_chain An associated event chain. ID of an existing Event chain No event_chain = "mymod_example_event_chain"
picture A picture for the project. String No picture = GFX_evt_alien_nature
sound Does this project have a specific sound? yes/no No sound = no
icon An icon to show on the left in the event log tree. String No icon = "gfx/interface/icons/situation_log/situation_log_quest.dds"
cost Science point cost of the project (must be '0' if using days_to_research). Integer No cost = 560
days_to_research How many days it will take to complete this project. Either cost or days_to_research must be defined. Integer No days = 180
tech_department Which department will handle this. physics_technology, society_technology, engineering_technology Yes tech_department = physics_technology
same_option_group_as If it is a sub-project of another special_project ID No same_option_group_as = { KETLING_PROJECT_1 }
AI_wait_days AI will wait for the amount of days specified. Works like normal AI weight fields, with factor/add/weight. Country scope, FROM is creation scope weight integer, modifier_rule fields No

AI_wait_days = { weight = 80 modifier = { factor = 0.5 has_ethic = ethic_fanatic_militarist } }

timelimit In how many days will this project fail, triggering the on_fail statement. Integer, -1 for unlimited No timelimit = 100
location Does this project have a specific location? yes/no No location = no
event_scope The scope in which the statements run. ship_event, planet_event Yes event_scope = planet_event
requirements Conditions needed to start the project.[more] Conditions No

requirements = { shipclass_science_ship = 1 leader = scientist skill > 1 }

abort_trigger Ongoing project will be canceled if this trigger returns true
  • this = country (project owner)
  • from = event scope (planet or ship, MIGHT NOT EXIST)
  • fromfrom = project creation scope (usually equals location)
Conditions No

abort_trigger = { NOT = { exists = fromfrom } }

on_start Statements to run when the project starts.
  • this = event scope (ship or planet)
  • from = project creation scope (usually equals location)
Statements No

on_start = { owner = { set_country_flag = started_x_project } }

on_success / on_progress_25/50/75 Statements to run when the project is complete.
  • this = event scope (ship or planet)
  • from = project creation scope (usually equals location)
Statements Yes

on_success = { owner = { country_event = { id = mymod.event.1 } } } on_success = { ship_event = { id = mymod.anomaly.1 } }

on_cancel Statement fires if the abort trigger returns true
  • this = country (project owner)
  • from = event scope (planet or ship, MIGHT NOT EXIST)
  • fromfrom = project creation scope (usually equals location)
Statements No on_cancel = {}
on_fail Statements to run when the project fails.
  • this = country (project owner)
  • from = project creation scope (usually equals location)
Statements Yes on_fail = { #times out

owner = { country_event = { id = federations3.2129 } } }

requirements[編輯 | 編輯原始碼]

Requirements use condition-like syntax, but they have their own set of commands. They do not support AND and OR commands.

Name Description Values Required Example
leader The type of leader needed at location. scientist, admiral, general, ruler, governor No leader = scientist
skill The skill level of the leader. Integer No skill > 2
has_trait The leader must have this trait Leader trait ID No has_trait = leader_trait_expertise_voidcraft
shipclass_military The number of military ships required. Integer No shipclass_military = 1
shipclass_constructor The number of constructor ships required Integer No shipclass_constructor = 1
shipclass_science_ship The number of science ships required Integer No shipclass_science_ship = 1
shipclass_colonizer The number of colonizers required Integer No shipclass_colonizer = 1
shipclass_transport The number of transport ships required Integer No shipclass_transport = 1
assault_armies The number of assault armies required Integer No assault_armies = 1
defense_armies The number of defense armies required Integer No defense_armies = 2
research_station Is a research station required at location? yes No research_station = yes
mining_station Is a mining station required at location? yes No mining_station= yes
observation_station Is an observation station required at location? yes No observation_station = yes
fleet_power If shipclass_military the power of the fleet required Integer No fleet_power > 999999
is_founder_species Does owner has to be a founder species? yes No is_founder_species = yes
Example[編輯 | 編輯原始碼]
requirements = {
	shipclass_science_ship = 1
	leader = scientist
	skill > 2
}

Usage[編輯 | 編輯原始碼]

Once you have a special project defined, you can start it in an event by using the enable_special_project command. The command has three parameters:

Name Description Example
name The key of the special project. name = "MYMOD_EXAMPLE_1_PROJECT"
location The location where the event takes place, for events with no location, it’s usually set to the capital.
capital_scope = {
	enable_special_project = {
		name = "MYMOD_EXAMPLE_1_PROJECT"
		location = this
		owner = root
	}
}
owner The country which will have this project enabled. owner = root

Example[編輯 | 編輯原始碼]

	enable_special_project = {
		name = "MYMOD_EXAMPLE_1_PROJECT"
		location = this
		owner = root
	}

There is also the abort_special_project command to end a special project, it is used like:

	abort_special_project = {
		type = MYMOD_EXAMPLE_1_PROJECT
		location = capital_scope
	}

The country is inferred from the location parameter.

A trigger example: has_special_project = CAPTURE_QUEEN

Localisation[編輯 | 編輯原始碼]

The localisation entries depend on the key property. The key is used for title and key_DESC is used for description.

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