-
Notifications
You must be signed in to change notification settings - Fork 7
Mod File System
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.
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 are the heart of the modinstaller. They are formatted as follows:
{
"modID": "curseddlls",
"Name": "CursedDlls",
"RawName": "CursedDlls.BepInEx_v1.3.zip",
"FileSizeMB": "2.01",
"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?",
"DelInfoArray": ["BepInEx/plugins/CursedDlls"],
"Dependencies": [
"bepinex",
"monomod"
],
"ImgLoc": "https://i.imgur.com/example.png",
"IncompatableMods": [ "examplemodid", "examplemodid2"],
"SingularModData": {
"OccupiesID": [ "id1", "id2"],
"OccupiesName": [ "idname1", "idname2" ]
},
"HideMod": false
}
(Some of these are placeholders.)
This is the unique ID that is saved and used in ModInstaller. Once you've set this, don't change it.
The name that is displayed to the end user.
This is the name of the file that is downloaded- in this case, CursedDlls.BepInEx_v1.3.zip
.
Not needed to function.
While many sites give you how many MBs are left to download, some sites do not. In the latter case, ModInstaller will default to simply showing the amount of MBs downloaded, however this allows you to set the file size manually.
An array of the authors' names.
The version of the mod. If the version between the downloaded mod conflicts with the database version, it will show the user.
A description of the mod. New lines are made by using \n
.
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.
As of now, we've added an override to this system- simply add %
to the end of the path and it won't do this.
Website allows the Website button to function. Put the link to the mod's mod page here.
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
moveAllFromFolderOfType?[folder to move from]?[extention to move]?[location to move to]
EX: moveAllFromFolderOfType?Mods/Hotmods/?h3mod?Mods/
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.
Not needed to function, but HIGHLY recommended.
DelInfoArray
is an array of files to delete to disable or delete the mod. In this case, BepInEx/plugins/CursedDlls
tells ModInstaller to delete the folder selected. As it is an array, to add an extra file simply add another item to the array. As an example:
"DelInfoArray": [ "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 ("??"
).
DelInfoArray
is a relatively new system, but before it was DelInfo
. DelInfo
is identical to DelInfoArray
however instead of using an array to separate items, it just uses a ?
. Internally, ModInstaller uses the DelInfo system. e.g:
"DelInfoArray": [ "BepInEx/plugins/CursedDlls", "BepInEx/plugins/Meatyceiver2.dll" ]
"DelInfo": "BepInEx/plugins/CursedDlls?BepInEx/plugins/Meatyceiver2.dll"
It is not recommended to use DelInfo.
Dependencies
are a simple array of modids that this mod relies on. If these mods are missing, ModInstaller will install them with the mod.
Not needed to function.
A location for an image to display. It's not recommended to use in some situations, as it takes up space the description would've used.
Not needed to function.
IncompatableMods, or more often referred to as "Direct Incompatability", is where you set a modid that the mod specifically is incompatible with in an array.
Not needed to function.
Singular Mods Data is what we refer to as "Singular Incompatability", is where only one mod can be enabled at a time. As an example, two skins mods for the same weapon cannot be enabled at the same time.
The Occupies ID field is what is compared against each other, while the Occupies Name is what is displayed to the end user.
Not needed to function.
Hides the mod from being displayed in downloadable mods.