« Previous - Version 7/18 (diff) - Next » - Current version
tcp, 06/24/2011 19:23


Versioning System

The versioning system allows you to register your mod, incl version.
In Multiplayer, the versions are compared between server and clients, and warnings are displayed when mismatches have been detected.

Implementation

Add to your config.cpp, MyMod_main's CfgPatches section:

version = 1.0.1; versionStr = "1.0.1"; versionAr[] = {1,0,1};

To add a custom script function that will be triggered on version mismatch:

class CfgSettings {
   class CBA {
      class Versioning {
         class MyMod {
            handler = "myMod_fnc_mismatch"; // Make sure this function is compiled at a called preInit, not spawn/execVM
         };
      };
   };
};

To add a dependency on e.g CBA:

class CfgSettings {
   class CBA {
      class Versioning {
         class MyMod {
            class Dependencies {
               CBA[]={"cba_main", {0,5,1}, "true"};
            };
         };
      };
   };
};

To add Removed addons to the Upgrade Registry:

class CfgSettings {
   class CBA {
      class Registry {
         class PREFIX {
            removed[] = {"myMod_addon1"};
         };
      };
   };
};

Shared Version Display (optional)

versionDesc - String for Display Name. Add to the cycling display of mod names and versions

versionAct - String for Code, optional. Add a double click action using MouseButtonDblClick. Leave empty ("") or omit if not used.

Example CfgPatches entries from the A.C.E. mod:

versionDesc = "A.C.E.";
versionAct = "['MAIN',_this] execVM 'x\ace\addons\main\about.sqf';";

Operation: Mouse over to temporarily pause cycling. Left click to cycle forward. Right click to cycle back. Double click to perform currently displayed mod's action, if any.