User Tools

Site Tools


arma2:editor_modules:function

ArmA 2 Function Library

ArmA 2 Forum, ArmA 2 Home, ArmA 2 Config, ArmA 2 File Formats, ArmA 2 Missions, ArmA 2 3D Modeling, ArmA 2 Scripting, ArmA 2 Terrain, ArmA 2 Texturing, ArmA 2 Tools

Functions Library

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"};

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 (TODO)

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
arma2/editor_modules/function.txt · Last modified: 2024/08/01 20:58 by snakeman

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

All PMC web site download services are temporarily suspended until web site yearly fees have been recovered, want to download addons/mods? Then Support PMC.

If you are grateful for all the work PMC has done in the past 25 years, use Support PMC page.