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.

Updates the view configuration according to the View Configuration array structure.

Note: The View Configuration array should follow the format of the view XML files in VBS3 Installation Folder\settings\CIGI\Views(file).xml.

  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 locks the camera to the entity origin, and keeps the camera 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 origin along the Right vector in meters.
  13. Array position 12: offset_y - Distance from entity origin along the Forward vector in meters.
  14. Array position 13: offset_z - Distance from entity origin along the Up vector in meters.

Syntax

Syntax:viewConfig call Gateway_ViewModify
Parameters:
  • viewConfig: Array - The View Configuration (see description).
Return Value:Array - An array with the following values:
  • Boolean - Returns true, if the view is successfully modified, false otherwise.
  • String - An error message, if the view is not successfully modified.

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:
// Returns [true]. The set statement changes the z offset to 2m. IG client 1 should be updated.
view = [1] call Gateway_ViewGet;
view set [13, 2];
modified = view call Gateway_ViewModify;
// Returns [true] IG client 1 should be configured based on the arguments.
modified = [1, 0, -25, 15, -25, 15, 0, 0, 0, 0, 0, 0, 0.4, 1.65] call Gateway_ViewModify;

Additional Information

See also: Gateway ViewAttachGroup, Gateway ViewGet, 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