TestingLib

v1.2.2·Updated 2026-02-15

A library that implements methods to help with testing.

About this mod Author’s original text

WARNING

This (DevTools / TestingLib) is no longer developed. It'd be better to create an alternative solution for development tools, or use Imperium.

If you want to fork this, do not! The code and architecture is bad, you're better off creating something from the ground up.

TestingLib

This is a tool intended for making testing of enemy mods faster in Lethal Company. This is intended to be used in debug builds of your mods. For example:

//... in your Plugin class:

private void Awake() {

Logger.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!");

var ExampleEnemy = Assets.MainAssetBundle.LoadAsset("ExampleEnemy");

//...

if DEBUG

TestingLib.Patch.PatchAll();

TestingLib.OnEvent.PlayerSpawn += OnEvent_PlayerSpawn;

endif

}

if DEBUG

private void OnEvent_PlayerSpawn()

{

TestingLib.Execute.ToggleTestRoom();

TestingLib.Tools.GiveItemToSelf(TestingLib.Lookup.Item.Shovel);

TestingLib.Tools.TeleportSelf(TestingLib.Tools.TeleportLocation.Outside);

TestingLib.Tools.SpawnEnemyInFrontOfSelf(ExampleEnemy.enemyName);

}

endif

//...

Currently, this library is used on DevTools and the experimental branch of LC-ExampleEnemy.

TestingLib Modules

TestingLib.Patch

Contains methods that patch various things in the game.

IsEditor()

Patches the game to think it is running in Unity Editor, allowing us to use the in-game debug menu.

SkipSpawnPlayerAnimation()

Skips the spawn player animation so you can start moving and looking around as soon as you spawn.

InfiniteSprint()

Patches the game to allow infinite sprinting by always setting SprintMeter to full.

OnDeathHeal()

Instead of dying, set health to full instead.

This helps with testing taking damage from your enemy, without death being a concern.

MovementCheat()

Allows jumping at any moment and by performing a double jump, the movement will become much

faster and a lot more responsive, and running will also increase jump height and gravity.

Note: This completely overrides PlayerControllerB's Jump_performed() method.

InfiniteCredits()

Credits get always set to 100 000 000.

InfiniteShotgunAmmo()

Skips the check for ammo when using the shotgun.

PatchAll()

Calls all methods in TestingLib.Patch:

Patch.IsEditor()

Patch.SkipSpawnPlayerAnimation()

Patch.OnDeathHeal()

Patch.MovementCheat()

Patch.InfiniteSprint()

Patch.InfiniteCredits()

Patch.InfiniteShotgunAmmo()

UnpatchAll()

Unpatches all applied patches.

TestingLib.Execute

Contains actions that can be executed.

ToggleTestRoom()

Toggles the testing room from the debug menu.

Should be ran on OnEvent.PlayerSpawn or later.

TestingLib.OnEvent

Contains Events that can be subscribed to.

PlayerSpawn

Event for when player spawns.

Called on On.GameNetcodeStuff.PlayerControllerB.SpawnPlayerAnimation.

TestingLib.Tools

Contains helpful methods for testing.

TeleportSelf(TeleportLocation location = 0)

  • TeleportLocation.Inside = 1
  • TeleportLocation.Outside = 2

Teleports you to the location specified in the test level.

TeleportSelfToEntrance()

Teleport yourself to entrance.

SpawnEnemyInFrontOfSelf(string enemyName)

Will find the enemy by name, and spawn it.

If name is invalid, prints all valid enemy names to console.

GiveItemToSelf(string itemName)

Will find item by name, and give it to your inventory.

If name is invalid, prints all valid item names to console.

TestingLib.Lookup

Get the names of items and enemies in the vanilla game without having to look them up.

TestingLib.Lookup.Item

Names of items.

TestingLib.Lookup.EnemyInside

Names of inside enemies.

TestingLib.Lookup.EnemyOutside

Names of outside enemies.

TestingLib.Lookup.EnemyDaytime

Names of daytime Enemies.

TestingLib.Enemy

Helpful methods for making debugging of enemies easier.

DrawPath(LineRenderer line, NavMeshAgent agent) // Consider not using this for now, as this is not an optimal solution.

Draws the NavMeshAgent's pathfinding. Should be used in DoAIInterval(). Do note that you need to add line renderer in your enemy prefab. This can be done as such:

//... in your

Install & use Install: BepInEx plugin

  1. The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
  2. Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
  3. Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
  4. Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.

Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.

Dependencies

Install these first, or the mod will not work:

BepInEx-BepInExPackEvaisa-HookGenPatcher

File & checksum

Filename
TestingLib-1.2.2.zip
File size
73.9 KiB