Event trigger.png Support charity and get Stellaris with accompanying expansions in the Humble "Stellaris Discovery" Bundle Event trigger.png

Fleet modding

From Stellaris Wiki
Jump to navigation Jump to search

Version

Outliner top.png
This article has been verified for the current PC version (2.8) of the game.

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

Fleet Orders[edit]

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[edit]

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[edit]

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_closest_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[edit]

  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.
Empire EmpireEthicsGovernments • Civics • OriginsMandatesAgendasTraditions • Ascension PerksEdictsPoliciesRelicsTechnologiesCustom Empires
Pops JobsFactions
Leaders LeadersLeader Traits
Species SpeciesSpecies Traits
Planets PlanetsPlanetary Feature • Orbital DepositBuildings • DistrictsPlanetary Decisions
Systems SystemsStarbasesMegastructuresBypassesMap
Fleets FleetsShips • Components
Land Warfare ArmiesBombardment Stance
Diplomacy Diplomacy • Federations • Galactic CommunityOpinion ModifiersCasus Belli • War Goals
Events EventsAnomaliesSpecial projectsArchaeological Sites
Gameplay GameplayDefinesResources • Economy
Dynamic modding Dynamic moddingEffectsConditionsScopesModifiersVariablesAI
Media/localisation Maya exporterGraphicsPortraitsFlagsEvent picturesInterfaceIconsMusicLocalisation
Other Console commandsSave-game editingSteam Workshop