群星
ParaWikis
最新百科
都市天际线2百科
英雄无敌3百科
维多利亚3百科
奇妙探险队2百科
罪恶帝国百科
英白拉多:罗马百科
热门百科
群星百科
欧陆风云4百科
十字军之王2百科
十字军之王3百科
钢铁雄心4百科
维多利亚2百科
ParaWikis
申请建站
ParaWikis
ParaCommons
最近更改
随机页面
加入QQ群
工具
链入页面
相关更改
特殊页面
页面信息
页面值
阅读
编辑
编辑源代码
查看历史
讨论
编辑“
Effects
”
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
{{version|3.1}} == Introduction == An Effect is a script that does something, similar to a function in other programming languages. An Effect differs from a Trigger in that a Trigger always returns a boolean, True or False, and doesn't change anything in the game. An Effect is the script that actually changes game state (i.e. Applies modifiers, creates or destroys objects, etc.) The list below is not complete, as it only includes the Effects built-in to the engine. More effects are scripted and located in common/scripted_effects. You can write your own effects there as well. If you have Event code that is repeated multiple times, it is usually easier to put the code into an Effect and just call the Effect from the event code everyplace it needs to run. An Effect runs in the scope in which it is called. Be careful using the FROM scope in effects, as you can't be sure from where the script will always be run. == Dump Export == Current effects can be found in an '''''effects.log''''' file in your local data folder's script_documentation (defaults to "%USERPROFILE%\Documents\Paradox Interactive\Stellaris\'''logs\script_documentation\'''").<sup>[[Talk:Effects#Regexp|[regexp s. talk]]]</sup> {| class="wikitable sortable" style="font-size:90%; text-align:left; width:100%" |- ! Name !! Desc !! Example !! Scopes <!--!! Target !! Category--> |- | tooltip || Just a tooltip || || all |- | win || The scoped country wins the game ||class=mw-code| win = yes | country |- | hidden_effect || Prevents enclosed effects from being displayed in tooltip ||class=mw-code| hidden_effect = { <effects> } | all |- | custom_tooltip || Displays a specific localization string in tooltip ||class=mw-code| custom_tooltip = <string> | all |- | if || Executes enclosed effects if limit criteria are met ||class=mw-code| if = { limit = { <triggers> } <effects> } | all |- | end_all_treaties_with || Ends all treaties with the target ||class=mw-code| end_all_treaties_with = <target> | country |- | random_list || Picks one random set of effects from a list, influenced by relative weight ||class=mw-code| random_list = { 50 = { <effects> } 20 = { <effects> } 30 = { <effects> } 999 = { <effects> } } | all |- | locked_random_list || Picks one random set of effects from a list, influenced by relative weight once per event scope ||class=mw-code| locked_random_list = { 50 = { <effects> } 20 = { <effects> } 30 = { <effects> } 999 = { <effects> } } | all |- | remove_deposit || Remove resource deposit on the scoped planet or deposit, does not fire on_cleared if used on a blocker ||class=mw-code| remove_deposit = <key/yes> | planet deposit |- | add_blocker || Adds a blocker to a planet, with some control over what it is set to block (add_deposit will add a random planetary deposit to block) ||class=mw-code| add_blocker = { type = <key> blocked_deposit = none (default)/<deposit scope – copies the type to the blocked deposit but any flags or variables are lost>/random } | planet |- | set_owner || Instantly sets the owner of the scoped planet/fleet/army/starbase to target country ||class=mw-code| set_owner = <target> | megastructure planet fleet leader army starbase |- | unemploy_pop || Fires scoped pop from its job ||class=mw-code| unemploy_pop = yes | pop |- | check_planet_employment || Immediately runs a job evaluation on the planet, firing and employing pops as needed ||class=mw-code| check_planet_employment = yes | planet |- | change_species_portrait || Changes the portrait of the species in scope. ||class=mw-code| change_species_portrait = <key or species event target> | species |- | clear_pop_category || Resets category of a pop ||class=mw-code| clear_pop_category = yes | pop |- | add_random_non_blocker_deposit || Adds random non-blocker resource deposit to the scoped planet ||class=mw-code| add_random_non_blocker_deposit = yes | planet |- | remove_last_built_building || Removes last built building from the scoped planet ||class=mw-code| remove_last_built_building = yes | planet |- | remove_all_buildings || Removes all buildings from the scoped planet ||class=mw-code| remove_all_buildings = yes | planet |- | give_technology || Instantly gives a specific tech to the scoped country ||class=mw-code| give_technology = { tech = tech_desert_colonization message = yes } | country |- | add_building || Begins construction of a specific building on the scoped planet ||class=mw-code| add_building = <key> | planet |- | add_planet_devastation || Instantly adds devastation to scoped planet ||class=mw-code| add_planet_devastation = 5 | planet |- | create_half_species || Creates a new pop from a half-species on the planet ||class=mw-code| create_half_species = { species_one = <target> species_two = <target> } | all |- | calculate_modifier || Forces target planet or country to calculate its internal modifier ||class=mw-code| calculate_modifier = yes | planet |- | establish_branch_office || Establish branch office on scoped planet for target country ||class=mw-code| establish_branch_office = <target> | planet |- | close_branch_office || Close branch office on scoped planet ||class=mw-code| close_branch_office = yes | planet |- | clear_blockers || Removes all blockers from the scoped planet ||class=mw-code| clear_blockers = yes | planet |- | set_built_species || Changes the built species of the scoped object ||class=mw-code| set_built_species = <target> | country |- | set_first_contact_flag || Sets an arbitrarily-named flag on the scoped first contact site ||class=mw-code| set_first_contact_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | first_contact |- | set_federation_flag || Sets an arbitrarily-named flag on the scoped federation ||class=mw-code| set_federation_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | federation |- | set_country_flag || Sets an arbitrarily-named flag on the scoped country ||class=mw-code| set_country_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | country |- | set_planet_flag || Sets an arbitrarily-named flag on the scoped planet ||class=mw-code| set_planet_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | planet |- | set_fleet_flag || Sets an arbitrarily-named flag on the scoped fleet ||class=mw-code| set_fleet_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | fleet |- | set_ship_flag || Sets an arbitrarily-named flag on the scoped ship ||class=mw-code| set_ship_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | ship |- | remove_first_contact_flag || Removes a flag from the scoped first contact site ||class=mw-code| remove_first_contact_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | first_contact |- | remove_federation_flag || Removes a flag from the scoped federation ||class=mw-code| remove_federation_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | federation |- | remove_country_flag || Removes a flag from the scoped country ||class=mw-code| remove_country_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | country |- | remove_planet_flag || Removes a flag from the scoped planet ||class=mw-code| remove_planet_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | planet |- | remove_fleet_flag || Removes a flag from the scoped fleet ||class=mw-code| remove_fleet_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | fleet |- | remove_ship_flag || Removes a flag from the scoped ship ||class=mw-code| remove_ship_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | ship |- | every_owned_ship || Iterate through each ship in the fleet or owned by the country – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_owned_ship = { limit = { <triggers> } <effects> } | country fleet |- | random_owned_ship || Iterate through each ship in the fleet or owned by the country – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_owned_ship = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country fleet |- | create_species || Creates a new species ||class=mw-code| create_species = { name = <string> plural = <string> class = <species class key> portrait = <random/portrait id> homeworld = <target> name_list = <namelist> traits = { <specific/random traits> } sapient = <Y/N, determines if species is pre-sapient> is_mod = <Y/N, determines if species is a modification of another> immortal = <Y/N, determines if species leaders are immortal> can_be_modified = <Y (default)/N/this> } | all |- | create_country || Creates a new country ||class=mw-code| create_country = { name = <string/random> adjective = <string> contact_rule = <string> type = <key> auto_delete = <bool> name_list = <key> ship_prefix = <string> authority = <key> civics = random / { civic = <key> civic = random } species = <target> flag = <random / { icon = { category = <key> file = <filename.dds> } background = { category = <key> file = <filename.dds> } colors = { <key> <key> } } ethos = <random / { ethic = <key> ethic = <key> }> restrictions = { <restrictions, see "common\governments\readme_requirements.txt"> } effect = { <effects executed on country> } } | all |- | create_fleet || Creates a new fleet ||class=mw-code| create_fleet = { name = <string> effect = { <create_ship, set_owner, set_location etc effects go here> } } | all |- | create_army || Creates a new army ||class=mw-code| create_army = { name = <string> owner = <target> species = <target>/random type = <key> } | planet |- | modify_army || Modifies army with parameters: ||class=mw-code| modify_army = { name = <string> owner = <target> species = <target>/random type = <key> } | army |- | set_location || Sets the fleet/ambient object's location, can be fine-tuned ||class=mw-code| set_location = <target> set_location = { target = <target> distance = <int/random> angle = <int/random> direction = <in_system/out_system> } | fleet ambient_object |- | create_ship || Creates a new ship ||class=mw-code| create_ship = { name = <string/random> design = <ship design key/target, or use random_existing_design> random_existing_design = <ship size key> graphical_culture = <graphical culture key> prefix = <Y/N, determines if ship name should use owner country prefix> colonizer_species = <species, default: fleet owner founder species> } | fleet starbase |- | create_pop || Creates a new pop on the scoped planet ||class=mw-code| create_pop = { species = <target / key> ethos = <random / target / { ethic = <key> ethic = <key> }> } | planet |- | create_colony || Creates a colony on the scoped planet ||class=mw-code| create_colony = { owner = <target> species = <target / key> ethos = <random / target / { ethic = <key> ethic = <key> }> } | planet |- | set_capital || Sets the scoped planet to be the capital of its owner country ||class=mw-code| set_capital = yes | planet |- | change_pc || Changes the class of the scoped planet ||class=mw-code| change_pc = <class/random list> change_pc = { class = <class/random list> inherit_entity = yes } | planet |- | set_star_class || Sets the star's star class, affecting system and galactic map graphics and potentially modifiers. Also changes the planet class of the system's primary star. ||class=mw-code| set_star_class = <star class> | galactic_object |- | random_country || Iterate through all countries – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_country = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | all |- | random_pop || Executes enclosed effects on a random pop that meets the limit criteria. Warning: deprecated, use random_owned_pop ||class=mw-code| random_pop = { limit = { <triggers> } <effects> } | planet |- | kill_pop || Instantly destroys the scoped pop ||class=mw-code| kill_pop = yes | pop |- | destroy_colony || Destroys the colony on the scoped planet ||class=mw-code| destroy_colony = yes | planet |- | add_experience || Adds a sum of experience points to the scoped leader ||class=mw-code| add_experience = 200 | leader |- | set_ring || Adds or removes a planetary ring around the scoped planet ||class=mw-code| set_ring = no | planet |- | create_mining_station || Creates a mining station in orbit of the scoped planet ||class=mw-code| create_mining_station = { owner = <target> } | planet |- | create_research_station || Creates a research station in orbit of the scoped planet ||class=mw-code| create_research_station = { owner = <target> } | planet |- | set_pop_flag || Sets an arbitrarily-named flag on the scoped pop ||class=mw-code| set_pop_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | pop |- | remove_pop_flag || Removes a flag from the scoped pop ||class=mw-code| remove_pop_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | pop |- | every_owned_pop || Iterate through all owned pops – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_owned_pop = { limit = { <triggers> } <effects> } | planet country pop_faction sector |- | set_name || Sets the name of the scoped country/planet/ship/fleet/leader/army/system/pop faction ||class=mw-code| set_name = <string> | megastructure planet country ship fleet galactic_object leader army pop_faction war federation sector |- | set_adjective || Sets the adjective of the scoped country ||class=mw-code| set_adjective = <string> | country |- | set_ship_prefix || Sets the ship prefix of the scoped country ||class=mw-code| set_ship_prefix = <string> | country |- | add_modifier || Adds a specific modifier to the scoped object for a set duration ||class=mw-code| add_modifier = { modifier = <key> days/months/years = <int, -1 (default) means it never expires> multiplier = <float>/<variable> (optional) time_multiplier = <variable> (optional: days/months/years value is multiplied by the value of this variable) clear_on_owner_change = yes (optional: default no; clears modifier if planet/system/megastructure's owner changes) } | megastructure planet country ship pop fleet galactic_object pop_faction federation spy_network espionage_operation |- | reduce_hp || Reduces the hull points of the scoped ship by a specific amount ||class=mw-code| reduce_hp = 120 | ship |- | reduce_hp_percent || Reduces the hull points of the scoped ship by a relative amount ||class=mw-code| reduce_hp_percent = 0.25 | ship |- | repair_ship || Restores all hull points to the scoped ship ||class=mw-code| repair_ship = yes | ship |- | set_surveyed || Sets the planet or system as un/surveyed by target country ||class=mw-code| set_surveyed = { surveyed = yes surveyor = <target> } | planet galactic_object |- | set_visited || Sets the target system as 'visited' (i.e. low system intel on the map) ||class=mw-code| set_visited = <target> | country |- | destroy_country || Destroys the scoped country ||class=mw-code| destroy_country = yes | country |- | set_variable || Sets or creates an arbitrarily-named variable with a specific value in the current scope ||class=mw-code| set_variable = { which = <string> value = <float>/<variable>/<scope.variable>/trigger:<trigger> } | megastructure planet country ship pop fleet galactic_object leader army ambient_object species pop_faction war federation starbase deposit sector archaeological_site first_contact spy_network espionage_operation espionage_asset |- | clear_variable || Clears a previously-set variable from the game. ||class=mw-code| clear_variable = <string> | megastructure planet country ship pop fleet galactic_object leader army ambient_object species pop_faction war federation starbase deposit sector archaeological_site first_contact spy_network espionage_operation espionage_asset |- | round_variable || Rounds a previously-set variable to the closest integer. ||class=mw-code| round_variable = <string> | megastructure planet country ship pop fleet galactic_object leader army ambient_object species pop_faction war federation starbase deposit sector archaeological_site first_contact spy_network espionage_operation espionage_asset |- | floor_variable || Rounds a previously-set variable down to the previous integer. ||class=mw-code| floor_variable = <string> | megastructure planet country ship pop fleet galactic_object leader army ambient_object species pop_faction war federation starbase deposit sector archaeological_site first_contact spy_network espionage_operation espionage_asset |- | ceiling_variable || Rounds a previously-set variable up to the next integer. ||class=mw-code| ceiling_variable = <string> | megastructure planet country ship pop fleet galactic_object leader army ambient_object species pop_faction war federation starbase deposit sector archaeological_site first_contact spy_network espionage_operation espionage_asset |- | export_modifier_to_variable || Exports the value of a specified modifier in the current scope to a specified variable. ||class=mw-code| export_modifier_to_variable = { modifier = pop_growth_speed_reduction variable = <string> } | megastructure planet country ship pop fleet galactic_object leader army species pop_faction |- | export_trigger_value_to_variable || Exports the value of a trigger to a specified variable (so for num_pops, it'll export the number of pops). ||class=mw-code| export_trigger_value_to_variable = { trigger = pop_produces_resource parameters = { resource = energy } (optional: specify extra parameters for triggers with { } variable = <string> (this example will print the amount of energy the pop produces to a variable) rounded = yes (default: no) } | megastructure planet country ship pop fleet galactic_object leader army ambient_object species pop_faction war federation starbase deposit sector archaeological_site first_contact spy_network espionage_operation espionage_asset |- | export_resource_stockpile_to_variable || Exports the value of the current country's stockpile of the specified resource to a variable. ||class=mw-code| export_resource_stockpile_to_variable = { resource = energy variable = <string> } | country |- | export_resource_income_to_variable || Exports the value of the current country's monthly income of the specified resource to a variable. ||class=mw-code| export_resource_income_to_variable = { resource = energy variable = <string> } | country |- | remove_global_flag || Removes a global flag ||class=mw-code| remove_global_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | all |- | set_global_flag || Sets an arbitrarily-named global flag ||class=mw-code| set_global_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | all |- | change_variable || Increments a previously-set variable by a specific amount ||class=mw-code| change_variable = { which = <string> value = <float>/<variable>/<scope.variable>/trigger:<trigger> } | megastructure planet country ship pop fleet galactic_object leader army ambient_object species pop_faction war federation starbase deposit sector archaeological_site first_contact spy_network espionage_operation espionage_asset |- | every_galaxy_pop || Executes enclosed effects for every pop in the game that meet the limit criteria ||class=mw-code| every_galaxy_pop = { limit = { <triggers> } <effects> } | all |- | every_country || Iterate through all countries – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_country = { limit = { <triggers> } <effects> } | all |- | every_playable_country || Iterate through all playable countries – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_playable_country = { limit = { <triggers> } <effects> } | all |- | random_playable_country || Iterate through all playable countries – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_playable_country = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | all |- | set_event_locked || Silently disables the scoped fleet to prevent player action, remember to unlock at the end of the event ||class=mw-code| set_event_locked = no | fleet |- | clear_orders || Clears all fleet orders from the scoped fleet ||class=mw-code| clear_orders = yes | fleet |- | order_forced_return || Forces scoped fleet to retreat to friendly territory ||class=mw-code| order_forced_return = yes | fleet |- | declare_war || Declares war between the scoped country and target country ||class=mw-code| declare_war = { target = <target country> name = <optional war name> attacker_war_goal = <war goal> } | country |- | set_star_flag || Sets an arbitrarily-named flag on the scoped system ||class=mw-code| set_star_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | galactic_object |- | remove_star_flag || Removes a flag from the scoped system ||class=mw-code| remove_star_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | galactic_object |- | set_army_flag || Sets an arbitrarily-named flag on the scoped army ||class=mw-code| set_army_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | army |- | set_deposit_flag || Sets an arbitrarily-named flag on the scoped deposit ||class=mw-code| set_deposit_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | deposit |- | set_war_flag || Sets an arbitrarily-named flag on the scoped war ||class=mw-code| set_war_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | war |- | set_starbase_flag || Sets an arbitrarily-named flag on the scoped starbase ||class=mw-code| set_starbase_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | starbase |- | set_sector_flag || Sets an arbitrarily-named flag on the scoped sector ||class=mw-code| set_sector_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | sector |- | set_archaeology_flag || Sets an arbitrarily-named flag on the scoped arc site ||class=mw-code| set_archaeology_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | archaeological_site |- | set_spynetwork_flag || Sets an arbitrarily-named flag on the scoped spy network ||class=mw-code| set_spynetwork_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | spy_network |- | set_espionage_asset_flag || Sets an arbitrarily-named flag on the scoped espionage asset ||class=mw-code| set_espionage_asset_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | espionage_asset |- | remove_army_flag || Removes a flag from the scoped army ||class=mw-code| remove_army_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | army |- | remove_deposit_flag || Removes a flag from the scoped deposit ||class=mw-code| remove_deposit_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | deposit |- | remove_war_flag || Removes a flag from the scoped war ||class=mw-code| remove_war_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | war |- | remove_starbase_flag || Removes a flag from the scoped starbase ||class=mw-code| remove_starbase_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | starbase |- | remove_sector_flag || Removes a flag from the scoped sector ||class=mw-code| remove_sector_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | sector |- | remove_archaeology_flag || Removes a flag from the scoped arc site ||class=mw-code| remove_archaeology_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | archaeological_site |- | remove_spynetwork_flag || Removes a flag from the scoped spy network ||class=mw-code| remove_spynetwork_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | spy_network |- | remove_espionage_asset_flag || Removes a flag from the scoped espionage asset ||class=mw-code| remove_espionage_asset_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | espionage_asset |- | set_spawn_system_batch || Optimizes the calls for spawn_system effect. ||class=mw-code| Spawn system should be located in a block between Begin and End. Begin: set_spawn_system_batch = begin End: set_spawn_system_batch = end | all |- | spawn_system || Spawns a new system at a position relative to the scoped system/planet/ship. ||class=mw-code| spawn_system = { min_jumps = <value> max_jumps = <value> min_distance = <int 0-100> max_distance = <int 0-100> initializer = <key for pre-defined system> hyperlane=<yes/no> is_discovered=<yes/no>} | megastructure planet ship fleet galactic_object starbase no_scope |- | dismantle || Dismantles the scoped orbital station (fleet) ||class=mw-code| dismantle = yes | fleet |- | set_advisor_active || Enables or disables the VIR window pop-in ||class=mw-code| set_advisor_active = no | country |- | save_event_target_as || Saves the current scope as an arbitrarily-named target to be referenced later in the (unbroken) event chain ||class=mw-code| save_event_target_as = <string> | all |- | save_global_event_target_as || Saves the current scope as an arbitrarily-named target to be referenced later, accessible globally until cleared ||class=mw-code| save_global_event_target_as = <string> | all |- | clear_global_event_target || Deletes the specified saved global target reference ||class=mw-code| clear_global_event_target = <string> | all |- | clear_global_event_targets || Deletes all saved global target references ||class=mw-code| clear_global_event_targets = yes | all |- | break || Prevents execution of subsequent effects in the same effect block, used with if-statements ||class=mw-code| break = yes | all |- | set_tutorial_level || Changes the scoped country's tutorial level (0 none, 1 limited, 2 full) ||class=mw-code| set_tutorial_level = 0 | country |- | begin_event_chain || Starts a situation log event chain for target country ||class=mw-code| begin_event_chain = { event_chain = <key> target = <target> } | all |- | end_event_chain || Ends a specific situation log event chain for the scoped country ||class=mw-code| end_event_chain = <key> | country |- | queue_actions || Adds actions to the scoped fleet's action queue ||class=mw-code| queue_actions = { repeat = { <fleet actions> } } | fleet |- | clear_fleet_actions || Clears all queued fleet actions for target fleet ||class=mw-code| clear_fleet_actions = <target> | fleet |- | destroy_fleet || Destroys the target fleet (with death graphics) ||class=mw-code| destroy_fleet = <target> destroy_fleet = { target=<target> kill_leader=<yes/no> #default yes destroy_template=<yes/no> #default no } | all |- | destroy_and_spawn_debris_for || Sets the current ship or fleet to be destroyed and spawn a debris project for the specified country. ||class=mw-code| destroy_and_spawn_debris_for = from | ship fleet |- | create_ambient_object || Creates a new ambient object ||class=mw-code| create_ambient_object = { type = <key> location = <target> } For VFX use: create_ambient_object = { type = <key> scale = <float> location = <target> use_3d_location = <bool, use 3D entity or 2D coordinate of the location entity as base> entity_offset = { min = <int> max = <int> } entity_offset_angle = { min = <int> max = <int> } entity_offset_height = { min = <int> max = <int> } entity_face_object = star/FROM/etc entity_scale_to_size = yes/no play_animation_once = yes/no target = <target> duration = <int, days> } | all |- | destroy_ambient_object || Destroys target ambient object ||class=mw-code| destroy_ambient_object = <target> | all |- | add_trait || Adds a specific trait to the scoped leader ||class=mw-code| add_trait = <trait> | leader |- | remove_trait || Removes a specific trait from the scoped leader ||class=mw-code| remove_trait = <key> | leader |- | modify_species || Creates a new, modified species based on an already-extant species ||class=mw-code| modify_species = { species = <target> # species to modify base = <target>/auto/none # new base species; default: auto (uses species) add_trait = <key> # optional, can specify multiple remove_trait = <key> # optional, can specify multiple add_traits_at_start_of_list = yes # optional, pushes out other traits if needed ideal_planet_class = <target or pc_name> # optional change_scoped_species = yes/no # modify scoped pops/planet/leader/country; default: yes portrait = <target or portrait name> # optional effect = { SCOPE_SPECIES } # optional effect to run on the resulting new species, is executed after any handling of change_scoped_species } | planet country pop leader species |- | add_opinion_modifier || Adds a specific opinion modifier for the scoped country towards target country ||class=mw-code| add_opinion_modifier = { modifier = <key> who = <target> } | country |- | establish_contact || Establishes first contact between the scoped country and target country at the set location ||class=mw-code| establish_contact = { who = <target> location = <target> } | country |- | set_hostile || Sets the target country as hostile. This will work on countries you don't have comms with, unlike set_faction_hostility. ||class=mw-code| set_hostile = from | country |- | set_faction_hostility || Sets the aggro state of the scoped faction-type country ||class=mw-code| set_faction_hostility = { target = country set_hostile = yes set_neutral = no set_friendly = no } | country |- | set_market_leader || Set scoped country as the current Galactic Market leader. set_market_leader = <yes/no> ||class=mw-code| | country |- | random_system_planet || Iterate through each planet in the current system – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_system_planet = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | galactic_object |- | add_event_chain_counter || Increments (or decrements with negative values) an event chain counter for the scoped country by a specific amount ||class=mw-code| add_event_chain_counter = { event_chain = <key> counter = <key> amount = <int>/<variable> } | country |- | add_anomaly || Adds a specific anomaly category to the scoped planet ||class=mw-code| add_anomaly = { category = <key> target = target:country } | all |- | set_disable_at_health || Sets the scoped ship to become disabled at a certain hull point percentage ||class=mw-code| set_disable_at_health = <0-1 float> | ship |- | remove_building || Removes a specific building from the scoped planet ||class=mw-code| remove_building = <key> | planet |- | change_planet_size || Increases or reduces the size of the scoped planet by a specified amount ||class=mw-code| change_planet_size = <+/- int> | planet |- | every_deposit || Iterate through each deposit on the planet – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_deposit = { limit = { <triggers> } <effects> } | planet |- | random_deposit || Iterate through each deposit on the planet – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_deposit = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | planet |- | set_policy_cooldown || Sets the specified policy group to have a cooldown as if the policy had just been changed. ||class=mw-code| set_policy_cooldown = <policy group e.g. diplomatic_stance> | planet country ship pop |- | create_point_of_interest || Creates a point of interest for the scoped country at a specific location, associated with an event chain ||class=mw-code| create_point_of_interest = { id = <key> name = <string> desc = <string> event_chain = <key> location = <target> } | planet country ship pop |- | remove_point_of_interest || Removes a specific point of interest from the scoped country's situation log ||class=mw-code| remove_point_of_interest = <key> | country |- | set_relation_flag || Sets a relation flag for the scoped country towards target country ||class=mw-code| set_relation_flag = { who = <target> flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) } | country |- | remove_relation_flag || Removes a specific relation flag towards target country from the scoped country ||class=mw-code| remove_relation_flag = { who = <target> flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) } | country |- | random_moon || Iterate through each moon of the planet – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_moon = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | planet |- | every_moon || Iterate through each moon of the planet – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_moon = { limit = { <triggers> } <effects> } | planet |- | kill_leader || Kills the scoped leader or leader of the scoped country/fleet/ship/planet/army ||class=mw-code| kill_leader = { type = general type = scientist etc. } kill_leader = { type = <key, optional, if left out will kill scoped leader> show_notification = <yes/no> heir = <yes, optional, if added to type = ruler, will kill heir instead> fire = yes (default: no; if yes, fires on_leader_fired instead of on_leader_death } | planet country ship fleet leader army |- | assign_leader || Assigns target leader to the scoped country/fleet/army/pop faction/sector ||class=mw-code| assign_leader = <target> | country fleet army pop_faction sector |- | country_add_ethic || Adds a specific ethic to the scoped country ||class=mw-code| country_add_ethic = <key> | country |- | country_remove_ethic || Removes a specific ethic from the scoped country ||class=mw-code| country_remove_ethic = <key> | country |- | set_timed_first_contact_flag || Sets an arbitrarily-named flag on the scoped first contact site for a set duration ||class=mw-code| set_timed_first_contact_flag = { flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) days/months/years = <int>/<variable> } | first_contact |- | set_timed_federation_flag || Sets an arbitrarily-named flag on the scoped federation for a set duration ||class=mw-code| set_timed_federation_flag = { flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) days/months/years = <int>/<variable> } | federation |- | set_timed_country_flag || Sets an arbitrarily-named flag on the scoped country for a set duration ||class=mw-code| set_timed_country_flag = { flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) days/months/years = <int>/<variable> } | country |- | set_timed_fleet_flag || Sets an arbitrarily-named flag on the scoped fleet for a set duration ||class=mw-code| set_timed_fleet_flag = { flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) days/months/years = <int>/<variable> } | fleet |- | set_timed_global_flag || Sets an arbitrarily-named global flag for a set duration ||class=mw-code| set_timed_global_flag = { flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) days/months/years = <int>/<variable> } | all |- | set_timed_planet_flag || Sets an arbitrarily-named flag on the scoped planet for a set duration ||class=mw-code| set_timed_planet_flag = { flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) days/months/years = <int>/<variable> } | planet |- | set_timed_pop_flag || Sets an arbitrarily-named flag on the scoped pop for a set duration ||class=mw-code| set_timed_pop_flag = { flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) days/months/years = <int>/<variable> } | pop |- | set_timed_relation_flag || Sets an arbitrarily-named flag for the scoped country towards target country for a set duration ||class=mw-code| set_timed_relation_flag = { flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) who = <target> days/months/years = <int> } | country |- | set_timed_ship_flag || Sets an arbitrarily-named flag on the scoped ship for a set duration ||class=mw-code| set_timed_ship_flag = { flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) days/months/years = <int>/<variable> } | ship |- | set_timed_star_flag || Sets an arbitrarily-named flag on the scoped system for a set duration ||class=mw-code| set_timed_star_flag = { flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) days/months/years = <int>/<variable> | galactic_object |- | set_timed_army_flag || Sets an arbitrarily-named flag on the scoped army for a set duration ||class=mw-code| set_timed_army_flag = { flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) days/months/years = <int>/<variable> } | army |- | set_timed_deposit_flag || Sets an arbitrarily-named flag on the scoped deposit for a set duration ||class=mw-code| set_timed_deposit_flag = { flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) days/months/years = <int>/<variable> } | deposit |- | set_timed_war_flag || Sets an arbitrarily-named flag on the scoped war for a set duration ||class=mw-code| set_timed_war_flag = { flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) days/months/years = <int>/<variable> } | war |- | set_timed_starbase_flag || Sets an arbitrarily-named flag on the scoped starbase for a set duration ||class=mw-code| set_timed_starbase_flag = { flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) days/months/years = <int>/<variable> } | starbase |- | set_timed_sector_flag || Sets an arbitrarily-named flag on the scoped sector for a set duration ||class=mw-code| set_timed_sector_flag = { flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) days/months/years = <int>/<variable> } | sector |- | set_timed_archaeology_flag || Sets an arbitrarily-named flag on the scoped arc site for a set duration ||class=mw-code| set_timed_archaeology_flag = { flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) days/months/years = <int>/<variable> } | archaeological_site |- | set_timed_spynetwork_flag || Sets an arbitrarily-named flag on the scoped spy network for a set duration ||class=mw-code| set_timed_spynetwork_flag = { flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) days/months/years = <int>/<variable> } | spy_network |- | set_timed_espionage_asset_flag || Sets an arbitrarily-named flag on the scoped espionage asset for a set duration ||class=mw-code| set_timed_espionage_asset_flag = { flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) days/months/years = <int>/<variable> } | espionage_asset |- | set_saved_date || Sets an arbitrarily-named date flag for the scoped object. Acts both as an <scope object>_flag and as a means for saving a date. The flag can then be referred to in localisations [This.<flag>] to produce the date. ||class=mw-code| set_saved_date = { key = <key> (refer to this in locs; note: this is actually a <country/whatever>_flag) days_from_present = <int>/<variable> (time until the date you wish to save) expires = <int>/<variable> (time until the saved date is cleared, default is never) } | megastructure planet country ship pop fleet galactic_object leader army ambient_object species pop_faction war federation starbase deposit sector archaeological_site first_contact spy_network espionage_operation espionage_asset |- | every_planet_within_border || Iterate through each planet within the current empire's borders – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_planet_within_border = { limit = { <triggers> } <effects> } | country |- | every_rim_system || Iterate through all rim systems – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_rim_system = { limit = { <triggers> } <effects> } | all |- | random_rim_system || Iterate through all rim systems – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_rim_system = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | all |- | remove_modifier || Removes a specific modifier from the scope object ||class=mw-code| remove_modifier = <key> | megastructure planet country ship pop fleet galactic_object pop_faction federation spy_network espionage_operation |- | add_ship_design || Adds a specific ship design to the scoped country ||class=mw-code| add_ship_design = <target> | country |- | add_mission_progress || Adds or subtracts progress to/from the scoped observation post's current mission ||class=mw-code| add_mission_progress = <+/- float> | fleet |- | create_army_transport || Creates a new army in a new transport ship ||class=mw-code| create_army_transport = { ship_name = <string> graphical_culture = <key> army_name = <string> army_type = <key> species = <target> } | fleet |- | switch || Executes the first appropriate effect set for a specific trigger ||class=mw-code| switch = { trigger = <trigger> <corresponding key/bool/int> = { <effect> } <corresponding key/bool/int> > (less/greater than appear 'reversed') { <effect> } default = { <effect> } } | all |- | set_pop_faction || Sets the scoped pop to belong to a specific pop faction ||class=mw-code| set_pop_faction = <target> | pop |- | set_graphical_culture || Sets the scoped object's graphical culture ||class=mw-code| set_graphical_culture = <key> | megastructure country |- | set_formation_scale || Scales the scoped fleet's formation's ship spacing, above and below 1.0 ||class=mw-code| set_formation_scale = <float> | fleet |- | set_controller || Instantly sets the planet/fleet's controller to target country ||class=mw-code| set_controller = <target> | planet fleet |- | force_faction_evaluation || Forces target pop to immediately evaluate their attraction to various pop factions ||class=mw-code| force_faction_evaluation = yes | pop |- | enable_faction_of_type || Forces scoped country to evaluate whether to create a specific faction type immediately, rather than monthly ||class=mw-code| enable_faction_of_type = <key> | country |- | clear_uncharted_space || Clears uncharted space from the galaxy map for the scoped country, in a radius around target system ||class=mw-code| clear_uncharted_space = { from = <target> } | country |- | every_owned_leader || Iterate through each leader that is owned by the country – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_owned_leader = { limit = { <triggers> } <effects> } | country |- | random_owned_leader || Iterate through each leader that is owned by the country – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_owned_leader = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country |- | establish_communications || Establish communications between scoped country and target country ||class=mw-code| establish_communications = <target> | country |- | add_monthly_resource_mult || Adds a lump sum of a resource to the scoped country, defined as a multiple of the country's monthly income of that resource (clamped to max and min allowed values) ||class=mw-code| add_monthly_resource_mult = { resource = <key> value = <multiplier, float> max = <max cap, int> min = <min cap, int> } | country |- | set_leader_flag || Sets an arbitrarily-named flag on the scoped leader ||class=mw-code| set_leader_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | leader |- | remove_leader_flag || Removes a flag from the scoped leader ||class=mw-code| remove_leader_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | leader |- | add_research_option || Adds a tech research option to the scoped country's tech view list, permanent until researched ||class=mw-code| add_research_option = <key> | country |- | set_heir || Sets the target leader to be the scoped country's heir ||class=mw-code| set_heir = <target> | country |- | leave_alliance || Removes scoped country from any alliances it is in ||class=mw-code| leave_alliance = { override_requirements = yes/no (default: no) apply_opinion_penalty = yes (default: no; sets whether 'Broke Federation' opinion is applied) } | country |- | random_owned_pop || Iterate through all owned pops – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_owned_pop = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | planet country pop_faction sector |- | set_policy || Sets a policy to a specific option for the scoped country and specifies if policy cooldown should go into effect ||class=mw-code| set_policy = { policy = <key> option = <key> cooldown = <bool> } | all |- | recruitable || Sets scoped leader as non/recruitable ||class=mw-code| recruitable = yes | leader |- | closest_system || Executes enclosed effects on a system -within a specific number of jumps span- that meets the limit criteria. This completely ignores bypasses (wormholes and gateways) ||class=mw-code| closest_system = { min_steps = <int, minimum # of systems 'away'> max_steps = <int, maximum # of systems 'away'> use_bypasses = yes/no (default: no) limit = { <triggers> } <effects> } | all |- | random_owned_fleet || Iterate through each fleet owned by the country – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_owned_fleet = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country |- | random_ambient_object || Iterate through every ambient object in the game – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_ambient_object = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | all |- | random_system_ambient_object || Iterate through every ambient object in the solar system – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_system_ambient_object = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | galactic_object |- | every_ambient_object || Iterate through every ambient object in the game – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_ambient_object = { limit = { <triggers> } <effects> } | all |- | every_system_ambient_object || Iterate through every ambient object in the solar system – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_system_ambient_object = { limit = { <triggers> } <effects> } | galactic_object |- | set_ambient_object_flag || Sets an arbitrarily-named flag on the scoped ambient object ||class=mw-code| set_ambient_object_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | ambient_object |- | set_timed_ambient_object_flag || Sets an arbitrarily-named flag on the scoped ambient object for a set duration ||class=mw-code| set_timed_ambient_object_flag = { flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) days/months/years = <int>/<variable> } | fleet |- | remove_ambient_object_flag || Removes a flag from the scoped ambient object ||class=mw-code| remove_ambient_object_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | ambient_object |- | every_fleet_in_system || Iterate through each fleet in the current system – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_fleet_in_system = { limit = { <triggers> } <effects> } | galactic_object |- | random_fleet_in_system || Iterate through each fleet in the current system – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_fleet_in_system = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | galactic_object |- | set_aggro_range || Sets the scoped fleet/country's aggro range in intra-system units ||class=mw-code| set_aggro_range = <int> | country fleet |- | set_fleet_stance || Sets the stance of the scoped fleet ||class=mw-code| set_fleet_stance = <key, aggressive/passive/evasive> | fleet |- | add_favors || Add <value> favors for scoped country to use on target country. add_favor = { ||class=mw-code| target = <target> value = 2/variable } | country |- | remove_favors || Remove <value/all> favors that scoped country have on target country: ||class=mw-code| remove_favors = { target = <target> value = <value/all/variable> } | country |- | set_aggro_range_measure_from || Determines whether the scoped fleet/country's aggro range is measured from the fleet's current position or its spawn location ||class=mw-code| set_aggro_range_measure_from = <key, self/return_point> | country fleet |- | establish_communications_no_message || Silently establish communications between scoped country and target country ||class=mw-code| establish_communications_no_message = <target> | country |- | remove_war_participant || Removes a specified country from the war ||class=mw-code| remove_war_participant = <target> | war |- | set_subject_of || Sets the scoped country to be a specific subject of target country ||class=mw-code| set_subject_of = { who = <target> subject_type = <key> } | country |- | unassign_leader || Unassigns scoped leader from their post or unassigns leader from the scoped planet/ship/fleet/army ||class=mw-code| unassign_leader = <target> | ship fleet leader army |- | exile_leader_as || Exiles the scoped country/fleet/army/pop faction's leader and saves them with a custom name ||class=mw-code| exile_leader_as = <key> | country fleet leader army pop_faction |- | set_leader || Reinstates a previously-exiled leader to the scoped country/fleet/army/pop faction ||class=mw-code| set_leader = <key> | country fleet army pop_faction |- | add_skill || Adds to the scoped leader's skill level ||class=mw-code| add_skill = 2 | leader |- | set_skill || Sets the scoped leader's level ||class=mw-code| set_skill = 3 | leader |- | every_neighbor_system || Iterate through all a system's neighboring systems by hyperlane – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_neighbor_system = { limit = { <triggers> } <effects> } | galactic_object |- | random_neighbor_system || Iterate through all a system's neighboring systems by hyperlane – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_neighbor_system = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | galactic_object |- | set_federation_leader || Sets a country to lead a federation ||class=mw-code| set_federation_leader = <target> | country federation |- | add_colony_progress || Adds to ongoing colonization progress on the scoped planet ||class=mw-code| add_colony_progress = <0.0-1.0> | planet |- | start_colony || Starts colonization of the scoped planet ||class=mw-code| start_colony = { owner = <target> species = <target / key> ethos = <random / target / { ethic = <key> ethic = <key> }> } | planet |- | subtract_variable || Decrements a previously-set variable by a specific amount ||class=mw-code| subtract_variable = { which = <string> value = <float>/<variable>/<scope.variable>/trigger:<trigger> } | megastructure planet country ship pop fleet galactic_object leader army ambient_object species pop_faction war federation starbase deposit sector archaeological_site first_contact spy_network espionage_operation espionage_asset |- | multiply_variable || Multiplies a previously-set variable by a specific amount ||class=mw-code| multiply_variable = { which = <string> value = <float>/<variable>/<scope.variable>/trigger:<trigger> } | megastructure planet country ship pop fleet galactic_object leader army ambient_object species pop_faction war federation starbase deposit sector archaeological_site first_contact spy_network espionage_operation espionage_asset |- | divide_variable || Divides a previously-set variable by a specific amount ||class=mw-code| divide_variable = { which = <string> value = <float>/<variable>/<scope.variable>/trigger:<trigger> } | megastructure planet country ship pop fleet galactic_object leader army ambient_object species pop_faction war federation starbase deposit sector archaeological_site first_contact spy_network espionage_operation espionage_asset |- | modulo_variable || Modulos a previously-set variable by a specific amount i.e. X % Y ||class=mw-code| modulo_variable = { which = <string> value = <float>/<variable>/<scope.variable>/trigger:<trigger> } | megastructure planet country ship pop fleet galactic_object leader army ambient_object species pop_faction war federation starbase deposit sector archaeological_site first_contact spy_network espionage_operation espionage_asset |- | round_variable_to_closest || Rounds a previously-set variable to the closest X ||class=mw-code| round_variable_to_closest = { which = <string> value = <float>/<variable>/<scope.variable>/trigger:<trigger> (variable will be rounded to a multiple of this value) } | megastructure planet country ship pop fleet galactic_object leader army ambient_object species pop_faction war federation starbase deposit sector archaeological_site first_contact spy_network espionage_operation espionage_asset |- | play_sound || Play the defined sound effect ||class=mw-code| play_sound = myfirstsoundeffect | all |- | set_crisis_sound || Sets the crisis ambient loop to the current effect ||class=mw-code| set_crisis_sound = myfirstsoundeffect | all |- | stop_crisis_sound || Stops the crisis ambient loop ||class=mw-code| stop_crisis_sound = yes | all |- | force_add_civic || Adds civic to a government without checking the restrictions ||class=mw-code| force_add_civic = <civic> | country |- | force_remove_civic || Removes civic from a government without checking the restrictions ||class=mw-code| force_remove_civic = <civic> | country |- | set_origin || Sets the country's origin to a certain value. Note: This will not run effects executed during galaxy generation. ||class=mw-code| set_origin = <origin> | country |- | set_is_female || Sets the gender of the scoped leader ||class=mw-code| set_is_female = true | leader |- | reroll_random || Rerolls the random seed. Use if you want to have a second random_list return a different result. Do not use in tooltips that show random results, because the tooltip will be wrong! ||class=mw-code| reroll_random = yes | all |- | create_fleet_from_naval_cap || Creates a new fleet from empire designs up to specified fraction of naval cap ||class=mw-code| create_fleet_from_naval_cap = 0.5 create_fleet_from_naval_cap = { fraction = 0.5 ship_owner_type = <country/federation/galactic_community> | country |- | remove_opinion_modifier || Removes a specific opinion modifier towards target country or any contry from the scoped country ||class=mw-code| remove_opinion_modifier = { modifier = <key> who = <target (optional)> } | country |- | set_war_goal || Sets a war goal to the scoped rebel country/war ||class=mw-code| set_war_goal = { type = <key> target = <target> enemy = <target> } | country war |- | change_country_flag || Changes the scoped country's flag ||class=mw-code| change_country_flag = random change_country_flag = { icon = { category = <key> file = <filename> } background = { category = <key> file = <filename> } colors = { <key> <key> } } | country |- | add_threat || Adds diplomatic threat from target country ||class=mw-code| add_threat = { who = <country> amount = 4/variable } | planet country galactic_object |- | set_mission || Sets the current mission of an observation station ||class=mw-code| set_mission = passive_observation | fleet |- | change_dominant_species || Changes the dominant species of the current Country, change_all also changes all usage of that species (Pops etc) in the empire ||class=mw-code| change_dominant_species = { species = target change_all = yes } | country |- | end_rivalry || Force-end rivalry with target country ||class=mw-code| end_rivalry = <target> | country |- | set_truce || Force a truce with target country of a specified type, or a war ||class=mw-code| set_truce = { target = <country/war> type = war/liberation/alliance/guarantee/none } | country |- | end_truce || Force-end truce with target country ||class=mw-code| end_truce = <target> | country |- | set_species_flag || Sets an arbitrarily-named flag on the scoped species ||class=mw-code| set_species_flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) | species |- | set_timed_species_flag || Sets an arbitrarily-named flag on the scoped species for a set duration ||class=mw-code| set_timed_species_flag = { flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) days/months/years = <int>/<variable> } | species |- | remove_species_flag || Removes a flag from the scoped species ||class=mw-code| remove_species_flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) | species |- | auto_move_to_planet || Makes a fleet or ship auto-move to target planet ||class=mw-code| auto_move_to_planet = { target = <planet> clear_auto_move_on_arrival = yes } | ship fleet |- | remove_auto_move_target || Makes a fleet or ship stop auto-moving ||class=mw-code| remove_auto_move_target = yes | ship fleet |- | auto_follow_fleet || Makes a fleet or ship auto-move to target fleet and potentially attack it ||class=mw-code| auto_follow_fleet = { target = <fleet> attack_fleet = yes } | ship fleet |- | set_closed_borders || Changes closed borders status between two countries ||class=mw-code| set_closed_borders = { who = target status = yes/no forced = <int>/<variable> (number of years) } | country |- | every_war_participant || Iterate through all war participants – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_war_participant = { limit = { <triggers> } <effects> } | war |- | repair_percentage || Restores a certain percentage of hull points to the scoped ship ||class=mw-code| repair_percentage = yes | ship fleet |- | endgame_telemetry || Send endgame telemetry event ||class=mw-code| | all |- | set_deposit || Replaces resource deposit on the scoped planet ||class=mw-code| set_deposit = <key/random> | planet |- | randomize_flag_symbol || Randomizes a country's flag symbol within the selected category ||class=mw-code| randomize_flag_symbol = pirate | country |- | add_claims || Adds claims on target system ||class=mw-code| add_claims = { who = <country> num_of_claims = x show_notification = no } | galactic_object |- | remove_claims || Removes claims on target system ||class=mw-code| remove_claims = { who = <country> num_of_claims = x } | galactic_object |- | create_military_fleet || Creates a military fleet with the designs of a specified country. ||class=mw-code| create_military_fleet = { owner = <target> scaled_size = 1.0 effect = { } } | all |- | guarantee_country || Makes a country guarantee another country ||class=mw-code| guarantee_country = <target> guarantee_country = { target = <target> free_guarantee_days = 30 | country |- | every_owned_fleet || Iterate through each fleet owned by the country – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_owned_fleet = { limit = { <triggers> } <effects> } | country |- | every_subject || Iterate through all subjects of the scoped country – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_subject = { limit = { <triggers> } <effects> } | country |- | random_subject || Iterate through all subjects of the scoped country – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_subject = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country |- | set_species_homeworld || Defines a homeworld for the current species. ||class=mw-code| set_species_homeworld = <target planet> | species |- | clear_resources || Clears resources of a country ||class=mw-code| clear_resources = yes | country |- | reset_planet|| Rebuild modifiers and resource deposits on target planet ||class=mw-code| reset_planet = yes | planet |- | reroll_planet || Rebuild modifiers and resource deposits on target planet ||class=mw-code| reroll_planet = yes | planet |- | reroll_planet_modifiers || Rebuild modifiers on target planet ||class=mw-code| reroll_planet_modifiers = yes | planet |- | reroll_deposits || Rebuild resource deposits on target planet ||class=mw-code| reroll_deposits = yes | planet |- | delete_fleet || Deletes the target fleet (no death graphics) ||class=mw-code| delete_fleet = <target> delete_fleet = { target=<target> kill_leader=<yes/no> #default yes destroy_template=<yes/no> #default no } | all |- | add_trust || Adds trust on scope country towards target country ||class=mw-code| add_trust = { amount = <amount>/<variable> who = <target> } | country |- | add_tradition || Adds the specified tradition to the scoped country. add_tradition = <tradition_key> ||class=mw-code| | country |- | join_war || Joins wars on the side of target country ||class=mw-code| join_war = <target> | country |- | add_global_ship_design || Adds a specific global design to the game ||class=mw-code| add_global_ship_design = <target> | all |- | set_timed_leader_flag || Sets an arbitrarily-named flag on the scoped leader for a set duration ||class=mw-code| set_timed_leader_flag = { flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) days/months/years = <int>/<variable> } | leader |- | set_species_identity || Sets the current species scopes identity to match the target scopes making them evaluate as the same species in is_same_species trigger. ||class=mw-code| set_species_identity = new/<target species> | species |- | pop_force_add_ethic || Adds a specific ethic to the scoped pop regardless if pop-species allows ethic divergence or not. ||class=mw-code| pop_force_add_ethic = <key> | pop |- | set_empire_name || Sets the name of the current Empire. ||class=mw-code| set_empire_name = "name" | country |- | set_empire_flag || Sets the flag of the current Empire. ||class=mw-code| set_empire_flag = <flag> | country |- | set_planet_name || Sets the name of the current planet. ||class=mw-code| set_planet_name = "name" | planet |- | set_fleet_formation || Sets a custom fleet formation on a fleet. ||class=mw-code| set_fleet_formation = { position = { x = 1 y = 1 } position = { x = 2 y = 1 } } | fleet |- | create_message || Creates a message, can take multiple variables ||class=mw-code| create_message = { type = BYPASS_EXPLORED localization = BYPASS_EXPLORED_MESSAGE days = 30 target = root variable = { type = name localization = SYSTEM1 scope = from } variable = { type = name localization = SYSTEM2 scope = fromfrom } } | all |- | set_halted || Sets the mega structure upgrade to halted status for n days. -1 days = indefinitely ||class=mw-code| set_halted = nDays | megastructure |- | upgrade_megastructure_to || Starts an upgrade process on a mega structure. ||class=mw-code| upgrade_megastructure_to = <new_type> | megastructure |- | set_planet_entity || Change entity of a planet. ||class=mw-code| Example: set_planet_entity = { entity = <name of entity> graphical_culture = <target or name of culture> picture = <picture override> atmosphere_color = <color from 3 components> atmosphere_intensity = <0.0 – 1.0> atmosphere_width = <0.0 – 1.0> } | planet |- | remove_planet || Removes the planet from the scope ||class=mw-code| remove_planet = yes | planet |- | set_megastructure_flag || Sets an arbitrarily-named flag on the scoped mega structure ||class=mw-code| set_megastructure_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | megastructure |- | set_timed_megastructure_flag || Sets an arbitrarily-named flag on the scoped mega structure for a set duration ||class=mw-code| set_timed_megastructure_flag = { flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) days/months/years = <int>/<variable> } | megastructure |- | remove_megastructure_flag || Removes a flag from the scoped mega structure ||class=mw-code| remove_megastructure_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | megastructure |- | destroy_ship || Destroys the target ship (with death graphics) ||class=mw-code| destroy_ship = <target> | all |- | delete_ship || Deletes the target ship (no death graphics) ||class=mw-code| delete_ship = <target> | all |- | change_species || Changes the species of the scoped object ||class=mw-code| change_species = <target> | country ship pop leader army |- | change_leader_portrait || Changes the portrait of the leader in scope. ||class=mw-code| change_leader_portrait = <key or species event target> | leader |- | resettle_pop || Instantly resettles pop ||class=mw-code| resettle_pop = { pop = <target pop> planet = <target planet> tile = <target tile> } | all |- | set_citizenship_type || Set citizenship type for scoped species/pop/leader ||class=mw-code| set_citizenship_type = { country = <target> type = citizenship_full cooldown = yes } | pop leader species |- | set_military_service_type || Set military service type for scoped species/pop/leader ||class=mw-code| set_military_service_type = { country = <target> type = military_service_full cooldown = yes } | pop leader species |- | set_purge_type || Set purge type for scoped species/pop/leader ||class=mw-code| set_purge_type = { country = <target> type = purge_full cooldown = yes } | pop leader species |- | set_slavery_type || Set slavery type for scoped species/pop/leader ||class=mw-code| set_slavery_type = { country = <target> type = slavery_livestock cooldown = yes } | pop leader species |- | set_population_controls || Set population control for scoped species/pop/leader ||class=mw-code| set_population_controls = { country = <target> type = yes/no cooldown = yes } | pop leader species |- | set_migration_controls || Set migration control for scoped species/pop/leader ||class=mw-code| set_migration_controls = { country = <target> type = yes/no cooldown = yes } | pop leader species |- | set_colonization_controls || Set colonization control for scoped species/pop/leader ||class=mw-code| set_colonization_controls = { country = <target> type = yes/no cooldown = yes } | pop leader species |- | set_living_standard || Set living standard for scoped species/pop/leader ||class=mw-code| set_living_standard = { country = <target> type = living_standard_good cooldown = yes } | pop leader species |- | shift_ethic || Shifts an empire towards a specific ethic, adjusting afterwards to keep number of ethics points consistent ||class=mw-code| shift_ethic = <key> | country |- | pop_change_ethic || Changes scoped pop to chosen ethic ||class=mw-code| pop_change_ethic = <key> | pop |- | clear_ethos || Clears all ethics of specified pop or country ||class=mw-code| clear_ethos = yes | country pop |- | clear_planet_modifiers || Clear modifiers on target planet ||class=mw-code| clear_planet_modifiers = yes | planet |- | remove_all_armies || Removes all armies on scoped planet ||class=mw-code| remove_all_armies = yes | planet |- | mutate_species || Randomly mutate a species. ||class=mw-code| mutate_species = yes | species |- | rename_species || rename_species = { ||class=mw-code| use one of the following: name = "an entry within the species name database" name = random name_list = "key" } | species |- | reset_years_of_peace || Resets years of peace for a country. ||class=mw-code| reset_years_of_peace = yes | country |- | add_ruler_trait || Adds a specific ruler trait to the scoped leader, even if they are not currently ruler; it becomes active when they become ruler ||class=mw-code| add_ruler_trait = <trait> | leader |- | remove_ruler_trait || Removes a specific ruler trait from the scoped leader, even if they are not currently ruler; this is relevant if they ever become ruler ||class=mw-code| remove_ruler_trait = <trait> | leader |- | add_notification_modifier || Add a notification modifier to the country ||class=mw-code| add_notification_modifier = <key> | country |- | remove_notification_modifier || Remove a notification modifier to the country ||class=mw-code| remove_notification_modifier = <key> | country |- | set_city_graphical_culture || Sets the scoped country's city graphical culture ||class=mw-code| set_city_graphical_culture = <key> | country |- | set_player || Assign the player of the target country to play the scoped country instead ||class=mw-code| event_target:new_country = { set_player = event_target:old_country } | country |- | change_species_characteristics || Changes the characteristics of a species ||class=mw-code| change_species_characteristics = { sapient = <Y/N, determines if species is pre-sapient> immortal = <Y/N, determines if species leaders are immortal> pops_can_be_colonizers = <Y/N, determines if pops of that species can colonize> pops_can_migrate = <Y/N, determines if pops of that species can migrate> pops_can_reproduce = <Y/N, determines if pops of that species can reproduce> pops_can_join_factions = <Y/N, determines if pops of that species can join factions> can_generate_leaders = <Y/N, determines if that species can generate leaders> pops_can_be_slaves = <Y/N, determines if pops from that species can become slaves> pops_have_happiness = <Y/N, determines if pops from that species have happiness> can_be_modified = <Y/N, determines if the species can be modified> pops_auto_growth = <1, speed at which the pops from that species grow automatically pop_maintenance = <1, amount of energy each pop of that species consume monthly new_pop_resource_requirement = { type = food_surplus value = 42 } add_trait = <key> # optional, can specify multiple remove_trait = <key> # optional, can specify multiple add_traits_at_start_of_list = yes # optional, pushes out other traits if needed portrait = <key/species/leader event target, limits > gender = <any/male/female/leader event target, limits species to this gender or removes limit if 'any'> can_change_leader = <Y/N, apply portrait and gender (randomizes new name) changes to existing leaders> | species |- | copy_techs_from || Copies all techs from the target country to the scoped country, except for some exceptions listed. Tech weights (and weight modifiers) are honoured, meaning that techs a country should not have will not be copied. ||class=mw-code| copy_techs_from = { target = country except = { tech_1 tech_2 } } | country |- | create_bypass || Creates a bypass in the parent SpatialObject (stored in FromFrom), of the type passed in "type". ||class=mw-code| create_bypass = { owner = <target> type = <bypass type> effect = { <effects> } } | megastructure |- | activate_gateway || Activates the gateway associated with a megastructure. ||class=mw-code| activate_gateway = <target> | all |- | spawn_natural_wormhole || Spawns a new natural wormhole in the scoped system. ||class=mw-code| spawn_natural_wormhole = { bypass_type = <wormhole/sealed_wormhole> orbit_distance = 100 orbit_angle = 90 random_pos = yes/no } | galactic_object |- | link_wormholes || Link the wormhole from the scoped system to the wormhole in the target system. ||class=mw-code| link_wormholes = from | galactic_object |- | create_starbase || Creates a starbase in orbit of the star of the scoped galactic object ||class=mw-code| create_starbase = { owner = <target> size = <ship_size> module = <starbase_module> building = <starbase_building> effect = { … } } | galactic_object |- | set_starbase_size || Sets the ship size of a starbase ||class=mw-code| set_starbase_size = <ship_size> | starbase |- | set_starbase_module || Sets a module in a slot on a starbase ||class=mw-code| set_starbase_module = { slot = <int> module = <starbase_module> } | starbase |- | set_starbase_building || Sets a building in a slot on a starbase ||class=mw-code| set_starbase_building = { slot = <int> building = <starbase_building> } | starbase |- | remove_starbase_module || Removes a module from a certain slot or all slots on a starbase ||class=mw-code| remove_starbase_module = { slot = <int> (optional, default = all) module = <starbase_module> (optional) } | starbase |- | remove_starbase_building || Remove a building from a certain slot or all slots on a starbase ||class=mw-code| remove_starbase_building = { slot = <int> (optional, default = all) building = <starbase_building> (optional) } | starbase |- | add_casus_belli || Adds a Casus Belli to the scoped country against the target country. ||class=mw-code| add_casus_belli = { type = cb_subjugation who = <country> days = 10/variable } | country |- | get_galaxy_setup_value || Copies a value from the galaxy setup into a variable, optionally scaling it by an int value ||class=mw-code| get_galaxy_setup_value = { which = <string> setting = <string> [ scale_by = <float> ] } possible values: num_empires, num_advanced_empires, num_fallen_empires, num_marauder_empires, mid_game_year, end_game_year, victory_year, num_guaranteed_colonies, num_gateways, num_wormhole_pairs, num_hyperlanes, habitable_worlds_scale, primitive_worlds_scale, crisis_strength_scale, tech_costs_scale | all |- | finish_upgrade || Finish the current upgrade of a Mega Structure. ||class=mw-code| finish_upgrade = yes | megastructure |- | effect_on_blob || Executes an effect on systems with planets owned by the scoped country, starting at an origin, and until a certain percentage of owned planets matching the planet_limit has been covered. ||class=mw-code| effect_on_blob = { center = <system target> owned_planets_percentage = 1.0/variable planet_limit = { <planet triggers> } effect = { <system effects> } } | country |- | add_seen_bypass_type || Makes the scoped country remember that it has encountered the bypass type ||class=mw-code| add_seen_bypass_type = bypass_type | country |- | add_seen_bypass || Makes the scoped country remember that it has encountered the bypass ||class=mw-code| add_seen_bypass = FROM | country |- | set_fleet_bombardment_stance || Sets the bombardment stance of the scoped fleet ||class=mw-code| set_fleet_bombardment_stance = selective | fleet |- | check_casus_belli_valid || Re-evaluate the specified casus belli type with given target country ||class=mw-code| check_casus_belli_valid = { target = none/<optional country target> type = <optional casus belli type> } | country |- | copy_ethos_and_authority || Makes the scoped country copy the ethos and government authority of the target country. ||class=mw-code| copy_ethos_and_authority = FROM | country |- | clone_leader || Clones the last created leader for the scoped country ||class=mw-code| clone_leader = { target = <event target> #properties to override, see create_leader effect = { … } } | country |- | set_home_base || Set the home base of the scoped fleet to the specified starbase ||class=mw-code| set_home_base = event_target:cool_starbase | fleet |- | add_hyperlane || Adds a hyperlane between two systems ||class=mw-code| add_hyperlane = { from = <system> to = <system> } | all |- | remove_hyperlane || Removes existing hyperlane between two systems ||class=mw-code| remove_hyperlane = { from = <system> to = <system> } | all |- | else_if || Executes enclosed effects if limit criteria of preceding 'if' or 'else_if' is not met, and its own limit is met ||class=mw-code| if = { limit = { <triggers> } <effects> } else_if = { limit = { <triggers> } <effects> } | all |- | create_saved_leader || Creates a new saved leader for the scoped country with a lookup key ||class=mw-code| create_saved_leader = { key = <string> creator = <target> name = <random / string> species = <target / key> gender = <optional / gender> #defalut = random type = <random / key> skill = <random / int> set_age = <int> traits = { trait = <key> trait = <key> } } | country |- | remove_saved_leader || Removes a saved leader for the scoped country with a lookup key ||class=mw-code| remove_saved_leader = <string> | country |- | activate_saved_leader || Moves a saved leader to the active for the scoped country with a lookup key ||class=mw-code| activate_saved_leader = { key = <string> add_to_owned=<yes/no> #default yes effect = {…} } | country |- | add_relic || Adds the specified relic to the scoped country. add_relic = <relic_key> ||class=mw-code| | country |- | remove_relic || Removes the specified relic from the scoped country. remove_relic = <relic_key> ||class=mw-code| | country |- | delete_megastructure || Deletes the target mega structure (no death graphics) ||class=mw-code| delete_megastructure = <target> | all |- | add_random_research_option || Adds s random tech research option to the scoped country's tech view list, permanent until researched. if none applicable it runs fail_effects ||class=mw-code| add_random_research_option = { category = <string> area = <key> tier = <int> add_progress = <num>/<variable> ignore_prereqs = <yes/no> #default no ignore_rare = <yes/no> #default yes fail_effects = {} } | country |- | copy_random_tech_from || Adds a random tech from the target country within the given category and tech area constraints. The country must be able to research said tech (weight > 0, fulfils potential trigger) ||class=mw-code| copy_random_tech_from = { who = <country> category = computing (optional) area = physics (optional) progress = 0.5/variable (optional: this makes it grant the tech option rather than the whole tech) } | country |- | add_asteroid_belt || Adds an asteroid belt at the distance in the scope. ||class=mw-code| Example: add_asteroid_belt = { radius=<desired radius> type=<asteroid belt type key> } | galactic_object |- | set_asteroid_belt || Sets an asteroid belt at the distance in the scope. ||class=mw-code| Example: set_asteroid_belt = { radius=<desired radius> type=<asteroid belt type key> } | galactic_object |- | fleet_action_research_special_project || Sends a fleet to research a special project ||class=mw-code| fleet_action_research_special_project = { special_project = test_project target = event_target:project_planet } | fleet |- | remove_last_built_district || Removes last built district from the scoped planet ||class=mw-code| remove_last_built_district = yes | planet |- | remove_all_districts || Removes all districts from the scoped planet ||class=mw-code| remove_all_districts = yes | planet |- | remove_district || Removes a specific district from the scoped planet ||class=mw-code| remove_district = <key> | planet |- | add_district || Begins construction of a specific district on the scoped planet ||class=mw-code| add_district = <key> | planet |- | enable_on_market || Enables a resource on the Galactic Market ||class=mw-code| enable_on_market = <resource_key> | all |- | enable_galactic_market || Enables the galactic market. enable_galactic_market = <yes/no> ||class=mw-code| | country |- | add_timed_trait || Adds a specific trait to the scoped leader for a specific duration ||class=mw-code| add_timed_trait = { trait = <trait> days/months/years = <value>/<variable> } | leader |- | create_archaeological_site || Creates a archaeological site associated with the scope object ||class=mw-code| create_archaeological_site = <site type> | megastructure planet ship fleet galactic_object ambient_object starbase |- | destroy_archaeological_site || Destroys a archaeological site in right hand site event target ||class=mw-code| destroy_archaeological_site = <event target> | all |- | add_stage_clues || Adds clues to the current stage of an archaeological or first contact site ||class=mw-code| add_stage_clues = <int> | archaeological_site first_contact |- | add_expedition_log_entry || Adds clues to the current stage of a archaeological site ||class=mw-code| add_stage_clues = <int> | archaeological_site |- | reset_current_stage || Resets the current stage ||class=mw-code| reset_current_stage = yes/no yes = also randomize new difficulty if stage allows that. no = does not change difficulty | archaeological_site |- | finish_current_stage || Finish the current stage ||class=mw-code| finish_current_stage = yes/no/<country> yes = trigger stage completed for each stage and current excavator. no = do not trigger any stage completed country = use this country instead of excavator, no stage complete will be triggered. | archaeological_site |- | finish_site || Finish the whole archaeological site ||class=mw-code| finish_site = yes/no/<country> yes = trigger stage completed for each stage and current excavator. no = do not trigger any stage completed country = use this country instead of excavator, no stage complete will be triggered. | archaeological_site |- | set_site_progress_locked || Locks or unlocks the progress of a site ||class=mw-code| set_site_progress_locked = yes/no | archaeological_site first_contact |- | custom_tooltip_with_params || Displays a specific localization string with parameters in tooltip ||class=mw-code| custom_tooltip_with_params = { description = <loc key> description_parameters = { <value key> = <string/int/num/bool> } } | all |- | set_federation_law || Sets the given law for the scoped federation ||class=mw-code| set_federation_law = <federation law> | federation |- | add_to_galactic_community || Tries to add the scoped country to the Galactic Community ||class=mw-code| add_to_galactic_community = yes/no | country |- | add_to_galactic_community_no_message || Tries to add the scoped country to the Galactic Community without producing member joining notifications. ||class=mw-code| add_to_galactic_community_no_message = yes/no | country |- | remove_from_galactic_community || Tries to remove the scoped country from the Galactic Community ||class=mw-code| remove_from_galactic_community = yes/no | country |- | add_to_galactic_council || Tries to add the scoped country to the Galactic Council ||class=mw-code| add_to_galactic_council = yes/no | country |- | remove_from_galactic_council || Tries to remove the scoped country from the Galactic Council ||class=mw-code| remove_from_galactic_council = yes/no | country |- | steal_relic || Steal all/a random/a specific relic from a target country ||class=mw-code| steal_relic = { target = <Target Country> relic = <relic_name/all/random> | country |- | country_list_tooltip || Prints a list of the countries that match the limit triggers in a tooltip, each separated by a line break. ||class=mw-code| country_list_tooltip = { limit = { <triggers> } } | all |- | owned_planet_list_tooltip || Prints a list of the country's planets that match the limit triggers in a tooltip, each separated by a line break. ||class=mw-code| owned_planet_list_tooltip = { limit = { <triggers> } } | country |- | owned_pop_faction_list_tooltip || Prints a list of the country's pop factions that match the limit triggers in a tooltip, each separated by a line break. ||class=mw-code| owned_pop_faction_list_tooltip = { limit = { <triggers> } } | country |- | owned_leader_list_tooltip || Prints a list of the country's leaders that match the limit triggers in a tooltip, each separated by a line break. ||class=mw-code| owned_leader_list_tooltip = { limit = { <triggers> } } | country |- | owned_fleet_list_tooltip || Prints a list of the country's fleets that match the limit triggers in a tooltip, each separated by a line break. ||class=mw-code| owned_fleet_list_tooltip = { limit = { <triggers> } divider_tooltip = localisation } | country |- | set_cooldown || Locks the leader in its current role for the next X days. ||class=mw-code| set_cooldown = int | leader |- | add_federation_experience || Adds experience to the scoped federation ||class=mw-code| add_federation_experience = <federation experience> | federation |- | set_federation_type || Sets federation type to the scoped federation ||class=mw-code| set_federation_type = <federation type> | federation |- | set_federation_succession_type || Sets federation succession type to the scoped federation ||class=mw-code| Please don't use outside law on_enact, functional effect! Use set_federation_law and has_federation_law instead. set_federation_succession_type = <federation succession type> Federation succession types: strongest/diplomatic_weight/rotation/challenge/random | federation |- | set_federation_succession_term || Sets federation succession term to the scoped federation ||class=mw-code| Please don't use outside law on_enact, functional effect! Use set_federation_law and has_federation_law instead. set_federation_succession_type = <federation succession term> Federation succession terms: status_change/years_10/years_20/years_30/years_40 | federation |- | set_only_leader_builds_fleets || Sets exclusive right to build fleets by federation leader ||class=mw-code| Please don't use outside law on_enact, functional effect! Use set_federation_law and has_federation_law instead. set_only_leader_builds_fleets = <yes/no> | federation |- | set_allow_subjects_to_join || Sets right for subjects to join federations ||class=mw-code| Please don't use outside law on_enact, functional effect! Use set_federation_law and has_federation_law instead. set_allow_subjects_to_join = <yes/no> | federation |- | set_equal_voting_power || Sets different voting weight ||class=mw-code| Please don't use outside law on_enact, functional effect! Use set_federation_law and has_federation_law instead. set_equal_voting_power = <yes/no> | federation |- | set_diplomacy_action_setting || Sets diplomatic action custom setting ||class=mw-code| Please don't use outside law on_enact, functional effect! Use set_federation_law and has_federation_law instead. set_diplomacy_action_setting = { action = <action_key> settings = { tvote_type = default } } | federation |- | set_free_migration || Sets unified migration flag for federation ||class=mw-code| Please don't use outside law on_enact, functional effect! Use set_federation_law and has_federation_law instead. set_free_migration = <yes/no> | federation |- | set_federation_settings || Sets diplomatic action custom setting ||class=mw-code| Please don't use outside law on_enact, functional effect! Use set_federation_law and has_federation_law instead. set_federation_settings = { <setting> = <value> … } | federation |- | add_associate_member || Add specified country as an associate member ||class=mw-code| add_associate_member = { who = <target> override_requirements = yes/no } | federation |- | remove_associate_member || Removes a specific associate member from the federation ||class=mw-code| remove_associate_member = { who = <country> override_requirements = yes/no } | federation |- | add_cohesion || Add cohesion to the federation ||class=mw-code| add_cohesion = <value> | federation |- | set_council_size || Sets the number of seats on the Galactic Council ||class=mw-code| set_council_size = <int> | all |- | increase_council_size || Increases the number of seats on the Galactic Council by 1 ||class=mw-code| increase_council_size = yes/no | all |- | decrease_council_size || Decreases the number of seats on the Galactic Council by 1 ||class=mw-code| decrease_council_size = yes/no | all |- | set_council_veto || Sets whether council members can veto resolutions or not ||class=mw-code| set_council_veto = yes/no | all |- | set_council_emergency_measures || Sets whether council members can propose emergency measures or not ||class=mw-code| set_council_emergency_measures = yes/no | all |- | add_permanent_councillor || Gives provided country a permanent position on the Galactic Council ||class=mw-code| add_permanent_councillor = yes/no | country |- | remove_permanent_councillor || Remove the provided country from their permanent council position ||class=mw-code| remove_permanent_councillor = yes/no | country |- | set_sector_capital || Sets the scoped planet to be the capital of the sector it is part of. If used in the capital sector, it will shift the empire capital. Warning: Experimental, may have unintended consequences. ||class=mw-code| set_sector_capital = yes | planet |- | set_sector_focus || Sets the sector's focus ||class=mw-code| set_sector_focus = <sector focus> | sector |- | set_colony_type || Sets the colony's designation type ||class=mw-code| set_colony_type = <colony type> | planet |- | set_male_ruler_title || Sets the country's male ruler title to a custom value ||class=mw-code| set_male_ruler_title = "Grand Executioner" | country |- | set_female_ruler_title || Sets the country's female ruler title to a custom value ||class=mw-code| set_female_ruler_title = "Grand Executionerress" | country |- | set_male_heir_title || Sets the country's male heir title to a custom value ||class=mw-code| set_male_heir_title = "Little Executioner" | country |- | set_female_heir_title || Sets the country's female heir title to a custom value ||class=mw-code| set_female_heir_title = "Little Executioneress" | country |- | clear_custom_ruler_and_heir_titles || Clears all custom ruler and heir titles from the country, resetting them to default values ||class=mw-code| clear_custom_ruler_and_heir_titles = yes | country |- | complete_special_project || Completes a specific special project for the country, firing the on complete effects ||class=mw-code| complete_special_project = { type = <project key> location = <target> } | country |- | set_government_cooldown || Locks the country's government for a given period of days, the default cooldown, or unlocks it. ||class=mw-code| set_government_cooldown = 500/default/no | country |- | change_colony_foundation_date || Changes the colony foundation date (affecting on_colony_X_years pulses) by a specific number of days. Use with care, you can probably break things with this! ||class=mw-code| change_colony_foundation_date = <+/- int> | planet |- | log_error || Prints a message to error.log for debugging purposes. ||class=mw-code| | all |- | add_intel || Adds the defined amount of intel toward the target empire add_intel = { amount = <float>/<variable> who = <target> } ||class=mw-code| | country |- | fire_on_action || Fires a made-up on_action. ||class=mw-code| fire_on_action = { on_action = <string> scopes = { from = X fromfrom = Y } } | all |- | set_first_contact_stage || Sets the given stage for the scoped first contact ||class=mw-code| set_first_contact_stage = <stage name> | first_contact |- | finish_current_operation_stage || Finish the current operation phase ||class=mw-code| finish_current_operation_stage = yes/no yes = trigger stage completed for each stage and current excavator. no = do not trigger any stage completed | espionage_operation |- | set_mia || Sets the current fleet to go missing in action and return home. ||class=mw-code| set_mia = yes | fleet |- | create_espionage_asset || Creates espionage asset within a given spy network ||class=mw-code| create_espionage_asset = { type = <espionage asset type> effect = { <effects executed on asset> } } | spy_network |- | destroy_espionage_asset || Destroys espionage asset within a given spy network/operation ||class=mw-code| destroy_espionage_asset = <esspionage asset type> | spy_network espionage_operation |- | set_espionage_operation_progress_locked || Locks or unlocks the progress of an espionage operation ||class=mw-code| set_espionage_operation_progress_locked = yes/no | espionage_operation |- | unassign_espionage_asset || Unassignes espionage asset from the scope operation to owning spy network ||class=mw-code| unassign_espionage_asset = <esspionage asset type> | espionage_operation |- | assign_espionage_asset || Assigns espionage asset to the scope operation from owning spy network ||class=mw-code| assign_espionage_asset = <esspionage asset type> | espionage_operation |- | set_espionage_operation_flag || Sets an arbitrarily-named flag on the scoped espionage operation ||class=mw-code| set_espionage_operation_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | espionage_operation |- | remove_espionage_operation_flag || Removes a flag from the scoped espionage operation ||class=mw-code| remove_espionage_operation_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | espionage_operation |- | complete_crisis_objective || Gives the player the reward for the specified crisis objective ||class=mw-code| complete_crisis_objective = <objective> | country |- | espionage_operation_event || Fires a espionage event event for the scoped object, with optional DAYS and RANDOM delay ||class=mw-code| espionage_operation_event = { id = <id> days = x (optional: specify delay) random = y (optional: specify random delay from 0 to value, which is added on to the 'days' delay) scopes = { from = fromfrom } (optional: specify scope overrides) } | espionage_operation |- | join_war_on_side || Joins the war on the specified side. ||class=mw-code| join_war_on_side = { war = <target> side = attackers/defenders/<country> } | country |- | dissolve_federation || Dissolved the current federation ||class=mw-code| dissolve_federation = yes | federation |- | remove_random_starbase_building || Remove a number of random building (s) matching/not matching a type from the starbase ||class=mw-code| remove_random_starbase_building = { type = <starbase building> ( optional. default: all ) count = <int> (optional. default: 1 ) } | starbase |- | remove_random_starbase_module || Remove a number of random module (s) matching/not matching a type from the starbase ||class=mw-code| remove_random_starbase_module = { type = <starbase module> ( optional. default: all ) count = <int> (optional. default: 1 ) } | starbase |- | set_timed_espionage_operation_flag || Sets an arbitrarily-named flag on the scoped espionage operation for a set duration ||class=mw-code| set_timed_espionage_operation_flag = { flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) days/months/years = <int>/<variable> } | espionage_operation |- | destroy_espionage_operation || Destroys a espionage operation site in right hand site event target ||class=mw-code| destroy_espionage_operation = <event target> | all |- | add_espionage_information || Adds information to the current stage of an espionage operation ||class=mw-code| add_espionage_information = <value> | espionage_operation |- | add_victory_score || Adds victory score to a country ||class=mw-code| add_victory_score = { source=<loc_key> score=<value>/<variable> } | country |- | store_galactic_community_leader_backup_data || Stores a copy of the specified data of the Galactic Custodian/Emperor. The values default to 'no'. ||class=mw-code| store_galactic_community_leader_backup_data = { flag = <yes/no> room = <yes/no> name = <yes/no ethics = <yes/no> government = <yes/no> } | all |- | restore_galactic_community_leader_backup_data || Retores backed up data to the Galactic Custodian/Emperor ||class=mw-code| restore_galactic_community_leader_backup_data = <yes/no> | all |- | activate_crisis_progression || Activates crisis progression for the country ||class=mw-code| activate_crisis_progression = yes | country |- | room_name_override || Sets the room background of the empire. Provide an empty string to remove the override. ||class=mw-code| room_name_override = <room_name> | country |- | set_ai_personality || Sets the AI personality of a country to a new one ||class=mw-code| set_ai_personality=<personality> | country |- | add_custodian_term_days || Increase the current Custodian term time ||class=mw-code| add_custodian_term_days = <days> | all |- | set_custodian_term_days || Set the current Custodian term time. -1 will make the Custodianship permanent. ||class=mw-code| set_custodian_term_days = <days> | all |- | pass_targeted_resolution || Immediately passes the first found (oldest) proposed/voting for/failed resolution OR a new resolution of this type that has the specified target. Ignores whether the target is valid or not. ||class=mw-code| pass_targeted_resolution = { resolution = <resolution type> target = <target> | country |- | set_update_modifiers_batch || Disables modifier system to do full updates between Begin and End. ||class=mw-code| On end it will trigger a full update of any dirty modifiers. Begin: set_update_modifiers_batch = begin End: set_update_modifiers_batch = end | all |- | validate_planet_buildings_and_districts || Checks whether the planets and districts on the planet are valid (their potential triggers are fulfilled), removes or replaces them if not. ||class=mw-code| validate_planet_buildings_and_districts = yes | planet |- | country_event || Fires a country event for the scoped country, with optional DAYS and RANDOM delay ||class=mw-code| country_event = { id = <id> days = x (optional: specify delay) random = y (optional: specify random delay, capped at value) scopes = { from = fromfrom } (optional: specify scope overrides) } | country |- | planet_event || Fires a planet event for the scoped planet, with optional DAYS and RANDOM delay ||class=mw-code| planet_event = { id = <id> days = x (optional: specify delay) random = y (optional: specify random delay, capped at value) scopes = { from = fromfrom } (optional: specify scope overrides) } | planet |- | random || All enclosed effects may or may not be executed depending on set chance ||class=mw-code| random = { chance = 50 <effects> } | all |- | create_ship_design || Creates a new ship design for use with last_created_design target ||class=mw-code| create_ship_design = { design = <key> ftl = <target, optional, sets FTL drive to target country's> } | all |- | change_government || Change the scoped country's government authority and/or civics ||class=mw-code| change_government = random or change_government = { authority = random / <key> civics = random / { civic = <key> civic = random } cooldown = no (default: yes) remove_invalid_civics = yes (default: no) } | country |- | ship_event || Fires a ship event for the scoped ship, with optional DAYS and RANDOM delay ||class=mw-code| ship_event = { id = <id> days = x (optional: specify delay) random = y (optional: specify random delay from 0 to value, which is added on to the 'days' delay) scopes = { from = fromfrom } (optional: specify scope overrides) } | ship |- | pop_event || Fires a pop event for the scoped pop, with optional DAYS and RANDOM delay ||class=mw-code| pop_event = { id = <id> days = x (optional: specify delay) random = y (optional: specify random delay from 0 to value, which is added on to the 'days' delay) scopes = { from = fromfrom } (optional: specify scope overrides) } | pop |- | enable_special_project || Enables a specific special research project for target country at a specific location (should be same as the current scope where possible) ||class=mw-code| enable_special_project = { name = <project key> owner = <target, default = root> location = <target, ideally THIS (that is default)> } | all |- | add_resource || Adds specific resource to the stockpile for the country scope: ||class=mw-code| add_resource = { <resource_name_1> = <value_1> <resource_name_2> = <value_2> … mult = <variable> (optional: multiplies all gained resources by a variable) } | country |- | fleet_event || Fires a fleet event for the scoped fleet, with optional DAYS and RANDOM delay ||class=mw-code| fleet_event = { id = <id> days = x (optional: specify delay) random = y (optional: specify random delay from 0 to value, which is added on to the 'days' delay) scopes = { from = fromfrom } (optional: specify scope overrides) } | fleet |- | random_planet_within_border || Iterate through each planet within the current empire's borders – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_planet_within_border = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country |- | pop_remove_ethic || Removes a specific ethic from the scoped pop ||class=mw-code| pop_remove_ethic = <key> | pop |- | create_rebels || Creates a rebellion ||class=mw-code| create_rebels = { name = <random / string> authority = <random / key> civics = random / { civic = <key> civic = random } species = <target> ethos = <random / { ethic = <key> ethic = <key> } } | planet |- | cancel_terraformation || Cancels terraformation of the scoped planet ||class=mw-code| cancel_terraformation = yes | planet |- | set_primitive_age || Sets a 'primitive age' for the scoped (primitive, pre-FTL) country ||class=mw-code| set_primitive_age = renaissance_age | country |- | while || Repeats enclosed effects while limit criteria are met or until set iteration count is reached ||class=mw-code| while = { limit = { <triggers> } <effects> } while = { count = [3|Variable] <effects> } | all |- | clear_blocker || Clears scoped deposit blocker and fires its on_cleared effect ||class=mw-code| clear_blocker = yes | deposit |- | every_system_in_cluster || Executes enclosed effects on every system in the cluster that meet the limit criteria ||class=mw-code| every_system_in_cluster = { limit = { <triggers> } <effects> } | all |- | create_cluster || Creates a cluster centered around the specified spatial object ||class=mw-code| | all |- | remove_army || Removes the scoped army ||class=mw-code| remove_army = yes | army |- | prevent_anomaly || Disables or enables anomaly generation for the scoped planet ||class=mw-code| prevent_anomaly = yes | planet |- | add_deposit || Adds resource deposit to the scoped planet (note: if you add a blocker, it will add a random deposit that can be blocked by that deposit) ||class=mw-code| add_deposit = <key/random> | planet |- | clear_deposits || Removes all deposits from the scoped planet ||class=mw-code| clear_deposits = yes | planet |- | set_country_type || Changes the country type of the scoped country ||class=mw-code| set_country_type = <key> | country |- | set_age || Sets the age of the scoped leader ||class=mw-code| set_age = <int> | leader |- | conquer || Conquers the planet by setting its owner to target country and adding an unhappiness modifier ||class=mw-code| conquer = <target country> | planet |- | pop_faction_event || Fires a pop faction event for the scoped pop faction, with optional DAYS and RANDOM delay ||class=mw-code| pop_faction_event = { id = <id> days = x (optional: specify delay) random = y (optional: specify random delay from 0 to value, which is added on to the 'days' delay) scopes = { from = fromfrom } (optional: specify scope overrides) } | pop_faction |- | set_pop_faction_flag || Sets an arbitrarily-named flag on the scoped pop's faction/pop faction ||class=mw-code| set_pop_faction_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | pop pop_faction |- | remove_pop_faction_flag || Removes a flag from the scoped pop's faction/pop faction ||class=mw-code| remove_pop_faction_flag = <key> (note: one can use e.g. my_flag@from to track relationships between objects) | pop pop_faction |- | set_timed_pop_faction_flag || Sets an arbitrarily-named flag on the scoped pop faction for a set duration ||class=mw-code| set_timed_pop_faction_flag = { flag = <key> (note: one can use <key>@scope e.g. my_flag@from to track relationships between objects) days = <int> } | pop pop_faction |- | add_tech_progress || Gives percentage progress (0.0-1.0) in a specific tech to the scoped country ||class=mw-code| add_tech_progress = { tech = <key> progress = <float>/<variable> } | country |- | abort_special_project || Aborts a specific special project for the country, removing it from the situation log ||class=mw-code| abort_special_project = { type = <project key> location = <target> } | country |- | every_pop_faction || Iterate through all the country's pop factions – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_pop_faction = { limit = { <triggers> } <effects> } | country |- | random_pop_faction || Iterate through all the country's pop factions – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_pop_faction = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country |- | observer_event || Fires an observer event for all observers. ||class=mw-code| | all |- | set_custom_capital_location || Sets a custom spatial object as custom country capital location. ||class=mw-code| set_custom_capital_location = <target> | country |- | spawn_planet || Spawns a planet in a system. ||class=mw-code| | galactic_object |- | spawn_megastructure || Spawns a mega structure in a system. ||class=mw-code| spawn_megastructure = { type = ring_world_ruined name = <string> owner = <target> planet = <planet/star target> coords_from = <target> (use this or 'planet' to set the location) graphical_culture = <target> orbit_distance = 50 orbit_angle = 50 } | galactic_object |- | remove_megastructure || Removes a mega structure. ||class=mw-code| remove_megastructure = <target mega structure> | all |- | trigger_megastructure_icon || if a planet has trigger_megastructure_icon = yes then the map icon for the star will show a megastructure icon ||class=mw-code| | planet |- | run_ai_strategic_data || Recomputes ALL strategic data for AI = yes ||class=mw-code| | country |- | add_static_war_exhaustion || Adds static war exhaustion, scaled with value_for_planet_destruction, to owner of the battle location ||class=mw-code| add_static_war_exhaustion = { attacker = <country> location = <planet> value_for_planet_destruction = <0.0-1.0>/<variable> #scales the amount of war exhaustion that is added } | country |- | set_planet_size || Sets the planet size to a specified number ||class=mw-code| set_planet_size = <int> | planet |- | run_ai_strategic_war_data || Recomputes strategic war ( attack / defense ) data for AI = yes ||class=mw-code| | country |- | expire_site_event || Manually flags an archaeological event as expired ||class=mw-code| expire_site_event = ancrel.7003 | archaeological_site |- | pass_resolution || Immediately passes the first found (oldest) proposed/voting for/failed resolution OR a new resolution of this type. ||class=mw-code| pass_resolution = <resolution type> | country |- | pass_resolution_no_cooldown || Immediately passes the first found (oldest) proposed/voting for/failed resolution OR a new resolution of this type. Skips the cooldown on the relevant category. ||class=mw-code| pass_resolution_no_cooldown = <resolution type> | country |- | first_contact_event || Fires a first contact event for the scoped first contact site, with optional DAYS and RANDOM delay ||class=mw-code| first_contact_event = { id = <id> days = x (optional: specify delay) random = y (optional: specify random delay from 0 to value, which is added on to the 'days' delay) scopes = { from = fromfrom } (optional: specify scope overrides) } | first_contact |- | finish_first_contact || Ends the First Contact ||class=mw-code| finish_first_contact = yes | first_contact |- | set_galactic_custodian || Sets whether or not the scoped country is the Galactic Custodian ||class=mw-code| set_galactic_custodian = yes/no | country |- | set_galactic_emperor || Sets whether or not the scoped country is the Galactic Emperor ||class=mw-code| set_galactic_emperor = yes/no | country |- | add_imperial_authority || Add imperial_authority ||class=mw-code| add_imperial_authority = <value> | all |- | add_stage_modifier || Adds a specific modifier to the current espionage operation stage for a set duration or until stage is changed ||class=mw-code| add_stage_modifier = { modifier = <key> days = <int, -1 means it never expires> } | espionage_operation |- | remove_stage_modifier || Removes a specific modifier from the espionage operation current stage ||class=mw-code| remove_stage_modifier = <key> | espionage_operation |- | add_intel_report || Adds the intel level for the category selected. Default duration (0) is forever. ||class=mw-code| add_intel_report = { category = <string> level = <int> days = <int> who = <target> } | country |- | set_galactic_defense_force || Sets whether the Galactic Defense force or Imperial Armada exists ||class=mw-code| set_galactic_defense_force = yes/no | all |- | clear_intel_report || Removes all the intel reports related to the provided category. ||class=mw-code| clear_intel_report = { category = <string> who = <target> } | country |- | starbase_event || Fires a starbase event for the scoped starbase ||class=mw-code| starbase_event = { id = <id> days = x (optional: specify delay) random = y (optional: specify random delay from 0 to value, which is added on to the 'days' delay) scopes = { from = fromfrom } (optional: specify scope overrides) } | starbase |- | system_event || Fires a system event for the scoped system ||class=mw-code| system_event = { id = <id> days = x (optional: specify delay) random = y (optional: specify random delay from 0 to value, which is added on to the 'days' delay) scopes = { from = fromfrom } (optional: specify scope overrides) } | galactic_object |- | leader_event || Fires a leader event for the scoped leader ||class=mw-code| leader_event = { id = <id> days = x (optional: specify delay) random = y (optional: specify random delay from 0 to value, which is added on to the 'days' delay) scopes = { from = fromfrom } (optional: specify scope overrides) } | leader |- | transfer_galactic_defense_force_fleets || Moves all owned GDF fleets to the target. ||class=mw-code| transfer_galactic_defense_force_fleets = <target> | country |- | cancel_resolution || Immediately cancels/removes the latest active/passed/proposed/voting for/failed resolution of this type ||class=mw-code| cancel_resolution = <resolution type> | country |- | add_spy_network_level || Adds levels to the current Spy Network ||class=mw-code| add_spy_network_level = <int> | spy_network |- | every_system_planet || Iterate through each planet in the current system – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_system_planet = { limit = { <triggers> } <effects> } | galactic_object |- | join_alliance || Join federation with target ||class=mw-code| join_alliance = { who = <target> override_requirements = yes/no } | country |- | complete_tutorial_step || Create and sends an telemetry event keeping track of the tutorial steps for the current game ||class=mw-code| | all |- | set_emperor_can_change_council_members || Sets whether the Galactic Emperor can change Imperial Council members or not ||class=mw-code| set_emperor_can_change_council_members = yes/no | all |- | create_leader || Creates a new leader for the scoped country ||class=mw-code| create_leader = { name = <random / string> species = <target / key> gender = <gender> #optional, default = random type = <random / key> skill = <random / int> set_age = <int> traits = { trait = <key> trait = <key> } } | country |- | set_disabled || Enables or disables the scoped ship ||class=mw-code| set_disabled = no | ship |- | else || Executes enclosed effects if limit criteria of preceding 'if' or 'else_if' is not met ||class=mw-code| if = { limit = { <triggers> } <effects> } else = { <effects> } | all |- | log || Prints a message to game.log for debugging purposes. ||class=mw-code| | all |- | debug_break || Trigger an assertion to stop the debugger when encountering this effect; argument is ignored ||class=mw-code| debug_break = yes | all |- | inverted_switch || Executes the first appropriate effect set for a specific trigger treated as NOT. ||class=mw-code| inverted_switch = { trigger = <trigger> <corresponding key/bool/int> = { <effect> } <corresponding key/bool/int> > (less/greater than appear 'reversed') { <effect> } default = { <effect> } } | all |- | ordered_ambient_object || Iterate through every ambient object in the game – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_ambient_object = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | all |- | ordered_system_ambient_object || Iterate through every ambient object in the solar system – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_system_ambient_object = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | galactic_object |- | random_owned_army || Iterate through each army that is owned by the country – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_owned_army = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country |- | ordered_owned_army || Iterate through each army that is owned by the country – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_owned_army = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country |- | every_owned_army || Iterate through each army that is owned by the country – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_owned_army = { limit = { <triggers> } <effects> } | country |- | random_planet_army || Iterate through each army on the planet (not in ground combat) belonging to the planet owner – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_planet_army = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | planet |- | ordered_planet_army || Iterate through each army on the planet (not in ground combat) belonging to the planet owner – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_planet_army = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | planet |- | every_planet_army || Iterate through each army on the planet (not in ground combat) belonging to the planet owner – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_planet_army = { limit = { <triggers> } <effects> } | planet |- | random_ground_combat_defender || Iterate through each army currently defending the planet in ground combat – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_ground_combat_defender = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | planet |- | ordered_ground_combat_defender || Iterate through each army currently defending the planet in ground combat – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_ground_combat_defender = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | planet |- | every_ground_combat_defender || Iterate through each army currently defending the planet in ground combat – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_ground_combat_defender = { limit = { <triggers> } <effects> } | planet |- | random_ground_combat_attacker || Iterate through each army currently attacking the planet in ground combat – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_ground_combat_attacker = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | planet |- | ordered_ground_combat_attacker || Iterate through each army currently attacking the planet in ground combat – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_ground_combat_attacker = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | planet |- | every_ground_combat_attacker || Iterate through each army currently attacking the planet in ground combat – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_ground_combat_attacker = { limit = { <triggers> } <effects> } | planet |- | ordered_country || Iterate through all countries – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_country = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | all |- | random_relation || Iterate through all relations – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_relation = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country |- | ordered_relation || Iterate through all relations – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_relation = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country |- | every_relation || Iterate through all relations – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_relation = { limit = { <triggers> } <effects> } | country |- | random_neighbor_country || Iterate through all neighbor countries – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_neighbor_country = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country |- | ordered_neighbor_country || Iterate through all neighbor countries – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_neighbor_country = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country |- | every_neighbor_country || Iterate through all neighbor countries – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_neighbor_country = { limit = { <triggers> } <effects> } | country |- | random_bordering_country || Iterate through all bordering countries of a system – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_bordering_country = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | galactic_object |- | ordered_bordering_country || Iterate through all bordering countries of a system – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_bordering_country = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | galactic_object |- | every_bordering_country || Iterate through all bordering countries of a system – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_bordering_country = { limit = { <triggers> } <effects> } | galactic_object |- | random_rival_country || Iterate through all countries rivalled by the scoped country – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_rival_country = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country |- | ordered_rival_country || Iterate through all countries rivalled by the scoped country – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_rival_country = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country |- | every_rival_country || Iterate through all countries rivalled by the scoped country – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_rival_country = { limit = { <triggers> } <effects> } | country |- | random_federation_ally || Iterate through all countries in a federation with the scoped country – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_federation_ally = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country |- | ordered_federation_ally || Iterate through all countries in a federation with the scoped country – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_federation_ally = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country |- | every_federation_ally || Iterate through all countries in a federation with the scoped country – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_federation_ally = { limit = { <triggers> } <effects> } | country |- | ordered_playable_country || Iterate through all playable countries – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_playable_country = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | all |- | ordered_subject || Iterate through all subjects of the scoped country – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_subject = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country |- | random_spynetwork || Iterate through each spynetwork – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_spynetwork = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country no_scope |- | ordered_spynetwork || Iterate through each spynetwork – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_spynetwork = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country no_scope |- | every_spynetwork || Iterate through each spynetwork – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_spynetwork = { limit = { <triggers> } <effects> } | country no_scope |- | random_espionage_operation || Iterate through each espionage operation – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_espionage_operation = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country no_scope spy_network |- | ordered_espionage_operation || Iterate through each espionage operation – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_espionage_operation = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country no_scope spy_network |- | every_espionage_operation || Iterate through each espionage operation – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_espionage_operation = { limit = { <triggers> } <effects> } | country no_scope spy_network |- | random_espionage_asset || Iterate through each espionage asset – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_espionage_asset = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | no_scope spy_network espionage_operation |- | ordered_espionage_asset || Iterate through each espionage asset – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_espionage_asset = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | no_scope spy_network espionage_operation |- | every_espionage_asset || Iterate through each espionage asset – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_espionage_asset = { limit = { <triggers> } <effects> } | no_scope spy_network espionage_operation |- | random_federation || Iterate through each federation – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_federation = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | all |- | ordered_federation || Iterate through each federation – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_federation = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | all |- | every_federation || Iterate through each federation – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_federation = { limit = { <triggers> } <effects> } | all |- | random_first_contact || Iterate through each first contact (both active and complete) that this country is engaging in – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_first_contact = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country |- | ordered_first_contact || Iterate through each first contact (both active and complete) that this country is engaging in – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_first_contact = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country |- | every_first_contact || Iterate through each first contact (both active and complete) that this country is engaging in – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_first_contact = { limit = { <triggers> } <effects> } | country |- | random_active_first_contact || Iterate through each active (non-completed) first contact that this country is engaging in – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_active_first_contact = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country |- | ordered_active_first_contact || Iterate through each active (non-completed) first contact that this country is engaging in – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_active_first_contact = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country |- | every_active_first_contact || Iterate through each active (non-completed) first contact that this country is engaging in – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_active_first_contact = { limit = { <triggers> } <effects> } | country |- | random_galaxy_fleet || Iterate through each fleet in the entire game – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_galaxy_fleet = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | all |- | ordered_galaxy_fleet || Iterate through each fleet in the entire game – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_galaxy_fleet = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | all |- | every_galaxy_fleet || Iterate through each fleet in the entire game – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_galaxy_fleet = { limit = { <triggers> } <effects> } | all |- | random_combatant_fleet || Iterate through each fleet this fleet is in combat with – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_combatant_fleet = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | fleet |- | ordered_combatant_fleet || Iterate through each fleet this fleet is in combat with – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_combatant_fleet = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | fleet |- | every_combatant_fleet || Iterate through each fleet this fleet is in combat with – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_combatant_fleet = { limit = { <triggers> } <effects> } | fleet |- | ordered_fleet_in_system || Iterate through each fleet in the current system – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_fleet_in_system = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | galactic_object |- | ordered_owned_fleet || Iterate through each fleet owned by the country – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_owned_fleet = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country |- | random_fleet_in_orbit || Iterate through each fleet orbiting the current planet/starbase/megastructure – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_fleet_in_orbit = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | megastructure planet starbase |- | ordered_fleet_in_orbit || Iterate through each fleet orbiting the current planet/starbase/megastructure – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_fleet_in_orbit = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | megastructure planet starbase |- | every_fleet_in_orbit || Iterate through each fleet orbiting the current planet/starbase/megastructure – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_fleet_in_orbit = { limit = { <triggers> } <effects> } | megastructure planet starbase |- | random_orbital_station || Iterate through each orbital station owned by the current country or in the current system – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_orbital_station = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country galactic_object |- | ordered_orbital_station || Iterate through each orbital station owned by the current country or in the current system – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_orbital_station = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country galactic_object |- | every_orbital_station || Iterate through each orbital station owned by the current country or in the current system – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_orbital_station = { limit = { <triggers> } <effects> } | country galactic_object |- | random_galcom_member || Iterate through each member of the galactic community – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_galcom_member = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | all |- | ordered_galcom_member || Iterate through each member of the galactic community – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_galcom_member = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | all |- | every_galcom_member || Iterate through each member of the galactic community – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_galcom_member = { limit = { <triggers> } <effects> } | all |- | random_council_member || Iterate through each member of the galactic council – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_council_member = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | all |- | ordered_council_member || Iterate through each member of the galactic council – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_council_member = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | all |- | every_council_member || Iterate through each member of the galactic council – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_council_member = { limit = { <triggers> } <effects> } | all |- | ordered_owned_leader || Iterate through each leader that is owned by the country – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_owned_leader = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country |- | random_pool_leader || Iterate through each leader that is recruitable for the country – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_pool_leader = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country |- | ordered_pool_leader || Iterate through each leader that is recruitable for the country – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_pool_leader = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country |- | every_pool_leader || Iterate through each leader that is recruitable for the country – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_pool_leader = { limit = { <triggers> } <effects> } | country |- | random_envoy || Iterate through each envoy available to the country – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_envoy = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country |- | ordered_envoy || Iterate through each envoy available to the country – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_envoy = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country |- | every_envoy || Iterate through each envoy available to the country – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_envoy = { limit = { <triggers> } <effects> } | country |- | random_megastructure || Iterate through each megastructure – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_megastructure = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | all |- | ordered_megastructure || Iterate through each megastructure – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_megastructure = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | all |- | every_megastructure || Iterate through each megastructure – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_megastructure = { limit = { <triggers> } <effects> } | all |- | random_owned_megastructure || Iterate through each owned megastructure – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_owned_megastructure = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country |- | ordered_owned_megastructure || Iterate through each owned megastructure – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_owned_megastructure = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country |- | every_owned_megastructure || Iterate through each owned megastructure – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_owned_megastructure = { limit = { <triggers> } <effects> } | country |- | random_system_megastructure || Iterate through each megastructure in system – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_system_megastructure = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | all |- | ordered_system_megastructure || Iterate through each megastructure in system – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_system_megastructure = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | all |- | every_system_megastructure || Iterate through each megastructure in system – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_system_megastructure = { limit = { <triggers> } <effects> } | all |- | random_member || Iterate through each member of the federation – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_member = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | federation |- | ordered_member || Iterate through each member of the federation – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_member = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | federation |- | every_member || Iterate through each member of the federation – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_member = { limit = { <triggers> } <effects> } | federation |- | random_associate || Iterate through each associate member of the federation – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_associate = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | federation |- | ordered_associate || Iterate through each associate member of the federation – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_associate = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | federation |- | every_associate || Iterate through each associate member of the federation – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_associate = { limit = { <triggers> } <effects> } | federation |- | ordered_system_planet || Iterate through each planet in the current system – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_system_planet = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | galactic_object |- | ordered_planet_within_border || Iterate through each planet within the current empire's borders – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_planet_within_border = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country |- | random_owned_planet || Iterate through each inhabited planet owned by the current empire – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_owned_planet = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country sector |- | ordered_owned_planet || Iterate through each inhabited planet owned by the current empire – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_owned_planet = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country sector |- | every_owned_planet || Iterate through each inhabited planet owned by the current empire – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_owned_planet = { limit = { <triggers> } <effects> } | country sector |- | random_controlled_planet || Iterate through each inhabited planet controlled by the current empire – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_controlled_planet = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country |- | ordered_controlled_planet || Iterate through each inhabited planet controlled by the current empire – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_controlled_planet = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country |- | every_controlled_planet || Iterate through each inhabited planet controlled by the current empire – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_controlled_planet = { limit = { <triggers> } <effects> } | country |- | random_galaxy_planet || Iterate through each planet ANYWHERE in the game; warning: resource intensive! - executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_galaxy_planet = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | all |- | ordered_galaxy_planet || Iterate through each planet ANYWHERE in the game; warning: resource intensive! - executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_galaxy_planet = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | all |- | every_galaxy_planet || Iterate through each planet ANYWHERE in the game; warning: resource intensive! - executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_galaxy_planet = { limit = { <triggers> } <effects> } | all |- | ordered_deposit || Iterate through each deposit on the planet – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_deposit = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | planet |- | ordered_moon || Iterate through each moon of the planet – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_moon = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | planet |- | ordered_owned_pop || Iterate through all owned pops – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_owned_pop = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | planet country pop_faction sector |- | random_species_pop || Iterate through each pop that belongs to this species; warning: resource-intensive! - executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_species_pop = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | species |- | ordered_species_pop || Iterate through each pop that belongs to this species; warning: resource-intensive! - executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_species_pop = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | species |- | every_species_pop || Iterate through each pop that belongs to this species; warning: resource-intensive! - executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_species_pop = { limit = { <triggers> } <effects> } | species |- | ordered_pop_faction || Iterate through all the country's pop factions – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_pop_faction = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country |- | random_galaxy_sector || Iterate through all sectors in the game – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_galaxy_sector = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | all |- | ordered_galaxy_sector || Iterate through all sectors in the game – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_galaxy_sector = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | all |- | every_galaxy_sector || Iterate through all sectors in the game – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_galaxy_sector = { limit = { <triggers> } <effects> } | all |- | random_owned_sector || Iterate through every owned sector – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_owned_sector = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country |- | ordered_owned_sector || Iterate through every owned sector – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_owned_sector = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country |- | every_owned_sector || Iterate through every owned sector – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_owned_sector = { limit = { <triggers> } <effects> } | country |- | ordered_owned_ship || Iterate through each ship in the fleet or owned by the country – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_owned_ship = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country fleet |- | random_ship_in_system || Iterate through each ship in the current system – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_ship_in_system = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | galactic_object |- | ordered_ship_in_system || Iterate through each ship in the current system – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_ship_in_system = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | galactic_object |- | every_ship_in_system || Iterate through each ship in the current system – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_ship_in_system = { limit = { <triggers> } <effects> } | galactic_object |- | random_owned_pop_species || Iterate through each species of a country's owned pops – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_owned_pop_species = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country |- | ordered_owned_pop_species || Iterate through each species of a country's owned pops – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_owned_pop_species = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country |- | every_owned_pop_species || Iterate through each species of a country's owned pops – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_owned_pop_species = { limit = { <triggers> } <effects> } | country |- | random_galaxy_species || Check if any species in the galaxy meet the specified criteria – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_galaxy_species = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | all |- | ordered_galaxy_species || Check if any species in the galaxy meet the specified criteria – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_galaxy_species = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | all |- | every_galaxy_species || Check if any species in the galaxy meet the specified criteria – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_galaxy_species = { limit = { <triggers> } <effects> } | all |- | random_owned_species || Check if any of the species <on the planet/in the country> meet the specified criteria – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_owned_species = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | planet country |- | ordered_owned_species || Check if any of the species <on the planet/in the country> meet the specified criteria – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_owned_species = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | planet country |- | every_owned_species || Check if any of the species <on the planet/in the country> meet the specified criteria – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_owned_species = { limit = { <triggers> } <effects> } | planet country |- | random_enslaved_species || Check if any of the species with enslaved pops <on the planet/in the country> meet the specified criteria – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_enslaved_species = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | planet country |- | ordered_enslaved_species || Check if any of the species with enslaved pops <on the planet/in the country> meet the specified criteria – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_enslaved_species = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | planet country |- | every_enslaved_species || Check if any of the species with enslaved pops <on the planet/in the country> meet the specified criteria – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_enslaved_species = { limit = { <triggers> } <effects> } | planet country |- | random_owned_starbase || Iterate through every owned starbase – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_owned_starbase = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country |- | ordered_owned_starbase || Iterate through every owned starbase – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_owned_starbase = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country |- | every_owned_starbase || Iterate through every owned starbase – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_owned_starbase = { limit = { <triggers> } <effects> } | country |- | random_system || Iterate through all systems – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_system = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | all |- | ordered_system || Iterate through all systems – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_system = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | all |- | every_system || Iterate through all systems – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_system = { limit = { <triggers> } <effects> } | all |- | ordered_rim_system || Iterate through all rim systems – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_rim_system = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | all |- | random_system_within_border || Iterate through all systems within the country's or sector's borders – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_system_within_border = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country sector |- | ordered_system_within_border || Iterate through all systems within the country's or sector's borders – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_system_within_border = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country sector |- | every_system_within_border || Iterate through all systems within the country's or sector's borders – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_system_within_border = { limit = { <triggers> } <effects> } | country sector |- | ordered_neighbor_system || Iterate through all a system's neighboring systems by hyperlane – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_neighbor_system = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | galactic_object |- | random_neighbor_system_euclidean || Iterate through all a system's neigboring systems (by closeness, not by hyperlanes) – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_neighbor_system_euclidean = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | galactic_object |- | ordered_neighbor_system_euclidean || Iterate through all a system's neigboring systems (by closeness, not by hyperlanes) – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_neighbor_system_euclidean = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | galactic_object |- | every_neighbor_system_euclidean || Iterate through all a system's neigboring systems (by closeness, not by hyperlanes) – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_neighbor_system_euclidean = { limit = { <triggers> } <effects> } | galactic_object |- | random_war_participant || Iterate through all war participants – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_war_participant = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | war |- | ordered_war_participant || Iterate through all war participants – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_war_participant = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | war |- | random_attacker || Iterate through all attackers in the current war – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_attacker = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | war |- | ordered_attacker || Iterate through all attackers in the current war – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_attacker = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | war |- | every_attacker || Iterate through all attackers in the current war – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_attacker = { limit = { <triggers> } <effects> } | war |- | random_defender || Iterate through all defenders in the current war – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_defender = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | war |- | ordered_defender || Iterate through all defenders in the current war – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_defender = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | war |- | every_defender || Iterate through all defenders in the current war – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_defender = { limit = { <triggers> } <effects> } | war |- | random_war || Iterate through all wars the country is engaged in – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object randomly. ||class=mw-code| random_war = { limit = { <triggers> } weights = { (optional – adds weights to affect the chance a specific object is selected) base = float modifier = { <add/factor = float> <triggers> } } <effects> } | country |- | ordered_war || Iterate through all wars the country is engaged in – executes the enclosed effects on one of them for which the limit triggers return true. Picks the specific object according to the order specified (position 0, order_by = trigger:num_pops would run the effects on the X with the most pops) ||class=mw-code| ordered_war = { limit = { <triggers> } position = <integer, starting with 0> order_by = <variable>/trigger:<trigger> inverse = yes/no (default: no – if yes, then 0 is lowest rather than highest) <effects> } | country |- | every_war || Iterate through all wars the country is engaged in – executes the enclosed effects on all of them for which the limit triggers return true ||class=mw-code| every_war = { limit = { <triggers> } <effects> } | country |} For comparing '''old lists''' of Stellaris effects (modifiers and triggers) for most game versions since launch, you can use the [[wikipedia:GitHub|GitHub]] file history feature [https://github.com/OldEnt/stellaris-triggers-modifiers-effects-list/commits/master here] <small> (created by OldEnt)</small>. ==== Depreciated ==== {| class="wikitable sortable" style="font-size:90%; text-align:left; width:100%" |set_primitive |[<s>DEPRECATED</s> REMOVED in 3.1, USE '''set_country_type'''] Sets the scoped country as primitive. |country |- |random_pop |[<s>DEPRECATED</s> REMOVED in 3.1, USE '''random_owned_pop'''] Executes enclosed effects on a random pop that meets the limit criteria. |planet |- | random/every_(research/mining)'''_station''' |[REMOVED in 3.1] Executes enclosed effects on a (random/every) orbital (research/mining) station that meets the limit criteria. |planet country |} == Scripted Effects == There are more than singular Effects can be used for an Effect. See [[Dynamic modding#Scripted Effects|Scripted Effects]] for details. {{ModdingNavbox}} [[Category:模组制作]]
摘要:
请注意您对群星百科的所有贡献都被认为是在知识共享署名-非商业性使用-相同方式共享下发布,请查看在
群星百科:版权
的细节。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源。
未经许可,请勿提交受版权保护的作品!
为防止机器编辑,请完成下方验证
取消
编辑帮助
(在新窗口中打开)
本页使用的模板:
Template:Clear
(
编辑
)
Template:ModdingNavbox
(
编辑
)
Template:Navbox
(
编辑
)
Template:Navboxgroup
(
编辑
)
Template:Version
(
编辑
)
×
登录
密码
记住登录
加入群星百科
忘记密码?
其他方式登录