Marks a unit as captive. If the unit is a vehicle, the commander is marked.
A captive is neutral to everyone, and does not trigger Detected By conditions for its original side. Enemies do not fire on a captive unit, but the captive unit itself still attacks (unless its behavior or combat mode have been adjusted with setBehaviour or setCombatMode, respectively).
Using a number instead of a Boolean has no further effect on the engine behavior, but can be used by scripting commands to keep track of the captivity status at a finer resolution (for example, when handcuffed, grouped, and so on).
In V1.50+, more captive numbers have become available:
Combinations of these modes are possible, by adding the base numbers:
Once an action is activated, the captive value may change automatically (after the capture action is executed, the captiveNum value for that unit changes to 4, to indicate that they can now be released).
|Syntax:||unit setCaptive captiveBool|
|Syntax:||unit setCaptive captiveNum (V1.19+)|
|See also:||captiveNum, setBehaviour, setCombatMode|
If using captive numbers on units that are not (yet) known to the player, it may be necessary in some versions of VBS to reveal the captive unit to the player, in order for the user actions to become visible right away (without the reveal it may take several minutes for them to show up).
In V1.70, the capture action does not work (handcuffing does), so units have to be join manually, in order to become part of the player group.