Jump to content
chicago

Satellite view (SATCOM) for ARMA 3

Recommended Posts

Hi everyone,

 

I'm trying to add rotate satellite camera key functions to the PXS Satcom scripts.

 

I've tried this so far highlighted in red but no success.

key_function.sqf

Spoiler

private ["_event","_keyCode","_return"];

_event = _this;
_keyCode = _event select 1;
_return = true;

switch (_keyCode) do {
    case 1://ESC
    {
        call PXS_fnc_CloseCamera;
    };
    case 2://1 normal view
    {
        [2] call PXS_fnc_AdjustCamera;
    };
    case 3://2 thermograph
    {
        [3] call PXS_fnc_AdjustCamera;
    };
    case 4://3 white is hot
    {
        [4] call PXS_fnc_AdjustCamera;
    };
    case 5://4 black is hot
    {
        [5] call PXS_fnc_AdjustCamera;
    };
    case 50://M change default satellite position
    {
        call PXS_fnc_ChangePosition;
    };
    default
    {
        _return = false;
    };
};

// key combo handling
if (!(_return)) then
{
    private["_pressedButtonArray"];
    _pressedButtonArray = [_keyCode];
    _return = true;

    // check for key actions
    switch (true) do
    {
        //case 17://W  moves satellite camera forwards
        case (({_x in _pressedButtonArray} count (actionKeys "MoveForward")) > 0):
        {
            PXS_SatelliteNorthMovementDelta = 2.5;
            PXS_SatelliteTarget setPos [((getPos PXS_SatelliteTarget) select 0) - PXS_SatelliteNorthMovementDelta,((getPos PXS_SatelliteTarget) select 1) + PXS_SatelliteNorthMovementDelta,(getPos PXS_SatelliteTarget) select 2];
            call PXS_fnc_UpdateCamera;
        };
        //case 31://S  Moves satellite camera backwards
        case (({_x in _pressedButtonArray} count (actionKeys "MoveBack")) > 0):
        {
            PXS_SatelliteSouthMovementDelta = 2.5;
            PXS_SatelliteTarget setPos [((getPos PXS_SatelliteTarget) select 0) + PXS_SatelliteSouthMovementDelta,((getPos PXS_SatelliteTarget) select 1) - PXS_SatelliteSouthMovementDelta,(getPos PXS_SatelliteTarget) select 2];
            call PXS_fnc_UpdateCamera;
        };
        //case 30://A  Moves satellite camera left
        case (({_x in _pressedButtonArray} count (actionKeys "TurnLeft")) > 0):
        {
            PXS_SatelliteWestMovementDelta = 2.5;
            PXS_SatelliteTarget setPos [((getPos PXS_SatelliteTarget) select 0) - PXS_SatelliteWestMovementDelta,((getPos PXS_SatelliteTarget) select 1) - PXS_SatelliteWestMovementDelta,(getPos PXS_SatelliteTarget) select 2];
            call PXS_fnc_UpdateCamera;
        };
        //case 32://D  Moves satellite camera right
        case (({_x in _pressedButtonArray} count (actionKeys "TurnRight")) > 0):
        {
            PXS_SatelliteEastMovementDelta = 2.5;
            PXS_SatelliteTarget setPos [((getPos PXS_SatelliteTarget) select 0) + PXS_SatelliteEastMovementDelta,((getPos PXS_SatelliteTarget) select 1) + PXS_SatelliteEastMovementDelta,(getPos PXS_SatelliteTarget) select 2];
            call PXS_fnc_UpdateCamera;
        };
        //Q  Rotates satellite camera left
        case (({_x in _pressedButtonArray} count (actionKeys "LeanLeft")) > 0):
        {
            PXS_SatelliteCamera setVectorDirAndUp [[0,0,-1],[((vectorUp PXS_SatelliteCamera select 0)-0.05),1,0]];
        };
        //E  Rotates satellite camera right
        case (({_x in _pressedButtonArray} count (actionKeys "LeanRight")) > 0):
        {
            PXS_SatelliteCamera setVectorDirAndUp [[0,0,-1],[((vectorUp PXS_SatelliteCamera select 0)+0.05),1,0]];
        };

        //case 78://Num +  Zooms satellite camera in
        case ((({_x in _pressedButtonArray} count (actionKeys "ZoomIn")) > 0) || (({_x in _pressedButtonArray} count (actionKeys "MoveDown")) > 0)):
        {
            if ((PXS_SatelliteZoom + (0.02 * FACTOR)) <= 47) then
            {
                PXS_SatelliteFOV = PXS_SatelliteFOV - (0.0005 * FACTOR);
                PXS_SatelliteZoom = PXS_SatelliteZoom + (0.02 * FACTOR);
                call PXS_fnc_UpdateCamera;
            };
        };
        //case 74://Num -  Zooms satellite camera out
        case ((({_x in _pressedButtonArray} count (actionKeys "ZoomOut")) > 0) || (({_x in _pressedButtonArray} count (actionKeys "MoveUp")) > 0)):
        {
            if ((PXS_SatelliteZoom - (0.02 * FACTOR)) >= 0.1) then
            {
                PXS_SatelliteFOV = PXS_SatelliteFOV + (0.0005 * FACTOR);
                PXS_SatelliteZoom = PXS_SatelliteZoom - (0.02 * FACTOR);
                call PXS_fnc_UpdateCamera;
            };
        };
        default
        {
            _return = false;
        };
    };
};

_return

 

Can anyone help please ?

Share this post


Link to post
Share on other sites

Anyone still using this? I cant seem to get it to work. I can start the satellite but when picking where i want to view on the map is gives me error "Resource Pxs_RcsSatellite not found" anyone have this issue?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×