Stellaris

Stellaris

~~Scripted Trigger Undercoat
kuyan-judith  [developer] 30 Mar, 2024 @ 6:41am
Complete list of features
Expanded use of vanilla triggers
The following vanilla scripted triggers are now used in place of the corresponding hardcoded triggers whenever possible:
  • is_gestalt (only when used in country scope)
  • is_megacorp (except when "auth_oligarchic" is checked for in the same or a very similar context)
  • is_machine_empire
  • is_hive_empire
  • is_fallen_empire
  • is_flora_species
  • is_subterranean_empire
  • is_homicidal
  • is_crafter_empire
  • is_eager_explorer_empire
  • is_pleasure_seeker_empire
  • is_anglers_empire
  • is_catalytic_empire
  • is_idyllic_bloom_empire
  • is_death_cult_empire
  • is_memorialist_empire
  • is_relentless_industrialist_empire
  • is_scavenger
  • has_toxic_baths
  • is_memory_vault_empire
  • is_ascensionist_empire
  • is_dimensional_worship_empire
  • is_starting_planet_type
  • uninhabitable_regular_planet
  • is_apocalypitc_empire
  • is_natural_design_empire
  • is_crowdsourcing_empire
  • is_wilderness_empire

The following vanilla hardcoded triggers are now used in place of lists of individual planet classes whenever possible:
  • is_artificial
  • is_asteroid

Additional country type triggers
Adds the following country-type-checking triggers, all of which are used wherever they're applicable and all of which can also be activated via country flags:
  • is_playable
  • is_empire (checks for playable and fallen empires)
  • is_endgame_crisis

Additional authority triggers
Moves most remaining has_authority checks to the following scripted triggers:
  • has_authority_corporate (used only when auth_oligarchic is checked for in the same or a similar context; otherwise is_megacorp is used instead)
  • has_authority_democratic
  • has_authority_oligarchic
  • has_authority_dictatorial
  • has_authority_imperial

Moves checks for advanced authorities into scripted triggers of the form "has_auth_cyber_creed_democratic", "has_auth_cyber_oligarchic_individualist" etc.

Origin triggers
Moves all applicable origin checks to the following scripted triggers:
  • has_federation_origin (applies to both Common Ground and Hegemon empires)
  • has_default_pre_ftl_origin
  • gets_prosperous_unification_bonus
  • is_subterranean_empire (vanilla trigger)
  • is_calamitous_birth_empire
  • is_resource_consolidator_empire
  • is_necrophage_empire/is_current_or_former_necrophage_empire (depending on whether the effect should be disabled by machine ascension)
  • is_hegemon_origin_empire
  • is_common_ground_empire
  • is_vassal_origin_overlord
  • has_imperial_vassal_origin
  • is_separatist_empire
  • is_mechanist_empire
  • is_syncretic_evolution_empire
  • is_life_seeded_empire
  • is_remnants_empire
  • is_shattered_ring_empire
  • is_scion_empire
  • is_galactic_doorstep_empire
  • is_tree_of_life_empire
  • is_shoulders_of_giants_empire
  • is_doomsday_empire
  • is_lost_colony_empire
  • is_clone_army_empire
  • is_here_be_dragons_empire
  • is_ocean_paradise_empire
  • is_progenitor_hive_empire
  • is_star_slingshot_empire
  • is_shroudwalker_apprentice_empire
  • is_overtuned_empire
  • is_toxic_knights_empire
  • is_fear_of_the_dark_empire
  • is_payback_empire
  • is_broken_shackles_empire
  • is_fruitful_empire
  • is_riftworld_empire
  • is_cybernetic_creed_empire
  • is_synthetic_firtility_empire
  • is_arc_welder_empire
  • is_storm_chasers_empire
  • is_treasure_hunter_empire
  • is_enlightened_empire
  • is_primal_calling_empire
  • is_evolutionary_predators_empire
  • is_starlit_citadel_empire
  • is_unplugged_empire
  • is_minamar
  • has_legendary_leader_origin_active (checks for all variants of origin_legendary_leader except origin_legendary_leader_dead)
  • legendary_leader_ascension_trigger
  • can_add_organic_void_dweller_traits
  • can_add_robotic_void_dweller_traits

