I am trying to take what Kind-Sir did with the MV22 Ramp animations and apply it to the Armored SUV.
Here is what I have:
suvpmc_addAction.sqf
suvpmc_functions.sqf:
suvpmc_init.sqf:
I grabbed the animation sequence from HERE
Does anyone see what i have done wrong?
I get the open and close cover only when in the drivers seat and not in the gunners seat.
What I would like to see happen is while in the gunners seat selecting the close cover would close the cover and put the gunner in the back seat position.
Here is what I have:
suvpmc_addAction.sqf
Code:
_array = _this select 3;
_param = _array select 0;
_code = _array select 1;
_spawn = _param spawn _code;
suvpmc_functions.sqf:
Code:
suvpmc_closecover = //function to close Cover
{
_vcl = vehicle player; //assign the vehicle the pilot is in to _vcl
_vcl animate ["HideGun_01",1]; //fold gun down
_vcl animate ["HideGun_02",1]; //fold gun down
_vcl animate ["HideGun_03",1]; //fold gun down
_vcl animate ["HideGun_04",1]; //fold gun down
_vcl animate ["CloseCover1",1]; //close cover1
_vcl animate ["CloseCover2",1]; //close cover2
_vcl setVariable ["suvpmc_cover", 1, true]; //set it closed
WaitUntil {!Alive _veh || format ["%1",_veh getVariable "suvpmc_cover"] != "1"}; //if suvpmc_cover is 0 or it is destroyed, continue with the script
_veh setVariable ["suvpmc_cover", 0,true]; //set suvpmc_cover to 0, not needed, haven't tested if it's needed
};
suvpmc_opencover = //function to open cover
{
_vcl = vehicle player; //assign the vehicle the pilot is in to _vcl
_vcl animate ["HideGun_01",0]; //fold gun down
_vcl animate ["HideGun_02",0]; //fold gun down
_vcl animate ["HideGun_03",0]; //fold gun down
_vcl animate ["HideGun_04",0]; //fold gun down
_vcl animate ["CloseCover1",0]; //close cover1
_vcl animate ["CloseCover2",0]; //close cover2
_vcl setVariable ["suvpmc_cover", 0,true]; //set it opened
};
suvpmc_init.sqf:
Code:
#include "suvpmc_functions.sqf"
{
_vcl = _this select 0; //set the vehicle to _vcl
_vcl setVariable ["suvpmc_cover", 0, true]; //create a variable for the cover
_closeCover = _x addaction ["Close Cover","addons\suvpmc_addAction.sqf",[[],suvpmc_closecover],7,true,false,"","player == driver _target && format [""%1"",_target getVariable ""suvpmc_cover""] != ""1"""]; //add action to close cover, details to come
_openCover = _x addaction ["Open Cover","addons\suvpmc_addAction.sqf",[[],suvpmc_opencover],7,true,false,"","player == driver _target && format [""%1"",_target getVariable ""suvpmc_cover""] == ""1"""]; //add action to open cover
} foreach (nearestObjects [[3000,3000,0], ["ArmoredSUV_PMC_DZ"], 50000]); //Get all Armored SUV vehicles in map
I grabbed the animation sequence from HERE
Does anyone see what i have done wrong?
I get the open and close cover only when in the drivers seat and not in the gunners seat.
What I would like to see happen is while in the gunners seat selecting the close cover would close the cover and put the gunner in the back seat position.