In XPS, a Type Definition is the term applied to the array or hashmap used when creating a HashmapObject with the *createhashmapobject* command.

Type Definitions in XPS are:

Structure

The structure of a Type Definition is an Array consisting of (at minimum) a list of Key/Value pairs. See createhashmapobject for more info.

example.sqf

[
  ["PropertyA","value"],
  ["MethodA", { hint "Method"; }]
]

Note: The SQF file must return an array.

In XPS, there is a third element which can be used to provide attributes to the preprocessor. See Preprocessor for more details.

CfgTypeDefinitions.hpp

XPS uses a base config class called XPS_Type_Definitions to preprocess and build the final type array at game launch.

To declare your Type Definition in the mission, you must create an hpp file and declare it like so:

CfgTypeDefinitions.hpp

class XPS_Type_Definitions {
   class MyAddon {
      class typeName {
         file = "x\\\\...filepath....\\\\fileName.sqf";
         type = "typ";
         preprocess = 1;
				
				//optional
         allowNils = 0;
         noStack = 1;
         preCache = 1;
         isFinal = 0;
         recompile = 1;
      }
   };
};

This entry would be preprocessed, built, and stored in a global variable MyAddon_typ_typeName

Properties: