Category:VBS2: Scripting Functions

From BISim Wiki - Mirror I
Jump to: navigation, search

Introduction

A function library has been introduced in v1.19. The function library adds a range of additional functions for use in scripts. These functions are not scripting commands, but rather are sub-routines created from the existing script commands (background info).

The function library supersedes 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 VBS2 (such as VBS2 Lite) some scripting functions may not be available . A popup error will appear when using a function that is not available.

See also: Category:VBS2: Scripting Commands

Usage

You can only use the function library in .sqf scripts. This means any script that is loaded using the preprocessFile command, or run via the execVM command. The functions can not be used in the editor, or in .sqs scripts.

The following line must be added to the top of every script in which you want to use functions from the library:

#include "\vbs2\headers\function_library.hpp"

To use a specific function, you use the following syntax:

_returnvalue = [parameters] call functionName;

Function names are case sensitive.
Incorrect casing will result in no value being returned, and no errors being displayed.

(i.e. fn_vbs_relPos will work, fn_vbs_RelPos will NOT!)

A testing method, to check for a function's presence, is documented here.

Pages in category "VBS2: Scripting Functions"

The following 166 pages are in this category, out of 166 total.

A

F

F cont.

F cont.

R

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox