Jump to content
Tankbuster

make a UAV from a backpack on the ground

Recommended Posts

Hello all!

My players tell me it's annoying to be required to have the UAV backpack on their back in order to create the UAV.
They want to, for example, get a UAV backpack direct from a vehicle inventory, throw it on the ground (this they can do) and then create the UAV from the grounded backpack. I'd like to give them the action to 'Assemble [drone]' while looking at it on the ground.

But backpacks on the ground are always dummyweapon.p3d or typeof them is GroundWeaponHolder. How can I check if they are looking at a UAV backpack?

 

Thanks,

 

Tanky -Paul-

Share this post


Link to post
Share on other sites

Check if an UAV backpack is in a weapon holder.

  • Like 1

Share this post


Link to post
Share on other sites

Well, in a very, VERY rough way 😁, the code bellow is kinda what I use for "instantly creating" a pack of drones for players.
I usually attach them to a car and detach' em using another addAction, but this one will work as a showcase, so it might help you with ideas and to change it as you wish.

For starters, just add any object (I usually use a create) and throw all that on it's init field.
Then, click on "Instant drone" action.

Maybe you could adapt something like that on UAV backpacks... 🤔
 

this addAction ["Instant Drone",
{
_crate = _this # 0;

    _stomper = "B_UGV_01_rcws_F" createVehicle [0, 0, 0];
    _stomper attachTo [_crate, [-0.4, -5.25, 0.3]];
	_stomper setVariable ['QS_attached',true,!is3DEN];
	_stomper allowDamage false;
	_stomper setObjectTextureGlobal [0,"a3\soft_f_exp\lsv_01\data\nato_lsv_01_black_co.paa"];
	_stomper addWeaponTurret ["M134_minigun",[0]];
	_stomper addMagazineTurret ["5000Rnd_762x51_Belt",[0]];
sleep 0.15;
    _falcon = "B_T_UAV_03_dynamicLoadout_F" createVehicle [0, 0, 0];
    _falcon attachTo [_crate, [0, -1.45, 2.5]];
	[_falcon, [0,0,0]] call BIS_fnc_setObjectRotation;
	_falcon setVariable ['QS_attached',true,!is3DEN];
	_falcon setObjectTextureGlobal [0,"a3\soft_f_exp\lsv_01\data\nato_lsv_01_black_co.paa"];
	_falcon setObjectTextureGlobal [1,"a3\soft_f_exp\lsv_01\data\nato_lsv_02_black_co.paa"];
	_falcon allowDamage false;
sleep 0.15;
	_medDrone = createVehicle ["C_UAV_06_medical_F",[0,0,0], [], 0, "NONE"];
	_medDrone attachTo [_crate,[1.4, -2.25, -0.15]];
	_medDrone enableWeaponDisassembly false;
	_medDrone setVariable ['QS_attached',true,!is3DEN];
	_medDrone allowDamage false;
	[_medDrone, [90,270,180]] call BIS_fnc_setObjectRotation;
sleep 0.15;
    _darter = createVehicle ["B_UAV_01_F",[0,0,0], [], 0, "NONE"];
    _darter attachTo [_crate, [-1.2, -2.25, -0.15]];
	[_darter, [90,270,0]] call BIS_fnc_setObjectRotation;
	_darter setVariable ['QS_attached',true,!is3DEN];
	_darter allowDamage false;
	_darter enableWeaponDisassembly false;
sleep 0.15;

private _attachedAll = (attachedObjects _crate);

{
	_x allowDamage true;
	detach _x
} forEach _attachedAll;
}];

 

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, Schatten said:

Check if an UAV backpack is in a weapon holder.

Oh, the holder is a container?

 

Oh! yes! backpackCargo returns the UAV backpack!

Thank you. I'm mostly retired from editing these days - my skills are a little dulled by time 🙂

Share this post


Link to post
Share on other sites
1 hour ago, JCataclisma said:

Well, in a very, VERY rough way 😁, the code bellow is kinda what I use for "instantly creating" a pack of drones for players.
I usually attach them to a car and detach' em using another addAction, but this one will work as a showcase, so it might help you with ideas and to change it as you wich.

For starters, just add any object (I usually use a create) and throw all that on it's init field.
Then, click on "Instant drone" action.

Maybe you could adapt something like that on UAV backpacks... 🤔
 


this addAction ["Instant Drone",
{
_crate = _this # 0;

    _stomper = "B_UGV_01_rcws_F" createVehicle [0, 0, 0];
    _stomper attachTo [_crate, [-0.4, -5.25, 0.3]];
	_stomper setVariable ['QS_attached',true,!is3DEN];
	_stomper allowDamage false;
	_stomper setObjectTextureGlobal [0,"a3\soft_f_exp\lsv_01\data\nato_lsv_01_black_co.paa"];
	_stomper addWeaponTurret ["M134_minigun",[0]];
	_stomper addMagazineTurret ["5000Rnd_762x51_Belt",[0]];
sleep 0.15;
    _falcon = "B_T_UAV_03_dynamicLoadout_F" createVehicle [0, 0, 0];
    _falcon attachTo [_crate, [0, -1.45, 2.5]];
	[_falcon, [0,0,0]] call BIS_fnc_setObjectRotation;
	_falcon setVariable ['QS_attached',true,!is3DEN];
	_falcon setObjectTextureGlobal [0,"a3\soft_f_exp\lsv_01\data\nato_lsv_01_black_co.paa"];
	_falcon setObjectTextureGlobal [1,"a3\soft_f_exp\lsv_01\data\nato_lsv_02_black_co.paa"];
	_falcon allowDamage false;
sleep 0.15;
	_medDrone = createVehicle ["C_UAV_06_medical_F",[0,0,0], [], 0, "NONE"];
	_medDrone attachTo [_crate,[1.4, -2.25, -0.15]];
	_medDrone enableWeaponDisassembly false;
	_medDrone setVariable ['QS_attached',true,!is3DEN];
	_medDrone allowDamage false;
	[_medDrone, [90,270,180]] call BIS_fnc_setObjectRotation;
sleep 0.15;
    _darter = createVehicle ["B_UAV_01_F",[0,0,0], [], 0, "NONE"];
    _darter attachTo [_crate, [-1.2, -2.25, -0.15]];
	[_darter, [90,270,0]] call BIS_fnc_setObjectRotation;
	_darter setVariable ['QS_attached',true,!is3DEN];
	_darter allowDamage false;
	_darter enableWeaponDisassembly false;
sleep 0.15;

private _attachedAll = (attachedObjects _crate);

{
	_x allowDamage true;
	detach _x
} forEach _attachedAll;
}];

 

Oh yes, very helpful! Thank you.

Share this post


Link to post
Share on other sites

 

 

makeuavfromdroppedbackpack = player addAction ["Assemble AR-2 Darter", "_dp = getpos cursorObject; deleteVehicle cursorObject; _d = createVehicle ['B_UAV_01_F', _dp,[],0,'CAN_COLLIDE']; createvehiclecrew _d;",nil,0,true,true,"","backpackCargo cursorObject isEqualto ['B_UAV_01_backpack_F']",10,false];

Thank you guys! good work!

  • Thanks 1

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

×