Arma 2: Functions Library

From Bohemia Interactive Community
Revision as of 01:03, 7 February 2021 by Lou Montana (talk | contribs) (Text replacement - "\{\{( *)Informative( *)\|" to "{{$1Feature$2|$2Informative$2|")
Jump to navigation Jump to search

Function Library is pack of script functions available from anywhere in game.

This page is mainly Arma 2 related, for Arma 3 visit Arma 3 Functions Library




Modules (F7) > Function Library




Place Function manager on map. No additional synchronizing needed.


First, you need to check if Functions were already initialized:

waituntil {!isnil "bis_fnc_init"};
Always check for 'BIS_fnc_init', not specific functions (e.g. 'BIS_fnc_setpitchbank')! Never set value of 'BIS_fnc_init' in any part of mission! It may lead to breakdown of some modules!

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 test.sqf

List of official functions

Arma 2: Functions