CMF3 Engine: XEH MODULE

From cluster wiki
Revision as of 22:50, 17 December 2022 by Eric (talk | contribs) (Created page with "The '''XEH_MODULE.sqf''' is located in the main component. It is the most important scriptfile out of all the scriptfiles in the CMF3 Framework Engine...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The XEH_MODULE.sqf is located in the main component. It is the most important scriptfile out of all the scriptfiles in the CMF3 Framework Engine. It's job is to load the all the components and declare and define all the functions. Without this script CMF3 would be a "functionless" framework. The way it works is it loops over an array of all the components and loads their XEH_PREP.sqf file. This inturn declares and defines all the functions in that component.

If you want to add or remove components from a CMF3 framework you can open up XEH_MODULE.sqf and edit line 14:

GVAR(components) = [
    "main",
    "common",
    "viewdistance",
    "menu",
    "gameplay",
    "enhancedVehicles",
    "kosherArsenal",
    "kosherGarage",
    "respawn",
    "utility",
    "zeus",
    "ai",
    "player"
];

It is also possible to edit it by modifying GVAR(components) (cmf_main_components) from another function as long as it is modified pre-init before GVAR(components_initialized) (cmf_main_components_initialized) is true.

When the components are done initializing a variable will be set to true to signal to the rest of CMF3 that all the functions are declared:

Locality Namespace Name Description
GLOBAL missionnamespace cmf_main_components_initialized When this variable is true all components of CMF3 has been initialized

There is also an event but in-engine this is not used:

Locality Name Description
GLOBAL cmf_main_modules_initialized Is raised when all CMF3 components have been initialized