mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Improved rope glitchyness
This commit is contained in:
parent
84af4b7676
commit
c65656a016
@ -7,8 +7,3 @@
|
|||||||
[QGVAR(startFastRope), {
|
[QGVAR(startFastRope), {
|
||||||
[FUNC(fastRopeServerPFH), 0, _this] call CBA_fnc_addPerFrameHandler;
|
[FUNC(fastRopeServerPFH), 0, _this] call CBA_fnc_addPerFrameHandler;
|
||||||
}] call EFUNC(common,addEventHandler);
|
}] call EFUNC(common,addEventHandler);
|
||||||
|
|
||||||
[QGVAR(ropeDetach), {
|
|
||||||
params ["_object", "_rope"];
|
|
||||||
_object ropeDetach _rope;
|
|
||||||
}] call EFUNC(common,addEventHandler);
|
|
||||||
|
@ -32,8 +32,10 @@ _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []];
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
[QGVAR(ropeDetach), [_hook, _ropeTop]] call EFUNC(common,serverEvent);
|
detach _dummy;
|
||||||
[{{deleteVehicle _x} count _this}, [_ropeTop, _ropeBottom, _dummy, _hook], 60] call EFUNC(common,waitAndExecute);
|
deleteVehicle _ropeTop;
|
||||||
|
deleteVehicle _hook;
|
||||||
|
[{{deleteVehicle _x} count _this}, [_ropeBottom, _dummy], 60] call EFUNC(common,waitAndExecute);
|
||||||
} count _deployedRopes;
|
} count _deployedRopes;
|
||||||
|
|
||||||
_vehicle setVariable [QGVAR(deployedRopes), [], true];
|
_vehicle setVariable [QGVAR(deployedRopes), [], true];
|
||||||
|
@ -35,13 +35,14 @@ _hookAttachment = _vehicle getVariable [QGVAR(FRIES), _vehicle];
|
|||||||
|
|
||||||
_origin = getPosATL _hook;
|
_origin = getPosATL _hook;
|
||||||
|
|
||||||
_dummy = createVehicle [QGVAR(helper), _origin vectorAdd [0, 0, -1], [], 0, "CAN_COLLIDE"];
|
_dummy = createVehicle [QGVAR(helper), _origin, [], 0, "CAN_COLLIDE"];
|
||||||
_dummy allowDamage false;
|
_dummy allowDamage false;
|
||||||
_dummy disableCollisionWith _vehicle;
|
_dummy disableCollisionWith _vehicle;
|
||||||
|
_dummy attachTo [_hook, [0, 0, 0]];
|
||||||
|
|
||||||
_ropeTop = ropeCreate [_dummy, [0, 0, 0], _hook, [0, 0, 0], 0.5];
|
_ropeTop = ropeCreate [_dummy, [0, 0, 0], _hook, [0, 0, 0], 0.5];
|
||||||
_ropeBottom = ropeCreate [_dummy, [0, 0, 0], 1];
|
_ropeBottom = ropeCreate [_dummy, [0, 0, 0], 1];
|
||||||
ropeUnwind [_ropeBottom, 30, 34.5, false];
|
ropeUnwind [_ropeBottom, 30, 35, false];
|
||||||
|
|
||||||
_ropeTop addEventHandler ["RopeBreak", {[_this, "top"] call FUNC(onRopeBreak)}];
|
_ropeTop addEventHandler ["RopeBreak", {[_this, "top"] call FUNC(onRopeBreak)}];
|
||||||
_ropeBottom addEventHandler ["RopeBreak", {[_this, "bottom"] call FUNC(onRopeBreak)}];
|
_ropeBottom addEventHandler ["RopeBreak", {[_this, "bottom"] call FUNC(onRopeBreak)}];
|
||||||
|
@ -26,6 +26,7 @@ if (vehicle _unit != _unit) exitWith {};
|
|||||||
|
|
||||||
//Start fast roping
|
//Start fast roping
|
||||||
if (animationState _unit != "ACE_FastRoping") exitWith {
|
if (animationState _unit != "ACE_FastRoping") exitWith {
|
||||||
|
detach _dummy;
|
||||||
_unit disableCollisionWith _dummy;
|
_unit disableCollisionWith _dummy;
|
||||||
_unit attachTo [_dummy, [0, 0, -1.45]];
|
_unit attachTo [_dummy, [0, 0, -1.45]];
|
||||||
[_unit, "ACE_FastRoping", 2] call EFUNC(common,doAnimation);
|
[_unit, "ACE_FastRoping", 2] call EFUNC(common,doAnimation);
|
||||||
|
@ -54,14 +54,14 @@ if (((getPos _unit select 2) < 0.2) || {ropeLength _ropeTop == 34.5} || {vectorM
|
|||||||
deleteVehicle _ropeBottom;
|
deleteVehicle _ropeBottom;
|
||||||
|
|
||||||
_origin = getPosASL _hook;
|
_origin = getPosASL _hook;
|
||||||
_dummy setPosASL (_origin vectorAdd [0, 0, -1]);
|
_dummy attachTo [_hook, [0, 0, 0]];
|
||||||
|
|
||||||
//Restore original mass and center of mass
|
//Restore original mass and center of mass
|
||||||
_dummy setMass 40;
|
_dummy setMass 40;
|
||||||
_dummy setCenterOfMass [0.000143227,0.00105986,-0.246147];
|
_dummy setCenterOfMass [0.000143227,0.00105986,-0.246147];
|
||||||
|
|
||||||
_ropeTop = ropeCreate [_dummy, [0, 0, 0], _hook, [0, 0, 0], 0.5];
|
_ropeTop = ropeCreate [_dummy, [0, 0, 0], _hook, [0, 0, 0], 0.5];
|
||||||
_ropeBottom = ropeCreate [_dummy, [0, 0, 0], 34.5];
|
_ropeBottom = ropeCreate [_dummy, [0, 0, 0], 35];
|
||||||
|
|
||||||
_ropeTop addEventHandler ["RopeBreak", {[_this, "top"] call FUNC(onRopeBreak)}];
|
_ropeTop addEventHandler ["RopeBreak", {[_this, "top"] call FUNC(onRopeBreak)}];
|
||||||
_ropeBottom addEventHandler ["RopeBreak", {[_this, "bottom"] call FUNC(onRopeBreak)}];
|
_ropeBottom addEventHandler ["RopeBreak", {[_this, "bottom"] call FUNC(onRopeBreak)}];
|
||||||
|
Loading…
Reference in New Issue
Block a user