Page tree
Skip to end of metadata
Go to start of metadata


Introduced in

Version:18.1.0

Description

Description:

Creates a brain for an object, if it does not have one already, and assigns a Behavior Tree to it.

Note: In V19.1.0+, the command effect is global in a multiplayer session.

The BT must first be loaded with the loadBTSet command. When the command is called with an empty array, the behavior running on the target entity, group, or object is terminated and removed. For example, after calling:

soldier setBT [];

The soldier stops performing whatever behavior they were running previously (if any).

Syntax

Syntax:object setBT [set, tree]
Parameters:
  • object: Object - The object for which a VBS Control brain is created.
  • set: String - The name of the BT set to use (property 'name', as defined in the .btset file).
  • tree: String - The name of the BT to use.
Return Value:Number - Can be one of the following:
  • 0 - Everything is OK.
  • 1 - General error.
  • 7 - Missing data error (nonexistent BT).
  • 8 - Compatibility error.
  • 9 - Bad root behavior error (setting a BT which expects some arguments).

Examples

Examples:
(group leader1) setBT ["BLUFOR_AI","Patrol"]

Additional Information

See also: loadBTSet, isActor, getBT
Multiplayer:
Problems:

Notes