You are viewing a potentially older version of this package. View all versions.
AllToasters-SpectateEnemies-2.7.0 icon

SpectateEnemies

Allows you to spectate enemies when dead.

Date uploaded a day ago
Version 2.7.0
Download link AllToasters-SpectateEnemies-2.7.0.zip
Downloads 11692
Dependency string AllToasters-SpectateEnemies-2.7.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
Rune580-LethalCompany_InputUtils-0.7.7 icon
Rune580-LethalCompany_InputUtils

API/Library for creating Unity InputActions with in-game re-binding support. Provides an alternative UI that allows for supporting mods to have in-game re-bindable keybinds.

Preferred version: 0.7.7

README

Spectate Enemies v2.7.0

by alltoasters

https://github.com/EBro912/SpectateEnemies

Installation

Requires the latest version of BepInEx 5 and InputUtils. After both have been installed, drag SpectateEnemy.dll into the BepInEx/plugins folder in the game's root directory.

Usage

When dead, pressing your "Swap" key (default: E) will swap between spectating players and spectating enemies. When spectating either side, you can left click to move to the next player or enemy as normal. The mod will also remember your last spectated enemy, as long as they are still alive.

Pressing your "Flashlight" key (default: RMB) will toggle a flashlight on your spectator camera to see enemies and players better in the dark.

Pressing the "Zoom Out/Zoom In" keys (default: Scroll Wheel) while spectating an enemy will zoom the camera in and out. This can help with bigger enemies that are hard to see at default zoom.

Keybinds

You can set your keybinds in the in-game keybind menu. The following SpectateEnemies keybinds correspond to these default controls:

"Swap between Players/Enemies" : E "Open Config Menu" : Insert "Toggle Flashlight" : Right Button "Zoom Out" : Scroll Wheel Down "Zoom In" : Scroll Wheel Up

Config Menu

Pressing your "Menu" key (default: Insert) will open the config menu. Clicking the box next to an enemy's name will enable/disable spectating that enemy.

You can also find a config in BepInEx/configs/SpectateEnemy.cfg, although I wouldn't mess with this file unless you know what you're doing.

If you would like to hide the controls tooltip on the right side of the screen, open the config file and change the Hide Controls option to true.

API for Developers

You can utilize the SpectateEnemies API to gather information about what SpectateEnemies is doing for use in your own mod. After adding SpectateEnemy.dll as a reference to your project, you can use the SpectateEnemiesAPI class to access the API functions.

Currently, three pieces of information are exposed:

SpectateEnemiesAPI.IsLoaded : bool Returns if SpectateEnemies is loaded and ready to run, useful as a sanity check before you start querying other SpectateEnemies functions.

SpectateEnemiesAPI.IsSpectatingEnemies : bool Returns true if the player is spectating an enemy, or false if the player is spectating another player

SpectateEnemiesAPI.CurrentEnemySpectating() : GameObject Returns the GameObject of the enemy that the player is spectating. This is the parent object, so you can access information such as the EnemyAI component.

Example Usage:

if (SpectateEnemiesAPI.IsSpectatingEnemies) {
   GameObject enemy = SpectateEnemiesAPI.CurrentEnemySpectating();
   Debug.Log(enemy.GetComponent<EnemyAI>().enemyType.enemyName);
}
// Prints: Flowerman

Custom Enemies

If you are creating custom enemies in your mod, they MUST have an EnemyType for SpectateEnemies to be able to find it. Otherwise, the mod will be unable to spectate your enemy. If you do not want your enemy to be spectatable, ensure they do not have an associated EnemyType. (A better solution for stopping enemies from being spectated is planned for the future)

CHANGELOG

Changelog

v2.7

  • Updated to support v65
  • Fixed an error that displayed when disconnecting (big thanks 1A3!)

v2.6

  • Updated to support v62
  • Fixed a minor error that would appear when the game starts
  • Fixed a minor inconsistency in the controls tooltip

v2.5

  • Updated to support v55
  • Fixed an issue where the menu scrollbar would not appear

