Skip to content
This repository has been archived by the owner on May 24, 2021. It is now read-only.

The ModFile System

potatoes1286 edited this page Mar 6, 2021 · 1 revision

ModLists

ModLists contain three things: an array of modfiles, a modlistid, and a user-end name to it, written as modlistname, modlistid, and modlist. Under the hood, it is only considered by its name, minus the file type, so 'charactermods.json' is known as 'charactermods', while the user-end name is what is shown to the user.

modinstallerinfo.h3vrmi

this is a specific modlist with a singular modfile that keeps track of the current version, the website to h3vrmodinstaller, and the modlists, which are stored under 'dependencies'.

To shorten down on length, the modlist locations are written as a list of "postfixes" that are combined with the closest prefix above it. So, in the example

[prefix A]

[postfix 1]

[postfix 2]

[prefix B]

[postfix 3]

would be converted to

[prefix A][postfix 1]

[prefix A][postfix 2]

[prefix B][postfix 3]

As an example, this is how the current modinstallerinfo.h3vrmi dependencies are written:

  "Dependencies": [
    "https://raw.githubusercontent.com/Frityet/H3VRModInstaller/master/src/Backend/JSON/Database/",
    "charactermods.json",
    "codemods.json",
    "dependencies.json",
    "customitems.json",
    "mapmods.json"
  ]

thus being read as

https://raw.githubusercontent.com/Frityet/H3VRModInstaller/master/src/Backend/JSON/Database/charactermods.json
https://raw.githubusercontent.com/Frityet/H3VRModInstaller/master/src/Backend/JSON/Database/codemods.json
https://raw.githubusercontent.com/Frityet/H3VRModInstaller/master/src/Backend/JSON/Database/dependencies.json
https://raw.githubusercontent.com/Frityet/H3VRModInstaller/master/src/Backend/JSON/Database/customitems.json
https://raw.githubusercontent.com/Frityet/H3VRModInstaller/master/src/Backend/JSON/Database/mapmods.json

This keeps things flexible and short.

Modfiles

Modfiles are the heart of the modinstaller. They are formatted as follows:

{
  "modID": "curseddlls",
  "Name": "CursedDlls",
  "RawName": "CursedDlls.BepInEx_v1.3.zip",
  "Author": [ 
    "BlockBuilder57",
    "drummerdude2003"
  ],
  "Version": "1.3",
  "Description": "line1 \n line2 \n line3",
  "Path": "https://github.com/drummerdude2003/CursedDlls.BepinEx/releases/download/v1.3/",
  "Website": "https://github.com/drummerdude2003/CursedDlls.BepinEx",
  "Arguments": "unzipToDir?",
  "DelInfo": "BepInEx/plugins/CursedDlls",
  "Dependencies": [ 
    "bepinex",
    "monomod"
  ]
}

(The description here has been replaced with a placeholder because the description is very long.)

Most of these are (hopefully) self-explanatory.

Arguments, DelInfo and Path is a bit more complicated.

DelInfo is a list of files to delete to disable the mod. In this case, BepInEx/plugins/CursedDlls tells ModInstaller to delete the folder selected. In the case where you want to delete multiple files, it can be done so with a ? separating the two files. As an example: BepInEx/plugins/CursedDlls?BepInEx/plugins/Meatyceiver2.dll. This will delete both the file and directory specified. There's also a specific control to prevent a null delinfo, an empty delinfo (""), and a delinfo argument containing nothing ("??").

Arguments tells ModInstaller how to install the selected mods. Any references to files/folders can be made from the H3VR directory or the H3VRModInstaller directory. There are three arguments that can be used:

unzipToDir?[targetdir] Ex: unzipToDir?VirtualObjects/ Note: unzipToDir? just unzips to the main h3vr folder.

moveToFolder?[file to move]?[location to move it to]?[as this] EX: moveToFolder?BetterHands.deli?Mods/?BetterHands.deli

addFolder?[directory to make] EX: addFolder?BepInEx/ExampleFolder

These can be strung together with a ? if need be: unzipToDir?VirtualObjects/?moveToFolder?BetterHands.deli?Mods/?BetterHands.deli

Paths can be started from either the root Game Directory, or the root of the folder H3VRMI is in. This is necessary, as mods are downloaded to H3VRMI's root folder first, then must be manipulated into the game directory.

It will first try and find the specified file in H3VRMI root folder, then the game directory, then tries to find a folder in the H3VRMI root folder, then the game directory.

Path is used to denote the path to the item to install, however to keep it compatible with older versions it has an odd quirk to it which is slated for removal sometime soon.

The path that is downloaded from is not Path, but Path + RawName. This is why the Path in this case is https://github.com/drummerdude2003/CursedDlls.BepinEx/releases/download/v1.3/ and not https://github.com/drummerdude2003/CursedDlls.BepinEx/releases/download/v1.3/**CursedDlls.BepInEx_v1.3.zip**.

Currently, as the only two download locations used are BoneTome which doesn't affect the download link and GitHub, it isn't a problem now, however can be a problem down the line.

Clone this wiki locally