You are viewing a potentially older version of this package. View all versions.
V0id-OrbitEnemyPurge-1.0.0 icon

OrbitEnemyPurge

Automatically despawns, clears, and purges any enemies on the ship or scene when in orbit, preventing enemy transfer across moons.

By V0id
Date uploaded 3 weeks ago
Version 1.0.0
Download link V0id-OrbitEnemyPurge-1.0.0.zip
Downloads 274
Dependency string V0id-OrbitEnemyPurge-1.0.0

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2100 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2100

README

Orbit Enemy Purge

A lightweight, automated Lethal Company mod that clears, despawns, and purges all enemies when the ship enters or stays in orbit, eliminating the bug where enemies on the ship are transferred to other moons when landing.


The Problem

In vanilla Lethal Company and modded lobbies, enemies (e.g. Masked, Spiders, Baboon Hawks, Hoarding Bugs, or modded creatures) that enter the ship elevator bounds or get parented to the ship often survive scene unloading when the ship departs. Because the ship is persistent across scenes (DontDestroyOnLoad), these enemies remain on the ship in orbit and are transported to whichever moon you land on next.


How This Mod Solves It

Orbit Enemy Purge hooks into the ship's orbit lifecycle:

  1. Round-End Scoreboard Display & Orbit Transition:

    • Triggers at the exact moment the performance report / scoreboard is shown in orbit (SwitchMapMonitorPurpose during EndOfGame), and when orbit is fully initialized (SetShipReadyToLand). Enemies remain visible during departure and are purged at the round conclusion before players revive.
    • Sweeps the entire scene and ship hierarchy for all EnemyAI entities, enemy colliders, and nest objects.
    • Authoritatively despawns networked enemy objects (NetworkObject.Despawn(true)) on host/server and destroys residual local instances on clients.
    • Clears RoundManager.Instance.SpawnedEnemies and resets active enemy power counters.
  2. Pre-Landing Sweep (StartGame):

    • Immediately before ship descent begins when the lever is pulled for a new moon, a final purge executes to guarantee a clean ship arrival.

Configuration

Settings are saved to BepInEx/config/com.v0id.orbitenemypurge.cfg:

  • EnablePurgeOnShipLeave (Default: true): Purge all enemies when the round-end scoreboard is displayed in orbit.
  • EnablePreLandingSweep (Default: true): Purge immediately before descending onto a new moon.
  • LogPurgedEnemies (Default: true): Log sweep executions and purged enemy information in the console (both in orbit and when not in orbit).

Compatibility

  • Fully compatible with vanilla and modded enemies (all enemies derived from EnemyAI).
  • Preserves player corpses (DeadBodyInfo) for recovery, revival, and quota value.
  • Host and client friendly (host performs authoritative network despawn; client ensures local visual/collider destruction).

CHANGELOG

Changelog

[1.0.0] - 2026-09-18

  • Initial release.
  • Automatically purges, despawns, and destroys all enemy entities on the ship and in the scene during orbit transition.
  • Implements continuous orbital sweep and pre-landing sweep.
  • Resolves cross-moon enemy transfer bugs.
  • Preserves player bodies (DeadBodyInfo).