Civic triggers
Moves has_civic and has_valid_civic checks to the following scripted triggers wherever applicable:
  • has_slaver_civic (for civic_slaver_guild and civic_indentured_assets)
  • has_reanimated_armies, has_permanent_employment and is_cordyceptic_empire (only for the aspects of these civics not covered by is_reanimator)
  • is_inwards_perfection_empire
  • is_despoiler_empire
  • is_agrarian_empire
  • is_aristocratic_empire
  • is_shared_burden_empire
  • is_environmentalist_empire
  • is_megachurch_empire
  • is_machine_assimilator
  • has_citizen_service
  • is_franchise
  • is_pompous_empire
  • is_feudal_empire
  • is_technocracy
  • has_exalted_priesthood
  • has_warrior_culture
  • has_natural_neural_network
  • has_efficient_bureaucracy
  • has_byzantine_bureaucracy
  • has_maintenance_protocols
  • has_dystopian_society
  • is_private_healthcare_empire
  • is_privateer_empire
  • has_crusader_spirit
  • has_parliamentary_system
  • has_heroic_tales
  • has_philosopher_king
  • is_servitor_empire
  • is_void_hive_empire
  • is_selective_kinship_empire
  • is_obsessional_directive_empire
  • is_tactical_algorithms_empire
  • is_astromining_drones_empire
  • is_augmentation_bazaars_empire
  • is_civil_education_empire
  • is_familiar_face_empire
  • is_aerospace_adaptation_empire
  • is_bodysnatcher_empire

