Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:3.7

Description

Description:

Returns the names of the content modules used by the specified cfgPatch or cfgVehicles class configuration.

The modules property is defined in class CfgPatches, and points to the respective CfgModules classes.

Syntax

Syntax:[name] call fn_vbs_getContentModules
Parameters:
  • name: String - Name of CfgPatches class to check.
Return Value:Array of String - Module names used by the specified class. Returns nil, if name is not a valid CfgPatches entry.

Alternative Syntax

Syntax:[config, guess] call fn_vbs_getContentModules
Parameters:
  • config: Config-2 - The configuration to evaluate.
  • guess: Boolean - If true, then the function uses the addon location to guess the module path, in case it is not defined (optional, default: false).
Return Value:Array of String - Module names used by the specified class. Returns nil, if configuration does not point to a valid CfgPatches entry. If guess is false, and no matching module definition is found, then an empty array is returned.

Warning

When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.

Examples

Examples:
_modules = ["vbs2_Structures_Bridges"] call fn_vbs_getContentModules;
// Returns ["vbs_xx_objects_module","vbs_gb_content_module","vbs_us_army_content_module"]
_modules = [configFile>>"cfgvehicles">>"vbs2_cone"] call fn_vbs_getContentModules;
// Returns ["vbs_core_content_module"]

Additional Information

See also: getVirtualFilePath, fn vbs addonExists, cfgPatch, fn_vbs_getContentModules
Multiplayer: 
Problems: 

Notes