2020-10-04 20:39:52 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
/*
|
2023-07-20 17:42:35 +00:00
|
|
|
* Author: BaerMitUmlaut, johnb43
|
2020-10-04 20:39:52 +00:00
|
|
|
* Creates a draggable / carryable clone of a dead unit.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Dead unit <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
2023-07-20 17:42:35 +00:00
|
|
|
* Cloned unit <OBJECT>
|
2020-10-04 20:39:52 +00:00
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [player] call ace_dragging_fnc_createClone;
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2023-07-20 17:42:35 +00:00
|
|
|
params ["_target"];
|
2020-10-04 20:39:52 +00:00
|
|
|
|
|
|
|
private _clone = QGVAR(clone) createVehicle [0, 0, 0];
|
2023-07-20 17:42:35 +00:00
|
|
|
|
|
|
|
// Clone loadout
|
|
|
|
_clone setUnitLoadout getUnitLoadout _target;
|
|
|
|
[_clone, _target call BIS_fnc_getUnitInsignia] call BIS_fnc_setUnitInsignia;
|
|
|
|
|
|
|
|
// Disable all damage
|
2020-10-11 18:44:35 +00:00
|
|
|
_clone allowDamage false;
|
2023-07-20 17:42:35 +00:00
|
|
|
_clone setVariable [QGVAR(original), _target, true];
|
|
|
|
|
|
|
|
// Turn on PhysX so that unit is not desync when moving with 'setPos' commands
|
|
|
|
[QEGVAR(common,awake), [_target, true]] call CBA_fnc_globalEvent;
|
|
|
|
|
|
|
|
// Move unit below terrain in order to hide it
|
|
|
|
_target setPosATL [0, 0, -10];
|
|
|
|
|
|
|
|
// Turn off PhysX
|
|
|
|
[QEGVAR(common,awake), [_target, false]] call CBA_fnc_globalEvent;
|
2020-10-04 20:39:52 +00:00
|
|
|
|
2023-07-20 17:42:35 +00:00
|
|
|
// Sets the facial expression
|
|
|
|
[[QGVAR(cloneCreated), [_target, _clone]] call CBA_fnc_globalEventJIP, _clone] call CBA_fnc_removeGlobalEventJIP;
|
2020-10-04 20:39:52 +00:00
|
|
|
|
|
|
|
_clone
|