OrbitEnemyPurge

版本 v1.0.0·更新於 2026-09-18

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

模組介紹 作者原文

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:

  • 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.
  • 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).

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

BepInEx-BepInExPack

檔案與校驗

檔案名稱
OrbitEnemyPurge-1.0.0.zip
檔案大小
141.8 KiB