v2.4.1

  • Added a missing game patch

v2.4

  • Added a scrollbar to the enemy picker GUI that appears when the enemy list exceeds the window
  • Updated InputUtils to the latest version
  • Fixed a minor error that would appear when the game exits
  • The ghost girl is now visible when spectating her and will display which player she is currently targeting

v2.3.1

  • Fixed an issue where certain custom enemy names would cause the config to fail to load

v2.3

  • Greatly improved the zoom feature (big thanks to HalfyRed!)
  • Switched the configuration system back to BepInEx's
    • This should also add support for LethalConfig!
  • Added a config option to disable the controls tooltip on the right side

v2.2.1 (Hotfix)

  • Fixed a crash caused by the only enemy alive being killed

v2.2

(Big thanks to @1A3 for helping with this update!)

  • Updated to support v47
  • Added support for modded enemies!
    • Note for developers, your enemy MUST have an EnemyType for it to be picked up by SpectateEnemies
  • Added zooming while spectating enemies, allows zooming from 1x to 10x zoom
    • Uses the scroll wheel by default, can be changed in the keybind settings
    • The current zoom level is displayed next to the (Spectating: ...) text
  • Enlarged the config menu box a little to allow more room for modded enemy entries
  • Shortened the controls text on the sidebar to be neater/less cluttered
  • The mod will no longer attempt to spectate dead enemies
  • The mod will no longer collect enemies disabled in the config as spectate targets
    • This should fix the issue where the first enemy spectated was sometimes a disabled enemy
  • The list of spectate targets will now refresh when moving to the next enemy
  • Improved some internal checks that were throwing errors in the console

v2.1.1 (Hotfix)

  • ACTUALLY fixed the issue where masked enemies could not be spectated

v2.1

  • Added 3 keybinds to the in-game keybind menu for most SpectateEnemies controls
    • InputUtils is now required by the mod, so ensure you install it as well
  • Fixed an issue where masked enemies could not be spectated (again)
  • Fixed an issue where the mod would attempt to spectate players who are not connected

v2.0

  • Added a developer API to allow mod developers to access some SpectateEnemies information
  • Added an in-game config menu to toggle spectating all enemies individually
    • The menu can be accessed with the "Insert" key
    • The menu is most likely temporary and will be moved to the in-game settings menu in the future

v1.5

  • Added the ability to spectate masked players
  • Added a message that is displayed when there are no enemies available to spectate
  • When spectating enemies for the first time in a round, the mod will now spectate the closest enemy to the player you are currently spectating
  • Fixed another issue that would allow you to continue spectating enemies after the game ended

v1.4

  • Updated to support v45
  • Fixed mod keybinds not working in the latest version
  • Fixed keybind text not displaying in the latest version
  • Fixed an issue that would cause the flashlight to remain on after the game ended
  • Fixed an issue that would allow you to continue spectating enemies after the game ended
  • Fixed an issue that would prevent the flashlight from being toggled after a vote to leave has been initiated

v1.3

  • "Added" a toggleable flashlight to the spectator camera (one already exists...it just wasn't enabled)
    • The flashlight can be toggled by clicking RMB
  • Added code to attempt to fix some enemies showing up as "Enemy" when spectated
  • Fixed an issue where the mod would sometimes fail to start spectating enemies
  • The controls tooltips will now dynamically update depending on which side the player is spectating

v1.2

  • Increased camera zoom for all enemies
  • Increased camera zoom even further for taller enemies
  • Added a "Spectate Passives" config option to enable/disable spectating passive enemies
  • Spectating now uses a toggle to swap between spectating players and enemies. The swap key is your "interact" key. (Default: E)
  • Added a control tooltip in the top right to show the key for the spectate toggle
  • The mod will now remember your last spectated enemy, if it is still alive

v1.1

  • Fixed an issue where mod values would not update upon the ship leaving or leaving the game
  • Fixed the Spectating text so that it displays the actual enemy name and not their GameObject name

v1.0

  • Initial release