Planet Class Triggers
Moves is_planet_class checks to the following scripted triggers wherever applicable:
  • is_shielded (for pc_shielded, pc_habitat_shielded, and pc_ringworld_shielded
  • is_shattered_world
  • planet_is_nonstandard_star (pc_neutron_star, pc_pulsar, and pc_black_hole)
  • planet_is_neutron_star_including_pulsar (pc_neutron_star and pc_pulsar)
  • is_city_world
  • is_habitat
  • is_shattered_ring_habitable
  • is_damaged_ring_segment
  • is_unshattered_ring_habitable_segment
  • is_gaia_world
  • is_hive_world
  • is_machine_world
  • is_nuked_world
  • is_relic_world
  • is_cosmogenesis_world
  • is_nanotech_world
  • is_continental_world
  • is_tropical_world
  • is_ocean_world
  • is_desert_world
  • is_arid_world
  • is_savannah_world
  • is_arctic_world
  • is_tundra_world
  • is_alpine_world
  • is_gas_giant
  • is_toxic_world
  • is_frozen_world
  • is_barren_cold_world
  • is_barren_dry_world
  • is_molten_world
  • is_ice_asteroid
  • is_rare_crystal_asteroid
  • is_cuthuloid_asteroid
  • is_rocky_asteroid
  • is_broken_world
  • is_gray_goo_world
  • is_infested_world
  • is_shrouded_world
  • planet_is_black_hole

Leader Class Triggers
Moves leader_class checks to the following scripted triggers:
  • leader_is_scientist_stu
  • leader_is_official_stu
  • leader_is_commander_stu
  • leader_is_envoy_stu

Civic Requirement Inline Scripts
The following inline scripts are added to the potential and possible blocks of civics:
  • governments/conditions/is_regular (the standard potential check for non-corporate, non-gestalt civics; should be used directly within the potential block)
  • governments/conditions/is_corporate (the standard potential check for corporate civics; should be used directly within the potential block)
  • governments/conditions/is_hive (the standard potential check for hive civics; should be used directly within the potential block)
  • governments/conditions/is_machine (the standard potential check for machine civics; should be used directly within the potential block)
  • governments/conditions/auth_<democratic/oligarchic/dictatorial/imperial/corporate/hive_mind/machine_intelligence> (authority checks for use within the possible-authority-OR context )

Leader Class Inline Scripts
Class restrictions on leader traits and council positions are moved to the following inline scripts:
  • leaders/class_restrictions/scientist
  • leaders/class_restrictions/official
  • leaders/class_restrictions/commander
  • leaders/class_restrictions/commander_or_official
  • leaders/class_restrictions/commander_or_scientist
  • leaders/class_restrictions/scientist_or_official
  • leaders/class_restrictions/generic (restricts to scientist, commander, or official)

Diplomatic Restriction Triggers
Recurring civic-based diplomatic restrictions are moved to the following scripted triggers:
  • homicidal_diplomacy_restrictions
  • homicidal_diplomacy_restrictions_no_exception (doesn't have the species-based exception for fanatic purifiers)
  • machine_assimilator_diplomacy_restrictions
  • inwards_perfection_diplomacy_restrictions
  • pompous_diplomacy_restrictions
  • pompous_sender_diplomacy_restrictions
  • barbaric_despoilers_diplomacy_restrictions

With the exception of the Pompous Purists restrictions, each of these triggers has the optional parameters "mirror" and "mirror_with_intel", functioning as follows:
  • "mirror = no" - countries with the relevant civics cannot send this action (except as to the same species or fellow robots) but can receive it
  • "mirror = yes" - countries with the relevant civics can't send or receive this, tooltip for would-be senders always explains why
  • "mirror_with_intel = yes" - countries with the relevant civics can't send or receive this, tooltip for would-be senders only explains why if they have the intel to see the relevant civics

Homicidal event options
The standard dismissals available to homicidal empires in NPC diplomacy events (i.e. "Xeno scum.", "Prey...", "PREY", and "<< Organics identified. Communications terminated. >>") are moved to the following inline scripts:
  • events/homicidal_option ("Prey...", contains an option which does nothing and replaces other options)
  • events/homicidal_option_2 ("PREY", contains an option which does nothing and replaces other options)
  • events/homicidal_option_text ("Prey...", contains three 'name' blocks for use within an option block which does something)
  • events/homicidal_option_text_2 ("PREY", contains three 'name' blocks for use within an option block which does something)

All four take a "who" parameter which should point to the country seeing the event, either "this" or "owner"

Additional Job Scripts
Adds the following jobs/<job>_add inline scripts and applies them wherever applicable:
  • crystal_miner
  • gas_extractor
  • mote_harvester
  • soldiers
  • enforcers (enforcers and patrol drones)
  • roboticists (roboticists and replicators)

Also:
  • Applies the vanilla jobs/<job>_add inline scripts in districts (as opposed to vanilla's use only in buildings)
  • Adds the jobs/civic_capital_jobs inline script, which handles the various civic-based partial replacements of politicians with merchants, nobles etc.

For each jobs/<job>_add script, adds a corresponding jobs/triggered_<job>_add script replacing similar sets of jobs where the basic version was unusable due either to a need for additional triggers, to a need for a "mult" parameter, or to the context not supporting "triggered_desc" blocks. In addition to the AMOUNT parameters, these have the following parameters:
  • trigger - additional triggers. set to " " if not needed.
  • mult_line - set to "mult = <whatever>" to add a mult parameter, and to " " if no such parameter is needed
  • desc - set to 1 to include triggered_desc blocks or 0 to omit them.
  • scaling - "scaling = per_pop" or scaling = "per crime" will apply job_<whatever>_per_pop and job_<whatever>_per_crime modifiers in place of the default "job_<whatever>_add" modifiers.

Giving inline scripts optional parameters requires a wrapper script; for this purpose, the "stu/jobs_add" script also exists; this script fills any non-listed parameters in the jobs/$job_type$_add scripts with default values.

The following jobs/triggered/<job>_add script combines two or more other jobs/triggered/<job>_add scripts and is only available in /triggered/ form:
  • administrators_add adds either bureaucrat jobs, priest jobs, or equal numbers of death priest and mortal initiate jobs (parameters: AMOUNT, priests_trigger, death_priests_trigger)

Script values for district jobs and housing
Jobs and housing from districts are now controlled by script values.

Empire Setup Script Values and Modifiers
Also adds the following script values, each of which can also be altered using the corresponding scripted modifier:
  • starting_pops / starting_pops_add - determines the total number of pops created on an empire's homeworld during setup
  • secondary_species_starting_pops / secondary_species_starting_pops - determines the number of pops of an empire's secondary species created on its homeworld during setup

These remove the need for generate_start_pops to directly check for civics or origins to determine whether to create secondary species pops and how many pops to create of each species. Other locations where vanilla checks for all secondary-species civics and origins now also check the secondary_species_starting_pops modifier.

Modifiers
Also adds the following modifiers:
  • rare_tech_draw_chance_mult
  • stu_deleterious_organic_modding_flag - if greater than 0, the can_add_negative_traits_organic and can_remove_positive_traits_organic game rules will evaluate true (but all individual organic traits will still be subject to other restrictions)
  • stu_can_build_non_unity_megastructures_flag - for use in megastructure technologies. If greater than 0 on an AI country, that country will budget for megastructures which don't cost unity
  • stu_can_build_unity_megastructures_flag - for use in megastructure technologies. If greater than 0 on an AI country, that country will budget for megastructures which do cost unity
  • stu_cannot_think_flag - if greater than 0 on a pop, can_think will evaluate false
  • stu_overtuned_flag - if greater than 0 on a pop, is_overtuned will evaluate true
  • stu_presapient_trait_flag - if greater than 0 on a pop, has_presapient_trait will evaluate true

Additional Diplomatic On_Actions
Adds the following on_actions, fired by script when the related diplomatic actions are accepted:
  • on_sign_trade_deal
  • on_accept_embassy
  • on_accept_societal_enlightenment
  • on_accept_technological_enlightenment
  • on_accept_pre_ftl_trade
  • on_defensive_pact_broken_victim, on_non_aggression_pact_broken_victim, on_research_pact_broken_victim, on_migration_pact_broken_victim, on_embassy_recalled_victim (also fired when the relevant pact is broken via script, by replacing end_all_treaties_with with the scripted effect end_all_treaties_with_stu)
  • on_leave_subjugation (also fired when subjugation is ended by script, by replacing release_subject and set_subject_of with the scripted effects release_subject_stu and set_subject_of_stu)
  • on_made_rival
  • on_independence_guaranteed
  • on_guarantee_broken_victim
  • on_independence_supported
  • on_support_broken_victim
  • on_become_federation_associate
  • on_associate_status_revoked
  • on_associate_status_relinquished
  • on_granted_border_access
  • on_borders_closed_victim
  • on_insulted
  • on_subject_integration_begun_subject
  • on_subject_integration_cancelled_subject
  • on_pledge_secret_fealty
  • on_break_secret_fealty (also fired when secret fealty is ended by script, but replacing remove_secret_fealty with the scripted effect remove_secret_fealty_stu)

Other On_Actions
Adds the following on_actions, fired by script whenever the applicable event occurs:
  • on_planet_spawned
  • on_system_spawned
  • on_embrace_faction
  • on_pops_killed_by_effect (implemented via replacing kill_pop with the scripted effect kill_pop_stu. since scripted on_actions can't set local_pop_amount, also temporarily sets a variable named "local_pop_amount_stu" to the number of pops killed.)

Flags
The following flags can be added to objects to alter specific behaviors:
  • stu_force_advanced_empire - country flag, guarantees a country will be selected to become an advanced empire
  • stu_cannot_be_advanced_empire - country flag, guarantees a country won't be selected to become an advanced empire
  • stu_can_bombard_everyone - country flag, allows orbital bombardment of arbitrary countries
  • stu_can_bombard_any_hostile - country flag, allows orbital bombardment of arbitrary hostile countries
  • stu_ai_restrict_system@<country> - system flag, causes an AI country to avoid a system
  • stu_system_blocks_jumps - system flag, prevents ships from jumping to a system
  • stu_harvested_leviathan_dna - makes a country count as having harvested leviathan DNA
  • stu_structure_can_teach_megaengineering - megastructures with this flag increase the chance for the megaengineering technology (which already checked for most vanilla megastructure types)
  • stu_counts_as_civilization_for_comms - makes a country count as a civilization for the purpose of the has_comms_with_alien_civilization trigger
  • stu_is_gate - makes a megastructure count as a gate for the purpose of has_no_non_gate_megastructure
  • stu_special_colony_type - makes a planet count as having a special colony type
  • stu_precursor_intro - makes a country count as having had a precursor intro
  • stu_situation_leviathan_biological - makes a leviathan parade situation count for is_situation_leviathan_biological
  • stu_is_organic_controllable_ship - makes a ship count for is_organic_controllable_ship
  • stu_has_special_star_flag - makes a system count for has_special_star_flag_trigger
  • stu_is_non_hostile_to_wraith - makes a country non-hostile to the Wraith
  • stu_terraforming_candidate - makes a country count for is_terraforming_candidate

Aquatic and Habitability Trait Modularization
  • habitability for dry, wet, and cold planets in general now uses the dry_habitability, wet_habitability, and cold_habitability static modifiers
  • The climate-based bindings for robotic habitability traits are moved to the inline scripts "traits/climate_bindings/dry", "traits/climate_bindings/wet", and "traits/climate_bindings/cold"
  • The planet class restriction on the aquatics trait is moved to the inline script traits/aquatic_pc_restriction
  • The logic for where aquatic species get bonuses is moved to the planet_gives_aquatics_bonus scripted trigger
  • The logic for where aquatic species get maluses is moved to the planet_gives_aquatics_malus scripted trigger

Conditional Script
Adds the stu/conditional_script inline script, taking the parameters CASE and CONTENTS, the latter of which should generally be a block of script enclosed in quotation marks. If CASE = 0 the script will be ignored, if CASE = 1 it will insert the script in CONTENTS.

This can be used either to include optional blocks in other inline scripts, or to include script which will be inserted or ignored based on a scripted variable provided by another mod.

Improvements to vanilla triggers
  • Many vanilla scripted triggers which previously only functioned correctly in a specific context due to the use of "from" or "root" scopes have been modifier to be more flexible through the use of parameters and/or "prev"
  • rather than listing all colonizable planet classes, colonizable_planet now simply checks the hardcoded is_colonizable trigger
  • Rather than having a whitelist of megastructure types which aren't gates, has_no_non_gate_megastructure now uses a (much shorter) blacklist of ones which are

Miscellaneous
  • all policies now have policy flags
  • with the exception of purge and precursors, pop categories that have happiness but lack the vanilla inline script "pop_categories/social_classes_triggered_modifiers" now instead get the inline scripts "pop_categories/stu_other_pop_category_triggered_modifiers", and all pop categories now get the inline script "pop_categories/social_classes_triggered_modifiers_no_happiness"
  • "damage vs. crisis" effects now use the damage_vs_crisis_mult static modifer
  • Moved the logic determining which starbases can build defense platforms to the scripted trigger can_have_defense_platforms
  • For the sake of convenience, adds scripted triggers for the DLC that don't already have them
Last edited by kuyan-judith; 31 May @ 12:08am