BeardLib
  • Home
  • Things to Know
    • Adding Files
    • ScriptData
  • Modules
    • Achievements
    • Add Files
    • Adding your own modules
    • AssetUpdates (Mod Updates)
    • Classes
    • Contact (contractors)
    • Crime Spree Mission
    • DLC
    • Dependencies
    • Elements
    • Global Value (Tagging weapons/etc)
    • Heist Music
      • Stealth Music
    • Hooks
    • Interactions
    • Keybind
    • Level
    • Localization
    • Mask Material
    • Mask Pattern
    • Mask
    • Melee
    • Menu Music
    • Menu
    • ModuleBase
    • Narrative
    • Options
    • Package
    • Script Mods (Replace script data)
    • Sounds
    • Tweak Modify
    • Weapon Mod
    • Weapon Skin
    • Weapon
    • XML
  • API
    • BeardLib Class
    • Constants
    • File Manager
    • Frameworks
    • Hooks
    • ModCore
    • Package Manager
    • Special Hook IDs
  • Utilities
    • FileIO
    • Input
    • Main
    • Math
    • Menu Helper Plus
    • Path
    • String
    • Sync
    • Table
    • Tweak Data Helper
    • XML
    • YAML
  • MenuUI
    • ComboBox
    • ImageButton
    • Item
    • Items
    • Keybind
    • Menus
    • Slider
    • TextBox
    • Toggle
Powered by GitBook
On this page
Edit on GitHub
  1. Modules

Dependencies

PreviousDLCNextElements

Last updated 3 years ago

Was this helpful?

CtrlK
  • Module Definition
  • Module name
  • XML Structure
  • Example
  • Functions

Was this helpful?

Updated for version 4.6.

Module Definition

The module inherits ModuleBase. All parameters and functions of this class are inherited by the module.

Module name

The name of the module you use as the meta of the module definition is 'Dependencies' or 'DependenciesModule' if _force_search is set to true in the module definition.

XML Structure

<Dependencies>
    <Dependency name type version id provider/>
</Dependencies>

<dependency name type version id provider/>

Parameter
Type
Description

name

String

The name of the mod to depend on. [REQ] For mod_overrides or map mods, this will be the name in main.xml. For blt mods, it will be the name in mod.txt or main.xml if present

type

String

The type of mod the dependency is. Options are blt, mod_overrides and map [Default: blt]

min_ver

String

The minimum required version of the dependency. [OPTIONAL]

Example

This example is what you would put inside your main node within your mod config

<Dependencies>
    <Dependency name="Custom Attachment Points" min_ver="2.3.1" id="22546" provider="modworkshop"/>
    <Dependency name="My Cool Mask" type="mod_overrides"/>
    <Dependency name="TheGreatMaze" type="map" min_ver="1.1" id="27125" provider="modworkshop"/>
</Dependencies>

Functions

Function
Description

Load(Table config

Called normally by the module's init function. This is what checks the dependencies. config is the current looping dependencies table (or self._config if not present)

CheckBLTMod(String name)

Goes through the currently added BLT mods and compares the mod name with name, returns true and the mod if found.

CompareVersion(Table dep, String/Number mod)

Compares the versions of the Dependency (dep) and the mod. Creates a ModError if Dependency version is higher than mod version.

CreateErrorDialog(Table dep)

Creates an ModError and add calls AddDepDownload if id and provider are in the Dependency's config.

AddDepDownload(Table dep)

Adds an to the mod. Called by CreateErrorDialog.

id

String/Number

The id of the mod on the server. [OPTIONAL] Having id and provider will add a ModAssetModule to download the dependency.

provider

String

The provider of updates for the mod/assets. [OPTIONAL] Having id and provider will add a ModAssetModule to download the dependency.

ModAssetModule