Functions Library – Arma 2
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 52: | Line 52: | ||
* BIS_fnc_Test1 - will load script \functions\category1\test1.sqf from mission or campaign directory | * BIS_fnc_Test1 - will load script \functions\category1\test1.sqf from mission or campaign directory | ||
* CSLA_fnc_Test2 - will load script \ca\modules\functions\category1\test2.sqf | * CSLA_fnc_Test2 - will load script \ca\modules\functions\category1\test2.sqf | ||
== List of official functions == | |||
[[:Category:ArmA_2:_Functions|ArmA 2: Functions]] |
Revision as of 12:26, 31 May 2009
Function Library is pack of script functions available from anywhere in game.
Initialization
Paths
Editor:
Units (F1) > Game Logic > Modules > Function Library
Data:
ca\modules\functions
Startup
Place Function manager on map. No additional synchronizing needed.
Usage
First, you need to check if Functions were already initialized:
waituntil {!isnil "bis_fnc_init"};
After that, you can call any function using following syntax:
_fnc = [params] call TAG_fnc_functionName.
In-game functions viewer
See BIS_fnc_help
Adding new functions
List of functions is defined in config - CfgFunctions. New ones can be also added in Description.ext file of mission or campaign.
class cfgFunctions { class BIS { class category1 { class Test1 {description="Testing file 1"}; }; }; class CSLA { class category1 { class Test2 {description="Testing file 2"; file="test.sqf"}; }; }; };
If 'file' path is not set, system will search for file 'functions\category\fn_function.sqf" (if function is defined in description.ext) or 'ca\modules\functions\category\fn_function.sqf" (if function is in config.cpp).
Result is:
- BIS_fnc_Test1 - will load script \functions\category1\test1.sqf from mission or campaign directory
- CSLA_fnc_Test2 - will load script \ca\modules\functions\category1\test2.sqf