Jump to content
  • 0

Armored SUV Gun Animations


Ghost

Question

I managed to make the Armored SUV turret opens and closes, the only issue is the gunner sticks out of the SUV when the turret is closed.

I utilized this thread as a reference

 

http://opendayz.net/threads/armored-suv-gun-animations.14848/

 

along with this one

 

http://opendayz.net/threads/release-mv22-ramp-door-animations.12520/

 

and I'm currently trying to see if the lock turret portion of this script can be utilized to finish it or if the turret can be opened automatically when a player enters the gunner seat if closed

 

http://www.armaholic.com/page.php?id=18709

 

 

 

Anyone got any ideas?

Link to comment
Share on other sites

Recommended Posts

  • 0

Additional Information:

Install Instructions

1) Download the attached script and extract in your main mpmission folder. 

i.e. \MPMissions\DayZ_Epoch_11.Chernarus\

 

2) In your mpmission folder open your init.sqf file

and find:

 

if (!isDedicated) then {
 
Insert the following line under the _playerMonitor = [] execVM .......
 
_Armored_SUV_PMC_DZE_turret = [] execVM "Custom\VehicleActions\suvpmc_init.sqf";

 

 

Files:

suvpmc_init.sqf

#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","Custom\VehicleActions\suvpmc_addAction.sqf",[[],suvpmc_closecover],7,true,false,"","player == gunner _target && format [""%1"",_target getVariable ""suvpmc_cover""] != ""1"""]; //add action to close cover, details to come
_openCover = _x addaction ["Open Cover","Custom\VehicleActions\suvpmc_addAction.sqf",[[],suvpmc_opencover],7,true,false,"","player == gunner _target && format [""%1"",_target getVariable ""suvpmc_cover""] == ""1"""]; //add action to open cover

} foreach (nearestObjects [[3000,3000,0], ["ArmoredSUV_PMC_DZE"], 50000]); //Get all Armored SUV vehicles in map

 
suvpmc_addAction.sqf

_array = _this select 3;


_param = _array select 0;
_code = _array select 1;
_spawn = _param spawn _code;

 
suvpmc_functions.sqf

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
};

 
Included 2 versions one for DZE and one for DZ Vehicles

Armored SUV DZ Turret Script.zip

Armored SUV DZE Turret Script.zip

Link to comment
Share on other sites

  • 0

I can confirm it works 100% were you in the gunner seat of the SUV and also

in the suvpmc_init.sqf 

change this line

 

} foreach (nearestObjects [[3000,3000,0], ["ArmoredSUV_PMC_DZ"], 50000]); //Get all Armored SUV vehicles in map

 

for

 

} foreach (nearestObjects [[3000,3000,0], ["ArmoredSUV_PMC_DZE"], 50000]); //Get all Armored SUV vehicles in map

 

if you are using DZE Vehicles

Link to comment
Share on other sites

  • 0

I can confirm it works 100% were you in the gunner seat of the SUV and also

in the suvpmc_init.sqf 

change this line

 

} foreach (nearestObjects [[3000,3000,0], ["ArmoredSUV_PMC_DZ"], 50000]); //Get all Armored SUV vehicles in map

 

for

 

} foreach (nearestObjects [[3000,3000,0], ["ArmoredSUV_PMC_DZE"], 50000]); //Get all Armored SUV vehicles in map

 

if you are using DZE Vehicles

Works now thanks, But it looks rather funny because the player is still sticking out.

 

Great Script!

Link to comment
Share on other sites

  • 0

I found this in another script it may help, i got the hatch to close and the person goes to the rear passenger seat.

 

(gunner _vcl) action ["moveToCargo", _vcl,1];

 

Regards

 

p.s I will post the full script when i have time later today.

Link to comment
Share on other sites

  • 0

Sure its on the first part of the suvpmc_functions.sqf,

 

suvpmc_closecover = //function to close Cover

{

    _vcl = vehicle player; //assign the vehicle the pilot is in to _vcl

    (gunner _vcl) action ["moveToCargo", _vcl,1]; <----------------------(Here)

    _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

};

 

Regards

 

p.s I think  (gunner _vcl) action ["moveToCargo", _vcl,1]; was called (gunner_car) in the other script.

 

Link to comment
Share on other sites

  • 0

I will have a look at my files but i think i just used Ghosts 2nd post to get it working, just need to add the bit I found to get into the back seat. And yeah I have not got the opposite way from back seat to gun working yet either.

Link to comment
Share on other sites

  • 0

Thank for taking the time to reply Asian Kid. Cant seem to see why it will not work for me.

 

Located in my "custom folder"

 

https://www.dropbox.com/sh/es1rhjzqhryjj8r/9TbXUjZg2S

 

 

dayz_epoch_13.Tavi\init.sqf

//Run the player monitor
_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
_playerMonitor =  [] execVM "\z\addons\dayz_code\system\player_monitor.sqf"; 
_Armored_SUV_PMC_DZE_turret = [] execVM "custom\VehicleActions\suvpmc_init.sqf";

Am trying on the right type of DZE SUV

 

Anyone mind taking a look to see if there is an issue?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...