fn vbs unitObserve (VBS2)

From Bohemia Interactive Community
Jump to: navigation, search
VBS2 references on this site are not maintained anymore, and may be outdated!
Please use the new, dedicated VBS2 Wiki instead:
http://resources.bisimulations.com/wiki
Introduced in Virtual Battlespace 2 version 1.40

Click on the images for descriptions

Introduced in

Game:
Virtual Battlespace 2
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 after taking damage or condition is met. Units that do not have a weapon in his or her hand (eg civilians, BLUFOR, or OPFOR with no weapons or weapon on their back), can use binoculars or vbs2_handicam in the "PRONE" or "STAND" position only. The canon camera can only be used in the "KNEEL" or "STAND" position, the exception are units without weapons, they can only "KNEEL" with the canon camera.

Syntax

Syntax:
[unitObs, unitTgt, weap, <stance>, <condition>] call fn_vbs_unitObserve
Parameters:
unitObs: Object - unit that will observe
unitTgt: Object - unit to be observed
weap: String - type of optics, can be "binocular", "vbs2_handicam", "vbs2_canon_xl1"
stance: String - optional, can be "STAND", "KNEEL" or "PRONE". Default is "STAND"
<condition>: Code - optional condition must return TRUE to stop observation. If omitted, unit stops observing after taking damage.
Return Value:
Nothing
Note

As this is a function, 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 them. More here.

Examples

Example 1:
[enemy1, unit1, "vbs2_canon_xl1", "KNEEL", {unit1 in car1}] call fn_vbs2_unitObserve;

//Enemy1 will observe unit1 in the kneeling position with a Canon camera until unit1 enters car1
Example 2:
[enemy1, unit1, "binocular"] call fn_vbs2_unitObserve;

//Enemy1 will observe unit1 in the standing position with binoculars until enemy1 takes damage

Additional Information

Multiplayer:
-

Notes

Notes

+ Add Note

Only post proven facts here. Use the talk page or the forums for discussions.

Notes

Bottom Section