### Handle Game Host Start for Multiplayer Support Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/events/CmtM0_Initializing.txt This `country_event` (ID: `CrisisManagerMenu.99`) is designed to fire only once for the game host in multiplayer sessions. It's triggered if the country is not an AI and does not have the `CmtFlagNoCall` global flag, immediately triggering `CrisisManagerMenu.100` to initiate host-specific setup routines. ```Paradox Script country_event = { id = CrisisManagerMenu.99 hide_window = yes fire_only_once = yes is_triggered_only = yes trigger = { NOR = { is_ai = yes has_global_flag = CmtFlagNoCall } } immediate = { country_event = { id = CrisisManagerMenu.100 } } } ``` -------------------------------- ### Example: Call Menu on Press Begin (Commented) Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/common/on_actions/Cmt00_Common_on_action.txt A commented-out example of an event hook that would trigger CrisisManagerMenu.0001 when a specific 'press begin' action occurs. This snippet is inactive but serves as a reference. ```Paradox Script # on_press_begin = { # events = { # CrisisManagerMenu.0001 ## Calling menu # } # } ``` -------------------------------- ### Define On Game Start Event (Paradox Script) Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/common/on_actions/z_dmm_mod_10.txt This snippet defines the 'on_game_start' event, which triggers the 'dmm_mod.101' event script when a new game begins. It's typically used for initial setup or global modifications that need to occur at the very beginning of a game session. ```Paradox Script on_game_start = { events = { dmm_mod.101 } } ``` -------------------------------- ### Example Country Event Definition (Commented) Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/events/CmtM1d_ConfigViewer~MidGame.txt A commented-out example of a country event definition, illustrating the structure for defining an event with an ID, title, description (with commented-out conditional text), a picture, and immediate effects. This event is set to be triggered only by other game logic, not by player interaction directly. ```Stellaris Script # country_event = { # id = CrisisManagerMenu.1028 # title = CrisisManagerMenu.1028.name # desc = CmtDescNotImplemented # # desc = { # # text = CrisisManagerMenu.1028.desc1 # # trigger = { CmtTriggerUprisingConfig = yes } # # } # # desc = { # # text = CrisisManagerMenu.1028.desc2 # # trigger = { CmtTriggerUprisingConfig = no } # # } # picture = GFX_evt_organic_oppression # is_triggered_only = yes # immediate = { # set_country_flag = CmtFlagConfigViewerShowing1028 # } # } ``` -------------------------------- ### Initialize Crisis Manager on Game Start Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/common/on_actions/Cmt00_Common_on_action.txt Triggers the CrisisManagerMenu.1 event when a new game starts, primarily for variable initialization. Includes a commented-out line for debugging purposes. ```Paradox Script on_game_start = { events = { CrisisManagerMenu.1 ## Init vars ## crisis_trigger.0001 ## For only debugging } } ``` -------------------------------- ### Call Host Menu on Country Game Start Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/common/on_actions/Cmt00_Common_on_action.txt Invokes the CrisisManagerMenu.99 event when a country's game starts, typically used to call the host menu for the Crisis Manager. ```Paradox Script on_game_start_country = { events = { CrisisManagerMenu.99 ## Calling host menu } } ``` -------------------------------- ### Example: Monthly Pulse Event (Commented) Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/common/on_actions/Cmt00_Common_on_action.txt A commented-out example for an event that would trigger on a monthly pulse, potentially for debugging purposes like `crisis_trigger.0001`. This snippet is inactive but serves as a reference. ```Paradox Script # on_monthly_pulse = { # events = { # # crisis_trigger.0001 ## For only debugging # } # } ``` -------------------------------- ### System and Megastructure Generation Configuration Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/common/solar_system_initializers/adt_distar_initializers.txt Defines parameters for generating home system resources, spawning megastructures like ruined ring worlds, and saving global event targets. Includes commented-out examples for alternative megastructure placements, demonstrating how to configure multiple instances or variations. ```Configuration generate_home_system_resources = yes spawn_megastructure = { type = "ring_world_ruined" orbit_angle = 0 orbit_distance = 45 } # spawn_megastructure = { # type = "ring_world_ruined" # orbit_angle = 180 # orbit_distance = 45 # } save_global_event_target_as = lcluster5b ``` -------------------------------- ### Stellaris Gatekeepers Origin Game Start Setup (origin_gatekeepers.001) Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/events/ori_gatekeepers.txt This `country_event` is triggered on game start for empires with the 'origin_gatekeepers' origin. It performs extensive setup, including adding initial resources and technologies (varying for lithoid empires), creating pops, configuring the capital habitat's size, entity, districts, and buildings. It also modifies the solar system by dismantling existing mining stations and setting specific deposits based on planet flags. Finally, it sets the country's origin to 'origin_void_dwellers' and triggers a follow-up event chain after a delay. ```Stellaris Script namespace = origin_gatekeepers country_event = { id = origin_gatekeepers.001 hide_window = yes is_triggered_only = yes fire_only_once = yes trigger = { has_origin = origin_gatekeepers } immediate = { add_research_option = tech_habitat_1 add_tech_progress = { tech = tech_habitat_1 progress = 0.7 } if = { limit = { is_lithoid_empire = no } add_resource = { food = 200 } give_technology = { tech = tech_eco_simulation message = no } give_technology = { tech = tech_hydroponics message = no } } else = { add_resource = { minerals = 200 } give_technology = { tech = tech_powered_exoskeletons message = no } give_technology = { tech = tech_space_mining_1 message = no } } capital_scope = { create_pop = { species = owner_main_species count = 20 } set_planet_entity = { entity = "habitat_phase_03_entity" graphical_culture = root } set_planet_size = 8 add_district_and_planet_size_if_needed_effect = { district = district_hab_housing } add_district_and_planet_size_if_needed_effect = { district = district_hab_science } add_district_and_planet_size_if_needed_effect = { district = district_hab_industrial } add_district_and_planet_size_if_needed_effect = { district = district_hab_industrial } add_district_and_planet_size_if_needed_effect = { district = district_hab_industrial } add_district_and_planet_size_if_needed_effect = { district = district_hab_energy } add_district_and_planet_size_if_needed_effect = { district = district_hab_energy } add_building = building_hab_major_capital if = { limit = { owner = { is_lithoid_empire = no } } add_building = building_bureaucratic_1 add_building = building_hydroponics_farm } else = { add_building = building_bureaucratic_1 add_building = building_holo_theatres } add_deposit = d_arcane_replicator solar_system = { every_system_planet = { limit = { is_star = yes exists = mining_station } mining_station = { dismantle = yes } } every_system_planet = { if = { limit = { has_planet_flag = gatekeeper_home_mining_target } create_mining_station = { owner = root } } if = { limit = { has_planet_flag = gatekeeper_home_pulsar } clear_deposits = yes set_deposit = d_energy_8 } if = { limit = { has_planet_flag = gatekeeper_home_bh } clear_deposits = yes set_deposit = d_dark_matter_deposit_3 } if = { limit = { has_planet_flag = gatekeeper_story_planet } save_event_target_as = gatekeepers_story_planet } } } } country_event = { id = origin_gatekeepers.100 days = 30 random = 30 } } after = { set_origin = origin_void_dwellers set_country_flag = origin_gatekeepers random_owned_ship = { limit = { fleet = { is_mobile = yes } } weights = { base = 1 modifier = { add = 20 is_ship_size = science } } ship_event = { id = apoc.3 scopes = { from = solar_system } } } } } ``` -------------------------------- ### Guidelines for Individual Crisis Power Configuration Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/common/scripted_variables/Cmt-101_Template-01_scripted_variables.txt Detailed instructions and warnings for configuring crisis strength individually. Explains how to activate individual settings, apply common factors, and set specific factors for each crisis faction. Emphasizes performance considerations for high factors, as they can heavily impact CPU and GPU load. ```APIDOC ### Common information for ''Individual Configurations'' ### - '@CmtT101_ConstCrisisStrength' must be set zero(0) for using following configurations. ### > If it is NOT zero(0), all of following configurations are ignored. ### - To set same parameter for all crisis ### > Input scale factor to '@CmtT101_Const****_Common'. ### > In this case, '@CmtT101_Const****_' are ignored. ### > 0(Zero) or negative number can NOT be inputted. ### - To set parameter individually for each crisis ### > Input 0(Zero) to '@CmtT101_Const****_Common'. ### > Input scale factor to '@CmtT101_Const****_' ### - All factors must be positive number that is multiple of 0.25. ### - Caution ### > Immoderate factor makes heavy load on CPU and GPU ### because these configurations modify the number of ships. ### > Also factors grater than 3 can be inputted if you endure processing load excessive. ``` -------------------------------- ### Define a Ship Event in Paradox Script Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/events/tutorial_events.txt This snippet demonstrates the basic structure for defining a `ship_event` in the game's scripting language. Ship events are typically associated with occurrences or actions related to in-game vessels. The example shows a common setup for tutorial or test events, configured to be hidden from the user, fire only once, and be triggered by other game logic rather than player interaction. ```Paradox Script ship_event = { id = tutorial.52 hide_window = yes fire_only_once = yes is_triggered_only = yes is_test_event = yes trigger = { always = no } } ``` -------------------------------- ### Guidelines for Individual Crisis Power Configuration Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/common/scripted_variables/Cmt-001_PrimacyTemplate_scripted_variables.txt These comments provide important instructions for configuring crisis power individually. They explain how to enable individual settings, how to apply common factors, and the constraints on input values, emphasizing potential performance impacts. ```Configuration ### Common information for ''Individual Configurations'' ### - '@CmtT001_ConstCrisisStrength' must be set zero(0) for using following configurations. ### > If it is NOT zero(0), all of following configurations are ignored. ### - To set same parameter for all crisis ### > Input scale factor to '@CmtT001_Const****_Common'. ### > In this case, '@CmtT001_Const****_' are ignored. ### > 0(Zero) or negative number can NOT be inputted. ### - To set parameter individually for each crisis ### > Input 0(Zero) to '@CmtT001_Const****_Common'. ### > Input scale factor to '@CmtT001_Const****_' ### - All factors must be positive number that is multiple of 0.25. ### - Caution ### > Immoderate factor makes heavy load on CPU and GPU ### Because these configurations modify the number of ships. ### > Also factors grater than 3 can be inputted if you endure processing load excessive. ``` -------------------------------- ### Stellaris Commented 'LINE' Combat Computer Template (Sapient) Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/common/component_templates/00_adt_utilities_roles.txt This commented-out code block illustrates a `utility_component_template` for a 'LINE' combat computer, specifically the 'SAPIENT' variant. It demonstrates the structure for defining a ship component, including its key, size, icon, power consumption, resource costs, class and size restrictions, component set, ship behavior, prerequisites, AI tags, and modifiers like fire rate and accuracy. This serves as a detailed example of component definition. ```Stellaris Script # utility_component_template = { # key = "COMBAT_COMPUTER_LINE_SAPIENT" # size = small # icon = "GFX_ship_part_computer_line_sapient" # icon_frame = 1 # power = @power3 # resources = { # category = ship_components # cost = { alloys = @cost3 } # } # class_restriction = { # shipclass_military # shipclass_military_special # } # size_restriction = { # destroyer # cruiser # battleship # crisis_destroyer # crisis_cruiser # star_eater # offspring_destroyer # offspring_cruiser # offspring_battleship # graygoo_interdictor # } # component_set = "combat_computers" # ship_behavior = "line" # prerequisites = { "tech_combat_computers_3" } # ai_tags = { gunship } # ai_tag_weight = 0 # ship_modifier = { # ship_fire_rate_mult = 0.2 # ship_accuracy_add = 20 # } # ai_weight = { # weight = 5 # modifier = { # factor = 0 # OR = { # has_global_flag = ghost_signal_5_flag # has_global_flag = ghost_signal_4_flag # has_global_flag = ghost_signal_3_flag # has_global_flag = ghost_signal_2_flag # # has_global_flag = ghost_signal_1_flag # has_notification_modifier = ghost_signal_1 # } # } # } # } ``` -------------------------------- ### Ship Behavior Configuration Schema Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/common/ship_behaviors/fe_ship_behaviors.txt Defines the available parameters and their valid values for configuring a ship's artificial intelligence behavior. This serves as a comprehensive reference for creating custom ship profiles. ```APIDOC ship_behavior: object name: string # Name preferred_attack_range: number | 'max' | 'min' | 'median' # The distance this ship wants to have to its combat position for 'attack_movement_pattern'. Valid values are: , 'max', 'min', 'median' (where the last 3 will use the weapon components of the ship design) formation_distance: number | 'max' | 'min' | 'median' # The distance this ship wants to have to its combat_position for 'passive_movement_pattern'. For a ship to switch to 'attack_movement_pattern' this needs to be less than distance to its combat position. Valid values are: , 'max', 'min', 'median' (where tha last 3 will use the weapon components of the ship design, for strike crafts just only use numbers) return_to_formation_distance: number | 'max' | 'min' | 'median' # Distance to combat position where the ship will force switch back to 'passive_move_pattern'. Valid values are: , 'max', 'min', 'median' (where tha last 3 will use the weapon components of the ship design, for strike crafts just only use numbers) source_target_anchor_factor: number # Weight factor where this ship wants to position itself between 'combat_source_anchor' and 'combat_target_anchor', this is the combat position. combat_source_anchor: 'parent' | 'root' # What anchor to use for source when calculating the combat position for this ship, this is the actual position of the anchor ship. Valid values are: 'parent', 'root' (where 'parent' is the immediate parent ship and 'root' the fleet leader ship) combat_target_anchor: 'parent' | 'root' # What anchor to use for target when calculating the combat position for this ship, this is the combat position of the anchor ship. For `root` this will be the actual target. Valid values are: 'parent', 'root' (where 'parent' is the immediate parent ship and 'root' the fleet leader ship) collision_awareness: number # How much we try to avoid other ships. collision_strafe: number # Allows the ship to move in any direction while colliding with another. collision_radius: number # Multiplier on the radius specified in the ship size. attack_move_pattern: string # Valid values: 'orbit', 'stay_at_range' passive_move_pattern: string # Valid values: 'charge', 'stay_at_range' desc: string # Description used in tooltip ``` -------------------------------- ### Set Earliest Khan Reigning Start Time Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/common/scripted_variables/Cmt-000_DefaultTemplate_scripted_variables.txt Specifies the earliest point a Khan can reign, relative to the Mid-Game Start Year, with various offset options and a unique template value for 'at anytime'. ```StellarisConfig @CmtT000_ConstKhanEarliestMgpy = 10 ### Set x of ''Mid-Game Start Year + x years''. ### x must be -999, -100, -75, -50, -25, 0, 10, 25, 50, 75 or 999. (Default = 10) ### Exception: -999 means 'at anytime' ### 999 means Template Unique Value (Beta Feature), set in ''common\scripted_variables\Cmt-xxx_Unique_scripted_variables.txt''. ``` -------------------------------- ### Define Crisis Menu Options for Event 5151 (Uprising Join War) Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/events/CmtM1d_ConfigViewer~MidGame.txt These snippets define menu options that trigger event 5151 based on the value of the 'CmtVarUprisingJoinWar' global variable. Options 'a' and 'b' trigger the event when the variable matches a specific value (1 or 2). Each option has a unique name and tooltip. ```Game Scripting Language option = { name = CrisisManagerMenu.5151a.name custom_tooltip = CrisisManagerMenu.5151a.tooltip trigger = { event_target:CmtGlobalVar = { check_variable = { which = CmtVarUprisingJoinWar value = 1 } } } hidden_effect = { CmtEffectTryCallEvent = { CALL = 5151 FROM = 1028 } } } option = { name = CrisisManagerMenu.5151b.name custom_tooltip = CrisisManagerMenu.5151b.tooltip trigger = { event_target:CmtGlobalVar = { check_variable = { which = CmtVarUprisingJoinWar value = 2 } } } hidden_effect = { CmtEffectTryCallEvent = { CALL = 5151 FROM = 1028 } } } ``` -------------------------------- ### Configure Crisis Manager Menu Auto-Open on Game Start Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/common/scripted_variables/Cmt-000_DefaultTemplate_scripted_variables.txt Determines whether the Crisis Manager menu automatically opens when the game starts. The default setting 'yes' enables this auto-opening behavior, while 'no' disables it, requiring manual access to the menu. ```Stellaris Mod Config @CmtT000_ConstCallOnGameStart = yes ``` -------------------------------- ### Configure Khanate Mid-Game Crisis Parameters Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/events/CmtT000_Vanilla.txt Sets variables for the Khanate mid-game crisis, including the number of Khanate events, the interval between them, and the earliest year of appearance. ```PDS Script if = { limit = { always = @CmtT000_ConstActivatedEventMidgame } ### Khan set_variable = { which = CmtVarKhanMultiple value = @CmtT000_ConstKhanMultiple } set_variable = { which = CmtVarKhanInterval value = @CmtT000_ConstKhanInterval } set_variable = { which = CmtVarKhanEarliestMgpy value = @CmtT000_ConstKhanEarliestMgpy } ``` -------------------------------- ### Initialize Game Variables and Flags for Crisis Manager Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/events/CmtM0_Initializing.txt This `country_event` (ID: `CrisisManagerMenu.21`) is triggered only once upon activation to set up crucial global flags and variables. It applies initial templates, dynamically adjusts L-Gate clue requirements based on galaxy size, and configures Cybrex fleet limits, ensuring the crisis system is properly initialized. ```Paradox Script country_event = { id = CrisisManagerMenu.21 hide_window = yes is_triggered_only = yes trigger = { is_country_type = global_event } immediate = { set_global_flag = CmtFlagActivated save_global_event_target_as = CmtGlobalVar # CmtEffectHardCoatedSettings = yes remove_global_flag = CmtFlagDebugMode # country_event = { id = CrisisManagerControl.9011 } ## For only debugging country_event = { id = CrisisManagerMenu.2000 } ## Apply Vanilla Template country_event = { id = CrisisManagerMenu.2001 } ## Auto apply of Template if = { limit = { always = @CmtT201_ConstSleeperFleet_ApplyOnStart has_global_flag = CmtFlagSleeperEdition } CmtEffectApplyTemplate201 = yes ## Apply Template for Initialization for Fleets of Sleepers. } # TODO outsource? # Dyn. L-Gate clue req counter. switch = { trigger = galaxy_size tiny = { change_variable = { which = CmtVarLgateReqClues value = -2 } } small = { change_variable = { which = CmtVarLgateReqClues value = -1 } } large = { change_variable = { which = CmtVarLgateReqClues value = 1 } } huge = { change_variable = { which = CmtVarLgateReqClues value = 2 } } } if = { limit = { lgate_enabled = no } change_variable = { which = CmtVarLgateReqClues value = -1 } } # Dyn. CybrexLimit for fleet comp. if = { limit = { is_variable_set = CmtVarCybrexResurfacing } if = { limit = { check_variable = { which = CmtVarCybrexResurfacing value = 5 } } set_variable = { which = CmtVarGrayGooCybrexLimit value = 30 } } else_if = { limit = { check_variable = { which = CmtVarCybrexResurfacing value = 4 } } set_variable = { which = CmtVarGrayGooCybrexLimit value = 38 } } else_if = { limit = { check_variable = { which = CmtVarCybrexResurfacing value = 3 } } set_variable = { which = CmtVarGrayGooCybrexLimit value = 66 } } else_if = { limit = { check_variable = { which = CmtVarCybrexResurfacing value = 2 } } set_variable = { which = CmtVarGrayGooCybrexLimit value = 110 } } } } } ``` -------------------------------- ### Initialize Crisis Manager on Game Start Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/events/CmtM0_Initializing.txt This event triggers immediately when a new game starts or a game is loaded, serving as the primary initialization point for the Crisis Manager system. It sets a detection flag and then dispatches an initialization event (`CrisisManagerMenu.21`) to the appropriate scope, whether it's a global event country or a specific event target. ```PDS Script event = { id = CrisisManagerMenu.1 hide_window = yes is_triggered_only = yes immediate = { CmtEffectSetDetectedEdition = yes ## Initializing Variables if = { limit = { is_scope_type = country is_country_type = global_event } country_event = { id = CrisisManagerMenu.21 } # log="Game started global_event" } else_if = { limit = { exists = event_target:global_event_country } event_target:global_event_country = { country_event = { id = CrisisManagerMenu.21 } } # log="Game started global_event_country" } else = { random_country = { # Should never happen limit = { is_country_type = global_event } country_event = { id = CrisisManagerMenu.21 } } } } } ``` -------------------------------- ### Apply Temporary Game Configurations Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/events/CmtT000_Vanilla.txt This small script snippet applies a general transfer effect, likely a utility function, and includes a comment indicating a configuration related to version updates, possibly for immediate application when the game is in the main menu. ```PDS Script CmtEffectTransferAll = yes ### Around version up: "immediate" in main menu ``` -------------------------------- ### Randomize L-Cluster Outcome on Game Start Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/events/!000_adt_distar_events_3_patch.txt Defines a hidden, triggered-only event (`distar.8000`) that determines the L-Cluster's initial state at game start. It uses a weighted random list to set global flags, potentially activating the Gray Goo crisis or a 'dragon season' scenario, while allowing for the removal of certain outcomes. ```Stellaris Script # event = { # id = distar.8000 # hide_window = yes # is_triggered_only = yes # # Empty outcome removed # # Single Dragon outcome removed # immediate = { # random_list = { # 8 = { # modifier = { factor = 0 lgate_enabled = no } # set_global_flag = gray_goo_crisis_set # set_global_flag = active_gray_goo # set_global_flag = dragon_season # } # 4 = { # set_global_flag = gray_goo_empire_set # set_global_flag = dragon_season # } # # 2 = { set_global_flag = dragon_season } # } # } # } ``` -------------------------------- ### Latest Khan Reigning Year Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/common/scripted_variables/Cmt-001_PrimacyTemplate_scripted_variables.txt Defines the latest point in the game, relative to the end-game start year, when the Great Khan can appear. ```Stellaris Script @CmtT001_ConstKhanLatestEgpy = 0 ### Set x of ''End-Game Start Year + x years''. ### x must be -999, -100, -75, -50, -25, 0, 25, 50, 75, 100 or 999. (Default = 0) ### Exception: 999 means ''Chance Never Terminate'' ### -999 means Template Unique Value (Beta Feature), set in ''common\scripted_variables\Cmt-xxx_Unique_scripted_variables.txt''. ### Caution: 999 and -999 are inverse of other similar configurations. ``` -------------------------------- ### Game Menu Navigation Options Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/events/CmtM1d_ConfigViewer~MidGame.txt Defines options for navigating through game menus, specifically 'Next Page' and 'Go Back'. These options conditionally trigger different country events (e.g., CrisisManagerMenu.1031, CrisisManagerMenu.1000, CrisisManagerMenu.1027, CrisisManagerMenu.1024) based on country flags (CmtFlagConfigViewerSeq), global flags (CmtFlagMidGameEdition, CmtFlagEndGameEdition, CmtFlagSleeperEdition), and whether all viewers are closed (CmtTriggerAllViewerClosed). They also manage the 'CmtFlagConfigViewerShowing1028' flag. ```Game Script (Clausewitz Engine) option = { name = CmtTextGoNextPage.name custom_tooltip = BLANK_STRING trigger = { has_country_flag = CmtFlagConfigViewerSeq } hidden_effect = { remove_country_flag = CmtFlagConfigViewerShowing1028 if = { limit = { OR = { has_global_flag = CmtFlagMidGameEdition has_global_flag = CmtFlagEndGameEdition } } country_event = { id = CrisisManagerMenu.1031 } } else = { country_event = { id = CrisisManagerMenu.1000 } } } } option = { name = CmtTextGoBack.name custom_tooltip = BLANK_STRING hidden_effect = { remove_country_flag = CmtFlagConfigViewerShowing1028 if = { limit = { has_country_flag = CmtFlagConfigViewerSeq } if = { limit = { has_global_flag = CmtFlagMidGameEdition } country_event = { id = CrisisManagerMenu.1027 } } else_if = { limit = { OR = { has_global_flag = CmtFlagEndGameEdition has_global_flag = CmtFlagSleeperEdition } } country_event = { id = CrisisManagerMenu.1024 } } else = { country_event = { id = CrisisManagerMenu.1000 } } } else_if = { limit = { CmtTriggerAllViewerClosed = yes } country_event = { id = CrisisManagerMenu.1000 } } } } ``` -------------------------------- ### Earliest Khan Reigning Year Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/common/scripted_variables/Cmt-001_PrimacyTemplate_scripted_variables.txt Defines the earliest point in the game, relative to the mid-game start year, when the Great Khan can appear. ```Stellaris Script @CmtT001_ConstKhanEarliestMgpy = 10 ### Set x of ''Mid-Game Start Year + x years''. ### x must be -999, -100, -75, -50, -25, 0, 10, 25, 50, 75 or 999. (Default = 10) ### Exception: -999 means 'at anytime' ### 999 means Template Unique Value (Beta Feature), set in ''common\scripted_variables\Cmt-xxx_Unique_scripted_variables.txt''. ``` -------------------------------- ### Define Khan Configuration Country Event (CrisisManagerMenu.1026) Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/events/CmtM1d_ConfigViewer~MidGame.txt This code block defines a 'country_event' with ID 'CrisisManagerMenu.1026'. It sets up the event's title, description (with conditional text based on 'CmtTriggerKhanConfig'), picture, and immediate effects (setting 'CmtFlagConfigViewerShowing1026'). It includes multiple options for user interaction, allowing navigation to other events (1027, 1024, 1000) or triggering dynamic event calls (4810, 4821) based on country flags, global flags, and the values of 'CmtVarKhanMultiple' and 'CmtVarKhanInterval' variables. ```Game Script country_event = { id = CrisisManagerMenu.1026 title = CrisisManagerMenu.1026.name desc = { text = CrisisManagerMenu.1026.desc1 exclusive_trigger = { CmtTriggerKhanConfig = yes } } desc = { text = CrisisManagerMenu.1026.desc2 exclusive_trigger = { CmtTriggerKhanConfig = no } } picture = GFX_evt_khan_throne_room is_triggered_only = yes immediate = { set_country_flag = CmtFlagConfigViewerShowing1026 } option = { name = CmtTextGoNextPage.name custom_tooltip = BLANK_STRING trigger = { has_country_flag = CmtFlagConfigViewerSeq } hidden_effect = { remove_country_flag = CmtFlagConfigViewerShowing1026 country_event = { id = CrisisManagerMenu.1027 } } } option = { name = CmtTextGoBack.name custom_tooltip = BLANK_STRING trigger = { has_country_flag = CmtFlagConfigViewerSeq } hidden_effect = { remove_country_flag = CmtFlagConfigViewerShowing1026 if = { limit = { OR = { has_global_flag = CmtFlagEndGameEdition has_global_flag = CmtFlagSleeperEdition } } country_event = { id = CrisisManagerMenu.1024 } } else_if = { limit = { NOT = { has_active_event = { CrisisManagerMenu.1000 } } } country_event = { id = CrisisManagerMenu.1000 } } } } option = { name = "graygoo.504.d" custom_tooltip = BLANK_STRING trigger = { NOT = { has_country_flag = CmtFlagConfigViewerSeq } } hidden_effect = { remove_country_flag = CmtFlagConfigViewerShowing1026 if = { limit = { CmtTriggerAllViewerClosed = yes NOT = { has_active_event = { CrisisManagerMenu.1000 } } } country_event = { id = CrisisManagerMenu.1000 } } } } option = { name = CmtTextSeparator.name custom_tooltip = CmtTextSeparator.tooltip trigger = { NOT = { has_global_flag = CmtFlagNoSeparator } } allow = { hidden_trigger = { always = no } } } option = { name = "CrisisManagerMenu.4810a.title" custom_tooltip = BLANK_STRING trigger = { event_target:CmtGlobalVar = { check_variable = { which = CmtVarKhanMultiple value = 1 } } } hidden_effect = { CmtEffectTryCallEvent = { CALL = 4810 FROM = 1026 } } } option = { name = CrisisManagerMenu.4810b.name custom_tooltip = BLANK_STRING trigger = { event_target:CmtGlobalVar = { check_variable = { which = CmtVarKhanMultiple value = 2 } } } hidden_effect = { CmtEffectTryCallEvent = { CALL = 4810 FROM = 1026 } } } option = { name = "CrisisManagerMenu.4810c.title" custom_tooltip = BLANK_STRING trigger = { event_target:CmtGlobalVar = { check_variable = { which = CmtVarKhanMultiple value = 3 } } } hidden_effect = { CmtEffectTryCallEvent = { CALL = 4810 FROM = 1026 } } } option = { name = CrisisManagerMenu.4810d.name custom_tooltip = CrisisManagerMenu.4810d.tooltip trigger = { event_target:CmtGlobalVar = { check_variable = { which = CmtVarKhanMultiple value = 4 } } } hidden_effect = { CmtEffectTryCallEvent = { CALL = 4810 FROM = 1026 } } } option = { name = CrisisManagerMenu.4810e.name custom_tooltip = CrisisManagerMenu.4810e.tooltip trigger = { event_target:CmtGlobalVar = { check_variable = { which = CmtVarKhanMultiple value = 5 } } } hidden_effect = { CmtEffectTryCallEvent = { CALL = 4810 FROM = 1026 } } } option = { name = CrisisManagerMenu.4810z.name custom_tooltip = "CmtTextErrUndefined.tooltip" trigger = { event_target:CmtGlobalVar = { OR = { check_variable = { which = CmtVarKhanMultiple value < 1 } check_variable = { which = CmtVarKhanMultiple value > 5 } } } } hidden_effect = { CmtEffectTryCallEvent = { CALL = 4810 FROM = 1026 } } } option = { name = CrisisManagerMenu.4821.V0.name custom_tooltip = BLANK_STRING trigger = { event_target:CmtGlobalVar = { check_variable = { which = CmtVarKhanInterval value < @CmtConstKhanInterval_T0 } OR = { check_variable = { which = CmtVarKhanMultiple value = 3 } check_variable = { which = CmtVarKhanMultiple value = 4 } } } } hidden_effect = { CmtEffectTryCallEvent = { CALL = 4821 FROM = 1026 } } } option = { name = CrisisManagerMenu.4821.VC.name custom_tooltip = BLANK_STRING trigger = { event_target:CmtGlobalVar = { NOR = { check_variable = { which = CmtVarKhanInterval value < @CmtConstKhanInterval_T0 } check_variable = { which = CmtVarKhanInterval value > @CmtConstKhanInterval_T5 } } OR = { check_variable = { which = CmtVarKhanMultiple value = 3 } check_variable = { which = CmtVarKhanMultiple value = 4 } } } } hidden_effect = { CmtEffectTryCallEvent = { CALL = 4821 FROM = 1026 } } } option = { name = CmtTextTemplateUnique.name custom_tooltip = BLANK_STRING trigger = { event_target:CmtGlobalVar = { check_variable = { which = CmtVarKhanInterval value > @CmtConstKhanInterval_T5 } OR = { check_variable = { which = CmtVarKhanMultiple value = 3 } ``` -------------------------------- ### Define On-Game-Start Event Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/common/on_actions/adt_on_actions.txt Configures the event that triggers immediately upon the game starting. The `a_deadly_tempest.1` event is executed. ```Stellaris Script on_game_start = { events = { a_deadly_tempest.1 } } ``` -------------------------------- ### Define AI Budget Allocation Parameters Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/common/defines/sdmsmr_defines.txt Configures how the AI allocates its budget towards military stations. It specifies fractions for general military station budgets and a separate fraction for mineral-specific military station budgets, influencing AI strategic decisions and resource management. ```Configuration NAI = { MILITARY_STATION_BUDGET_FRACTION = 0.12 MINERAL_MILITARY_STATION_BUDGET_FRACTION = 0.08 } ``` -------------------------------- ### Configure League of Non-Aligned Powers Formation Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/common/scripted_variables/Cmt-000_DefaultTemplate_scripted_variables.txt Sets the likelihood and size of the League of Non-Aligned Powers forming, with options from never formed to getting many members. ```StellarisConfig @CmtT000_ConstHeavenNpcLeague = 4 ### Never Formed = 1, Get Handful of Members = 2 ### Get Middle Amount of Members = 3, Get Many Members = 4 (Default) ``` -------------------------------- ### Define Tutorial and Advisor Tip Events (Stellaris Script) Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/events/tutorial_events.txt These snippets define various event types—first contact, country, and ship events—used for tutorials and advisor tips in Stellaris. Each event block specifies an ID, window visibility, firing conditions, and trigger logic, typically set to 'always = no' for events triggered by game logic rather than direct conditions. ```Stellaris Script first_contact_event = { id = tutorial.2000 hide_window = yes fire_only_once = yes is_triggered_only = yes is_test_event = yes trigger = { always = no } } ``` ```Stellaris Script first_contact_event = { id = tutorial.2004 hide_window = yes fire_only_once = yes is_triggered_only = yes is_test_event = yes trigger = { always = no } } ``` ```Stellaris Script country_event = { id = tutorial.2005 hide_window = yes fire_only_once = yes is_triggered_only = yes is_test_event = yes trigger = { always = no } } ``` ```Stellaris Script country_event = { id = tutorial.2006 hide_window = yes fire_only_once = yes is_triggered_only = yes is_test_event = yes trigger = { always = no } } ``` ```Stellaris Script country_event = { id = tutorial.2007 hide_window = yes fire_only_once = yes is_triggered_only = yes is_test_event = yes trigger = { always = no } } ``` ```Stellaris Script country_event = { id = tutorial.2010 hide_window = yes fire_only_once = yes is_triggered_only = yes is_test_event = yes trigger = { always = no } } ``` ```Stellaris Script country_event = { id = tutorial.2100 hide_window = yes fire_only_once = yes is_triggered_only = yes is_test_event = yes trigger = { always = no } } ``` ```Stellaris Script country_event = { id = tutorial.2105 hide_window = yes fire_only_once = yes is_triggered_only = yes is_test_event = yes trigger = { always = no } } ``` ```Stellaris Script country_event = { id = tutorial.2110 hide_window = yes fire_only_once = yes is_triggered_only = yes is_test_event = yes trigger = { always = no } } ``` ```Stellaris Script country_event = { id = tutorial.2111 hide_window = yes fire_only_once = yes is_triggered_only = yes is_test_event = yes trigger = { always = no } } ``` ```Stellaris Script country_event = { id = tutorial.2115 hide_window = yes fire_only_once = yes is_triggered_only = yes is_test_event = yes trigger = { always = no } } ``` ```Stellaris Script country_event = { id = tutorial.2120 hide_window = yes fire_only_once = yes is_triggered_only = yes is_test_event = yes trigger = { always = no } } ``` ```Stellaris Script country_event = { id = tutorial.2121 hide_window = yes fire_only_once = yes is_triggered_only = yes is_test_event = yes trigger = { always = no } } ``` ```Stellaris Script country_event = { id = tutorial.2125 hide_window = yes fire_only_once = yes is_triggered_only = yes is_test_event = yes trigger = { always = no } } ``` ```Stellaris Script country_event = { id = tutorial.2126 hide_window = yes fire_only_once = yes is_triggered_only = yes is_test_event = yes trigger = { always = no } } ``` ```Stellaris Script country_event = { id = tutorial.2130 hide_window = yes fire_only_once = yes is_triggered_only = yes is_test_event = yes trigger = { always = no } } ``` ```Stellaris Script country_event = { id = tutorial.2131 hide_window = yes fire_only_once = yes is_triggered_only = yes is_test_event = yes trigger = { always = no } } ``` ```Stellaris Script ship_event = { id = tutorial.2140 hide_window = yes fire_only_once = yes is_triggered_only = yes is_test_event = yes trigger = { always = no } } ``` ```Stellaris Script ship_event = { id = tutorial.2145 hide_window = yes fire_only_once = yes is_triggered_only = yes is_test_event = yes trigger = { always = no } } ``` ```Stellaris Script country_event = { id = tutorial.2150 hide_window = yes fire_only_once = yes is_triggered_only = yes is_test_event = yes trigger = { always = no } } ``` ```Stellaris Script country_event = { id = tutorial.2500 hide_window = yes fire_only_once = yes is_triggered_only = yes is_test_event = yes trigger = { always = no } } ``` ```Stellaris Script country_event = { id = tutorial.2550 hide_window = yes fire_only_once = yes is_triggered_only = yes is_test_event = yes trigger = { always = no } } ``` -------------------------------- ### Define Earliest Sleeper Awakening Time Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/common/scripted_variables/Cmt-101_Template-01_scripted_variables.txt Sets the earliest awakening time for sleepers relative to the End-Game Start Year. Allows for half awakening or template unique values. ```APIDOC @CmtT101_ConstSleeperEarliestEgsy: int = 0 Description: Set x of 'End-Game Start Year + x years'. Options: -999, -100, -75, -50, -25, 0, 25, 50, 75, 100, 999 Notes: -999: Half Awakening 999: Template Unique Value (Beta Feature), set in 'common\\scripted_variables\\Cmt-xxx_Unique_scripted_variables.txt'. ``` -------------------------------- ### Set Earliest Awakening Year for Sleepers Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/common/scripted_variables/Cmt-000_DefaultTemplate_scripted_variables.txt Specifies an offset from the 'End-Game Start Year' for when sleepers can awaken. Negative values allow for 'Half Awakening', and 999 indicates a unique template value. ```StellarisConfig @CmtT000_ConstSleeperEarliestEgsy = 0 ### Set x of ''End-Game Start Year + x years''. ### x must be -999, -100, -75, -50, -25, 0, 25, 50, 75, 100 or 999. (Default = 0) ### Exception: -999 means ''Half Awakening'' ### 999 means Template Unique Value (Beta Feature), set in ''common\scripted_variables\Cmt-xxx_Unique_scripted_variables.txt''. ``` -------------------------------- ### Implement 'Go Back' Navigation Option Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/events/CmtM1b_ConfigViewer~EndGame.txt This option provides a way to navigate back to the main viewer menu. It's active when the `CmtFlagConfigViewerSeq` country flag is set. Upon activation, it removes a specific country flag (`CmtFlagConfigViewerShowing1010`) and triggers a new country event, effectively changing the current menu context. ```PDX Script option = { name = CmtTextGoBackViewerMenu.name custom_tooltip = BLANK_STRING trigger = { has_country_flag = CmtFlagConfigViewerSeq } hidden_effect = { remove_country_flag = CmtFlagConfigViewerShowing1010 country_event = { id = CrisisManagerMenu.1000 } } } ``` -------------------------------- ### Khan Crisis Configuration Trigger Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/common/scripted_triggers/Cmt00_Common_scripted_triggers.txt Defines a trigger for the Khan crisis configuration. It activates if the Marauder crisis has not started yet or if debug mode is active, specifically within the MidGame edition. ```PDS Script CmtTriggerKhanConfig = { optimize_memory OR = { NOT = { has_global_flag = marauder_crisis_started } has_global_flag = CmtFlagDebugMode } has_global_flag = CmtFlagMidGameEdition } ``` -------------------------------- ### DMM Mod Registration Event (dmm_mod.101) Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/events/000_dmm_mod_10.txt This event handles the registration of a mod with the Dynamic Mod Menu (DMM) system. It checks for DMM installation status and either sets a temporary flag for older versions or uses `dmm_register_mod` for newer DMM versions, ensuring proper integration. ```Paradox Script event = { id = dmm_mod.101 hide_window = yes is_triggered_only = yes immediate = { if = { limit = { NOT = { has_global_flag = dmm_installed } } set_global_flag = dmm_mod_10 } else = { dmm_register_mod = { DMM_NAME = dmm_mod_10 DMM_FLAG = dmm_mod_10 } if = { limit = { has_global_flag = dmm_mod_10 } remove_global_flag = dmm_mod_10 } } } } ``` -------------------------------- ### Define On-Game-Start Country Event Source: https://github.com/f1r3pr1nc3/a-deadly-tempest/blob/master/mod/common/on_actions/adt_on_actions.txt Configures the event that triggers at game start specifically for a country. The `origin_gatekeepers.001` event is executed, typically used for setting up the capital system. ```Stellaris Script on_game_start_country = { events = { origin_gatekeepers.001 # Setup the capital system } } ```