Contributing: Building a Module - Global-Conflicts-ArmA/Olsen-Framework-Arma-3 GitHub Wiki

Structure of Modules

Modules consist of two core files:

  • settings.sqf
  • root.sqf

as well as any additional files utilized by the module, such as functions, XEH init files, etc. Example Cover Map Module

The settings.sqf file includes a description of the module for users as well as defines or vars that the user is intended to change in order to customize and set the module behaviour. Example Settings File

The root.sqf file includes a series of description #ifdef statements used by the framework in order to initialize the module execution, define functions, etc. Example Root file

The example root.sqf file includes a description_XEH_PreInit with a clientInit entry which executes upon mission load for clients. description_XEH_PreInit and description_XEH_Init defines can include:

  • Init: file is executed globally
  • clientInit: file is executed on clients
  • serverInit: file is executed on the server

the order inside the define determines the load order, aka if the clientInit is above the Init it will load first.

Further explanation of the XEH system can be found here.

The example root.sqf file also includes a description_functions with a #include "functions\CfgFunctions.hpp" entry which points to a CfgFunctions.hpp file that defines the new functions the module includes. Example CfgFunctions file

CfgFunctions.hpp that are included inside of description_functions are defined with the main framework prefix FW, so the example functions would be defined as FW_fnc_CM_bordersToMap, FW_fnc_CM_Init, and FW_fnc_CM_Live. For external functions needing their own prefix they can be included in a description_external_functions instead of the description_functions entry. Note that the included CfgFunctions.hpp file must include an additional class category and tag define. Example External Functions CfgFunctions File