Introduced in




Loads the .btset file into VBS3, to make the Behavior Trees (BTs) referenced by it accessible to setBT.

The .btset file contains references to all BT files that might be used in the mission.

If you specify a BT set that is not already loaded, only that BT set is loaded (the command returns an error, if the BT set dependencies are not satisfied). However, if you specify a BT set that is already loaded, the command reloads all the BT sets.


Syntax:loadBTSet filename
  • filename: String - If no path (or a relative path, for example: scripts\doit.btset) is given, then the file is read from the installation folder (or from an addon). Absolute paths (for example, c:\bi\scripts\doit.btset) can be used as well.
Return Value:Number - Can be one of the following:
  • 0 - Everything is OK.
  • 1 - General error.
  • 2 - Error loading .btset file (error when opening or reading from the file).
  • 3 - Error loading a dependent file (any other file than the argument given to loadBTSet, for example: .bt or .lua files or previously loaded BT sets).
  • 4 - Error in format (that is, the file opens, but contains errors).
  • 5 - Error allocating memory.
  • 10 - Invalid signature (one of the Behavior Trees in the .btset file contains an invalid signature file).


Loads file move.btset from the vbs_ctrl subfolder beneath the installation directory:
loadBTSet "vbs_ctrl\move.btset"

(VBS3 only) To reference BTs in the mission folder, use the following syntax:
_missionPath = format ["%1MPmissions\%2.%3\", getDirectory 0, missionName, worldName];
loadBTSet (_missionPath + "hello tree set btset");

To specify an absolute path, use the following syntax:
loadBTSet "C:\vbs_ctrl\hello tree set btset";

Additional Information

See also: setBT, getBT, getLoadedBTSets