-
Notifications
You must be signed in to change notification settings - Fork 4
Macros
GuzzenVonLidl edited this page Jun 20, 2016
·
1 revision
#Basic Info
NOTE:
1: For full list go to scriptComponent.hpp in the main folder.
2: all macros are case sensitive, by default they are uppercase.
Macros are a bit similar to functions in programming and allow you to use a single definition many times in the config, without having to duplicate the whole definition again and again.
It also gives you a centralized place to correct errors in this definition.
For more info visit the official wiki
Some macros are taken from to make it easy to understand when changing some settings here are the basics need to know.
##Basic Macros
- PREFIX - Main "TAG"
- COMPONENT - Name of a module
-
PREP(handler) - Used for defining a function.
Example of location modules\Gear\function\fnc_handler.sqf Function can then be called with "PREFIX_COMPOMENT_FNC_FUNCTION, so in this case GW_Gear_Fnc_handler -
PREPMAIN(log) - ALL MAIN macros will ignore the COMPONENT
Example: Unless defined elsewhere location for this will be in CORE\Functions\Function and will be called with
"PREFIX_FNC_FUNCTION" or GW_fnc_log -
GVAR(Blufor) - This is a global variable and will be named similar to a function.
Example: for COMPONENT GEAR the variable will be GVAR(Blufor) = "NATO",
Will be formated to GW_Gear_Blufor = "NATO" -
GVARMAIN() - ALL MAIN macros will ignore the COMPONENT
So combine GVAR and PREPMAIN
##Advanced Macros These macros will is used when scripting
-
QGVAR(Loadout) - Same as GVAR however is made to a "STRING"
Usually used with get & setVariable
Exampel: player getVariable QGVAR(Loadout) - FUNC(Handler) - gets the name of the function for that specific module, Example when scripting in Gear module will get function GW_Gear_Fnc_handler
- EFUNC(Radios,add) - From where ever you call this, it will get the "add" function from the "Radios" module
- FUNCMAIN - will get the function without COMPONENT
- LOGINFO("String") - LOGINFO("This is for advanced debugging");
- LOGWARNING("String") - LOGWARNING("This is for normal debugging");
- LOGERROR("String") - LOGERROR("This is output every time there is a problem");
- ADMIN_LOGINFO("String") - Same as LOGINFO however broadcasted for active admin instead
- ADMIN_LOGWARNING("String") - Same as above but for WARNING
- ADMIN_LOGERROR("String") - Same as above but for ERROR
-
FORMAT_X() - X is replaced with amount of variables and supports up to 9.
This macro is designed to be combined with any of the above logging macros.
Example: LOGINFO(FORMAT_2("Unit: %1, Role: %2", _unit, _role));