- This line was added.
- This line was removed.
- Formatting was changed.
The function library adds a range of additional functions for use in scripts. These are not scripting commands, but rather sub-routines created with existing script commands (VBS Function Library).
The VBS function library supercedes the old VBS1 Functions, although it is possible to re-load those functions for backwards compatibility with VBS1 scripts (see the VBS1 Functions article for more info).
In some limited builds of VBS (such as VBS2 Lite) some scripting functions may not be available. A popup error appears when using a function that is not available.
The following code shows a typical call syntax:
_returnvalue = [parameters] call functionName;
Note: A testing method, to check for a the presence of a function, is documented in Check Function Availability.
See also: Commands A-Z
- The function library can only be utilized in SQF scripts (a script that is loaded using preprocessFile or execVM).
Note: It cannot be used in init lines, triggers, waypoints, the Debug Console, or SQS scripts.
- The following line must be added to the top of every script in which a call to a library function is performed:
- Function names are case-sensitive.
Incorrect use of cases results in no value being returned, and no errors being displayed (for example,
fn_vbs_relPos works, while
- Functions can be called from any location that script commands can be executed from (init lines, triggers, waypoints, the Debug Console, or SQS scripts).
#includecall is needed.
- Function names are not case-sensitive.