Coder Social home page Coder Social logo

qmodmanager's Introduction

QModManager

All Contributors

Config based patch management for Subnautica and Subnautica: Below Zero

https://www.nexusmods.com/subnautica/mods/201/
https://www.nexusmods.com/subnauticabelowzero/mods/1/


This file will not provide a step-by-step tutorial for creating mods!

While creating a mod, you can use the 0Harmony-1.2.0.1.dll found in the Managed folder to patch methods at runtime and change their code.

Your mod must have a static method with no parameters that must be in a class which needs to be in a namespace. That method will be called when the game loads to load the mod. This is usually where you want to make your calls to SMLHelper or patch methods using Harmony.

The patch method and the build DLL file name will be specified in the mod.json file.

Example:

Mod.cs

using Harmony;

namespace MyNamespace
{
    class MyClass
    {
        static void PatchMethod()
        {
            HarmonyInstance.Create("AwesomeMod").PatchAll();
        }
    }
}

mod.json

{
  ...
  "AssemblyName": "MyMod.dll",
  "EntryMethod": "MyNamespace.MyClass.PatchMethod",
  ...
}

To support your mod for the QMods system, you need to learn how the mod.json file works. It contains informations about a mod, and it can have the folling keys:

  • Id: Your unique mod id. Can only contain alphanumeric characters and underscores.
    (required)
    Type: string
    Example: "BestMod"

  • DisplayName: The display name of your mod. Just like the mod id, but it can contain any type of characters.
    (required)
    Type: string
    Example: "Best Mod"

  • Author: Your username. Should be the same across all your mods. Can contain any type of characters.
    (required)
    Type: string
    Example: "Awesome Guy"

  • Version: The mod version. This needs to be updated every time your mod gets updated (please update it).
    (required)
    Type: string
    Example: "1.0.0"

  • Dependencies: Other mods that your mod needs. If a dependency is not found, the mod isn't loaded.
    (optional, defaults to [])
    Type: string[]
    Example: [ "DependencyModID" ]

  • VersionDependencies: Just like Dependencies, but you can specify a version range for the needed mods.
    (optional, default to {})
    Type: Dictionary<string, string>
    Example: { "SMLHelper": "2.x", "AnotherVeryImportantMod": ">1.2.3" }
    Note: The versioning system which is used is SemVer. Here is a readme file with all of the possible version range declarations. Some weird things could occurr, so it's recommended that you test out your version ranges here.

  • LoadBefore: Specify mods that will be loaded after your mod. If a mod in this list isn't found, it is simply ignored.
    (optional, defaults to [])
    Type: string[]
    Example: [ "AModID", "SomeOtherModID" ]

  • LoadAfter: Specify mods that will be loaded before your mod. If a mod in this list isn't found, it is simply ignored.
    (optional, defaults to [])
    Type: string[]
    Example: [ "AnotherModID" ]

  • Enable: Whether or not to enable the mod.
    (optional, defaults to true)
    Type: bool
    Example: true

  • Game: The game that this mod is for. Can be "Subnautica", "BelowZero", or "Both"
    (optional, defaults to "Subnautica")
    Type: string
    Example: "Subnautica"

  • AssemblyName: The name of the DLL file which contains the mod.
    (required)
    Type: string
    Example: "BestMod.dll"

  • EntryMethod: The method which is called to load the mod. The method must be public, static, and have no parameters.
    (required)
    Type: string
    Example: "BestMod.QMod.Patch"

The final result would look something like this:

{
  "Id": "BestMod",
  "DisplayName": "Best Mod",
  "Author": "Awesome Guy",
  "Version": "1.0.0",
  "Dependencies": [ "DependencyModID" ],
  "VersionDependencies": { 
    "SMLHelper": "2.x", 
    "AnotherVeryImportantMod": ">1.2.3" 
  },
  "LoadBefore": [ "AModID", "SomeOtherModID" ],
  "LoadAfter": [ "AnotherModID" ],
  "Enable": true,
  "Game": "Subnautica",
  "AssemblyName": "BestMod.dll",
  "EntryMethod": "BestMod.QMod.Patch"
}

Please note that you need to add commas after each value except the last one. If you get a "mod.json deserialization failed" error, check the mod.json file on an online json validator.


Mac Users

Refer to the README.md file in the Mac Installation folder for installation instructions.


Linux Users

Using Steam Proton 4.2, QModManager can be used with Subnautica, allowing you to use certain mods. To Get this working, the following actions should be taken.

  • (Optionally) Use an application like Q4Wine to add the Steam Proton directory to your prefix list for easy access.
  • Run the Windows installer in the Steam Proton directory ./steamapps/compatdata/264710/
  • Install QModManager into the actual Subnautica directory ./steamapps/common/Subnautica/
  • Manually install mods by adding them to the QMods folder in your Subnautica directory ./steamapps/common/Subnautica/QMods/

Contributors

Thanks goes to these wonderful people (emoji key):

AlexejheroYTB
AlexejheroYTB

๐Ÿ’ป ๐Ÿšง ๐Ÿ’ฌ ๐Ÿ“– ๐Ÿค” ๐Ÿ“†
Zachary Jones
Zachary Jones

๐Ÿ’ป ๐Ÿ–‹ ๐Ÿ”ง ๐Ÿš‡ ๐Ÿ’ก
Randy Knapp
Randy Knapp

๐Ÿ’ป ๐ŸŽจ
ahk1221
ahk1221

๐Ÿ’ป
Zachary Amoss
Zachary Amoss

๐Ÿ’ป ๐ŸŽจ
PrimeSonic
PrimeSonic

๐Ÿ’ฌ ๐Ÿค” โš ๏ธ ๐Ÿ›
legojoshua12
legojoshua12

๐Ÿ“ฆ โš ๏ธ ๐Ÿ“–
Zebralear
Zebralear

๐Ÿ“ฆ ๐Ÿ“–
Eonfge
Eonfge

๐Ÿ“ฆ ๐Ÿ“–
Andreas Pardeike
Andreas Pardeike

๐Ÿ”Œ

qmodmanager's People

Contributors

ahk1221 avatar alexejhero avatar allcontributors[bot] avatar bluefireexplosion avatar eonfge avatar legojoshua12 avatar nesrak1 avatar primesonic avatar qwiso avatar randyknapp avatar zebralear avatar

Watchers

 avatar

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.