RHS Feedback - AFRF
View Issue Details
0005080AFRF[All Projects] Generalpublic2019-06-11 12:142019-06-11 12:14
Sandiford 
 
nonefeatureN/A
newopen 
 
 
Yes
Stable
1.90
No
0005080: Better CSW Kornet and Metis
Better Kornet and Metis

See video: https://www.youtube.com/watch?v=JUDowearTsg [^]


The system:

The tripod bag is now the full weapon. Added an action to allow deploying it.

Deploying the weapon creates the static weapon attached to the player to allow positioning. Another action is used to finally deploy it.

The deployed weapon has magazines removed so deploys empty.


The gun bag is now a missile bag, that is one missile for the launcher.

The static launcher has an action added on deployment to allow loading a missile if the player his missile bag on his back.

Can be loaded from the gunner position, or from outside the vehicle.

Improvements:

I couldn't get the animations to activate from script. Obviously empty tube shouldn't be there to start with.

Perhaps player should be locked in place while the missile loads. Should the gunner be able to load?

Deployment may spaz out if it's put somewhere strange - ArmA physics...

Needs MP testing.
class RHS_Kornet_Missile_Bag: RHS_Kornet_Gun_Bag
{
    displayName="9K133 'Kornet' Missile";
    mass=80;
};


if ( ! isDedicated ) then {

    fnc_load_kornet_missile = {
        _wep = _this select 0;

        removeBackpack player;
        _wep addMagazine "rhs_mag_9m133";
        reload _wep;
    };

    fnc_unload_kornet_missile = {
        _wep = _this select 0;

        if ( count (magazines _wep) > 0 ) then {
            _wep removeMagazine "rhs_mag_9m133";
        };

        _wh = "GroundWeaponHolder" createVehicle (getpos _wep); // this is a bit janky, missile ends up wherever.
        _wh addBackpackCargoGlobal ["rhs_kornet_missile_bag", 1];
    };

    fnc_unload_and_take_kornet_missile = {
        _wep = _this select 0;

        if ( count (magazines _wep) > 0 && backpack player == "" ) then {
            _wep removeMagazine "rhs_mag_9m133";
            player addBackpack "rhs_kornet_missile_bag";
        };
    };

    fnc_take_kornet_launcher = {
        _wep = _this select 0;

        if ( count (magazines _wep) == 0 && backpack player == "" ) then {
            deleteVehicle _wep;
            player addBackpack "rhs_kornet_tripod_bag";
        };
    };

    fnc_add_kornet_actions = {
        _this addAction ["Load Kornet Missile", fnc_load_kornet_missile, [], 12, false, true, "", "count (magazines _target) == 0 && backpack player == 'rhs_kornet_missile_bag'", 3];
        _this addAction ["Unload and Drop Kornet Missile", fnc_unload_kornet_missile, [], 12, false, true, "", "count (magazines _target) > 0", 3];
        _this addAction ["Unload and Take Kornet Missile", fnc_unload_and_take_kornet_missile, [], 12, false, true, "", "count (magazines _target) > 0 && backpack player == ''", 3];
        _this addAction ["Pickup Kornet Launcher", fnc_take_kornet_launcher, [], 12, false, true, "", "isNull (gunner _target) && count (magazines _target) == 0 && backpack player == ''", 3];
    };

    fnc_sandi_deployKornet = {
        _wep = _this select 3;

        _wep setPosATL [(getpos _wep) select 0, (getpos _wep) select 1, 0];
        detach _wep;

        _handle = player getVariable ["deploying_kornet_handle", -1];
        player removeAction _handle;
            
        player setVariable ["deploying_kornet", objNull];
        player setVariable ["deploying_kornet_handle", -1];

        _wep remoteExec ["fnc_add_kornet_actions", 0, true];

    };

    fnc_sandi_placeKornet = {

        _class = "rhs_Kornet_9M133_2_msv";
        _mag = "rhs_mag_9m133";

        if ( backpack player == "rhs_kornet_tripod_bag" ) then {
            removeBackpack player;

            _wep = _class createVehicle (getPos player);
            _wep attachTo [player, [0.2, 1.9, 0.55]];
            _wep removeMagazines _mag;

            _handle = player addAction ["Place Kornet Launcher", { call fnc_sandi_deployKornet }, _wep, 12, true, true, "", ""];

            player setVariable ["deploying_kornet", _wep];
            player setVariable ["deploying_kornet_handle", _handle];


        };

    };

    waitUntil { ! isNull player };

    player addAction ["Deploy Kornet Launcher", { call fnc_sandi_placeKornet }, [], 12, false, true, "", "backpack player == 'rhs_kornet_tripod_bag' && (player getVariable ['deploying_kornet_handle', -1]) < 0"];

};


free to use
No tags attached.
Issue History
2019-06-11 12:14SandifordNew Issue

There are no notes attached to this issue.