Repository of shared, relatively self-contained functions that can be re-used across missions.
Using the shared functions is relatively easy:
- Copy or merge the
CfgFunctions
class from thedescription.ext
into your own mission'sdescrition.ext
. - Copy the
Functions\
directory (and sub directories) into the root of your mission folder.- You MUST keep the structure as-is, otherwise you will have to edit the CfgFunctions to point to a new location.
- (OPTIONAL) If you are desperate to save space, you can delete the function files
fn_*
that you are not using. But be sure to remove their reference from yourCfgFunctions
too!
Adding a function to this is two steps:
- To add a function, simply copy the SQF file into a category folder under
Functions
and ensure the filename is prefixed withfn_
.- Feel free to create a new category folder if one doesn't exist that matches your function usage.
- Update the
description.ext
, adding a new subclass underCfgFunctions
with your TAG and then any other subclasses for the category.- This is prefixed on the global variable for your function, for example
TAG_fnc_functionName
. - If using a category subclass, it must match the folder structure.
- This is prefixed on the global variable for your function, for example
class CfgFunctions
{
class MYTAG {
class General {
// Corresponds to Functions\General\fn_doThing.sqf
class doThing {};
};
};
};
For more information on CfgFunctions
, see the Arma 3 wiki.