Kesomannen-CompetitiveCompany icon

CompetitiveCompany

Adds a new team-based PvP scrap-collecting gamemode

Last updated 2 months ago
Total downloads 991
Total rating 2 
Categories Mods Client-side Server-side
Dependency string Kesomannen-CompetitiveCompany-0.2.0
Dependants 1 other package depends on this package

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
Evaisa-HookGenPatcher-0.0.5 icon
Evaisa-HookGenPatcher

Generates MonoMod.RuntimeDetour.HookGen's MMHOOK file during the BepInEx preloader phase.

Preferred version: 0.0.5
Ozone-Runtime_Netcode_Patcher-0.2.5 icon
Ozone-Runtime_Netcode_Patcher

Patches Netcode RPC methods during runtime utilizing Harmony

Preferred version: 0.2.5
LethalAPI-LethalAPI_Terminal-1.0.1 icon
LethalAPI-LethalAPI_Terminal

A fully fledged modding API for everything to do with the on-ship Terminal. Including custom commands, interactions, terminal overhauls, conditional command overrides, and more.

Preferred version: 1.0.1
Evaisa-FixPluginTypesSerialization-1.1.1 icon
Evaisa-FixPluginTypesSerialization

Fix custom Serializable structs and such not properly getting deserialized by Unity.

Preferred version: 1.1.1
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
Evaisa-LethalLib-0.16.1 icon
Evaisa-LethalLib

Personal modding tools for Lethal Company

Preferred version: 0.16.1

README

Competitive Company

In an effort to combat the declining performance of its employees, the Company is introducing a form of in-house training. This new initiative pits coworkers against each other in a scrap-collecting competition across the galaxy. By the end of a few days, the lucky winner will be awarded a continued contract with the Company and a brand new group of coworkers!

Sign up now to secure your future with the Company!


This mod is a rewrite and continuation of Competitive Company by agmas. It features a new game mode, where teams of players compete to collect the most amount of scrap within a set number of days.

[!IMPORTANT] All players in the lobby are required to have the mod installed!

[!NOTE] The gamemode cannot be toggled off; i.e. to play the base game you have to disable the whole mod.

Detailed description of features
  • Players are divided into teams, each with their own name, color and credits. Teams are managed through terminal commands (see below).
  • By default, the suit rack is disabled and players instead wear suits according their teams' color.
  • The quota system is removed, instead a match always ends after 3 days. The team who has collected the most scrap during this time wins.
  • Credits are automatically added to your team as you collect scrap. Any scrap that has been brought into the ship cannot be "cashed out" again.
  • The vanilla round report is replaced with a new one which, in addition to the usual stats, shows the current standings of all teams.
  • After the last round of a match, the winning team is shown in a special end-of-game cutscene.
  • You cannot start the ship before 3 PM has passed. Once you pull the lever, there's also 3-hour grace period before the ship actually takes off. Additionally, the spectator autopilot vote is disabled.
  • PvP is forbidden inside- and in a small area around the ship, as well as between teammates.

The numbers shown here are just default values and can be freely configured by the host.

Recommended Mods

This mod is designed to be somewhat minimal. To complement your experience, consider also using the following mods. These are required by everyone in the lobby unless stated otherwise.

  • MoreCompany lets you have up to 32 players in a lobby and customize your player's appearance with cosmetics.
  • LethalConfig adds an in-game menu for configuring mods, including this one. Does not need to be installed by everyone.
  • BetterEmotes adds more emotes to the game, which can be used in the end of match cutscene (see the Client config section).
  • Custom moons with LethalLevelLoader. Vanilla moons can prove too small and linear for this gamemode, especially with a large number of players. Here are some recommended mods made by the community:
    • TODO

Terminal Commands

Teams are managed through custom terminal commands:

