AssetUpdates (Mod Updates)
Updated for version ~4.0+.
Module Definition
The module is inherited from ModuleBase. So base parameters can be found there.
The purpose of this module is to provide updating of a mod or a mods assets.
Module name
The name of the module you use as the meta of the module definition is 'AssetUpdates' or 'ModAssetsModule' if _force_search
is set to true in the module definition.
XML Structure
<AssetUpdates id provider install_directory use_local_dir use_local_path folder_name version version_file important is_standalone>
<AssetUpdates id provider install_directory use_local_dir use_local_path folder_name version version_file important is_standalone>
Example
This example is what you would put inside your main node within your mod config
Where id
is the unique identifier on Modworkshop. So this example will update the directory of the mod with the mod with id '16212' and version
being the current version set in the mod page on Modworkshop. You can set it as any string/number you'd like. Numbers are recommended.
The example is what you'll see in most mods. Some old mods may have use_local_path
& use_local_dir
set to true. These parameters are already set to true by default.
Github Example
For commit based updating:
The id
for github provider updates is owner/repository
and branch
should be the branch you wish to update from, most of the time this should be master or main.
Upon the next commit, This will create a version_file
in the root of your mod with the hash of the commit, you will want to add this to your .gitignore.
For release based updating:
The version
should be the same as the tag of the release.
Optional versions
This example showcases optional versions, which can be enabled in the mod settings in the BeardLib Mod Manager.
The optional versions table should contain AssetUpdates modules with their module name replaced with the name you wish to list in the settings menu. The root element will be the stable
version.
Custom providers
You can either ask the current developers of BeardLib if they can add your site as a provider. Or, use custom providers feature of the module.
To make custom providers you need to have an API in your website. BeardLib will need to communicate with your API to get the version, mod files.
Providers are defined inside the module itself.
Since this is a more complicated topic, we'll start with an XML example:
<custom_provider check_func download_url/>
<custom_provider check_func download_url/>
In the future a module will be added to add a provider instead of repeating it in the module. Pay attention to the dollar signs in the URL, these will be replaced.
For example, $id$
in this case, will turn into MyMod
Creating a provider class
At the moment, it's possible to create a class for custom providers. The class acts like "custom_provider" only the functions have to be actual functions and not a path to the function. And you can use them like normal providers in the modules themselves.
Example of payday2concepts website (built in BeardLib):
You'll have to create these early enough so BeardLib mods can use it.
Having more than one update module in the mod.
At the moment, BeardLib adds updates into mods manager as single mod updates and does not account for individual updates. This will be changed in the future.
Functions
Get
Other
Last updated