NuK3Modpack

v1.0.0·Updated 2024-06-11

Modpack for me and my friends

About this mod Author’s original text

LethalCompany InputUtils

Utilities for creating InputActions and having them be accessible in-game.

InputActions created through this mod are accessible in-game via the keybinds menu added in update v45.

For feature requests or issues head over to my repo

General Users

This mod is just a dependency for other mods, it doesn't add content, but it allows mods to add keybinds.

Where are my bind overrides stored?

Depends on the version of InputUtils:

  • >= 0.4.1 BepInEx/config/controls
  • /g", Name = "Explode")]

public InputAction ExplodeKey { get; set; }

[InputAction("/h", Name = "Another")]

public InputAction AnotherKey { get; set; }

}

Using Attributes

  • Create instance properties for all desired InputActions
  • Annotate the instance properties with the [InputAction(...)] annotation

[!IMPORTANT]

For actions to be registered to the API, Properties MUST be annotated with [InputAction(...)]**

[InputAction("YourkbmPath", Name = "", GamepadPath = "", KbmInteractions = "", GamepadInteractions = "", ActionID = "", ActionType = InputActionType...)]

Required Parameters

  • kbmPath: The default bind for Keyboard and Mouse devices

Optional Parameters

  • Name: The Displayed text in the game keybinds menu
  • GamepadPath: The default bind for Gamepad devices
  • KbmInteractions: Sets the interactions of the kbm binding. See Interactions Docs
  • GamepadInteractions: Sets the interactions of the gamepad binding. See Interactions Docs
  • ActionID: Overrides the generated actionId (Generally you don't want to change this)
  • ActionType: Determines the behavior with which the action triggers. See ActionType Docs

So your Attribute could be written like this:

[InputAction("/minus", Name = "Explode")]

public InputAction ExplodeKey { get; set; }

Or with any combination of optional parameters:

[InputAction("/minus", Name = "Explode", GamepadPath = "/Button North", KbmInteractions = "hold(duration = 5)")]

public InputAction ExplodeKey { get; set; }

[!NOTE]

In this case above the Hold Interaction is being used. This keybind triggers after being held for 5 seconds. See Interactions Docs

At Runtime

  • Override Method void CreateInputActions(in InputActionMapBuilder builder)
  • Use the builder to create InputActions
  • Reference InputAction by calling Asset["actionId"] in your class

[!IMPORTANT]

Make sure you call Finish() after you're done creating each InputAction.

Here's an example usage of the runtime api

public class MyExampleInputClass: LcInputActions

{

public static readonly MyExampleInputClass Instance = new();

public InputAction ExplodeKey => Asset["explodekey"];

public override void CreateInputActions(in InputActionMapBuilder builder)

{

builder.NewActionBinding().WithActionId("explodekey").WithActionType(InputActionType.Button).WithKbmPath("/j").WithBindingName("Explode").Finish();

}

}

Referencing Your Binds

To use your InputActions class, you need to instantiate it.

[!IMPORTANT]

Do not create more than one instance of your InputActions class.

If your class is instantiated more than once, your InputActions are unlikely to work as intended.

The easiest (opinionated) way to do so would be to have a static instance in your plugin class.

[BepInPlugin(...)]

[BepInDependency("com.rune580.LethalCompanyInputUtils", BepInDependency.DependencyFlags.HardDependency)]

public class MyExamplePlugin: BaseUnityPlugin

{

internal static MyExampleInputClass InputActionsInstance = new MyExampleInputClass();

}

You could also opt for instantiating the instance in the InputActions class (Singleton-style).

public class MyExampleInputClass: LcInputActions

{

public static MyExampleInputClass Instance = new();

[InputAction("explodekey", "/j", "/Button North", Name = "Explode")]

public InputAction ExplodeKey { get; set; }

}

[!IMPORTANT]

But How Do I Get My Binds String?

You may have noticed that /yourKey can be a little confusing for the special buttons. So try this:

  • First, arbitrarily set the value to some regular value or just an empty stri

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:

Hypick-BetterShotgunBepInEx-BepInExPackFlipMods-ReservedItemSlotCoreRugbugRedfern-SkinwalkersEvaisa-LethalLibanormaltwig-LateCompanyFlipMods-ReservedFlashlightSlotx753-Mimics

File & checksum

Filename
NuK3Modpack-1.0.0.zip
File size
18.3 KiB