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




Introduced in

Version:3.8.0

Description

Description:IMPORTANT: This function only works when VBS is started with the -gateway switch.

Returns the configuration for the specified view according to the View Configuration array structure:

  1. Array position 0: view_id - Unique identifier between 0 -> 65535
  2. Array position 1: attach_to - Part ID to attach to (Not all vehicles have these parts. Attaching to an invalid part will lock the camera to the entity's origin and keep the camera's orientation facing North):
    1. 0 - hull
    2. 1 - main turret
    3. 2 - main gun
    4. 3 - cupola turret
    5. 4 - cupola gun
  3. Array position 2: fov_left - Left half-angle of the view frustum in degrees
  4. Array position 3: fov_right - Right half-angle of the view frustum in degrees
  5. Array position 4: fov_bottom - Bottom half-angle of the view frustum in degrees
  6. Array position 5: fov_top - Top half-angle of the view frustum in degrees
  7. Array position 6: fov_near - Near clipping plane of the view frustum (Unused by VBS IG)
  8. Array position 7: fov_far - Far clipping plane of the view frustum (Unused by VBS IG)
  9. Array position 8: yaw - Angle of clockwise rotation around the Up vector in degrees
  10. Array position 9: pitch - Angle of clockwise rotation around the Left vector in degrees (Clamps to -90 -> 90)
  11. Array position 10: roll - Angle of clockwise rotation around the Forward vector in degrees
  12. Array position 11: offset_x - Distance from entity's origin along the Right vector in meters
  13. Array position 12: offset_y - Distance from entity's origin along the Forward vector in meters
  14. Array position 13: offset_z - Distance from entity's origin along the Up vector in meters

Syntax

Syntax:[viewID] call Gateway_ViewGet
Parameters:
  • viewID: Number - The ID of the view. Unique identifier between 0 -> 65535.
Return Value:Array - The View Configuration (see description).

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:
// Can return [ 1, 0, 25, 25, 13.5, 12.5, 0, 0, 0, 0, 0, -0.85, -0.1, 1.55 ]
view = [1] call Gateway_ViewGet;

Additional Information

See also: Gateway ViewAttachGroup, Gateway ViewModify, Gateway ViewRemove, Gateway ViewClearGroup, Gateway ViewSetSensor, IG UpdateCamera
Multiplayer:The function returns nil, if not used in multiplayer or when Gateway is not active (the -gateway start-up parameter is not used).
Problems: 

Notes