### Stellaris Message Type Definition Example Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/common/message_types/AP_message_types.txt An example demonstrating the comprehensive structure and available properties for defining a `message_type` in Stellaris Paradox Script. It illustrates fields such as `key`, `icon`, `icon_frame`, `name` (localization key), `sound`, `sound_is_advisor`, `auto_opens` (message auto-opening behavior), and `ping` (map visualization). ```Paradox Script #message_type = { # key = "CONSTRUCTION_MESSAGE_TYPE" # Message key, used from code. # icon = "GFX_message_other_construction" # Sprite to use for gui item "message_icon_button" # icon_frame = 1 # Frame index to use for gui item "message_frame" # # name = "MESSAGE_DECLARE_WAR_TITLE" # Localization key to use for title, if impty it will use "MESSAGE__TITLE instead. # sound = "advisor_notification_construction_complete" # Sound to play on message creation # # sound_is_advisor = yes # Depricated and does nothing. # auto_opens = others # Specifies if the message should be auto opened or not, valid: 'none', 'player', 'others' and 'all' (default: 'player). Some messages as events are ignoring this since thay have their own option. # ping = "ping_notification_green" # Ping map to use for map visualization. #} ``` -------------------------------- ### Stellaris Script: On War Beginning Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/common/on_actions/AP_on_actions.txt Defines events that trigger at the very start of a war. 'Root' refers to the country involved in the war, and 'From' refers to the war object itself, enabling pre-war preparations or declarations. ```Stellaris Script on_war_beginning = { events = { AP_effect.2 } } ``` -------------------------------- ### Initialize Advanced Policies Global Flag Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/events/AP_events_common.txt This country event, triggered only once upon game start or mod activation, sets a global flag `AP_installed` if it's not already present. This flag serves as a general indicator that the Advanced Policies mod has been successfully initialized. ```Stellaris Script namespace = AP_flag country_event = { id = AP_flag.1 hide_window = yes is_triggered_only = yes fire_only_once = yes trigger = { NOT = { has_global_flag = AP_installed } } immediate = { set_global_flag = AP_installed } } ``` -------------------------------- ### Define Start Screen Part for Ancient Remnants Civic Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/common/start_screen_messages/AP_start_screen_messages.txt This configuration snippet defines a part for the Stellaris start screen, specifically for empires that possess the 'Ancient Remnants' civic. It sets the display location to '2' and uses the localization key 'AP_START_SCREEN_ANCIENT_REMNANTS'. The part triggers only if the 'civic_AP_ancient_remnants' civic is active for the country. ```Stellaris Script part = { location = 2 localization = "AP_START_SCREEN_ANCIENT_REMNANTS" trigger = { has_civic = civic_AP_ancient_remnants } } ``` -------------------------------- ### Define Start Screen Part for Children of the Darkness Origin Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/common/start_screen_messages/AP_start_screen_messages.txt This configuration snippet defines a part for the Stellaris start screen, specifically for empires with the 'Children of the Darkness' origin. It sets the display location to '1' and uses the localization key 'AP_START_SCREEN_CHILDREN_OF_THE_DARKNESS'. The part triggers only if a 'custom_start_screen' country flag is active and the 'AP_children_of_the_darkness' origin is present. ```Stellaris Script part = { location = 1 localization = "AP_START_SCREEN_CHILDREN_OF_THE_DARKNESS" trigger = { has_country_flag = custom_start_screen has_origin = AP_children_of_the_darkness } } ``` -------------------------------- ### Stellaris Script: On Game Start (Country) Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/common/on_actions/AP_on_actions.txt Defines a set of events that trigger when a new game starts for a country. This block is executed once at the beginning of a new game session for each country, initiating various policy-related flags and civic effects. ```Stellaris Script on_game_start_country = { events = { AP_flag.1 AP_civic.1 AP_civic.2 AP_civic.3 AP_origin.1 AP_origin.2 } } ``` -------------------------------- ### Initialize Panic Situation Active Flag (AP_panic.1) Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/events/AP_events_situations.txt This `situation_event` automatically sets the `AP_panic_active` country flag if it's not already present. It is triggered only and hidden from the player, serving as an initial setup mechanism for the panic system. ```Stellaris Script situation_event = { id = AP_panic.1 hide_window = yes is_triggered_only = yes trigger = { owner = { NOT = { has_country_flag = AP_panic_active } } } immediate = { owner = { set_country_flag = AP_panic_active } } } ``` -------------------------------- ### Define Start Screen Part for Sky Treaders Origin Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/common/start_screen_messages/AP_start_screen_messages.txt This configuration snippet defines a part for the Stellaris start screen, specifically for empires with the 'Sky Treaders' origin. It sets the display location to '1' and uses the localization key 'AP_START_SCREEN_SKY_TREADERS'. The part triggers only if a 'custom_start_screen' country flag is active and the 'AP_sky_treaders' origin is present. ```Stellaris Script part = { location = 1 localization = "AP_START_SCREEN_SKY_TREADERS" trigger = { has_country_flag = custom_start_screen has_origin = AP_sky_treaders } } ``` -------------------------------- ### Stellaris Event: Children of the Darkness Origin Start Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/events/AP_events_flavour.txt Defines the initial planet event (AP_origin.11) for the 'Children of the Darkness' origin. It triggers an event chain and enables a special project upon homeworld occupation check. ```Stellaris Script planet_event = { id = AP_origin.11 title = AP_origin.11_title desc = AP_origin.11_desc picture = GFX_evt_archaeology_camp is_triggered_only = yes location = THIS pre_triggers = { is_homeworld = yes is_occupied_flag = no } option = { name = AP_origin.11_1 begin_event_chain = { event_chain = AP_event_children_of_the_darkness target = ROOT } enable_special_project = { name = AP_CHILDREN_OF_THE_DARKNESS_1 owner = root } } } ``` -------------------------------- ### Stellaris Planetary Quota Situation Definition Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/common/situations/AP_situations.txt Defines the 'Planetary Quota' game situation, including its visual representation, description, and event handlers for monthly updates, start, completion, and failure. It specifies how progress is tracked (bidirectional), initial values, and distinct stages with their icons and progress thresholds. It also includes a default idle approach specific to this situation. ```Stellaris Script situation_AP_planetary_quota = { picture = GFX_evt_financial_instruments desc = { text = situation_AP_planetary_quota_desc trigger = { always = yes } } on_monthly = { events = { } } on_start = { } on_progress_complete = { } on_abort = { } on_fail = { } monthly_progress = { base = 0 } progress_direction = bidirectional fail_icon = GFX_situation_outcome_bankrupcy fail_icon_frame = GFX_situation_outcome_frame_red complete_icon = GFX_situation_outcome_meh complete_icon_frame = GFX_situation_outcome_frame_green start_value = 1 # I want it to start low and all growth should come from events stages = { AP_quota_0 = { end = 25 icon = GFX_situation_stage_frame_green icon_background = GFX_situation_stage_frame_blue } AP_quota_1 = { end = 50 icon = GFX_situation_stage_1 icon_background = GFX_situation_stage_frame_blue } AP_quota_2 = { end = 75 icon = GFX_situation_stage_2 icon_background = GFX_situation_stage_frame_blue } AP_quota_3 = { end = 100 icon = GFX_situation_stage_3 icon_background = GFX_situation_stage_frame_blue } } approach = { name = AP_quota_approach_idle icon = GFX_situation_approach_shrug icon_background = GFX_situation_approach_bg_yellow default = yes on_select = { custom_tooltip = AP_quota_approach_idle } allow = { } ai_weight = { weight = 1 } } } ``` -------------------------------- ### Stellaris Script: On Ground Combat Started Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/common/on_actions/AP_on_actions.txt Defines events that trigger specifically when ground combat begins on a planet. In this context, 'This' refers to the planet where combat is occurring, and 'From' refers to the country initiating the attack. ```Stellaris Script on_ground_combat_started = { events = { AP_effect.1 } } ``` -------------------------------- ### Industrial War Complex Civic Startup Event Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/events/AP_events_common.txt This event grants the `tech_AP_bombartment` technology to empires that possess the `civic_AP_war_complex` civic. It ensures the technology is provided immediately upon game start or civic adoption, without displaying a message to the player. ```Stellaris Script country_event = { id = AP_civic.3 hide_window = yes is_triggered_only = yes trigger = { has_valid_civic = civic_AP_war_complex } immediate = { give_technology = { tech = tech_AP_bombartment message = no } } } ``` -------------------------------- ### Stellaris Event Definition: AP_PQ.500 Egalitarian Policy Start Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/events/AP_events_quota.txt Initiates the event chain for Egalitarian Empires (`AP_PQ.500`), triggered when `quota_egalitarian` is 1 and `planet_quota_planned` is active. This event provides options for 'Progress', 'Project Focus', or 'Abolish', each leading to different follow-up events (`AP_PQ.510`, `AP_PQ.520`, or `AP_PQ.2`). ```Stellaris Event Script planet_event = { id = AP_PQ.500 is_triggered_only = yes location = from picture = GFX_evt_busy_spaceport title = AP_PQ.500_title desc = AP_PQ.500_desc trigger = { check_variable = { which = quota_egalitarian value = 1 } has_modifier = planet_quota_planned } abort_trigger = { owner = { NOT = { has_country_flag = quota_active } } } abort_effect = { IF = { limit = { OR = { has_modifier = planet_quota_planned has_modifier = planet_quota_phase_1 has_modifier = planet_quota_phase_2 has_modifier = planet_quota_phase_3 } } else = { } set_variable = { which = quota_fail value = 1 } planet_event = { id = AP_PQ.2 days = 5 } } } ## Progress Option option = { name = AP_PQ.500_1 hidden_effect = { planet_event = { id = AP_PQ.510 days = 30 random = 30 } } } # Project Focus option = { name = AP_PQ.500_2 hidden_effect = { planet_event = { id = AP_PQ.520 days = 30 random = 30 } } } ## Abolish option = { name = AP_PQ.500_3 hidden_effect = { set_variable = { which = quota_abolish value = 1 } planet_event = { id = AP_PQ.2 days = 30 random = 30 } } } } ``` -------------------------------- ### Define Reanimators Policy Options Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/common/policies/AP_civic_policies.txt This policy set defines various options for empires with the 'Reanimated Armies' civic, requiring the Necroid DLC. Options include modifiers for colony starting pops, colony development speed, army defense/attack health and damage, envoy relations, and max rivalries. ```Stellaris Policy Language AP_reanimators = { potential = { has_valid_civic = civic_reanimated_armies } option = { name = AP_reanimators_inner_focus modifier = { colony_start_num_pops_add = 1 planet_colony_development_speed_mult = 0.2 army_defense_health_mult = 0.33 army_defense_damage_mult = 0.33 } AI_weight = { weight = 2 } } option = { name = AP_reanimators_outer_focus modifier = { envoy_improve_relations_mult = 0.1 envoy_harm_relations_mult = 0.1 army_attack_health_mult = 0.33 army_attack_damage_mult = 0.33 max_rivalries = 1 } AI_weight = { weight = 1 modifier = { factor = 3 is_xenophile = yes } modifier = { factor = 3 owner = { is_unfriendly = yes } } } } } ``` -------------------------------- ### Define Mobile Construction Civic Policy (Stellaris Script) Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/common/policies/AP_civic_policies.txt This policy offers options for civilian benefits like terraforming speed and unity production, and military benefits like army/ship starting experience. AI weighting considers militarist, weak, pacifist, and war status traits, influencing AI empires to prioritize either peaceful expansion or military readiness. ```Stellaris Script AP_mobile_construction = { potential = { has_valid_civic = civic_AP_mobile_construction } option = { name = AP_mobile_construction_civilian modifier = { terraform_speed_mult = 0.25 country_unity_produces_mult = 0.1 planet_amenities_mult = 0.1 } AI_weight = { weight = 1 modifier = { factor = 2 is_militarist = no } modifier = { factor = 5 owner_main_species = { has_trait = trait_weak } } modifier = { factor = 2 is_pacifist = yes } modifier = { factor = 10 is_at_war = no is_militarist = no } } } option = { name = AP_mobile_construction_military modifier = { army_starting_experience_add = 100 ship_starting_experience_add = 100 ``` -------------------------------- ### Stellaris Situation Object Configuration Schema Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/common/examples.txt This snippet provides the full configuration schema for defining a 'Situation' object in Stellaris. It outlines all available properties, including UI elements, event hooks (on_start, on_progress_complete), progress tracking, various modifiers (country, triggered, target), and interactive player 'approach' options. This serves as a template for creating custom in-game events and challenges. ```Stellaris DSL # test_situation = { # #Note on locs: it expects "test_situation", "test_situation_type", and "test_situation_desc" # #The difference between the first and second keys is that the first is the name while the Situation exists # #It can use [Target.GetName] and so on. # #The _type key is used in cases where the Situation does not exist yet, specifically the start_situation effect's tooltip # #Consequently, stuff like [Target.GetName] will not work there. # desc = { text = x triggers = { } } #default is _desc, but you can do triggered overrides # picture = GFX_evt_alien_nature #Also supports triggered pictures like in events # complete_icon = GFX_icon # complete_icon_frame = GFX_icon_frame # fail_icon = GFX_icon # fail_icon_frame = GFX_icon_frame # category = positive #positive/negative/neutral - this affects the tone of various UI elements # complete_category = positive #Only for progress_direction = bidirectional - only affects progress towards completetion (right) # fail_category = negative #Only for progress_direction = bidirectional - only affects progress towards fail (left) # progress_direction = bidirectional #monodirectional/bidirectional (defaults to monodirectional) # on_start = { } #Effects when the Situation is created # on_progress_complete = { #Effects when Situation's progress has reached 100 # #You should always call destroy_situation = this from here or from an event fired by here # } # on_fail = { #Effects when Situation's total progress is below 0 # #You should always call destroy_situation = this from here or from an event fired by here # } # on_abort = {} #Effects when Situation is cancelled via abort_trigger trigger # abort_trigger = {} #Trigger for when a Situation should abort, firing on_abort # start_value = 20 #Situation will start at this number. Default is 0 # modifier = { } #Modifier applying to the country experiencing the situation # triggered_modifier = { #Triggered modifier applying to the country experiencing the situation, if the triggers are true # potential = { } # modifier = { } # } # target_modifier = { } #Modifier applying to the target planet of a Situation. Does not work on other scope types! # triggered_target_modifier = { #Modifier applying to the target planet of a Situation, if the triggers are true. Does not work on other scope types! # potential = { } # modifier = { } # } # #This behaves like an on_action. Note: technically, this is an on_action called test_situation. So don't call your situation "on_monthly_pulse"! # on_monthly = { # events = { # } # random_events = { # } # } # stages = { #List all your stages here, in the correct order. # low_level = { # icon = GFX_asset_name # end = 20 # } # medium_level = { # icon = GFX_asset_name # end = 40 # } # high_level = { #Expects the key to be localised. You can also define _desc and it will show on the tooltip, but this is optional. # icon = GFX_asset_name # background = GFX_asset_name # end = 100 # on_first_enter = { } #Effect for the first time this stage fires # modifier/triggered_modifier/target_modifier/triggered_target_modifier = { } #as standard (applies only during this Stage) # custom_tooltip = x #this will print in the stage tooltip (on_first_enter will not, because spoilers; modifiers will) # } # } # approach = { # name = approach_a #This is localised. If you add a loc key "approach_a_desc", it will also show, but this is optional. # icon = GFX_asset_icon # icon_background = GFX_asset_icon_background # allow = { } #If this fails, the Approach is greyed out # potential = { } #If this fails, the Approach is not shown # on_select = { } #Effect when you pick the Approach. # default = yes #Sets the Approach to be the Situation's default. This means that it will be picked when the Situation starts, and if the current # #Approach is invalidated (fails potential or allow check). This won't happen while the Situation is locked, so events which demand # #a choice of Approach can lock the situation (set_situation_locked) in immediate (or the Situation's on_start) and unlock them in after. # modifier/triggered_modifier/target_modifier/triggered_target_modifier = { } #as standard (applies only when this Approach is picked) # resources = { #Resource table as standard # category = situations # cost = { } # upkeep = { } # produces = { } # } # ai_weight = { } #AI will pick the one with the highest weight # } # approach = { # name = approach_b #all approaches must have at least a name ``` -------------------------------- ### Handle Ancient Site Interaction and Army Creation (Stellaris Script) Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/events/AP_events_common.txt Defines a planet event triggered by an ancient site and specific civic. It creates multiple 'ancient sentinal' armies and offers options to add an army inspiration modifier or grant unity resources. This event is designed to fire only once. ```Stellaris Script planet_event = { id = AP_effect.1 is_triggered_only = yes title = AP_effect.1_title desc = AP_effect.1_desc fire_only_once = yes location = from auto_opens = yes show_sound = event_ground_battle picture = GFX_evt_ground_combat pre_triggers = { has_ground_combat = yes original_owner = yes is_occupied_flag = no } trigger = { has_deposit = d_AP_ancient_site owner = { has_valid_civic = civic_AP_ancient_remnants } } immediate = { create_army = { owner = THIS type = ancient_sentinal name = AP_effect.1_army_name } create_army = { owner = THIS type = ancient_sentinal name = AP_effect.2_army_name } create_army = { owner = THIS type = ancient_sentinal name = AP_effect.3_army_name } } option = { name = AP_effect.1_1 custom_tooltip = AP_effect.1_tooltip add_modifier = { modifier = army_inspiration days = 30 } } option = { name = AP_effect.1_2 custom_tooltip = AP_effect.1_tooltip owner = { add_resource = { unity = 1500 } } } } ``` -------------------------------- ### Debug: Create Pirate Country and Armies (Stellaris Script) Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/events/AP_events_common.txt Defines a planet event for debugging purposes. It immediately creates a pirate country and then spawns 6 'gene_warrior_army' units for that newly created country. This event is set to always trigger. ```Stellaris Script planet_event = { id = AP_debug.1 is_triggered_only = yes trigger = { always = yes } hide_window = yes immediate = { create_pirate_country = yes while = { count = 6 create_army = { owner = last_created_country type = gene_warrior_army } } } } ``` -------------------------------- ### Planetary Decision: Trail by Fire Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/common/static_modifiers/AP_static_modifiers.txt A planetary decision that boosts pop happiness, immigration growth, army build speed, and army starting experience. However, it slightly reduces overall pop growth speed. ```Paradox Script planet_trail_by_fire = { icon_frame = 1 icon = gfx/interface/icons/planet_modifiers/pm_alien_propaganda.dds pop_happiness = 0.1 pop_growth_from_immigration = 0.25 planet_army_build_speed_mult = 0.5 army_starting_experience_add = 250 pop_growth_speed = -0.05 } ``` -------------------------------- ### Send War Policy Recommendation Message (Stellaris Script) Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/events/AP_events_common.txt Defines a country event that triggers only if a specific country flag (`AP_WAR_POLICY_MESSAGE_RECIEVED`) is not set and the country is not AI. It creates a localized message for the player and then sets the flag to prevent repeated messages. ```Stellaris Script country_event = { id = AP_effect.2 is_triggered_only = yes hide_window = yes location = from trigger = { NOT = { has_country_flag = AP_WAR_POLICY_MESSAGE_RECIEVED } is_ai = no } immediate = { create_message = { type = AP_WAR_POLICY_RECOMENDATION localization = AP_WAR_POLICY_RECOMENDATION_1 days = 30 target = THIS } set_country_flag = AP_WAR_POLICY_MESSAGE_RECIEVED } } ``` -------------------------------- ### Children of the Darkness Origin Startup Event Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/events/AP_events_common.txt This event provides initial benefits for empires with the 'Children of the Darkness' origin. It adds an `d_AP_underground_cities` deposit and the `building_AP_access_tunnel_complete` building to the capital planet. It also schedules a follow-up planet event `AP_origin.11` after a delay. ```Stellaris Script namespace = AP_origin country_event = { id = AP_origin.1 hide_window = yes is_triggered_only = yes trigger = { has_origin = AP_children_of_the_darkness } immediate = { capital_scope = { add_deposit = d_AP_underground_cities add_building = building_AP_access_tunnel_complete planet_event = { id = AP_origin.11 days = 720 random = 2880 } } } } ``` -------------------------------- ### Check for Subterranean Empire Origin (Stellaris Script) Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/common/scripted_triggers/AP_triggers.txt This trigger determines if the current country (This) has either the 'origin_subterranean' or 'AP_children_of_the_darkness' origin. It's a simple check to categorize empires based on their starting conditions. ```Stellaris Script is_subterranean_empire = { OR = { has_origin = origin_subterranean has_origin = AP_children_of_the_darkness } } ``` -------------------------------- ### Stellaris Event: Sky Treaders Origin Start Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/events/AP_events_flavour.txt Defines the initial planet event (AP_origin.21) for the 'Sky Treaders' origin. It begins an event chain and enables a special project targeting the system star. ```Stellaris Script planet_event = { id = AP_origin.21 title = AP_origin.21_title desc = AP_origin.21_desc picture = GFX_evt_archaeology_camp is_triggered_only = yes location = THIS option = { name = AP_origin.21_1 begin_event_chain = { event_chain = AP_event_sky_treaders target = space_owner } enable_special_project = { name = AP_SKY_TREADERS_1 owner = space_owner location = system_star } } } ``` -------------------------------- ### Initial Planetary Quota Event Definition (AP_PQ.1) Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/events/AP_events_quota.txt Defines the primary event `AP_PQ.1` which serves as the entry point for the Planetary Quota system. This event is triggered only when a planet has the `planet_quota_planned` modifier. It presents different descriptions and options based on the owner empire's ethics (militarist, authoritarian, egalitarian) and current state (at war), setting specific quota variables and scheduling follow-up events. ```Stellaris Script namespace = AP_PQ ## initial basic event for the decision planet_event = { id = AP_PQ.1 is_triggered_only = yes title = AP_PQ.1_title picture = GFX_evt_busy_spaceport location = from trigger = { has_modifier = planet_quota_planned } ## militarist at war desc desc = { text = AP_PQ.1_militarist_desc exclusive_trigger = { owner = { is_at_war = yes is_militarist = yes } } } ## remaining desc desc = { text = AP_PQ.1_remaining_desc trigger = { owner = { is_gestalt = no } } } ## autocrate desc desc = { text = AP_PQ.1_autocrate_desc trigger = { owner = { is_authoritarian = yes } } } # egalitarion desc desc = { text = AP_PQ.1_ega_desc trigger = { owner = { is_egalitarian = yes } } } ## militarist at war option (complete) option = { name = AP_PQ.1_militarist_option exclusive_trigger = { owner = { is_militarist = yes } hidden_trigger = { owner = { NAND = { has_policy_flag = AP_condition_yellow has_policy_flag = AP_condition_red has_policy_flag = AP_condition_void } is_at_war = yes } } } hidden_effect = { set_variable = { which = quota_military value = 1 } planet_event = { id = AP_PQ.200 days = 30 random = 10 } } } ## Autocrate option option = { name = AP_PQ.1_autocrate_option trigger = { owner = { is_authoritarian = yes } } hidden_effect = { set_variable = { which = quota_autocracy value = 1 } planet_event = { id = AP_PQ.300 days = 30 random = 20 } } } ## remaining option option = { name = AP_PQ.1_remainging_option trigger = { owner = { is_gestalt = no # is_egalitarian = no # is_authoritarian = no } } hidden_effect = { set_variable = { which = quota_remaining value = 1 } planet_event = { id = AP_PQ.400 days = 30 random = 30 } } } ## egalitarian option option = { name = AP_PQ.1_ega_option trigger = { owner = { is_gestalt = no is_egalitarian = yes } } hidden_effect = { set_variable = { which = quota_egalitarian value = 1 } planet_event = { id = AP_PQ.500 days = 30 random = 30 } } } } ``` -------------------------------- ### Stellaris Panic Situation Approaches Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/common/situations/AP_situations.txt Defines different strategic approaches for a 'panic' situation within the game, including de-escalated, idle, and escalated states. Each approach specifies its visual icon, custom tooltips, and AI weighting logic, which dictates when the AI should select a particular approach based on conditions like war status or situation progress. ```Stellaris Script approach = { name = AP_panic_approach_deescalated icon = GFX_situation_approach_balance_sheet icon_background = GFX_situation_approach_bg_green on_select = { custom_tooltip = AP_panic_approach_deescalated_tooltip } allow = { } ai_weight = { weight = 1 # Deescaltion only while at peace modifier = { factor = 10 owner = { is_at_war = no } } # Deescalation while at war modifier = { factor = 0 owner = { is_at_war = yes } } } } approach = { name = AP_panic_approach_idle icon = GFX_situation_approach_shrug icon_background = GFX_situation_approach_bg_yellow default = yes on_select = { custom_tooltip = AP_panic_approach_idle_tooltip } allow = { } ai_weight = { weight = 1 # AI should only go to phase condition red not void, simply because i do not trust the AI modifier = { factor = 5 situation_progress >= 50 } } } approach = { name = AP_panic_approach_escalated icon = GFX_situation_approach_fist icon_background = GFX_situation_approach_bg_green on_select = { custom_tooltip = AP_panic_approach_escalated_tooltip } allow = { # i do not want the player or AI to complete it but simply ride the buffs and policy changes situation_progress < 99 custom_tooltip = { fail_text = AP_panic_approach_escalate_not_allowed situation_progress <= 99 } } ai_weight = { weight = 1 modifier = { factor = 0 OR = { owner = { is_at_war = no } situation_progress >= 50 } } modifier = { factor = 10 situation_progress <= 50 } } } ``` -------------------------------- ### Sky Treaders Origin Startup Event Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/events/AP_events_common.txt This event provides initial benefits for empires with the 'Sky Treaders' origin. It adds the `building_AP_migrant_capital_hacthery` building to the capital planet. It also schedules a follow-up planet event `AP_origin.21` after a delay. ```Stellaris Script country_event = { id = AP_origin.2 hide_window = yes is_triggered_only = yes trigger = { has_origin = AP_sky_treaders } immediate = { capital_scope = { add_building = building_AP_migrant_capital_hacthery planet_event = { id = AP_origin.21 days = 360 random = 1440 } } } } ``` -------------------------------- ### Define Children of the Darkness Event Visuals (Stellaris Script) Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/common/event_chains/AP_event_chains.txt Configures the icon and picture for the 'Children of the Darkness' in-game event. This snippet specifies the path to the icon file and references a graphical event picture, typically used in the situation log or event pop-ups to visually represent the event. ```Stellaris Script AP_event_children_of_the_darkness = { icon = "gfx/interface/icons/situation_log/situation_log_main_quest.dds" picture = GFX_evt_ancient_records } ``` -------------------------------- ### Ancient Remnants Civic Startup Event Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/events/AP_events_common.txt This event initializes effects for empires with the 'Ancient Remnants' civic. If the owner has `civic_AP_ancient_remnants` and the `AP_ancient_remnant_installed` flag is not set, it adds an `d_AP_ancient_site` deposit to the capital. Additionally, it sets the AI personality to `ancient_rebuilder` for pacifist/xenophile/free haven/idealistic foundation empires, otherwise `ancient_reclaimer`. ```Stellaris Script country_event = { id = AP_civic.2 hide_window = yes is_triggered_only = yes trigger = { owner = { has_valid_civic = civic_AP_ancient_remnants NOT = { has_country_flag = AP_ancient_remnant_installed } } } immediate = { if = { limit = { owner = { has_valid_civic = civic_AP_ancient_remnants } } owner = { set_country_flag = AP_ancient_remnant_installed capital_scope = { add_deposit = d_AP_ancient_site } } } if = { limit = { owner = { has_valid_civic = civic_AP_ancient_remnants OR = { is_pacifist = yes is_xenophile = yes has_valid_civic = civic_free_haven has_valid_civic = civic_idealistic_foundation } } } owner = { set_ai_personality = ancient_rebuilder } else = { set_ai_personality = ancient_reclaimer } } } } ``` -------------------------------- ### Manage Underground City Deposits (Stellaris Script) Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/events/AP_events_common.txt Defines a planet event for the 'Children of the Darkness' origin. It conditionally adds or replaces `d_AP_underground_city` deposits. If fewer than 6 exist, one is added. If exactly 6 exist, all are removed and a `d_AP_underground_cities` deposit is added, implying an upgrade or consolidation. ```Stellaris Script planet_event = { id = AP_effect.4 is_triggered_only = yes hide_window = yes location = from trigger = { owner = { has_origin = AP_children_of_the_darkness } } immediate = { if = { limit = { count_deposits = { type = d_AP_underground_city count < 6 } } add_deposit = d_AP_underground_city } else_if = { limit = { count_deposits = { count = 6 type = d_AP_underground_city } } while = { count = 6 remove_deposit = d_AP_underground_city } add_deposit = d_AP_underground_cities } } } ``` ```Stellaris Script planet_event = { id = AP_effect.5 is_triggered_only = yes hide_window = yes location = from trigger = { owner = { has_origin = AP_children_of_the_darkness } } immediate = { if = { limit = { count_deposits = { type = d_AP_underground_city count < 6 } } add_deposit = d_AP_underground_city } else_if = { limit = { count_deposits = { count = 6 type = d_AP_underground_city } } while = { count = 6 remove_deposit = d_AP_underground_city } add_deposit = d_AP_underground_cities } } } ``` -------------------------------- ### Define Industrial War Complex Civic Policy (Stellaris Script) Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/common/policies/AP_civic_policies.txt This policy offers options related to industrial production, ship construction, and civilian benefits. AI weighting considers militarist, spiritualist, opportunist, slaver, and war status traits, guiding AI empires towards specific strategic advantages. ```Stellaris Script AP_industrial_war_complex = { potential = { has_valid_civic = civic_AP_war_complex } option = { name = AP_industrial_war_complex_production modifier = { planet_jobs_produces_mult = 0.1 planet_jobs_upkeep_mult = 0.05 } AI_weight = { weight = 1 modifier = { factor = 5 NOT = { is_militarist = yes } } modifier = { factor = 2 is_spiritualist = yes } } } option = { name = AP_industrial_war_complex_ships modifier = { starbase_shipyard_build_time_mult = -0.2 starbase_shipyard_build_cost_mult = -0.1 } AI_weight = { weight = 1 modifier = { factor = 5 has_ai_personality_behaviour = opportunist } modifier = { factor = 2 has_ai_personality_behaviour = slaver } } } option = { name = AP_industrial_war_complex_civilian modifier = { pop_growth_speed = 0.05 planet_amenities_mult = 0.1 planet_stability_add = 5 } AI_weight = { weight = 1 modifier = { factor = 100 is_at_war = no } } } } ``` -------------------------------- ### Initiate Stellaris Autocratic Line Event Chain AP_PQ.300 Source: https://github.com/brickwithhat/stellaris-advanced-policies/blob/master/events/AP_events_quota.txt Starts the AP_PQ.300 planet event chain for the autocratic line in Stellaris, presenting options for slow or fast approaches. It checks for active quotas and triggers subsequent events like AP_PQ.301 or AP_PQ.302 based on player choice, with an abort condition if the quota becomes inactive. ```Stellaris Script planet_event = { id = AP_PQ.300 is_triggered_only = yes location = from picture = GFX_evt_busy_spaceport title = AP_PQ.300_title desc = AP_PQ.300_desc trigger = { has_modifier = planet_quota_planned check_variable = { which = quota_autocracy value = 1 } } abort_trigger = { owner = { NOT = { has_country_flag = quota_active } } } abort_effect = { IF = { limit = { OR = { has_modifier = planet_quota_planned has_modifier = planet_quota_phase_1 has_modifier = planet_quota_phase_2 has_modifier = planet_quota_phase_3 } } else = { } set_variable = { which = quota_fail value = 1 } planet_event = { id = AP_PQ.2 days = 5 } } } option = { name = AP_PQ.300_1 hidden_effect = { planet_event = { id = AP_PQ.302 days = 180 } } } option = { name = AP_PQ.300_2 hidden_effect = { planet_event = { id = AP_PQ.301 days = 30 random = 30 } } } } ```