### Handle Empire Initialization: Capital Planet Setup Source: https://github.com/xviper123/stellaris3.10_files/blob/main/common/on_actions/00_on_actions.txt Called during empire initialization when starting a new game if `has_secondary_species` game rule is true. Called before `empire_init_create_capital_pops`. Scoped to the planet, from the founder species, and fromfrom the secondary species (if exists). Triggers `game_start.12` for starting buildings, districts, and pops. ```Stellaris Script empire_init_capital_planet = { events = { game_start.12 # starting buildings, districts & pops # at this point the species might have changed (because we added traits), so FROMFROM might not be the secondary species anymore } } ``` -------------------------------- ### Stellaris: Home Planet Initialization (game_start.12) Source: https://github.com/xviper123/stellaris3.10_files/blob/main/events/game_start.txt This `planet_event` handles the initial setup of a player's home planet at game start. It conditionally generates deposits, blockers, buildings, districts, and pops based on planet flags and empire origins (e.g., 'Shattered Ring', 'Remnants', 'Void Dweller', 'Toxic Knights'). It ensures appropriate starting conditions for various origins. ```Stellaris Script # this: capital planet # from: founder species planet_event = { id = game_start.12 hide_window = yes is_triggered_only = yes immediate = { if = { limit = { NOT = { has_planet_flag = special_start_planet } } if = { limit = { OR = { NOT = { has_planet_flag = planet_earth } owner = { has_origin = origin_remnants } #no special earth for you, sorry } NOT = { owner = { has_origin = origin_shattered_ring } #setup in initializer } } generate_start_deposits_and_blockers = yes } else_if = { limit = { has_planet_flag = planet_earth NOR = { owner = { has_origin = origin_shattered_ring } #setup in initializer owner = { has_origin = origin_remnants } #custom blockers } } generate_earth_deposits_and_blockers = yes set_earth_entity = yes } generate_start_buildings_and_districts = yes generate_start_pops = yes generate_home_planet_final_pass = yes } if = { limit = { has_planet_flag = void_dweller_habitat_1 } void_dweller_home_planet_setup = yes } if = { limit = { has_planet_flag = toxic_knights_homeworld } toxic_knights_order_habitat_setup = yes } } } ``` -------------------------------- ### Stellaris Tutorial 5: Build Research Station - Start Event Source: https://github.com/xviper123/stellaris3.10_files/blob/main/events/tutorial_events.txt Initiates the 'Build Research Station' tutorial. This country event activates when the player is not AI, is at tutorial level 2, is waiting for this specific step, and has not yet built a research station or started its event chain. It guides the player towards constructing a research station. ```Stellaris Event Script country_event = { id = tutorial.11 title = tutorial.11.name desc = tutorial.11.desc show_sound = tut_research_station_intro is_advisor_event = yes trigger = { is_ai = no is_tutorial_level = 2 has_country_flag = waiting_tutorial_5 NOR = { any_controlled_ship = {is_ship_size = research_station } has_event_chain = tutorial_5_chain has_ethic = ethic_gestalt_consciousness } capital_scope = { solar_system = { closest_system = { max_steps = 10 limit = { any_system_planet = { is_capital = no is_surveyed = { who = ROOT status = yes } OR = { has_resource = { type = society_research amount > 0 } has_resource = { type = physics_research amount > 0 } has_resource = { type = engineering_research amount > 0 } } } } } } } } mean_time_to_happen = { days = 10 } immediate = { remove_country_flag = waiting_tutorial_5 begin_event_chain = { event_chain = "tutorial_5_chain" target = ROOT } } option = { name = SITLOG custom_tooltip = tutorial_5_tooltip } } ``` -------------------------------- ### Stellaris Void Dweller Home Planet Initialization Script Source: https://github.com/xviper123/stellaris3.10_files/blob/main/common/scripted_effects/01_start_of_game_effects.txt This script, `void_dweller_home_planet_setup`, defines the comprehensive initial setup for a Void Dweller empire's starting system in Stellaris. It handles the creation and configuration of multiple habitats, spawns major orbital megastructures, establishes mining stations, and modifies nearby systems to provide initial research and resource planets. Additionally, it grants specific starting technologies, research options, and resources to the empire, and populates the starting habitats with pops based on various empire civics and traits, such as 'eager explorer', 'hive', or 'permanent employment'. ```Stellaris Script void_dweller_home_planet_setup = { optimize_memory set_planet_flag = habitat_level_2 owner = { save_event_target_as = void_dweller_owner } solar_system = { random_system_planet = { limit = { has_planet_flag = habitat_1_planet } save_event_target_as = habitat_1_planet } spawn_megastructure = { type = "major_orbital" planet = event_target:habitat_1_planet coords_from = event_target:habitat_1_planet owner = event_target:void_dweller_owner graphical_culture = event_target:void_dweller_owner } random_system_planet = { limit = { has_planet_flag = habitat_2_planet } save_event_target_as = habitat_2_planet } spawn_megastructure = { type = "major_orbital" planet = event_target:habitat_2_planet coords_from = event_target:habitat_2_planet owner = event_target:void_dweller_owner graphical_culture = event_target:void_dweller_owner } random_system_planet = { limit = { has_planet_flag = habitat_3_planet } save_event_target_as = habitat_3_planet } spawn_megastructure = { type = "major_orbital" planet = event_target:habitat_3_planet coords_from = event_target:habitat_3_planet owner = event_target:void_dweller_owner graphical_culture = event_target:void_dweller_owner } every_system_planet = { limit = { has_planet_flag = mining_planet } create_mining_station = { owner = event_target:void_dweller_owner } } # Change starting pre-scripted ideal into inhabitable worlds # First pre-sripted is a research system closest_system = { limit = { has_star_flag = neighbor_t1_first_colony } set_star_flag = ideal_habitat_t1 max_steps = 3 random_system_planet = { limit = { is_colonizable = yes is_colony = no has_planet_flag = prescripted_ideal } change_pc = pc_frozen set_deposit = d_engineering_3 } while = { count = 3 random_system_planet = { limit = { is_star = no is_colonizable = no has_deposit = no has_anomaly = no } random_list = { 5 = { set_deposit = d_physics_1 } 5 = { set_deposit = d_society_1 } 5 = { set_deposit = d_engineering_1 } 1 = { set_deposit = d_physics_2 } 1 = { set_deposit = d_society_2 } 1 = { set_deposit = d_engineering_2 } } } } } # Second pre-sripted is a resource system closest_system = { limit = { has_star_flag = neighbor_t2_second_colony } set_star_flag = ideal_habitat_t2 max_steps = 6 random_system_planet = { limit = { is_colonizable = yes is_colony = no has_planet_flag = prescripted_ideal } remove_planet_flag = prescripted_ideal change_pc = pc_molten set_deposit = d_alloys_3 add_deposit = d_minerals_4 } while = { count = 3 random_system_planet = { limit = { is_star = no has_deposit = no has_anomaly = no } random_list = { 5 = { set_deposit = d_minerals_1 } 5 = { set_deposit = d_energy_1 } 1 = { set_deposit = d_minerals_2 } 1 = { set_deposit = d_energy_2 } } } } } } event_target:habitat_1_planet = { set_planet_flag = habitat@PREV } owner = { give_starting_resources_effect = yes give_technology = { tech = tech_habitat_1 message = no } add_research_option = tech_habitat_2 if = { limit = { OR = { is_lithoid_empire = no is_catalytic_empire = yes } } give_technology = { tech = tech_eco_simulation message = no } give_technology = { tech = tech_hydroponics message = no } root.solar_system.starbase = { remove_starbase_building = { slot = 1 } set_starbase_building = { slot = 1 building = hydroponics_bay } } } else = { give_technology = { tech = tech_powered_exoskeletons message = no } give_technology = { tech = tech_space_mining_1 message = no } root.solar_system.starbase = { remove_starbase_building = { slot = 1 } set_starbase_building = { slot = 1 building = mining_bay } } } if = { limit = { owner = { has_valid_civic = civic_private_healthcare_corporate } } give_technology = { message = no tech = tech_frontier_health } add_research_option = tech_subdermal_stimulation } } if = { limit = { owner = { is_eager_explorer_empire = no } } while = { count = 28 create_pop = { species = owner_main_species } } } else = { while = { count = 18 create_pop = { species = owner_main_species } } } if = { limit = { owner = { is_hive_empire = yes } } while = { count = 5 create_pop = { species = owner_main_species } } } if = { limit = { owner = { has_valid_civic = civic_permanent_employment } } while = { count = 4 random_owned_pop = { limit = { OR = { has_job = clerk has_job = technician has_job = miner ``` -------------------------------- ### Stellaris Tutorial Event: Observation Posts - Start Chain Source: https://github.com/xviper123/stellaris3.10_files/blob/main/events/tutorial_events.txt This ship event initiates the 'Observation Posts' tutorial chain. It triggers when a primitive civilization is discovered by a player at tutorial level 2, provided they have 'Space Construction' technology and haven't completed this specific tutorial segment. It guides players on interacting with pre-FTL societies. ```Stellaris Script ship_event = { id = tutorial.2140 title = tutorial.2140.name desc = tutorial.2140.desc show_sound = tut_msg_preftl_society_discovered is_advisor_event = yes is_triggered_only = yes trigger = { owner = { is_tutorial_level = 2 NOR = { has_event_chain = tutorial_20_chain has_country_flag = finished_tutorial_20 } has_technology = tech_space_construction } FROM = { has_owner = yes owner = { is_country_type = primitive } } } immediate = { begin_event_chain = { event_chain = "tutorial_20_chain" target = ROOT } } option = { name = SITLOG custom_tooltip = tutorial_20_tooltip } } ``` -------------------------------- ### Stellaris Tutorial Event: Start Build Second Science Ship (tutorial.20) Source: https://github.com/xviper123/stellaris3.10_files/blob/main/events/tutorial_events.txt This country event initiates the tutorial chain for building a second science ship. It checks the player's tutorial level and ensures they don't already have more than one science ship or are not a gestalt consciousness, which would make the objective irrelevant. If conditions are met, it begins the 'tutorial_9_chain' to guide the player. ```Paradox Script country_event = { id = tutorial.20 title = tutorial.20.name desc = tutorial.20.desc show_sound = tut_science_ship_intro is_advisor_event = yes is_triggered_only = yes trigger = { is_tutorial_level = 2 NOR = { has_event_chain = tutorial_9_chain count_controlled_ship = { limit = { is_ship_class = shipclass_science_ship } count > 1 } has_ethic = ethic_gestalt_consciousness } } immediate = { begin_event_chain = { event_chain = "tutorial_9_chain" target = ROOT } } option = { name = SITLOG custom_tooltip = tutorial_9_tooltip } } ``` -------------------------------- ### Stellaris Script: Initializing Planet Pops, Districts, and Buildings Source: https://github.com/xviper123/stellaris3.10_files/blob/main/common/solar_system_initializers/overlord_initializers.txt This script block defines the initial state of a planet, focusing on population creation, district allocation, and building setup. It ensures the planet starts with a specific number of robot pops, essential districts (city, mining, farming, generator, industrial), and key buildings like a capital, robot assembly, and research labs. ```Stellaris Script while = { count = 10 create_pop = { species = event_target:origin_imperial_species_robot } } while = { count = 2 add_district_and_planet_size_if_needed_effect = { district = district_city } add_district_and_planet_size_if_needed_effect = { district = district_mining } add_district_and_planet_size_if_needed_effect = { district = district_farming } add_district_and_planet_size_if_needed_effect = { district = district_generator } add_district_and_planet_size_if_needed_effect = { district = district_industrial } } remove_all_buildings = yes add_building = building_major_capital add_building = building_robot_assembly_plant add_building = building_bureaucratic_1 add_building = building_research_lab_1 add_building = building_paradise_dome add_building = building_commercial_zone validate_planet_buildings_and_districts = yes ``` -------------------------------- ### Example Stellaris System Initializer Script Source: https://github.com/xviper123/stellaris3.10_files/blob/main/common/solar_system_initializers/example.txt A complete example of a system initializer definition in Stellaris script, demonstrating various configuration options for galaxy generation, including star and planet definitions, asteroid belts, and initial effects. This script defines a system named 'Example System' with specific properties. ```Stellaris Script example_initializer = { name = "Example System" # [Optional; default/blank = random name] Localization string for this system/its main star class = "rl_standard_stars" # System's star class: may be a specific class (e.g., 'sc_binary_10') or a random class from a list (e.g., 'rl_standard_stars') asteroid_belt = { type = rocky_asteroid_belt radius = 60 # Distance from the solar system's center } flags = { example_system } # Flags that may be referenced in triggers and effects ('has_star_flag') ### USAGE & SPAWN CHANCES # Valid commands and values include: # usage = empire_init # May be chosen randomly for regular empires that do not specify a custom initializer # usage = fallen_empire_init # May be chosen randomly for fallen empires that do not specify a custom initializer # usage = misc_system_init # May be chosen randomly for unoccupied systems, i.e those which have not been initialized by empires or fallen empires # usage = custom_empire # May be selected by the player during custom empire creation # usage = origin # Used by Origins (see 'common\\governments\\civics\\00_origins.txt'), and therefore is not chosen at random as above # NOTE: You may specify multiple usages for an initializer, or none at all. If no usage is specified (as is the case for this example): the game may only use this initializer when explicitly called from another script, such as for a prescripted empire or as part of setting up an Origin. usage_odds = { # If a 'usage = x' has been specified (see above), 'usage_odds' sets the likelihood of this initializer being chosen over another base = 20 modifier = { # this = galactic_object (star) scope factor = 0 has_star_flag = empire_cluster } } max_instances = 10 # [Default/blank = infinite] The maximum number of times this initializer may be used, both randomly and via scripted effects # NOTE: if an initializer passes all the above, # The following two are checked after the Usage script above, and are mutually exclusive with each other: # spawn_chance = 60 # [1–100; default = 100] Percentage chance that this initializer is considered at all # scaled_spawn_chance = 8 # [integer] Percentage chance that this initializer is considered, per a formula: (scaled_spawn_chance * total systems in galaxy ) / 100 ### SETTINGS # primitive_system = yes # [default = no] Sets this initializer to appear more or less often depending on the 'Pre-FTL Civilizations' galaxy setting # prevent_anomalies = yes # [default = no] Prevents generic anomalies from spawning inside this system ### INITIALIZER EFFECT # Called once all planets have been created and the system is initialized: # this = galactic_object scope; root = first system in this initializer tree (if any); prev = previous system in this tree (if any) init_effect = { set_name = "Name set from an effect" } ### STARS & PLANETS # Stars are initialized as planets and then classified as stars: planet = { class = star orbit_distance = 0 } # You may create standalone orbital lines, unrelated to any other object: orbital_line = { orbit_distance_from_parent = 20 ``` -------------------------------- ### Primitive Worlds Scale Slider Value Source: https://github.com/xviper123/stellaris3.10_files/blob/main/common/script_values/00_script_values.txt This value retrieves the current setting for the 'primitive_worlds_scale' from the galaxy setup. It starts with a base of 0 and adds the value from the setup parameter. ```Stellaris Script primitive_slider_value = { base = 0 complex_trigger_modifier = { trigger = check_galaxy_setup_value parameters = { setting = primitive_worlds_scale } mode = add } } ``` -------------------------------- ### Stellaris System Initializer Configuration Reference Source: https://github.com/xviper123/stellaris3.10_files/blob/main/common/solar_system_initializers/example.txt Detailed reference for defining a Stellaris system initializer, outlining all available properties, their types, possible values, and descriptions. This structure is processed by the game's 'InitializeSystem' function during galaxy generation. ```APIDOC example_initializer: name: string (Optional; default/blank = random name) Localization string for this system/its main star. class: string System's star class: may be a specific class (e.g., 'sc_binary_10') or a random class from a list (e.g., 'rl_standard_stars'). asteroid_belt: object type: string (e.g., 'rocky_asteroid_belt') radius: integer (Distance from the solar system's center, e.g., 60) flags: array of strings Flags that may be referenced in triggers and effects ('has_star_flag'), e.g., { example_system }. usage: string (Optional) Determines when this initializer may be chosen. Multiple usages can be specified, or none. Possible values: - empire_init: May be chosen randomly for regular empires. - fallen_empire_init: May be chosen randomly for fallen empires. - misc_system_init: May be chosen randomly for unoccupied systems. - custom_empire: May be selected by the player during custom empire creation. - origin: Used by Origins (not chosen at random). usage_odds: object (If 'usage' is specified) Sets the likelihood of this initializer being chosen over another. base: integer (e.g., 20) modifier: object factor: integer (e.g., 0) has_star_flag: string (e.g., empire_cluster) max_instances: integer (Optional; default/blank = infinite) The maximum number of times this initializer may be used. spawn_chance: integer (1-100; default = 100) Percentage chance that this initializer is considered at all. Mutually exclusive with 'scaled_spawn_chance'. scaled_spawn_chance: integer Percentage chance that this initializer is considered, per a formula: (scaled_spawn_chance * total systems in galaxy) / 100. Mutually exclusive with 'spawn_chance'. primitive_system: boolean (default = no) Sets this initializer to appear more or less often depending on the 'Pre-FTL Civilizations' galaxy setting. prevent_anomalies: boolean (default = no) Prevents generic anomalies from spawning inside this system. init_effect: object Called once all planets have been created and the system is initialized. Scope: 'this' = galactic_object, 'root' = first system in this initializer tree, 'prev' = previous system in this tree. Example effect: set_name = "Name set from an effect" planet: array of objects Defines stars and planets within the system. Stars are initialized as planets and then classified as stars. Properties for each planet object: class: string - star: Initializes as a star. - ideal_planet_class: Picks ideal planet class for empire/fallen empire species. - random_non_ideal: Picks non-ideal planet class for empire/fallen empire species. - random: Picks random planet class based on distance from star and system's star class. - random_colonizable: Picks random colonizable planet class. - random_non_colonizable: Picks random non-colonizable planet class. - random_asteroid: Picks random asteroid class. - none: Valid, affects orbit of subsequent planets, but no visible/interactible planet generated. - : Define a specific planet class, e.g., 'pc_barren'. orbit_distance: integer (e.g., 0 for star) count: integer or object (Default = 1) - integer: Number of planets to create (e.g., 1). - object: { min = x max = y } - Random number of planets between x and y. name: string (Optional; default/blank = random name) Localization string for this planet. orbital_line: array of objects Creates standalone orbital lines, unrelated to any other object. Properties for each orbital_line object: orbit_distance_from_parent: integer Distance from the system's center, irrespective of the previous planet or orbital line's orbit distance (e.g., 20). ``` -------------------------------- ### Game Start Global Events Trigger Source: https://github.com/xviper123/stellaris3.10_files/blob/main/common/on_actions/00_on_actions.txt Defines a collection of events that are triggered globally when a new game starts. These events cover a wide range of initial game setups, including spawning special systems, removing planet modifiers, setting up origins, and initializing various game features like wormholes, L-Cluster outcomes, and specific origin-related setups. ```Stellaris Script on_game_start = { events = { game_start.1 # Spawn special/hidden countries game_start.2 # removes random planet modifiers from homeworlds and spawns terraforming candidates game_start.3 # Hidden Game Start Event that resets tutorial for advisor trigger purposes game_start.5 # Countdown to Nomad Fleet game_start.31 # Create wormhole pairs distar.290 # Spawn Sealed System distar.252 # Phaseshifting Planet distar.295 # Connect Ratling Systems to one another distar.8000 # Randomize L-Cluster outcome colony_mod.100 #titanic life blocker setup game_start.50 # Set up Nebula system art galactic_features.420 # Spawn VLUUR clones.1 # Clone Army Origin, fix species before Leaders are generated central.1 # Central Crystal event ancrel.12050 # Surveillance Supercomputer system spawn astral_planes.1 # Spawn Astral Rifts situation.1999 # Randomize Kaleidoscope spawning } random_events = { 19 = 0 1 = akx.8000 } } ``` -------------------------------- ### Create Wormhole Pairs at Game Start (Stellaris 3.10) Source: https://github.com/xviper123/stellaris3.10_files/blob/main/events/game_start.txt This PdxScript event `game_start.31` is triggered only once at game start to procedurally generate natural wormhole pairs. It calculates the number of wormholes based on galaxy setup, then iteratively spawns two linked wormholes in random systems. The script avoids placing wormholes in starting systems or systems marked as 'empire_cluster' and ensures a minimum distance between linked wormholes to prevent immediate adjacency. ```PdxScript event = { id = game_start.31 hide_window = yes is_triggered_only = yes immediate = { get_galaxy_setup_value = { setting = num_wormhole_pairs which = local_wormholes_num scale_by = 5 } while = { count = local_wormholes_num random_system = { limit = { NOR = { has_natural_wormhole = yes starting_system = yes has_star_flag = empire_cluster } } random_system = { limit = { NOR = { has_natural_wormhole = yes starting_system = yes has_star_flag = empire_cluster } distance = { source = prev min_distance >= 500 } } prev = { # done this way to ensure we don't spawn "orphan" wormholes (wormholes that aren't linked to anything) spawn_natural_wormhole = { bypass_type = wormhole random_pos = yes orbit_angle = 360 } } spawn_natural_wormhole = { bypass_type = wormhole random_pos = yes orbit_angle = 360 } link_wormholes = prev } } } } } ``` -------------------------------- ### Stellaris Tutorial: Starbase Construction Chain (tutorial.75, 750, 76) Source: https://github.com/xviper123/stellaris3.10_files/blob/main/events/tutorial_events.txt This set of events guides the player through the starbase construction tutorial. `tutorial.75` initiates the chain, `tutorial.750` handles scenarios where the tutorial step is completed early, and `tutorial.76` marks the successful completion of the starbase tutorial chain. ```Stellaris Script country_event = { id = tutorial.75 title = tutorial.75.name desc = tutorial.75.desc show_sound = tut_frontier_station_intro is_advisor_event = yes is_triggered_only = yes trigger = { is_tutorial_level = 2 NOR = { has_event_chain = tutorial_25_chain has_country_flag = tutorial_cleared_early_75 has_ethic = ethic_gestalt_consciousness } } immediate = { begin_event_chain = { event_chain = "tutorial_25_chain" target = ROOT } } option = { name = SITLOG custom_tooltip = tutorial_25_tooltip } } ``` ```Stellaris Script ship_event = { id = tutorial.750 hide_window = yes is_triggered_only = yes trigger = { owner = { is_tutorial_level = 2 NOT = { has_country_flag = tutorial_cleared_early_75 } } } immediate = { owner = { set_country_flag = tutorial_cleared_early_75 } } } ``` ```Stellaris Script ship_event = { id = tutorial.76 title = tutorial.76.name desc = tutorial.76.desc show_sound = tut_frontier_station_success is_triggered_only = yes is_advisor_event = yes trigger = { owner = { is_tutorial_level = 2 has_event_chain = "tutorial_25_chain" } } immediate = { owner = { complete_tutorial_step = 020_built_starbase end_event_chain = "tutorial_25_chain" } } option = { name = "OK" } } ``` -------------------------------- ### Stellaris Tutorial Event: Start Survey Neighboring Systems Tutorial (tutorial.17) Source: https://github.com/xviper123/stellaris3.10_files/blob/main/events/tutorial_events.txt This advisor country event initiates the tutorial for surveying neighboring star systems. It identifies and flags the player's home system and three closest un-surveyed systems, then creates points of interest for these survey targets. It also sets up several backup events to handle potential early completion or delays. ```Paradox Script country_event = { id = tutorial.17 title = tutorial.17.name desc = tutorial.17.desc show_sound = tut_suvey_systems_intro # should fix typos in asset is_advisor_event = yes is_triggered_only = yes trigger = { is_tutorial_level = 2 NOR = { has_event_chain = tutorial_8_chain has_country_flag = tutorial_cleared_early_17 has_ethic = ethic_gestalt_consciousness } } immediate = { begin_event_chain = { event_chain = "tutorial_8_chain" target = ROOT } capital_scope = { solar_system = { set_star_flag = home_system closest_system = { limit = { NOT = { has_star_flag = home_system } } set_star_flag = survey_target_1 save_event_target_as = survey_target_1 } closest_system = { limit = { NOR = { has_star_flag = home_system has_star_flag = survey_target_1 } } set_star_flag = survey_target_2 save_event_target_as = survey_target_2 } closest_system = { limit = { NOR = { has_star_flag = home_system has_star_flag = survey_target_1 has_star_flag = survey_target_2 } } set_star_flag = survey_target_3 save_event_target_as = survey_target_3 } } } create_point_of_interest = { id = tutorial_8_poi.1 name = "tutorial_8_poi" desc = tutorial_8_poi_desc event_chain = tutorial_8_chain category = tutorial_8_cat location = event_target:survey_target_1 } create_point_of_interest = { id = tutorial_8_poi.2 name = "tutorial_8_poi" desc = tutorial_8_poi_desc event_chain = "tutorial_8_chain" category = tutorial_8_cat location = event_target:survey_target_2 } create_point_of_interest = { id = tutorial_8_poi.3 name = "tutorial_8_poi" desc = tutorial_8_poi_desc event_chain = "tutorial_8_chain" category = tutorial_8_cat location = event_target:survey_target_3 } } option = { name = SITLOG custom_tooltip = tutorial_8_tooltip hidden_effect = { set_country_flag = waiting_tutorial_11 country_event = { id = tutorial.20 days = 10 } country_event = { id = tutorial.200 days = 10 } #Backup for flags if you finish the quest early country_event = { id = tutorial.33 days = 120 } country_event = { id = tutorial.330 days = 120 } } } } ``` -------------------------------- ### Example Usage of Planet Event Pre-Triggers Source: https://github.com/xviper123/stellaris3.10_files/blob/main/events/000_added_pre_triggers_to_planet_events.txt Illustrates how to configure 'pre_triggers' for a planet event, setting specific conditions for filtering. This example shows a typical setup where a planet must have an owner, not be a homeworld, and not be involved in ground combat, among other conditions. ```Stellaris Script pre_triggers = { has_owner = yes is_homeworld = no original_owner = yes is_ai = no has_ground_combat = no is_capital = no is_occupied_flag = no } ``` -------------------------------- ### Define Tutorial Chain for Observation Post Construction Source: https://github.com/xviper123/stellaris3.10_files/blob/main/common/event_chains/00_tutorial_chains.txt This configuration block defines the 'tutorial_20_chain' for Stellaris, which guides players on building an observation post. It specifies the tutorial's icon, background picture, and a counter that completes when one observation post has been built. ```Stellaris Script tutorial_20_chain = { icon = "gfx/interface/icons/situation_log/situation_log_tutorial.dds" picture = GFX_evt_medieval_alien_civilization counter = { observation_post_built = { max = 1 } } } ``` -------------------------------- ### Stellaris Tutorial Event: Start Clear Tile Blocker Tutorial (tutorial.15) Source: https://github.com/xviper123/stellaris3.10_files/blob/main/events/tutorial_events.txt This advisor country event initiates the tutorial for clearing tile blockers. It begins the `tutorial_7_chain` event chain, provided the player is at tutorial level 2 and has not already cleared this tutorial or is a Gestalt Consciousness empire. It includes a 'SITLOG' option with a custom tooltip. ```Paradox Script country_event = { id = tutorial.15 title = tutorial.15.name desc = tutorial.15.desc show_sound = tut_tile_blockers_intro is_advisor_event = yes is_triggered_only = yes trigger = { is_tutorial_level = 2 NOR = { has_country_flag = tutorial_cleared_early_16 has_event_chain = tutorial_7_chain has_ethic = ethic_gestalt_consciousness } } immediate = { begin_event_chain = { event_chain = "tutorial_7_chain" target = ROOT } } option = { name = SITLOG custom_tooltip = tutorial_7_tooltip } } ``` -------------------------------- ### Stellaris Tutorial 6: Construct Planetary Building - Start Event Source: https://github.com/xviper123/stellaris3.10_files/blob/main/events/tutorial_events.txt This country event initiates the 'Construct Planetary Building' tutorial. It's triggered only if the player is at tutorial level 2 and has not yet started the 'tutorial_6_chain' or completed this tutorial step. It begins the event chain for guiding the player to build on a planet. ```Stellaris Event Script country_event = { id = tutorial.13 title = tutorial.13.name desc = tutorial.13.desc show_sound = tut_planetary_buildings_intro is_advisor_event = yes is_triggered_only = yes trigger = { is_tutorial_level = 2 NOR = { has_event_chain = tutorial_6_chain any_owned_planet = { #TODO [CD] [TUTORIAL] #has_building_construction = yes } has_country_flag = tutorial_cleared_early_14 has_ethic = ethic_gestalt_consciousness } } immediate = { begin_event_chain = { event_chain = "tutorial_6_chain" target = ROOT } } option = { name = SITLOG custom_tooltip = tutorial_6_tooltip } } ``` -------------------------------- ### Define Tutorial Chain for Frontier Outpost Construction Source: https://github.com/xviper123/stellaris3.10_files/blob/main/common/event_chains/00_tutorial_chains.txt This configuration block defines the 'tutorial_25_chain' for Stellaris, which guides players on building a frontier outpost. It specifies the tutorial's icon, background picture, and a counter that completes when one frontier outpost has been built. ```Stellaris Script tutorial_25_chain = { icon = "gfx/interface/icons/situation_log/situation_log_tutorial.dds" picture = GFX_evt_society_research counter = { frontier_outpost_built = { max = 1 } } } ``` -------------------------------- ### Full Tutorial Event Definition Source: https://github.com/xviper123/stellaris3.10_files/blob/main/events/advisor_events.txt Defines a country event for the full tutorial sequence. It is triggered only when an advisor is active and sets country flags for advisor tips, activates the advisor, and initiates the 'tutorial.1' event. ```Stellaris Script country_event = { id = advisor.2 title = advisor.2.name desc = advisor.2.desc is_advisor_event = yes is_triggered_only = yes show_sound = full_tut_advisor option = { name = advisor.2.a hidden_effect = { set_country_flag = advisor_tips set_advisor_active = yes country_event = { id = tutorial.1 } } } } ``` -------------------------------- ### Add Planetary Unification Research Option Source: https://github.com/xviper123/stellaris3.10_files/blob/main/events/game_start.txt This snippet adds the 'tech_planetary_unification' research option, likely as part of an initial game setup or event trigger. ```Stellaris Script add_research_option = tech_planetary_unification ``` -------------------------------- ### Fleet Action: wait Source: https://github.com/xviper123/stellaris3.10_files/blob/main/events/000_fleet_action_examples.txt Illustrates the `wait` action, which pauses fleet actions for a specified duration in days. The example shows waiting for 10.5 days. ```APIDOC wait = 10.5 ``` -------------------------------- ### Start Tutorial 1: Zoom Out Map (Country Event) Source: https://github.com/xviper123/stellaris3.10_files/blob/main/events/tutorial_events.txt This country event initiates the 'Zoom Out Map' tutorial (tutorial.1). It triggers if the tutorial level is 2 and the player is not a gestalt consciousness, nor already involved in related event chains. It saves the home system and begins the 'tutorial_survey_system_chain'. ```PdxScript country_event = { id = tutorial.1 title = tutorial.1.name desc = tutorial.1.desc show_sound = tut_survey_intro is_advisor_event = yes is_triggered_only = yes trigger = { is_tutorial_level = 2 NOR = { has_event_chain = tutorial_survey_system_chain has_country_flag = waiting_tutorial_4 has_country_flag = tutorial_survey_system_chain has_ethic = ethic_gestalt_consciousness } } immediate = { capital_scope = { solar_system = { save_event_target_as = home_system } } set_country_flag = tutorial_survey_system_chain begin_event_chain = { event_chain = "tutorial_survey_system_chain" target = ROOT } } option = { name = SITLOG custom_tooltip = tutorial_survey_system_tooltip hidden_effect = { country_event = { id = tutorial.71 days = 10 } } } } ``` -------------------------------- ### Start Tutorial 2: Research Technologies (Country Event) Source: https://github.com/xviper123/stellaris3.10_files/blob/main/events/tutorial_events.txt This country event (tutorial.3) initiates the 'Research Technologies' tutorial. It triggers if the tutorial level is 2 and the player has not yet started the 'tutorial_2_chain', researched 'tech_colonization_1', or is not a gestalt consciousness. It begins the 'tutorial_2_chain' and schedules backup events. ```PdxScript country_event = { id = tutorial.3 title = tutorial.3.name desc = tutorial.3.desc show_sound = tut_technologies_intro is_advisor_event = yes is_triggered_only = yes trigger = { is_tutorial_level = 2 NOR = { has_event_chain = tutorial_2_chain has_technology = tech_colonization_1 has_ethic = ethic_gestalt_consciousness } } immediate = { begin_event_chain = { event_chain = "tutorial_2_chain" target = ROOT } country_event = { id = tutorial.7 days = 21 } country_event = { id = tutorial.700 days = 21 } #Backup to set flags if finished early } option = { name = SITLOG custom_tooltip = tutorial_2_tooltip hidden_effect = { if = { limit = { has_technology = tech_colonization_1 } country_event = { id = tutorial.6 } } } } } ``` -------------------------------- ### Fruitful Start Event Chain Effect Source: https://github.com/xviper123/stellaris3.10_files/blob/main/common/scripted_effects/01_start_of_game_effects.txt This script defines a complex starting effect for a 'fruitful partnership' scenario. It establishes first contact with the Tyanki, initiates an event chain, sets up a future event for Tyanki technologies, upgrades a random starbase, and spawns Tyanki space critters in a nearby system, then guides them to the home system. ```Stellaris Script fruitful_start_effect = { # Establish first contact with the Tyanki set_country_flag = tiyanki_encountered create_tiyanki_country = yes # Set up the event chain container for the special proects begin_event_chain = { event_chain = fruitful_partnership_chain target = this } # Set up event for getting the Tyanki technologies later country_event = { id = origin.7000 days = 1800 random = 1800 } random_owned_starbase = { set_starbase_building = { slot = 1 building = feeder } } capital_scope.solar_system = { # Spawn critters to a nearby system random_neighbor_system = { set_star_flag = tiyanki_plantoid_system random_system_planet = { limit = { is_star = yes } event_target:tiyanki_country = { create_fleet = { name = "NAME_Tiyanki_Space_Whale" effect = { set_owner = event_target:tiyanki_country create_ship = { design = "NAME_Tiyanki_Cow" } create_ship = { design = "NAME_Tiyanki_Bull" } create_ship = { design = "NAME_Tiyanki_Calf" } create_ship = { design = "NAME_Tiyanki_Hatchling" } set_location = prevprev set_fleet_stance = passive set_aggro_range_measure_from = self set_aggro_range = 0 set_fleet_flag = NAME_Tiyanki_Space_Whale queue_actions = { wait = { # Cooldown until they start moving duration = 320 random = 80 } } } } } } # Imprint the space amoeba near your home so they will immediately go to your home system to eat, # instead of vanishing into a natural wormhole closest_system = { limit = { has_star_flag = tiyanki_plantoid_system } every_fleet_in_system = { limit = { owner = { is_country_type = tiyanki } } set_fleet_flag = fruitful_lured_critter auto_move_to_planet = { target = prev.star clear_auto_move_on_arrival = yes } } } } } ```