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 or returned from Plugin's NVSE User Defined function.
Local version can be a numeric value or a string depending on the method of receiving.



How to use:
Include "nvse\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 NVSE 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 4: ESP\ESM plugin, local version is taken from NVSE User-Defined-Function result.

{
  "PluginName": "MyModStringFromFunction",
  "PluginType": 1,
  "CheckType": 1,
  "PluginFileName": "MyModStringFromFunction.esp",
  "LocalVersionGetType": 10,
  "FormID": "800",
  "NexusID": 70879
}
Specify your plugin file name in "PluginFileName".
"LocalVersionGetType" is set to 10 which means SUPDateChecker will attempt to extract local version from the name of misc item(set in GECK).

Specify Script function form ID in "FormID" =  formID without first 2 digits.(zero can be excluded). Function should be present in specified esp\esm.
For instance, if Function formID is "03000800", you should specify only "800".


In this case function with specified formID will be called(if plugin is loaded and function exists).

Example functions:

Scriptname aquestLocalVersionFunction

begin function {}
    Print "aquestLocalVersionFunction CALLED"
    SetFunctionValue "2.9.6"
end

This function will return "2.9.6" as version(string)


Scriptname aquestLocalVersionFunctionNum

begin function {}
    Print "aquestLocalVersionFunctionNum CALLED"
    SetFunctionValue 3.5
end

For instance - this function will return 3.5 as version(float)



Case 5: NVSE Plugin.

Specify your plugin NVSE name in "SENameToCheck" - your plugin name which is set inside plugin and used in GetPluginVersion and IsPluginInstalled functions i.e. "SUP NVSE Plugin", "JIP NVSE Plugin". Version will be returned via NVSE interface.

{
  "PluginName": "My NVSE plugin",
  "PluginType": 1,
  "CheckType": 1,
  "SENameToCheck": "MyPluginNVSEName",
  "NexusID": 74192
}





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 for NVSE the path is "xNVSE/NVSE".



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. This is a common practise between NVSE coders.
For instance, your current version of the mod is specified as "1.45" but your NVSE 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 NVSE Function).
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.

Article information

Added on

Edited on

Written by

TommInfinite

0 comments