Skip to content

WeatherDefinition

WeatherDefinition is a ScriptableObject used to create and configure custom weathers for Lethal Company. It provides a Unity Editor interface for defining weather properties, spawn conditions, and gameplay modifiers.

WeatherDefinition Inspector

WeatherDefinition serves as the primary tool for creating custom weathers in the Unity Editor. It combines visual configuration, spawn weights, and gameplay modifiers into a single, easy-to-use asset.

  1. Right-click in the Project window
  2. Select Create > WeatherRegistry > WeatherDefinition
  3. Configure the properties in the Inspector
  4. Assign the definition to an AssetBundle for runtime loading
public string Name

The weather’s display name shown in-game on the terminal and ship monitor.

public TMP_ColorGradient ColorGradient

A TextMeshPro ColorGradient that defines the colors displayed on the ship’s terminal screen when this weather is active.

public ImprovedWeatherEffect Effect

The ImprovedWeatherEffect component that defines the weather’s in-game behavior and visual effects.

Each configuration option includes an Enabled checkbox to allow player customization through config files.

public FilterMode LevelFilterMode

Values:

  • Include - Weather only appears on listed moons
  • Exclude - Weather appears on all moons except listed ones
public string LevelFilters

Semicolon-separated list of moon names where this weather should or shouldn’t appear.

Example:

Experimentation;Assurance;Vow
public SerializableConfigElement<float> ScrapAmountMultiplier

Multiplier for the amount of scrap spawned on moons with this weather. Default is 1.0 (vanilla behavior).

Example values:

  • 0.5 - Half the normal scrap count
  • 1.0 - Normal scrap count
  • 1.5 - 50% more scrap
public SerializableConfigElement<float> ScrapValueMultiplier

Multiplier for the value of spawned scrap on moons with this weather. Default is 1.0 (vanilla behavior).

Example values:

  • 0.75 - 25% less valuable scrap
  • 1.0 - Normal scrap value
  • 1.25 - 25% more valuable scrap
public string LevelWeights

Semicolon-separated list of moon-specific spawn weights in the format MoonName@Weight.

Example:

Experimentation@50;Assurance@30;Vow@20

Higher weights increase the likelihood of the weather appearing on that moon.

public string WeatherToWeatherWeights

Semicolon-separated list of weather transition weights in the format WeatherName@Weight.

Example:

Rainy@75;Foggy@25

Controls the probability of transitioning from this weather to other weathers. Higher weights make transitions more likely.

public SerializableConfigElement<int> DefaultWeight

Fallback spawn weight used when no specific level or weather-to-weather weight is defined.

Default value: 0 (weather won’t spawn unless specific weights are set)

// Create the weather definition asset in Unity
// 1. Right-click > Create > WeatherRegistry > WeatherDefinition
// 2. Set the following properties:

Name = "Acid Rain"
ColorGradient = /* Green gradient */
Effect = /* Your ImprovedWeatherEffect asset */
DefaultWeight = 30
ScrapValueMultiplier = 0.8f  // Scrap is worth 20% less
// In the WeatherDefinition Inspector:
LevelFilterMode = Include
LevelFilters = "Titan;Dine;Rend"  // Only spawns on paid moons
LevelWeights = "Titan@60;Dine@30;Rend@10"
DefaultWeight = 0
// In the WeatherDefinition Inspector:
Name = "Light Rain"
DefaultWeight = 40
WeatherToWeatherWeights = "Rainy@60;Stormy@20;Foggy@20"  // Can transition to heavier weather
ScrapAmountMultiplier = 1.1f  // Slightly more scrap
  1. Weight Distribution: Keep total weights reasonable (0-100 range) for predictable spawning:

    // Good
    LevelWeights = "Experimentation@40;Assurance@30;Vow@30"
    
    // Also fine, but harder to reason about
    LevelWeights = "Experimentation@400;Assurance@300;Vow@300"
  2. Scrap Multipliers: Use multipliers to balance risk vs. reward:

    // Dangerous weather = more valuable scrap
    ScrapValueMultiplier = 1.3f
    ScrapAmountMultiplier = 0.9f  // But slightly less of it
  3. Filter Modes: Use Exclude for weathers that work everywhere except specific moons:

    LevelFilterMode = Exclude
    LevelFilters = "Company;"  // Works everywhere except company moons
  4. Config Options: Enable configuration for gameplay-affecting properties:

    ScrapAmountMultiplier.Enabled = true  // Players can adjust
    ScrapValueMultiplier.Enabled = true
    DefaultWeight.Enabled = true