Easiest way for a beginner imo would be
description.ext
class CfgFunctions {
#include "functions\cfgfunctions.hpp"
};
functions\cfgfunctions.hpp
class Spyder {
tag = "Spyder";
class main {
file = "";
class fn_taskCatcher {};
};
};
Then you create the function in the same folder as the cfgfunctions.hpp file -- but you need to prefix it with fn_
So your function filename is now
fn_taskCatcher.sqf
You can now reference the function with Spyder_fnc_taskCatcher
--------------------
Explanation:
#include "functions\cfgfunctions.hpp"
tells the game to copy the contents of the cfgfunctions file inside the functions folder to the description.ext.
tag = "Spyder";
This establishes the function prefix. All of your functions will be tag_fnc_functionname.
So using "Spyder" evaluates to Spyder_fnc_functionname;
file = "functions";
simply tells the game to look for the function files in the functions folder
class taskCatcher {};[/code] tells the game to include the taskCatcher function file.This needs to be in the folder referenced directly above and prefixed with [code]fn
So class taskCatcher {};
evaluates to the game needing a file named fn_taskCatcher.sqf in the file = "functions";
folder.
To add more functions:
class Spyder {
tag = "Spyder";
class main {
file = "functions";
class taskCatcher {};
class functionTwo {};
class functionThree {};
};
};
Awful at explaining but hopefully that helps you get an immediate idea of what everything is doing.