SUPDate Checker allows checking online version of the plugin against local version and if local version is outdated - notify
user.
Online version can be received from NexusMods or Github.
Local version can be received from Global variables, specified in JSON file, returned from Misc item names.
Local version can be a numeric value or a string depending on the method of receiving.
How to use:
Include "f4se\plugins\SUPDateChecker\MyFile.json" in your mod package.You can give the JSON file any name, just make sure it's unique.
Example JSONs and ESPs can be found below(in the article) and at "Misc" files download section.
Each and every JSON file should contain following values:
-"PluginName" - Plugin name to display in the Message - can be any name you choose for your mod;
-"PluginType" - 1 for ESM or ESPS, 2 for F4SE plugins.
-"CheckType" - 1 for checking version on Nexus, 2 for checking version on Github.
Then, depending on plugin type and check type JSON should contain:
Case 1: ESP\ESM plugin, local version is taken from value of a global variable.{
"PluginName": "MyModCheckGlobal",
"PluginType": 1,
"CheckType": 1,
"PluginFileName": "MyModCheckGlobal.esp",
"FormID": "800",
"LocalVersionGetType": 1,
"NexusID": 73800
}
Specify your plugin file name in "PluginFileName".
Specify global form ID in "FormID" = formID without first 2 digits.(zero can be excluded). Global variable should be present in specified esp\esm.
For instance, if global var formID is "03000800", you should specify only "800".
"LocalVersionGetType" is set to 1 which means SUPDateChecker will attempt to extract local version from global variable.
Case 2: ESP\ESM plugin, local version is taken from JSON file.{
"PluginName": "MyModLocalVersion",
"PluginType": 1,
"CheckType": 1,
"PluginFileName": "MyModLocalVersion.esp",
"LocalVersionGetType": 2,
"LocalVersion": 0.7,
"NexusID": 72951
}
Specify your plugin file name in "PluginFileName".
"LocalVersionGetType" is set to 2 which means SUPDateChecker will attempt to extract local version from JSON file.
In this case local version is 0.7.
You can also specify string as a "LocalVersion"{
"PluginName": "MyModLocalVersion",
"PluginType": 1,
"CheckType": 1,
"PluginFileName": "MyModLocalVersion.esp",
"LocalVersionGetType": 2,
"LocalVersion": "3.4.5.0",
"NexusID": 72951
}
In this case local version is "3.4.5.0".
Case 3: ESP\ESM plugin, local version is taken from name of misc item.{
"PluginName": "MyModCheckGlobal",
"PluginType": 1,
"CheckType": 1,
"PluginFileName": "MyModCheckGlobal.esp",
"FormID": "800",
"LocalVersionGetType": 3,
"NexusID": 73800
}
Specify your plugin file name in "PluginFileName".
"LocalVersionGetType" is set to 3 which means SUPDateChecker will attempt to extract local version from the name of misc item(set in GECK).
Specify misc item form ID in "FormID" = formID without first 2 digits.(zero can be excluded). Misc item should be present in specified esp\esm.
For instance, if misc item formID is "03000800", you should specify only "800".
Instead of a Misc item you can specify any other form that has name but I can't
guarantee that the name will be extracted successfully. Do it at your
own risk.
Case 5: F4SE Plugin.
Specify your DLL name in "PluginFileName" - i.e. "MyPlugin.dll".{
"PluginName": "Discord rich presence",
"PluginType": 2,
"CheckType": 1,
"PluginFileName": "Discord_Presence_F4SE.dll",
"LocalVersionGetType": 2,
"NexusID": 55384
}
At the moment current F4SE release doesn't allow internal checking of F4SE plugin versions. That's why you need to add function with the name of "fn_ext_SUPDateCheckerGetVersion" to your plugin which will return your current plugin version and add it to "exports.def". SUPDate Checker will try and get ProcAdress of this functions and if it exists - get the version.
Example:double fn_ext_SUPDateCheckerGetVersion()
{
return iVersion;
}
When new F4SE comes out, this plugin will be updated with new feature to receive local plugin versions with F4SE API.
I."CheckType"
Previously you could see "CheckType" set in each example.
-------------If set to 1, online version is taken from NexusMods.
You need to specify "NexusID" value(numeric) - Nexus mod ID.
You can get it from your mod page https://www.nexusmods.com/newvegas/mods/XXXXX, where XXXXX is mod ID
-------------If set to 2, online version is taken from GitHub.
You need to specify "GitHubPath" value(string) - For instance Mod Organizer 2 path is "ModOrganizer2/modorganizer".
Additional values:
-"DivideVerByHundred" - add this value to JSON file if your plugin version is specified as a
float but you keep version number as string.
For instance, your current version of the mod is specified as "1.45" but your F4SE version is 145. In this case you will need to specify the value.
Notes:
If you use longer versions in your mod like "1.2.3.5", then you need to specify local version as a string(via JSON file or via Misc item).
SUPDate Checker can compare this kind of versions, for instance:
1)"1.2.3.5" is bigger than "1.2.3.3"
2)"1.2.4" is bigger than "1.2.3.5"
etc.
That's all! Framework will do all the rest.
All you need to do now is to don't forget to update your global variable\Function result\JSon file with each version release.
In case mod is not loaded - framework skips the file.
0 comments