Git Product home page Git Product logo

reactor-essentials's Introduction

Essentials

Essentials is a modding library for Among Us with APIs to speed up and ease development, with the goal of improving mod compatibility.

Currently, the key features of Essentials are custom options and gameplay buttons, with more planned in the future to improve mod compatibility.

Installation

NOTE: At the moment, official builds are only compiled for the Steam client, however builds for 2021.5.10 or newer should work on all platforms.

  1. Install BepInEx.
  2. Install Reactor (CI 38 for Essentials 0.1.1+, CI 45 for Among Us version 2021.3.5s, CI 47 for 2021.3.31.3s, CI 55 for 2021.4.12s, CI 56 for 2021.4.14s, CI 64 for 2021.5.10s, CI 67 or newer for 2021.6.15s and 2021.6.30s).
  3. Grab the latest release for your client version (support for older clients may be dropped, in that case browse previous releases).
  4. Place the downloaded release in Among Us/BepInEx/plugins/ (same steps as installing Reactor).

Development

To develop plugins with Essentials, Essentials needs to be installed, follow the steps above before proceeding. Please configure notifications for future releases (Watch -> Custom -> Releases) to keep your projects up to date with bug fixes and new features.

  1. Open your project file (.csproj).
  2. Add or locate an ItemGroup tag.
  3. Add the appropriate line
  • When using an obfuscated version (2021.4.14s or older, when using Reactor.OxygenFilter.MSBuild): <Deobfuscate Include="$(AmongUs)\BepInEx\plugins\Essentials-$(GameVersion).dll" />
  • For any other version: <Reference Include="$(AmongUs)\BepInEx\plugins\Essentials-$(GameVersion).dll" />
  1. Build. Note that if you are using Visual Studio and modding an obfuscated version, building your project once with dotnet build may be required due to a Mono.Cecil issue present in Reactor.OxygenFilter.MSBuild.
  2. While a guide is not currently available, there's a demo project "Convert", also most types and methods contain documentation, the current key features are under the Essentials.Options and Essentials.UI namespaces.

Building Essentials

Newer versions of Essentials use configurations based on Among Us target version(s) and override the AmongUs environment variable as a result. Essentials depends on Reactor, follow installation steps 1 and 2 before proceeding.

Building for a single Among Us version

  1. Set up the AmongUs environment variable
  2. Select and build the project configuration targeting your target version, building with dotnet build -c CONFIGURATION (where CONFIGURATION is the configuration name, ex: S20210412), may be required when building for an obfuscated version due to a Mono.Cecil issue present in Reactor.OxygenFilter.MSBuild.
  3. The compiled binary will be copied to the plugins folder of your targeted Among Us version, as well as a bin folder in the solution's folder.

Building for multiple Among Us versions

  1. Add an environment variable named AmongUsMods targeting the parent folder that contains different Among Us versions in sub-folders, for example: %AmongUsMods%\2021.4.12s should lead to the 2021.4.12s sub-folder.
  2. Edit the build all.bat script (in the root folder of the solution) so that it would only contain the Among Us versions you're targeting.
  3. Run build all.bat (alternatively, in Visual Studio you can use Build -> Batch Build... from the toolbar and select all the target versions and then Build, running build all.bat may still be required when Reactor is updated).
  4. The compiled binary will be copied to the plugins folder of your targeted Among Us versions, as well as a bin folder in the solution's folder.

This mod is not affiliated with Among Us or Innersloth LLC, and the content contained therein is not endorsed or otherwise sponsored by Innersloth LLC. Portions of the materials contained herein are property of Innersloth LLC. © Innersloth LLC.

reactor-essentials's People

Contributors

dorcomando avatar sanae6 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

reactor-essentials's Issues

NullReferenceException when reopening the GameOptionsMenu

I get the following NullReferenceException when opening the GameOptionsMenu, after doing something specific:

  • Open the GameOptionsMenu -> CustomOption will be created
  • Close the GameOptionsMenu
  • On the created CustomOption, set MenuVisible to false
  • Reopen the GameOptionsMenu

After reopening the GameOptionsMenu, the NullReferenceException occurs (It should happen in GetGameOptions(lowestY)
else if ((UnityEngine.Object) option.GameSetting != (UnityEngine.Object) null) { ((UnityEngine.Component) option.GameSetting).gameObject.SetActive(true); optionBehaviourList.Add(option.GameSetting); }

Somehow the component/gameObject seems to be null.

[Error : Detour] UnhollowerBaseLib.Il2CppException: System.NullReferenceException: Object reference not set to an instance of an object.
at UnhollowerBaseLib.Il2CppException.RaiseExceptionIfNecessary (System.IntPtr returnedException) [0x00014] in :0
at UnityEngine.Component.get_gameObject () [0x0002c] in <045cf7e91f5542268be1763686f1f2ad>:0
at Essentials.Options.CustomOption.GetGameOptions (System.Single lowestY) [0x00063] in <1254f1b337aa418a8f8bfbd277af126f>:0
at Essentials.Options.CustomOption+GameOptionsMenuPatchStart.Postfix (GameOptionsMenu __instance) [0x0002b] in <1254f1b337aa418a8f8bfbd277af126f>:0
at (wrapper dynamic-method) GameOptionsMenu.DMDGameOptionsMenu::Start(GameOptionsMenu)
at (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition.(il2cpp -> managed) Start(intptr,UnhollowerBaseLib.Runtime.Il2CppMethodInfo*)

Originally posted by @BOTHLine in #8 (comment)

Adding references

Hello, I have a problem when I want to add project references such as 0Harmony.dll:
"The reference is invalid or unsupported"

Can you help me please ?

Modded Handshake

Newest Impostor Servers do not let modded handshake work with any mods and essentials creates custom rpcs and bypasses reactor modded handshake rules. I don't know if this can be fixed as of right now just letting someone know of the issue

Feature suggestion: dependencies

Hi,

having a lot of options can make the options list very long very fast. Therefore dependencies might be useful where we can change an option and depending on that options values we show or hide other options.

I don't need this right now but I'll just leave this as an idea here.

Add license

This repository is missing a license. I propose adding LGPL, but it's up to you really.

Scroller row count cannot be configured

Row count needs to either be configurable or calculated based on Y.

if (LobbyTextScroller && __result.Count(c => c == '\n') > 37) __result = __result.Insert(__result.IndexOf('\n'), " (Scroll for more)");

float maxY = rows < 38 ? MinY : rows * LobbyTextRowHeight + (rows - 38) * LobbyTextRowHeight;

Option positions don't update in the menu

I would love to have some method like "RecalculateOptionPositions" or something like that, where all the GameOptions reorder themselves.
Right now I do have a lot of empty spaces if I set MenuVisible to false.
Just something that iterates over all CustomOption entries and sets their new position (ignoring those which are invisible of course)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.