Command Description
join <team> [player] Join a team. The host can join other players by specifying their username as the last argument.
teams Lists all teams and their scores.
create-team <name> Creates a new team with the given name. By default, only the host can use this.
delete-team <team> Deletes the specified team. By default, only the host can use this.
set-team-name <name> Changes the name of your current team. The max length for team names is 64 characters.
set-team-color <color> Changes the color of your current team. The color can be one of red, green, blue, yellow, cyan, magenta, white or black, or a custom hex code (e.g. #FF0000).
settings View the current match settings.
scramble-teams Randomly assigns players to teams. Only the host can use this.

This information can also be found in-game by running the other command.

Configuration

Most configuration is done via a normal .cfg file. All options except those in the Client section are server-side and can only be set by the host. The options take effect immediately, meaning you can configure match settings on the fly with a mod like LethalConfig.

Additionally, you can define a custom set of default teams that will be created each time you start a lobby. This is done via a default_teams.json file in the config folder. Any players you specify will be put into that team after joining. For example:

[
  {
    "name": "Milk enjoyers",
    "color": "white",
    "players": [
      "Kesomannen"
    ]
  },
  {
    "name": "Orange juice fans",
    "color": "#e0701b"
  },
  {
    "name": "Water drinkers",
    "color": "aqua",
    "players": [
      "agmas",
      "frostycirno"
    ]
  }
]

Planned Features

  • [ ] Spectator role
  • [ ] Saving & loading
  • [ ] Controlled moon selection
    • Make it so only one team can select the next moon to go to. This will be configurable to either be the losers pick or cycle through the teams.
  • [ ] Better team management
    • Add a new ship object to view and manage the state of the game instead of using the terminal.

Using the API

This mod exposes an API for other mods to interact with.

  1. Download the mod from Thunderstore.
  2. Copy the CompetitiveCompany.dll and CompetitiveCompany.xml files to a folder in your project, for example lib.
  3. Add the following to your .csproj file:
<ItemGroup>
  <Reference Include="CompetitiveCompany" HintPath="relative/path/to/CompetitiveCompany.dll" />
</ItemGroup>
  1. Add a BepInDependency attribute to your plugin class:
[BepInDependency(CompetitiveCompany.Plugin.Guid)]
public class MyPlugin : BaseUnityPlugin {
    //...
}

You should now be able to access the public members under the CompetitiveCompany namespace. Here's a couple of quick examples:

using CompetitiveCompany.Game;

// Item that shows the position of all enemies when activated
public class XRayItem : GrabbableObject {
    public override void ItemActivate(bool used, bool buttonDown = true) {
        if (!used) return;

        var localTeam = Player.Local.Team;
        if (localTeam == null) return;

        foreach (var player in Session.Current.Players) {
            if (player.Team == localTeam) continue;

            var position = player.transform.position;
            var username = player.Controller.playerUsername;
            Debug.Log($"Enemy {username} is at {position}");

            // draw an indicator at the enemy's position
        }
    }
}
using CompetitiveCompany.Game;

// Only allow PvP inside of the facility
[BepInPlugin(...)]
public class Plugin : BaseUnityPlugin {
    void Awake() {
        Session.OnSessionStarted += OnSessionStarted;
    }

    void OnSessionStarted(Session session) {
        session.Combat.AddPredicate((attacker, victim) => {
            if (!attacker.Controller.isInsideFactory) {
                return DamagePredicateResult.Deny("PvP is only allowed inside the facility");
            }

            return DamagePredicateResult.Allow();
        });
    }
}

Building

Make sure you have the following installed:


  1. Clone the repository

    git clone https://github.com/Kesomannen/CompetitiveCompany.git
    
    
  2. Download the following mods from Thunderstore and place their DLLs in the lib folder:

  3. Add the MMHOOK_Assembly-CSharp.dll to the lib folder. This is generated by the HookGenPatcher mod on startup and located in the BepInEx/plugins/MMHOOK folder.

  4. Build the project with

    dotnet build
    

    The mod will be built to bin/Debug/netstandard2.1/CompetitiveCompany.dll. Alternatively do a release build with

     dotnet build -c Release
    

    which will create a thunderstore-ready zip file in the build folder.

[!IMPORTANT] When testing locally, don't forget to include assets/competitive-company and lib/FlowTween.dll in the same folder as the mod's DLL.

The unity project to build the asset bundle is not yet included in this repository.

The source code of FlowTween can be found here. The FlowTween.dll in this project is a slightly modified version with the editor scripts taken out.