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




Introduced in

Version:1.40

Description

Description:Make a unit watch a second unit/object with a video camera or binoculars.

Observing unit pivots to follow the target and does not move. Unit stance can be selected. The unit will stop observing when taking damage, or when a specified condition is met.

Due to limitations in the available animations some weapon/stance/device combinations cannot be executed:

  • Binoculars & handicams cannot be used when kneeling (if ordered to do so, unit will stand up)
  • Unarmed units cannot use Canon camera while standing (if ordered to do so, unit will kneel down)

Syntax

Syntax:[observer, target, device, stance, condition] call fn_vbs_unitObserve
Parameters:
  • observer: Object - Unit that will observe the target
  • target: Object - Unit/object to be observed
  • device: String - Type of device to use. Can be "binocular", "vbs2_handicam", "vbs2_canon_xl1".
  • stance: String - Stance to assume. Can be "STAND", "KNEEL" or "PRONE". (optional, default: "STAND")
  • condition: Code - Condition must return true to stop observation. (optional, default: observer taking damage.)
Return Value:Nothing

Warning

When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.

Examples

Examples:Enemy1 will observe unit1 in the standing position with binoculars until enemy1 takes damage:
[enemy1, unit1, "binocular"] call fn_vbs_unitObserve;
Enemy1 will observe unit1 in the kneeling position with a Canon camera until unit1 enters car1:
[enemy1, unit1, "vbs2_canon_xl1", "KNEEL", {unit1 in car1}] call fn_vbs_unitObserve;

Additional Information

See also: doWatch
Multiplayer:
Problems:

Notes