Anomalies modding

From Stellaris Wiki
Jump to navigation Jump to search


Outliner top.png
Please help with verifying or updating older sections of this article. At least some were last verified for version 2.0.

This article is for the PC version of Stellaris only.

Anomalies are events that have a chance of triggering whenever your science ship surveys a stellar body. Several different objects go into the creation of an anomaly, including:

  • Anomaly Categories
  • Anomalies
  • Anomaly Events

Anomaly Categories[edit]

Anomaly Categories define the range of possible anomalies that can occur when an object is surveyed. If for example you wish to create an anomaly that only occurs on asteroids (i.e. it may trigger when surveying an asteroid in game), you will want to define an anomaly category to limit that criteria.


anomaly_category = {
  key = "crashed_ship_asteroid_category"
  desc = "crashed_ship_asteroid_category_desc"
  picture = GFX_evt_mining_station
  level = 2

The above code defines some of the important features of the anomaly category. The key will be referenced by anomalies that wish to use this category, and along with the description define the text that will appear in-game when an anomaly of this type is encountered. The picture also is an in-game reference, appearing in the popup when an anomaly is discovered. The level defines the base difficulty in investigating this type of anomaly (i.e. what level science officer is recommended to attempt it), while the risk is the chance of failure when doing so.

     spawn_chance = {		
           modifier = {
                 add = 3
                 is_asteroid = yes

The spawn chance defines the likelihood that that an anomaly of this category will appear when surveying. The base spawn chance is zero, and here you can add weight based on filters like what type of object is being surveyed, how late in the game the player is, or even what ethics or technology the surveying player possesses.

     on_success = {

You can trigger events for successfully investigating the anomaly here, but this is not where we tie in anomalies. That is done on the anomaly objects themselves.

     on_fail = {
           ship_event = { id = anomaly_failure.1 }

You can also trigger events for failing...

     on_critical_fail = {
           random_list = {
                 16 = { ship_event = { id = anomaly_failure.400 } }
                 16 = { ship_event = { id = anomaly_failure.401 } }
                 16 = { ship_event = { id = anomaly_failure.402 } }
                 16 = { ship_event = { id = anomaly_failure.403 } }
                 16 = { ship_event = { id = anomaly_failure.404 } }
                 16 = { ship_event = { id = anomaly_failure.405 } }

...and for critically failing an investigation. Typically failures have no repercussions while critical failures can destroy the investigating research ship, science officer, or both. You could also expand upon this to spawn enemies, destroy resources, or affect AI opinions of the player.

The base game's anomaly categories can be found at: ...\Steam\SteamApps\common\Stellaris\common\anomalies\00_anomaly_categories[_2-4].txt


Anomalies are small entries that tie anomaly events to anomaly categories.


anomaly = {
     event = anomaly.1
     category = "origin_asteroid_category"

Each anomaly will have a category (where it can trigger from) and a starting event (what happens when successfully researched). Multiple anomalies can use the same anomaly category, so make sure you check the vanilla categories when you create a new anomaly to see if any of them match the criteria you're seeking.

     weight = 1

An anomaly's weight determines how frequently it will occur when multiple anomalies use the same category. If there is only a single anomaly for a category, it will occur every time this category is encountered. If there are multiple but they are all weighted the same, then there is an equal chance of any one of them occurring. By default, vanilla anomalies all have a weight of 1, but if you wish to add an anomaly that occurs more frequently than its peers, or you are testing a new anomaly and want it to occur every time, you can adjust the weight to reflect that.

     potential = {
           always = yes

Potential allows you to check for flags on an anomaly to see if it actually can occur. Many use always=yes to denote there are no conditions, but some, like the precursors anomalies, check to see if the related precursor chain is in effect and whether that particular precursor anomaly has already occurred to avoid duplicates. You can do the same to avoid duplicate anomalies of your own by setting flags during your anomaly events.

The base game's anomalies are stored in the same directory as the base anomaly categories: ...\Steam\SteamApps\common\Stellaris\common\anomalies\00_anomalies[_2-4].txt

Anomaly Events[edit]

Anomaly Events follow the same structure as other events in the game, they are simply triggered by anomalies. For a more detailed look at events, please visit the events page on this wiki.


ship_event = {
     id = anomaly.1
     title = ""
     desc = "anomaly.1.desc"
     picture = GFX_evt_mining_station
     show_sound = event_ship_bridge
     location = FROM

Anomaly events are ship events as they are centered on the science ship investigating the anomaly. In terms of scope, ROOT is the ship scope and FROM is the planet scope. For each event, you'll need a unique id, title, and desc. The title and desc will tie into the text and localization later. If you want you can include a picture and sound effect for your event as well, to be played when the event occurs.

     is_triggered_only = yes		
     immediate = {
           from = { orbital_deposit_tile = { clear_deposits = yes } }

The immediate affect takes place as soon as the event is triggered without informing the player. This is helpful for clearing an area of resources or units so that you can place your own in the option below.

     option = {
           name = REMARKABLE
           hidden_effect = {
                 FROM = {
                       add_modifier = {
                             modifier = "asteroid_coprolite"
                             days = -1
           FROM = { 
                 orbital_deposit_tile = {
                       add_deposit = d_vast_society_deposit

The option is the button(s) you push to close the event window. You can have more than one option if there is more than one choice to resolving an event, and each option can have its own unique effect to reflect the player's decision. You can even create event chains this way by activating special projects or setting flags that will trigger further events down the road. The name reflects the text that will appear in the button and can be customized in localization (in this example, the name of the button is using a global variable that is, as it appears, the string "Remarkable" as defined in the localization files). The hidden_effect can be used to make changes without the player being told they are occurring. If a change is placed outside the hidden_effect, it will be reflected in the option's tooltip if the player hovers over it.

The base game's anomaly events are in the events folder in the Stellaris directory: ...\Steam\SteamApps\common\Stellaris\events\anomaly_events[_1-6].txt

The anomaly failures from the anomaly categories section are also reflected in this folder: ...\Steam\SteamApps\common\Stellaris\events\anomaly_failures[_2-6].txt


Empire EmpireEthicsGovernments • Civics • OriginsMandatesAgendasTraditions • Ascension PerksEdictsPoliciesRelicsTechnologiesCustom Empires
Pops JobsFactions
Leaders LeadersLeader Traits
Species SpeciesSpecies Traits
Planets PlanetsPlanetary Feature • Orbital DepositBuildings • DistrictsPlanetary Decisions
Systems SystemsStarbasesMegastructuresBypassesMap
Fleets FleetsShips • Components
Land Warfare ArmiesBombardment Stance
Diplomacy Diplomacy • Federations • Galactic CommunityOpinion ModifiersCasus Belli • War Goals
Events EventsAnomaliesSpecial projectsArchaeological Sites
Gameplay GameplayDefinesResources • Economy
Dynamic modding Dynamic moddingEffectsConditionsScopesModifiersVariablesAI
Media/localisation Maya exporterGraphicsPortraitsFlagsEvent picturesInterfaceIconsMusicLocalisation
Other Console commandsSave-game editingSteam Workshop