Fleet modding

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


This is a quick reference for the different aspects of scripting some fleet events, triggers etc.

Fleet Orders[編輯 | 編輯原始碼]

The list of known fleet orders, used to define the current fleet action (i.e. has_fleet_order, used in Conditions).[1]

Order Description
aggressive_stance_fleet_order Fleet stance is aggressive
analyze_ftl_trail_order
assist_research_order Ship/fleet is going to assist research on planet
auto_explore_order Ship/fleet is going to automatically explore space
build_orbital_station_order Ship/fleet is going to construct any orbital, mining or research station
build_space_station_order Ship/fleet is going to construct a military station
collect_data_fleet_order Fleet is going to collect data from debris or ambient object
colonize_planet_order Ship is going to colonize a planet
combat_order
evade_hostiles_order
follow_order Ship/fleet is following the ship/fleet
merge_fleet_order Fleet is going to be merged
move_to_system_point_order Ship/fleet is moving to a point
land_armies_order Ship/fleet is going to land troops on planet
orbit_planet_order Ship/fleet is going to enter orbit of planet
rally_point_fleet_order Fleet is rallying to a point
research_anomaly_order Ship is going to research anomaly
return_fleet_order Fleet is returning
survey_planet_order Ship is going to survey planet
upgrade_design_fleet_order Ship/fleet is going to be upgraded
research_discovery_order
upgrade_design_at_starbase_fleet_order
upgrade_design_at_orbitable_fleet_order
repair_fleet_order Ship/fleet is going to be repaired
repair_ship_fleet_order Ship/fleet is going to be repaired
build_megastructure_fleet_order Fleet is going to construct a megastructure
destroy_planet_order Ship/fleet is going to destroy a planet
planet_killer_weapon_windup_order
planet_killer_weapon_fire_order
explore_bypass_order
use_bypass_order
jumpdrive_order
jumpdrive_windup
experimental_subspace_navigation_fleet_order
excavate_archaeological_site_fleet_order
  • italics orders - orders which are not studied or probably not working

Fleet Locking[編輯 | 編輯原始碼]

Fleet could be locked by set_event_locked = yes effect.
This will prevent any orders to this fleet. Don't forget to unlock it later.

Code examples[編輯 | 編輯原始碼]

Merge fleets
solar_system = {
	random_fleet_in_system = {
		limit = {
			is_ship_class = shipclass_military
			NOT = { is_same_value = root }
			owner = { is_same_empire = root.owner }
			fleet_power > 0
		}
		save_event_target_as = EXAMPLE_merge_fleet
	}
}
queue_actions = {
	find_random_fleet = {
		found_fleet = {
			merge_fleet = {
				target = event_target:EXAMPLE_merge_fleet
				allow_ftl = no
			}
		}
	}
}
  • Note: Vanilla doesn't use this (plain) command at all. Mods using this are e.q. "Aggressive Crisis Engine" and "A Deadly Tempest".
Change fleet leader on army/transport fleets.

As simple leader assign to transport fleets is not working (as to military fleets) and furthermore the documented scope from ships to army unexpectedly is not working (possible bug), there is a workaround to solve this supposed scope problem.[2]

# Just find the right army to the fleet to assign a leader to the appropriate army.
random_fleet_in_system = {
	limit = {
		exists = owner
		owner = { is_same_empire = event_target:EXAMPLE_empire }
		is_ship_class = shipclass_transport
		# NOT = { exists = leader }
	}
	owner = {
		random_owned_army = {
			limit = {
				exists = fleet
				fleet = { is_same_value = PREVPREVPREV }
				# NOT = { exists = leader }
			}
			assign_leader = event_target:EXAMPLE_leader
		}
	}
}
  • Note: Vanilla doesn't use this (plain) at all, e.q. mod using this is "Decentralized Empires (Regentmaker)".
"Jump" fleet to the scope

Transfers fleet to the selected scope.[3]

# Jumps to the capital scope.
fleet_event = {
    id = acemod_fleet.600
    hide_window = yes
    is_triggered_only = yes
    immediate = {
        set_location = {
            target = owner.capital_scope
            distance = 5
            angle = random
            direction = in_system
        }
        clear_orders = yes
        clear_fleet_actions = this
    }
}
Order colossus to fire on a planet in the same system[4]
solar_system = {
	random_system_planet = {
		limit = {
			has_planet_flag = shroud_target
		}
		save_event_target_as = killtarget
	}
}
queue_actions = {
	if = {
		limit = {
			exists = event_target:killtarget
			}
		clear_orders = yes
		clear_fleet_actions = THIS # Colossus fleet scope	
		find_closest_planet = {
			trigger = {
				id = schroud_target_1
				is_same_value = event_target:killtarget
			}
			found_planet = {
				move_to = this
				orbit_planet = this
				destroy_planet = this
			}
		}
	}
}

References[編輯 | 編輯原始碼]

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