mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
rework modifier key, cleanup sandbags, tripod, ladder, fix #2590
This commit is contained in:
parent
5f7c30dd7c
commit
2fe142032e
@ -86,6 +86,7 @@
|
||||
|
||||
if (isServer) then {
|
||||
["hideObjectGlobal", {(_this select 0) hideObjectGlobal (_this select 1)}] call FUNC(addEventHandler);
|
||||
["enableSimulationGlobal", {(_this select 0) enableSimulationGlobal (_this select 1)}] call FUNC(addEventHandler);
|
||||
};
|
||||
|
||||
|
||||
@ -94,8 +95,8 @@ if (isServer) then {
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
// ACE events
|
||||
"ACEg" addPublicVariableEventHandler { _this call FUNC(_handleNetEvent); };
|
||||
"ACEc" addPublicVariableEventHandler { _this call FUNC(_handleNetEvent); };
|
||||
"ACEg" addPublicVariableEventHandler {_this call FUNC(_handleNetEvent)};
|
||||
"ACEc" addPublicVariableEventHandler {_this call FUNC(_handleNetEvent)};
|
||||
|
||||
// Synced ACE events
|
||||
// Handle JIP scenario
|
||||
@ -219,8 +220,29 @@ call FUNC(assignedItemFix);
|
||||
|
||||
GVAR(ScrollWheelFrame) = diag_frameno;
|
||||
|
||||
addMissionEventHandler ["Loaded", {call FUNC(handleScrollWheelInit)}];
|
||||
["mainDisplayLoaded", {
|
||||
call FUNC(handleScrollWheelInit);
|
||||
[{
|
||||
call FUNC(handleModifierKeyInit);
|
||||
}, [], 0.1] call FUNC(waitAndExecute); // needs delay, otherwise doesn't work without pressing "RESTART" in editor once. Tested in 1.52RC
|
||||
}] call FUNC(addEventHandler);
|
||||
|
||||
// add PFH to execute event that fires when the main display (46) is created
|
||||
private "_fnc_initMainDisplayCheck";
|
||||
_fnc_initMainDisplayCheck = {
|
||||
[{
|
||||
if !(isNull findDisplay 46) then {
|
||||
// Raise ACE event locally
|
||||
["mainDisplayLoaded", [findDisplay 46]] call FUNC(localEvent);
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
}, 0, []] call CBA_fnc_addPerFrameHandler;
|
||||
};
|
||||
|
||||
call _fnc_initMainDisplayCheck;
|
||||
|
||||
// repeat this every time a savegame is loaded
|
||||
addMissionEventHandler ["Loaded", _fnc_initMainDisplayCheck];
|
||||
|
||||
// @todo remove?
|
||||
enableCamShake true;
|
||||
|
@ -91,6 +91,9 @@ PREP(getWindDirection);
|
||||
PREP(getZoom);
|
||||
PREP(goKneeling);
|
||||
PREP(hadamardProduct);
|
||||
PREP(handleModifierKey);
|
||||
PREP(handleModifierKeyUp);
|
||||
PREP(handleModifierKeyInit);
|
||||
PREP(handleScrollWheel);
|
||||
PREP(handleScrollWheelInit);
|
||||
PREP(hasItem);
|
||||
@ -204,6 +207,7 @@ PREP(getReflectorsWithSelections);
|
||||
PREP(getLightProperties);
|
||||
PREP(getLightPropertiesWeapon);
|
||||
PREP(getVehicleCrew);
|
||||
PREP(getVehicleUAVCrew);
|
||||
|
||||
// turrets
|
||||
PREP(getTurrets);
|
||||
|
@ -18,4 +18,12 @@ ACE_DEPRECATED("ace_common_fnc_getHitPoints","3.5.0","getAllHitPointsDamage");
|
||||
|
||||
params ["_vehicle"];
|
||||
|
||||
(getAllHitPointsDamage _vehicle select 0) - [""]
|
||||
private "_hitPointsWithSelections";
|
||||
_hitPointsWithSelections = getAllHitPointsDamage _vehicle;
|
||||
|
||||
// get correct format on vehicles without any hitpoints
|
||||
if (_hitPointsWithSelections isEqualTo []) then {
|
||||
_hitPointsWithSelections = [[],[],[]];
|
||||
};
|
||||
|
||||
(_hitPointsWithSelections select 0) - [""]
|
||||
|
@ -22,6 +22,11 @@ params ["_vehicle"];
|
||||
private "_hitPointsWithSelections";
|
||||
_hitPointsWithSelections = getAllHitPointsDamage _vehicle;
|
||||
|
||||
// get correct format on vehicles without any hitpoints
|
||||
if (_hitPointsWithSelections isEqualTo []) then {
|
||||
_hitPointsWithSelections = [[],[],[]];
|
||||
};
|
||||
|
||||
_hitPointsWithSelections resize 2;
|
||||
|
||||
_hitPointsWithSelections
|
||||
|
17
addons/common/functions/fnc_getVehicleUAVCrew.sqf
Normal file
17
addons/common/functions/fnc_getVehicleUAVCrew.sqf
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Returns array of uav dummy ais.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Vehicle <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* UAV Dummy Crew <ARRAY>
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_vehicle"];
|
||||
|
||||
[crew _vehicle, {getText (configFile >> "CfgVehicles" >> typeOf _this >> "simulation") == "UAVPilot"}] call FUNC(filter) // return
|
17
addons/common/functions/fnc_handleModifierKey.sqf
Normal file
17
addons/common/functions/fnc_handleModifierKey.sqf
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Handles key down event for modifier key.
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public : No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (_this select 3) then {ACE_modifier = 1};
|
||||
|
||||
false
|
16
addons/common/functions/fnc_handleModifierKeyInit.sqf
Normal file
16
addons/common/functions/fnc_handleModifierKeyInit.sqf
Normal file
@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Initializes the modifier key handler.
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public : No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
(findDisplay 46) displayAddEventHandler ["KeyDown", FUNC(handleModifierKey)];
|
||||
(findDisplay 46) displayAddEventHandler ["KeyUp", FUNC(handleModifierKeyUp)];
|
17
addons/common/functions/fnc_handleModifierKeyUp.sqf
Normal file
17
addons/common/functions/fnc_handleModifierKeyUp.sqf
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Handles key up event for modifier key.
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public : No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
ACE_modifier = 0;
|
||||
|
||||
false
|
@ -7,8 +7,7 @@ class Extended_PreInit_EventHandlers {
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit));
|
||||
serverInit = QUOTE(call COMPILE_FILE(XEH_serverInit));
|
||||
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -1,7 +1,14 @@
|
||||
// by PabstMirror, commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
[DFUNC(handleScrollWheel)] call EFUNC(common,addScrollWheelEventHandler);
|
||||
if (isServer) then {
|
||||
// release object on hard disconnection. Function is identical to killed
|
||||
addMissionEventHandler ["HandleDisconnect", {_this call FUNC(handleKilled)}];
|
||||
};
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
[{_this call FUNC(handleScrollWheel)}] call EFUNC(common,addScrollWheelEventHandler);
|
||||
|
||||
if (isNil "ACE_maxWeightDrag") then {
|
||||
ACE_maxWeightDrag = 800;
|
||||
@ -15,11 +22,11 @@ if (isNil "ACE_maxWeightCarry") then {
|
||||
["isNotCarrying", {!((_this select 0) getVariable [QGVAR(isCarrying), false])}] call EFUNC(common,addCanInteractWithCondition);
|
||||
|
||||
// release object on player change. This does work when returning to lobby, but not when hard disconnecting.
|
||||
["playerChanged", DFUNC(handlePlayerChanged)] call EFUNC(common,addEventhandler);
|
||||
["playerVehicleChanged", {[ACE_player, objNull] call DFUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
|
||||
["playerWeaponChanged", DFUNC(handlePlayerWeaponChanged)] call EFUNC(common,addEventhandler);
|
||||
["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
|
||||
["playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
|
||||
["playerWeaponChanged", {_this call FUNC(handlePlayerWeaponChanged)}] call EFUNC(common,addEventhandler);
|
||||
|
||||
// handle waking up dragged unit and falling unconscious while dragging
|
||||
["medical_onUnconscious", DFUNC(handleUnconscious)] call EFUNC(common,addEventhandler);
|
||||
["medical_onUnconscious", {_this call FUNC(handleUnconscious)}] call EFUNC(common,addEventhandler);
|
||||
|
||||
//@todo Captivity?
|
@ -1,5 +0,0 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
// release object on hard disconnection. Function is identical to killed
|
||||
addMissionEventHandler ["HandleDisconnect", DFUNC(handleKilled)];
|
@ -18,7 +18,7 @@ params ["_unit", "_target"];
|
||||
|
||||
if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
|
||||
// a static weapon has to be empty for dragging
|
||||
if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false};
|
||||
// a static weapon has to be empty for dragging (ignore UAV AI)
|
||||
if (((typeOf _target) isKindOf "StaticWeapon") && {{(getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "simulation")) != "UAVPilot"} count crew _target > 0}) exitWith {false};
|
||||
|
||||
alive _target && {vehicle _target == _target} && {_target getVariable [QGVAR(canCarry), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false]) || (_target isKindOf "CAManBase" && {(_target getHitPointDamage "HitLegs") > 0.4})}
|
||||
|
@ -21,7 +21,7 @@ _target = _this select 1;
|
||||
|
||||
if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
|
||||
// a static weapon has to be empty for dragging
|
||||
if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false};
|
||||
// a static weapon has to be empty for dragging (ignore UAV AI)
|
||||
if ((typeOf _target) isKindOf "StaticWeapon" && {{(getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "simulation")) != "UAVPilot"} count crew _target > 0}) exitWith {false};
|
||||
|
||||
alive _target && {vehicle _target == _target} && {_target getVariable [QGVAR(canDrag), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false]) || (_target isKindOf "CAManBase" && {(_target getHitPointDamage "HitLegs") > 0.4})};
|
||||
|
@ -17,7 +17,7 @@
|
||||
params ["_unit", "_target"];
|
||||
|
||||
// get attachTo offset and direction.
|
||||
private ["_position", "_direction"];
|
||||
private ["_position", "_direction", "_UAVCrew"];
|
||||
|
||||
_position = _target getVariable [QGVAR(carryPosition), [0, 0, 0]];
|
||||
_direction = _target getVariable [QGVAR(carryDirection), 0];
|
||||
@ -48,29 +48,26 @@ if (_target isKindOf "CAManBase") then {
|
||||
_unit setVariable [QGVAR(isCarrying), true, true];
|
||||
_unit setVariable [QGVAR(carriedObject), _target, true];
|
||||
|
||||
// add scrollwheel action to release object
|
||||
private "_actionID";
|
||||
_actionID = _unit getVariable [QGVAR(ReleaseActionID), -1];
|
||||
// add drop action
|
||||
_unit setVariable [QGVAR(ReleaseActionID), [
|
||||
_unit, "DefaultAction",
|
||||
{!isNull ((_this select 0) getVariable [QGVAR(carriedObject), objNull])},
|
||||
{[_this select 0, (_this select 0) getVariable [QGVAR(carriedObject), objNull]] call FUNC(dropObject_carry)}
|
||||
] call EFUNC(common,addActionEventHandler)];
|
||||
|
||||
if (_actionID != -1) then {
|
||||
_unit removeAction _actionID;
|
||||
};
|
||||
|
||||
_actionID = _unit addAction [
|
||||
format ["<t color='#FF0000'>%1</t>", localize LSTRING(Drop)],
|
||||
QUOTE([ARR_2(_this select 0, (_this select 0) getVariable [ARR_2(QUOTE(QGVAR(carriedObject)),objNull)])] call FUNC(dropObject_carry)),
|
||||
nil,
|
||||
20,
|
||||
false,
|
||||
true,
|
||||
"",
|
||||
QUOTE(!isNull (_this getVariable [ARR_2(QUOTE(QGVAR(carriedObject)),objNull)]))
|
||||
];
|
||||
|
||||
_unit setVariable [QGVAR(ReleaseActionID), _actionID];
|
||||
// show mouse hint
|
||||
[localize LSTRING(Drop), "", localize LSTRING(LowerRaise)] call EFUNC(interaction,showMouseHint);
|
||||
|
||||
// check everything
|
||||
[FUNC(carryObjectPFH), 0.5, [_unit, _target]] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
// reset current dragging height.
|
||||
GVAR(currentHeightChange) = 0;
|
||||
|
||||
// prevent UAVs from firing
|
||||
_UAVCrew = _target call EFUNC(common,getVehicleUAVCrew);
|
||||
|
||||
if !(_UAVCrew isEqualTo []) then {
|
||||
{_target deleteVehicleCrew _x} count _UAVCrew;
|
||||
_target setVariable [QGVAR(isUAV), true, true];
|
||||
};
|
||||
|
@ -14,9 +14,10 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_position", "_direction", "_offset", "_actionID"];
|
||||
params ["_unit", "_target"];
|
||||
|
||||
private ["_position", "_direction", "_offset", "_UAVCrew"];
|
||||
|
||||
// get attachTo offset and direction.
|
||||
_position = _target getVariable [QGVAR(dragPosition), [0, 0, 0]];
|
||||
_direction = _target getVariable [QGVAR(dragDirection), 0];
|
||||
@ -37,28 +38,26 @@ if (_target isKindOf "CAManBase") then {
|
||||
_unit setVariable [QGVAR(isDragging), true, true];
|
||||
_unit setVariable [QGVAR(draggedObject), _target, true];
|
||||
|
||||
// add scrollwheel action to release object
|
||||
_actionID = _unit getVariable [QGVAR(ReleaseActionID), -1];
|
||||
// add drop action
|
||||
_unit setVariable [QGVAR(ReleaseActionID), [
|
||||
_unit, "DefaultAction",
|
||||
{!isNull ((_this select 0) getVariable [QGVAR(draggedObject), objNull])},
|
||||
{[_this select 0, (_this select 0) getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject)}
|
||||
] call EFUNC(common,addActionEventHandler)];
|
||||
|
||||
if (_actionID != -1) then {
|
||||
_unit removeAction _actionID;
|
||||
};
|
||||
|
||||
_actionID = _unit addAction [
|
||||
format ["<t color='#FF0000'>%1</t>", localize LSTRING(Drop)],
|
||||
QUOTE([ARR_2(_this select 0, (_this select 0) getVariable [ARR_2(QUOTE(QGVAR(draggedObject)),objNull)])] call FUNC(dropObject)),
|
||||
nil,
|
||||
20,
|
||||
false,
|
||||
true,
|
||||
"",
|
||||
QUOTE(!isNull (_this getVariable [ARR_2(QUOTE(QGVAR(draggedObject)),objNull)]))
|
||||
];
|
||||
|
||||
_unit setVariable [QGVAR(ReleaseActionID), _actionID];
|
||||
// show mouse hint
|
||||
[localize LSTRING(Drop), ""] call EFUNC(interaction,showMouseHint);
|
||||
|
||||
// check everything
|
||||
[FUNC(dragObjectPFH), 0.5, [_unit, _target]] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
// reset current dragging height.
|
||||
GVAR(currentHeightChange) = 0;
|
||||
|
||||
// prevent UAVs from firing
|
||||
_UAVCrew = _target call EFUNC(common,getVehicleUAVCrew);
|
||||
|
||||
if !(_UAVCrew isEqualTo []) then {
|
||||
{_target deleteVehicleCrew _x} count _UAVCrew;
|
||||
_target setVariable [QGVAR(isUAV), true, true];
|
||||
};
|
||||
|
@ -16,8 +16,8 @@
|
||||
|
||||
params ["_unit", "_target"];
|
||||
|
||||
// remove scroll wheel action
|
||||
_unit removeAction (_unit getVariable [QGVAR(ReleaseActionID), -1]);
|
||||
// remove drop action
|
||||
[_unit, "DefaultAction", _unit getVariable [QGVAR(ReleaseActionID), -1]] call EFUNC(common,removeActionEventHandler);
|
||||
|
||||
private "_inBuilding";
|
||||
_inBuilding = [_unit] call FUNC(isObjectOnObject);
|
||||
@ -49,6 +49,9 @@ if (_inBuilding) then {
|
||||
_target setPosASL (getPosASL _target vectorAdd [0, 0, 0.05]);
|
||||
};
|
||||
|
||||
// hide mouse hint
|
||||
[] call EFUNC(interaction,hideMouseHint);
|
||||
|
||||
_unit setVariable [QGVAR(isDragging), false, true];
|
||||
_unit setVariable [QGVAR(draggedObject), objNull, true];
|
||||
|
||||
@ -63,3 +66,8 @@ if !(_target isKindOf "CAManBase") then {
|
||||
if (_unit getvariable ["ACE_isUnconscious", false]) then {
|
||||
[_unit, "unconscious", 2, true] call EFUNC(common,doAnimation);
|
||||
};
|
||||
|
||||
// recreate UAV crew
|
||||
if (_target getVariable [QGVAR(isUAV), false]) then {
|
||||
createVehicleCrew _target;
|
||||
};
|
||||
|
@ -16,8 +16,8 @@
|
||||
|
||||
params ["_unit", "_target"];
|
||||
|
||||
// remove scroll wheel action
|
||||
_unit removeAction (_unit getVariable [QGVAR(ReleaseActionID), -1]);
|
||||
// remove drop action
|
||||
[_unit, "DefaultAction", _unit getVariable [QGVAR(ReleaseActionID), -1]] call EFUNC(common,removeActionEventHandler);
|
||||
|
||||
private "_inBuilding";
|
||||
_inBuilding = [_unit] call FUNC(isObjectOnObject);
|
||||
@ -55,6 +55,9 @@ if (_inBuilding) then {
|
||||
_target setPosASL (getPosASL _target vectorAdd [0, 0, 0.05]);
|
||||
};
|
||||
|
||||
// hide mouse hint
|
||||
[] call EFUNC(interaction,hideMouseHint);
|
||||
|
||||
_unit setVariable [QGVAR(isCarrying), false, true];
|
||||
_unit setVariable [QGVAR(carriedObject), objNull, true];
|
||||
|
||||
@ -65,3 +68,8 @@ if !(_target isKindOf "CAManBase") then {
|
||||
["fixPosition", _target, _target] call EFUNC(common,targetEvent);
|
||||
["fixFloating", _target, _target] call EFUNC(common,targetEvent);
|
||||
};
|
||||
|
||||
// recreate UAV crew
|
||||
if (_target getVariable [QGVAR(isUAV), false]) then {
|
||||
createVehicleCrew _target;
|
||||
};
|
||||
|
@ -13,20 +13,15 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_carriedItem", "_position", "_maxHeight"];
|
||||
|
||||
params ["_scrollAmount"];
|
||||
|
||||
// requires modifier key to be hold down
|
||||
if (missionNamespace getVariable ["ACE_Modifier", 0] == 0) exitWith {false};
|
||||
private ["_unit", "_carriedItem", "_position", "_maxHeight"];
|
||||
|
||||
_unit = ACE_player;
|
||||
|
||||
// EH is always assigned. Exit and don't overwrite input if not carrying
|
||||
if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {false};
|
||||
|
||||
|
||||
|
||||
// move carried item 15 cm per scroll interval
|
||||
_scrollAmount = _scrollAmount * 0.15;
|
||||
|
||||
|
@ -49,5 +49,9 @@
|
||||
<Italian>Trasporta</Italian>
|
||||
<Russian>Нести</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Dragging_LowerRaise">
|
||||
<English>Raise/Lower</English>
|
||||
<German>Heben/Senken</German>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
|
@ -94,16 +94,16 @@
|
||||
<Russian>Отмена</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Explosives_ScrollAction">
|
||||
<English>+ Modifier, rotates</English>
|
||||
<German>+ Modifikator, drehen</German>
|
||||
<Spanish>+ Modificador, girar</Spanish>
|
||||
<French>+ Modificateur, tourner</French>
|
||||
<Italian>+ Modificatore, rotazione</Italian>
|
||||
<Czech>+ Modifikátor, otočit</Czech>
|
||||
<Hungarian>+ Változtatás, forgatás</Hungarian>
|
||||
<Polish>+ Modyfikator, obrót</Polish>
|
||||
<Portuguese>+ Modificador, rotaciona</Portuguese>
|
||||
<Russian>+ Bращать</Russian>
|
||||
<English>+Ctrl rotate</English>
|
||||
<German>+Strg drehen</German>
|
||||
<Spanish>+Ctrl girar</Spanish>
|
||||
<French>+Ctrl tourner</French>
|
||||
<Italian>+Ctrl rotazione</Italian>
|
||||
<Czech>+Ctrl otočit</Czech>
|
||||
<Hungarian>+Ctrl forgatás</Hungarian>
|
||||
<Polish>+Ctrl obrót</Polish>
|
||||
<Portuguese>+Ctrl rotaciona</Portuguese>
|
||||
<Russian>+Ctrl Bращать</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Explosives_Jammer_TurnOn">
|
||||
<English>Turn On Thor III</English>
|
||||
|
@ -148,7 +148,7 @@ class RscInteractionHelperIcon: RscInteractionIcon {
|
||||
class RscInteractionText: RscText{
|
||||
x = 21 * GUI_GRID_W;
|
||||
y = 16 * GUI_GRID_H;
|
||||
w = 8 * GUI_GRID_W;
|
||||
w = 24 * GUI_GRID_W;
|
||||
h = 1.5 * GUI_GRID_H;
|
||||
};
|
||||
class RscTitles {
|
||||
|
@ -64,22 +64,5 @@ private ["_team"];
|
||||
{false},
|
||||
[20, [true, false, false]], false] call cba_fnc_addKeybind;
|
||||
|
||||
["ACE3 Common", QGVAR(modifierKey), localize LSTRING(ModifierKey),
|
||||
{
|
||||
// Conditions: canInteract
|
||||
//if !([ACE_player, objNull, ["isNotDragging"]] call EFUNC(common,canInteractWith)) exitWith {false}; // not needed
|
||||
|
||||
// Statement
|
||||
ACE_Modifier = 1;
|
||||
// Return false so it doesn't block other actions
|
||||
false
|
||||
},
|
||||
{
|
||||
//Probably don't want any condidtions here, so variable never gets locked down
|
||||
ACE_Modifier = 0;
|
||||
false;
|
||||
},
|
||||
[29, [false, false, false]], false] call cba_fnc_addKeybind;
|
||||
|
||||
["isNotSwimming", {!underwater (_this select 0)}] call EFUNC(common,addCanInteractWithCondition);
|
||||
["isNotOnLadder", {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState (_this select 0) >> "ACE_isLadder") != 1}] call EFUNC(common,addCanInteractWithCondition);
|
||||
|
@ -18,4 +18,5 @@
|
||||
if (isNull (uiNamespace getVariable ["ACE_Helper_Display", objNull])) exitWith {};
|
||||
|
||||
(QGVAR(InteractionHelper) call BIS_fnc_rscLayer) cutText ["", "PLAIN"];
|
||||
|
||||
showHUD true;
|
||||
|
@ -20,17 +20,15 @@
|
||||
#define GUI_GRID_W (0.025)
|
||||
#define GUI_GRID_H (0.04)
|
||||
|
||||
private ["_scroll", "_display"];
|
||||
|
||||
PARAMS_2(_leftClick,_rightClick);
|
||||
_scroll = "";
|
||||
if (count _this > 2) then {
|
||||
_scroll = _this select 2;
|
||||
};
|
||||
params ["_leftClick", "_rightClick", ["_scroll", ""]];
|
||||
|
||||
(QGVAR(InteractionHelper) call BIS_fnc_rscLayer) cutRsc [QGVAR(InteractionHelper), "PLAIN", 0.5, false];
|
||||
|
||||
disableSerialization;
|
||||
|
||||
private "_display";
|
||||
_display = uiNamespace getVariable ["ACE_Helper_Display", objNull];
|
||||
|
||||
if (isNull _display) exitWith {};
|
||||
|
||||
(_display displayCtrl 1000) ctrlSetText _leftClick;
|
||||
@ -44,10 +42,12 @@ if (isNull _display) exitWith{};
|
||||
if (_scroll == "") exitWith {
|
||||
(_display displayCtrl 1002) ctrlShow false;
|
||||
(_display displayCtrl 1202) ctrlShow false;
|
||||
(_display displayCtrl 1001) ctrlSetPosition [21 * GUI_GRID_W, 18 * GUI_GRID_H, 8 * GUI_GRID_W, 1.5 * GUI_GRID_H];
|
||||
(_display displayCtrl 1201) ctrlSetPosition [20 * GUI_GRID_W, 18.5 * GUI_GRID_H, 1 * GUI_GRID_W, 1 * GUI_GRID_H];
|
||||
(_display displayCtrl 1001) ctrlSetPosition [21 * GUI_GRID_W, 18 * GUI_GRID_H, 24 * GUI_GRID_W, 1.5 * GUI_GRID_H];
|
||||
(_display displayCtrl 1201) ctrlSetPosition [20 * GUI_GRID_W, 18.5 * GUI_GRID_H, 1.5 * GUI_GRID_W, 1 * GUI_GRID_H];
|
||||
(_display displayCtrl 1001) ctrlCommit 0;
|
||||
(_display displayCtrl 1201) ctrlCommit 0;
|
||||
};
|
||||
|
||||
(_display displayCtrl 1002) ctrlSetText _scroll;
|
||||
|
||||
showHUD false;
|
||||
|
@ -1,3 +1,4 @@
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
@ -13,7 +14,15 @@ class Extended_PostInit_EventHandlers {
|
||||
class Extended_Init_EventHandlers {
|
||||
class ACE_SandbagObject {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DEFUNC(dragging,initObject));
|
||||
init = QUOTE(_this call EFUNC(dragging,initObject));
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_Killed_EventHandlers {
|
||||
class CAManBase {
|
||||
class ADDON {
|
||||
killed = QUOTE(_this call FUNC(handleKilled));
|
||||
};
|
||||
};
|
||||
};
|
@ -1,14 +1,15 @@
|
||||
|
||||
class CfgVehicles {
|
||||
class Man;
|
||||
class CAManBase: Man {
|
||||
class ACE_SelfActions {
|
||||
class ACE_Sandbags {
|
||||
class GVAR(place) {
|
||||
displayName = CSTRING(DeploySandbag);
|
||||
condition = QUOTE(call FUNC(canDeploy));
|
||||
//wait a frame to handle "Do When releasing action menu key" option:
|
||||
statement = QUOTE([ARR_2({_this call FUNC(deploy)}, [])] call EFUNC(common,execNextFrame));
|
||||
condition = QUOTE(_this call FUNC(canDeploy));
|
||||
//wait a frame to handle "Do When releasing action menu key" option
|
||||
statement = QUOTE([ARR_2({_this call FUNC(deploy)},_this)] call EFUNC(common,execNextFrame));
|
||||
exceptions[] = {"isNotSwimming"};
|
||||
showDisabled = 1;
|
||||
showDisabled = 0;
|
||||
priority = 4;
|
||||
icon = PATHTOF(UI\icon_sandbag_ca.paa);
|
||||
};
|
||||
@ -26,8 +27,8 @@ class CfgVehicles {
|
||||
MACRO_ADDITEM(ACE_Sandbag_empty,1);
|
||||
};
|
||||
};
|
||||
/*
|
||||
class ACE_Item_Sandbag: Item_Base_F {
|
||||
|
||||
/*class ACE_Item_Sandbag: Item_Base_F {
|
||||
author = ECSTRING(common,ACETeam);
|
||||
scope = 2;
|
||||
scopeCurator = 2;
|
||||
@ -39,8 +40,8 @@ class CfgVehicles {
|
||||
count = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
*/
|
||||
};*/
|
||||
|
||||
class thingX;
|
||||
class ACE_SandbagObject: thingX {
|
||||
author = ECSTRING(common,ACETeam);
|
||||
@ -55,10 +56,10 @@ class CfgVehicles {
|
||||
nameSound = "Bunker";
|
||||
icon = PATHTOF(UI\icon_sandbag_ca.paa);
|
||||
accuracy = 1000;
|
||||
|
||||
destrType = "DestructDefault";
|
||||
|
||||
class DestructionEffects {};
|
||||
|
||||
class Damage {
|
||||
tex[] = {};
|
||||
mat[] = {
|
||||
@ -67,28 +68,19 @@ class CfgVehicles {
|
||||
"z\ace\addons\sandbag\data\bag_destruct.rvmat"
|
||||
};
|
||||
};
|
||||
|
||||
class ACE_Actions {
|
||||
class ACE_MainActions {
|
||||
selection = "";
|
||||
distance = 5;
|
||||
condition = "true";
|
||||
|
||||
class ACE_PickUp {
|
||||
selection = "";
|
||||
displayName = CSTRING(PICKUPSB);
|
||||
distance = 4;
|
||||
condition = QUOTE(!(_player getVariable [ARR_2('ace_sandbag_usingSandbag',false)]));
|
||||
statement = QUOTE([ARR_2(_target,_player)] call FUNC(pickup));
|
||||
showDisabled = 0;
|
||||
exceptions[] = {};
|
||||
priority = 5;
|
||||
icon = PATHTOF(UI\icon_sandbag_ca.paa);
|
||||
};
|
||||
class ACE_Carry {
|
||||
selection = "";
|
||||
displayName = CSTRING(CARRYSB);
|
||||
distance = 4;
|
||||
condition = QUOTE(!(_player getVariable [ARR_2('ace_sandbag_usingSandbag',false)]));
|
||||
statement = QUOTE([ARR_2(_target,_player)] call FUNC(carry));
|
||||
condition = QUOTE(!(_player getVariable [ARR_2(QUOTE(QGVAR(isUsingSandbag)),false)]));
|
||||
statement = QUOTE([ARR_2(_player,_target)] call FUNC(pickup));
|
||||
showDisabled = 0;
|
||||
exceptions[] = {};
|
||||
priority = 5;
|
||||
@ -97,6 +89,7 @@ class CfgVehicles {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class ACE_SandbagObject_NoGeo: ACE_SandbagObject {
|
||||
scope = 1;
|
||||
model = PATHTOF(data\ace_sandbag_nogeo.p3d);
|
||||
|
@ -1,15 +1,27 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
GVAR(placer) = objNull;
|
||||
if (isServer) then {
|
||||
// Cancel deploy on hard disconnection. Function is identical to killed
|
||||
addMissionEventHandler ["HandleDisconnect", {_this call FUNC(handleKilled)}];
|
||||
};
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
GVAR(sandBag) = objNull;
|
||||
GVAR(deployPFH) = -1;
|
||||
GVAR(deployDirection) = 0;
|
||||
|
||||
// Cancel deploy sandbag if interact menu opened
|
||||
["interactMenuOpened", {
|
||||
if (GVAR(deployPFH) != -1 && {!isNull (GVAR(sandBag))}) then {
|
||||
call FUNC(deployCancel);
|
||||
};
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
[{_this call FUNC(handleScrollWheel)}] call EFUNC(common,addScrollWheelEventHandler);
|
||||
|
||||
[{_this call DFUNC(handleScrollWheel)}] call EFUNC(common,addScrollWheelEventHandler);
|
||||
// Cancel deploy sandbag if interact menu opened
|
||||
["interactMenuOpened", {[ACE_player] call FUNC(handleInteractMenuOpened)}] call EFUNC(common,addEventHandler);
|
||||
|
||||
// Cancel deploy on player change. This does work when returning to lobby, but not when hard disconnecting.
|
||||
["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
|
||||
["playerInventoryChanged", {_this call FUNC(handlePlayerInventoryChanged)}] call EFUNC(common,addEventhandler);
|
||||
["playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
|
||||
|
||||
// handle waking up dragged unit and falling unconscious while dragging
|
||||
["medical_onUnconscious", {_this call FUNC(handleUnconscious)}] call EFUNC(common,addEventhandler);
|
||||
|
||||
//@todo Captivity?
|
||||
|
@ -3,12 +3,15 @@
|
||||
ADDON = false;
|
||||
|
||||
PREP(canDeploy);
|
||||
PREP(carry);
|
||||
PREP(deploy);
|
||||
PREP(deployCancel);
|
||||
PREP(deployConfirm);
|
||||
PREP(drop);
|
||||
PREP(handleInteractMenuOpened);
|
||||
PREP(handleKilled);
|
||||
PREP(handlePlayerChanged);
|
||||
PREP(handlePlayerInventoryChanged);
|
||||
PREP(handleScrollWheel);
|
||||
PREP(handleUnconscious);
|
||||
PREP(pickup);
|
||||
|
||||
ADDON = true;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
* Author: Ruthberg, commy2
|
||||
* Checks if the player can deploy a sandbag
|
||||
*
|
||||
* Arguments:
|
||||
@ -9,7 +9,7 @@
|
||||
* Can deploy <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_sandbag_fnc_canDeploy
|
||||
* [ACE_player] call ace_sandbag_fnc_canDeploy
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
@ -17,13 +17,13 @@
|
||||
|
||||
#define SURFACE_BLACKLIST ["water", "concrete", "tarmac", "wood", "metal", "roof_tin", "roof_tiles", "wood_int", "concrete_int", "tiles_int", "metal_int", "stony", "rock", "int_concrete", "int_tiles", "int_wood", "tiling", "wavymetal", "int_metal"]
|
||||
|
||||
if !([ACE_player, "ACE_Sandbag_empty"] call EFUNC(common,hasItem)) exitWith { false };
|
||||
if (ACE_player getVariable [QGVAR(usingSandbag), false]) exitWith { false };
|
||||
if ((getPosATL ACE_player select 2) - (getPos ACE_player select 2) > 1E-5) exitWith { false };
|
||||
params ["_unit"];
|
||||
|
||||
if !("ACE_Sandbag_empty" in items _unit) exitWith {false};
|
||||
|
||||
private ["_surfaceClass", "_surfaceType"];
|
||||
|
||||
_surfaceClass = ([surfaceType (position ACE_player), "#"] call CBA_fnc_split) select 1;
|
||||
_surfaceClass = (surfaceType getPosASL _unit) select [1];
|
||||
_surfaceType = getText (configfile >> "CfgSurfaces" >> _surfaceClass >> "soundEnviron");
|
||||
|
||||
!(_surfaceType in SURFACE_BLACKLIST)
|
||||
|
@ -1,56 +0,0 @@
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
* Carry sandbag
|
||||
*
|
||||
* Arguments:
|
||||
* 0: sandbag <OBJECT>
|
||||
* 1: unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [_sandbag, _unit] call ace_sandbag_fnc_carry
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_sandbag", "_unit"];
|
||||
|
||||
_unit playActionNow "PutDown";
|
||||
|
||||
_unit setVariable [QGVAR(usingSandbag), true];
|
||||
[{
|
||||
params ["_sandbag", "_unit"];
|
||||
|
||||
GVAR(carrier) = ACE_player;
|
||||
|
||||
[GVAR(carrier), "ACE_Sandbag", true] call EFUNC(common,setForceWalkStatus);
|
||||
|
||||
deleteVehicle _sandbag;
|
||||
|
||||
GVAR(sandBag) = createVehicle ["ACE_SandbagObject_NoGeo", [0, 0, 0], [], 0, "NONE"];
|
||||
GVAR(sandBag) enableSimulationGlobal false;
|
||||
|
||||
// Force physx update
|
||||
{
|
||||
_x setPosASL (getPosASL _x);
|
||||
} count (GVAR(carrier) nearObjects ["ACE_SandbagObject", 5]);
|
||||
|
||||
GVAR(carryPFH) = [{
|
||||
if (GVAR(carrier) != ACE_player) exitWith {
|
||||
call FUNC(drop);
|
||||
};
|
||||
GVAR(sandBag) setPosASL ((eyePos ACE_player) vectorAdd (positionCameraToWorld [0, 0, 1] vectorDiff positionCameraToWorld [0, 0, 0]));
|
||||
GVAR(sandBag) setDir (GVAR(deployDirection) + getDir ACE_player);
|
||||
}, 0, []] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
[localize LSTRING(DropSandbag), "", ""] call EFUNC(interaction,showMouseHint);
|
||||
|
||||
GVAR(carrier) setVariable [QGVAR(drop),
|
||||
[GVAR(carrier), "DefaultAction",
|
||||
{GVAR(carryPFH) != -1 && !isNull (GVAR(sandBag))},
|
||||
{call FUNC(drop);}
|
||||
] call EFUNC(common,AddActionEventHandler)];
|
||||
}, [_sandbag, _unit], 1, 0.5] call EFUNC(common,waitAndExecute);
|
@ -1,47 +1,61 @@
|
||||
/*
|
||||
* Author: Garth 'L-H' de Wet, Ruthberg
|
||||
* Author: Garth 'L-H' de Wet, Ruthberg, edited by commy2 for better MP and eventual AI support
|
||||
* Starts the deploy process for sandbags.
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
* 0: unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_sandbag_fnc_deploy
|
||||
* [ACE_player] call ace_sandbag_fnc_deploy
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
closeDialog 0;
|
||||
params ["_unit"];
|
||||
|
||||
GVAR(placer) = ACE_player;
|
||||
// prevent the placing unit from running
|
||||
[_unit, "ACE_Sandbag", true] call EFUNC(common,setForceWalkStatus);
|
||||
|
||||
[GVAR(placer), "ACE_Sandbag", true] call EFUNC(common,setForceWalkStatus);
|
||||
// create the sandbag
|
||||
private "_sandBag";
|
||||
_sandBag = createVehicle ["ACE_SandbagObject_NoGeo", [0, 0, 0], [], 0, "NONE"];
|
||||
|
||||
GVAR(sandBag) = createVehicle ["ACE_SandbagObject_NoGeo", [0, 0, 0], [], 0, "NONE"];
|
||||
GVAR(sandBag) enableSimulationGlobal false;
|
||||
GVAR(sandBag) = _sandBag;
|
||||
|
||||
// prevent collisions with sandbag
|
||||
["enableSimulationGlobal", [_sandBag, false]] call EFUNC(common,serverEvent);
|
||||
|
||||
GVAR(deployDirection) = 0;
|
||||
|
||||
// pfh that runs while the deployment is in progress
|
||||
GVAR(deployPFH) = [{
|
||||
if (GVAR(placer) != ACE_player) exitWith {
|
||||
call FUNC(deployCancel);
|
||||
};
|
||||
GVAR(sandBag) setPosASL ((eyePos ACE_player) vectorAdd (positionCameraToWorld [0, 0, 1] vectorDiff positionCameraToWorld [0, 0, 0]));
|
||||
GVAR(sandBag) setDir (GVAR(deployDirection) + getDir ACE_player);
|
||||
}, 0, []] call CBA_fnc_addPerFrameHandler;
|
||||
(_this select 0) params ["_unit", "_sandBag"];
|
||||
|
||||
if (isNull _sandBag) exitWith {
|
||||
[_unit] call FUNC(deployCancel);
|
||||
};
|
||||
|
||||
_sandBag setPosASL (eyePos _unit vectorAdd (positionCameraToWorld [0, 0, 1] vectorDiff positionCameraToWorld [0, 0, 0]));
|
||||
_sandBag setDir (GVAR(deployDirection) + getDir _unit);
|
||||
}, 0, [_unit, _sandBag]] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
// add mouse button action and hint
|
||||
[localize LSTRING(ConfirmDeployment), localize LSTRING(CancelDeployment), localize LSTRING(ScrollAction)] call EFUNC(interaction,showMouseHint);
|
||||
|
||||
GVAR(placer) setVariable [QGVAR(Deploy),
|
||||
[GVAR(placer), "DefaultAction",
|
||||
{GVAR(deployPFH) != -1 && !isNull (GVAR(sandBag))},
|
||||
{call FUNC(deployConfirm);}
|
||||
] call EFUNC(common,AddActionEventHandler)];
|
||||
_unit setVariable [QGVAR(Deploy), [
|
||||
_unit, "DefaultAction",
|
||||
{GVAR(deployPFH) != -1},
|
||||
{[_this select 0] call FUNC(deployConfirm)}
|
||||
] call EFUNC(common,addActionEventHandler)];
|
||||
|
||||
GVAR(placer) setVariable [QGVAR(Cancel),
|
||||
[GVAR(placer), "zoomtemp",
|
||||
{GVAR(deployPFH) != -1 && !isNull (GVAR(sandBag))},
|
||||
{call FUNC(deployCancel);}
|
||||
] call EFUNC(common,AddActionEventHandler)];
|
||||
_unit setVariable [QGVAR(Cancel), [
|
||||
_unit, "zoomtemp",
|
||||
{GVAR(deployPFH) != -1},
|
||||
{[_this select 0] call FUNC(deployCancel)}
|
||||
] call EFUNC(common,addActionEventHandler)];
|
||||
|
||||
_unit setVariable [QGVAR(isDeploying), true, true];
|
||||
|
@ -1,35 +1,36 @@
|
||||
/*
|
||||
* Author: Garth 'L-H' de Wet, Ruthberg
|
||||
* Author: Garth 'L-H' de Wet, Ruthberg, edited by commy2 for better MP and eventual AI support
|
||||
* Cancels sandbag deployment
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
* 0: unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_sandbag_fnc_deployCancel
|
||||
* [ACE_player] call ace_sandbag_fnc_deployCancel
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (isNull GVAR(placer)) exitWith {};
|
||||
params ["_unit"];
|
||||
|
||||
[GVAR(deployPFH)] call cba_fnc_removePerFrameHandler;
|
||||
// enable running again
|
||||
[_unit, "ACE_Sandbag", false] call EFUNC(common,setForceWalkStatus);
|
||||
|
||||
if (!isNull (GVAR(sandBag))) then {
|
||||
// delete placement dummy
|
||||
deleteVehicle GVAR(sandBag);
|
||||
};
|
||||
|
||||
[GVAR(placer), "ACE_Sandbag", false] call EFUNC(Common,setForceWalkStatus);
|
||||
// remove deployment pfh
|
||||
[GVAR(deployPFH)] call CBA_fnc_removePerFrameHandler;
|
||||
GVAR(deployPFH) = -1;
|
||||
|
||||
// remove mouse button actions
|
||||
call EFUNC(interaction,hideMouseHint);
|
||||
[GVAR(placer), "DefaultAction", GVAR(placer) getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler);
|
||||
[GVAR(placer), "zoomtemp", GVAR(placer) getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler);
|
||||
|
||||
GVAR(placer) addItem "ACE_Sandbag_empty";
|
||||
[_unit, "DefaultAction", _unit getVariable [QGVAR(Deploy), -1]] call EFUNC(common,removeActionEventHandler);
|
||||
[_unit, "zoomtemp", _unit getVariable [QGVAR(Cancel), -1]] call EFUNC(common,removeActionEventHandler);
|
||||
|
||||
GVAR(sandBag) = objNull;
|
||||
GVAR(placer) = objNull;
|
||||
_unit setVariable [QGVAR(isDeploying), false, true];
|
||||
|
@ -1,51 +1,59 @@
|
||||
/*
|
||||
* Author: Garth 'L-H' de Wet, Ruthberg
|
||||
* Author: Garth 'L-H' de Wet, Ruthberg, edited by commy2 for better MP and eventual AI support
|
||||
* Confirms sandbag deployment
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
* 0: unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_sandbag_fnc_deployConfirm
|
||||
* [ACE_player] call ace_sandbag_fnc_deployConfirm
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (isNull GVAR(sandBag) || isNull GVAR(placer)) exitWith {};
|
||||
params ["_unit"];
|
||||
|
||||
[GVAR(deployPFH)] call cba_fnc_removePerFrameHandler;
|
||||
// enable running again
|
||||
[_unit, "ACE_Sandbag", false] call EFUNC(common,setForceWalkStatus);
|
||||
|
||||
[GVAR(placer), "ACE_Sandbag", false] call EFUNC(Common,setForceWalkStatus);
|
||||
[GVAR(placer), "DefaultAction", GVAR(placer) getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler);
|
||||
[GVAR(placer), "zoomtemp", GVAR(placer) getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler);
|
||||
// remove sandbag from inventory
|
||||
_unit removeItem "ACE_Sandbag_empty";
|
||||
|
||||
call EFUNC(interaction,hideMouseHint);
|
||||
|
||||
GVAR(placer) playActionNow "PutDown";
|
||||
|
||||
GVAR(placer) setVariable [QGVAR(usingSandbag), true];
|
||||
// delete placement dummy and create real sandbag
|
||||
[{
|
||||
_this setVariable [QGVAR(usingSandbag), false];
|
||||
}, GVAR(placer), 1.5, 0.5] call EFUNC(common,waitAndExecute);
|
||||
if (isNull GVAR(sandBag)) exitWith {};
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
private ["_position", "_direction", "_sandBag"];
|
||||
|
||||
[{
|
||||
private ["_sandBag", "_position", "_direction"];
|
||||
_position = getPosASL GVAR(sandBag);
|
||||
_direction = getDir GVAR(sandBag);
|
||||
|
||||
deleteVehicle GVAR(sandBag);
|
||||
|
||||
_sandBag = createVehicle ["ACE_SandbagObject", [0, 0, 0], [], 0, "NONE"];
|
||||
_sandBag enableSimulationGlobal true;
|
||||
_sandBag setPosASL _position;
|
||||
_sandBag setDir _direction;
|
||||
|
||||
GVAR(placer) removeItem "ACE_Sandbag_empty";
|
||||
|
||||
GVAR(sandBag) = objNull;
|
||||
GVAR(placer) = objNull;
|
||||
}, [], 1.0, 0.5] call EFUNC(common,waitAndExecute);
|
||||
}, [_unit], 1] call EFUNC(common,waitAndExecute);
|
||||
|
||||
// remove deployment pfh
|
||||
[GVAR(deployPFH)] call CBA_fnc_removePerFrameHandler;
|
||||
GVAR(deployPFH) = -1;
|
||||
|
||||
// remove mouse button actions
|
||||
call EFUNC(interaction,hideMouseHint);
|
||||
|
||||
[_unit, "DefaultAction", _unit getVariable [QGVAR(Deploy), -1]] call EFUNC(common,removeActionEventHandler);
|
||||
[_unit, "zoomtemp", _unit getVariable [QGVAR(Cancel), -1]] call EFUNC(common,removeActionEventHandler);
|
||||
|
||||
// play animation
|
||||
_unit playActionNow "PutDown";
|
||||
|
||||
_unit setVariable [QGVAR(isDeploying), false, true];
|
||||
|
@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Author: Garth 'L-H' de Wet, Ruthberg
|
||||
* Drop sandbag
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_sandbag_fnc_deployCancel
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (isNull GVAR(sandBag) || isNull GVAR(carrier)) exitWith {};
|
||||
|
||||
[GVAR(carryPFH)] call cba_fnc_removePerFrameHandler;
|
||||
|
||||
[GVAR(carrier), "ACE_Sandbag", false] call EFUNC(Common,setForceWalkStatus);
|
||||
[GVAR(carrier), "DefaultAction", GVAR(carrier) getVariable [QGVAR(drop), -1]] call EFUNC(Common,removeActionEventHandler);
|
||||
|
||||
call EFUNC(interaction,hideMouseHint);
|
||||
|
||||
GVAR(carrier) playActionNow "PutDown";
|
||||
|
||||
[{
|
||||
_this setVariable [QGVAR(usingSandbag), false];
|
||||
}, GVAR(carrier), 1.5, 0.5] call EFUNC(common,waitAndExecute);
|
||||
|
||||
[{
|
||||
private ["_sandBag", "_position", "_direction"];
|
||||
_position = getPosASL GVAR(sandBag);
|
||||
_direction = getDir GVAR(sandBag);
|
||||
|
||||
deleteVehicle GVAR(sandBag);
|
||||
|
||||
_sandBag = createVehicle ["ACE_SandbagObject", [0, 0, 0], [], 0, "NONE"];
|
||||
_sandBag enableSimulationGlobal true;
|
||||
_sandBag setPosASL _position;
|
||||
_sandBag setDir _direction;
|
||||
|
||||
GVAR(sandBag) = objNull;
|
||||
GVAR(carrier) = objNull;
|
||||
}, [], 1.0, 0.5] call EFUNC(common,waitAndExecute);
|
19
addons/sandbag/functions/fnc_handleInteractMenuOpened.sqf
Normal file
19
addons/sandbag/functions/fnc_handleInteractMenuOpened.sqf
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Handle opening of interaction menu.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
if (_unit getVariable [QGVAR(isDeploying), false]) then {
|
||||
[_unit] call FUNC(deployCancel);
|
||||
};
|
19
addons/sandbag/functions/fnc_handleKilled.sqf
Normal file
19
addons/sandbag/functions/fnc_handleKilled.sqf
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Handle death.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
if (_unit getVariable [QGVAR(isDeploying), false]) then {
|
||||
[_unit] call FUNC(deployCancel);
|
||||
};
|
24
addons/sandbag/functions/fnc_handlePlayerChanged.sqf
Normal file
24
addons/sandbag/functions/fnc_handlePlayerChanged.sqf
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Handle player changes.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: New Player Unit <OBJECT>
|
||||
* 1: Old Player Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_newPlayer", "_oldPlayer"];
|
||||
|
||||
if (_newPlayer getVariable [QGVAR(isDeploying), false]) then {
|
||||
[_newPlayer] call FUNC(deployCancel);
|
||||
};
|
||||
|
||||
if (_oldPlayer getVariable [QGVAR(isDeploying), false]) then {
|
||||
[_oldPlayer] call FUNC(deployCancel);
|
||||
};
|
@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Handle the InventoryChanged event.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
* 1: Weapon <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
if (_unit getVariable [QGVAR(isDeploying), false]) then {
|
||||
if !("ACE_Sandbag_empty" in items _unit) then {
|
||||
[_unit] call FUNC(deployCancel);
|
||||
};
|
||||
};
|
19
addons/sandbag/functions/fnc_handleUnconscious.sqf
Normal file
19
addons/sandbag/functions/fnc_handleUnconscious.sqf
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Handle unconsciousness.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
if (_unit getVariable [QGVAR(isDeploying), false]) then {
|
||||
[_unit] call FUNC(deployCancel);
|
||||
};
|
@ -3,27 +3,32 @@
|
||||
* Pick up sandbag
|
||||
*
|
||||
* Arguments:
|
||||
* 0: sandbag <OBJECT>
|
||||
* 1: unit <OBJECT>
|
||||
* 0: unit <OBJECT>
|
||||
* 1: sandbag <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [_sandbag, _unit] call ace_sandbag_fnc_pickup
|
||||
* [_unit, _sandbag] call ace_sandbag_fnc_pickup
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_sandbag", "_unit"];
|
||||
params ["_unit", "_sandbag"];
|
||||
|
||||
_unit playActionNow "PutDown";
|
||||
|
||||
_unit setVariable [QGVAR(usingSandbag), true];
|
||||
_unit setVariable [QGVAR(isUsingSandbag), true];
|
||||
|
||||
[{
|
||||
params ["_sandbag", "_unit"];
|
||||
_unit setVariable [QGVAR(usingSandbag), false];
|
||||
params ["_unit", "_sandbag"];
|
||||
|
||||
_unit setVariable [QGVAR(isUsingSandbag), false];
|
||||
|
||||
if (isNull _sandbag) exitWith {};
|
||||
|
||||
deletevehicle _sandbag;
|
||||
|
||||
// Force physx update
|
||||
@ -32,4 +37,4 @@ _unit setVariable [QGVAR(usingSandbag), true];
|
||||
} count (_unit nearObjects ["ACE_SandbagObject", 5]);
|
||||
|
||||
[_unit, "ACE_Sandbag_empty"] call EFUNC(common,addToInventory);
|
||||
}, [_sandbag, _unit], 1.5, 0.5] call EFUNC(common,waitAndExecute);
|
||||
}, [_unit, _sandbag], 1.5] call EFUNC(common,waitAndExecute);
|
||||
|
@ -146,16 +146,16 @@
|
||||
<Portuguese>Aqui não tem areia</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Sandbag_ScrollAction">
|
||||
<English>+ Modifier, rotates</English>
|
||||
<German>+ Modifikator, drehen</German>
|
||||
<Spanish>+ Modificador, girar</Spanish>
|
||||
<French>+ Modificateur, tourner</French>
|
||||
<Italian>+ Modificatore, rotazione</Italian>
|
||||
<Czech>+ Modifikátor, otočit</Czech>
|
||||
<Hungarian>+ Változtatás, forgatás</Hungarian>
|
||||
<Polish>+ Modyfikator, obrót</Polish>
|
||||
<Portuguese>+ Modificador, rotaciona</Portuguese>
|
||||
<Russian>+ Bращать</Russian>
|
||||
<English>+Ctrl rotate</English>
|
||||
<German>+Strg drehen</German>
|
||||
<Spanish>+Ctrl girar</Spanish>
|
||||
<French>+Ctrl tourner</French>
|
||||
<Italian>+Ctrl rotazione</Italian>
|
||||
<Czech>+Ctrl otočit</Czech>
|
||||
<Hungarian>+Ctrl forgatás</Hungarian>
|
||||
<Polish>+Ctrl obrót</Polish>
|
||||
<Portuguese>+Ctrl rotaciona</Portuguese>
|
||||
<Russian>+Ctrl Bращать</Russian>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
@ -1,3 +1,4 @@
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE( call COMPILE_FILE(XEH_preInit) );
|
||||
@ -9,3 +10,11 @@ class Extended_PostInit_EventHandlers {
|
||||
init = QUOTE( call COMPILE_FILE(XEH_postInit) );
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_Killed_EventHandlers {
|
||||
class CAManBase {
|
||||
class ADDON {
|
||||
killed = QUOTE(_this call FUNC(handleKilled));
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -5,8 +5,8 @@ class CfgVehicles {
|
||||
class ACE_SelfActions {
|
||||
class ACE_TacticalLadders {
|
||||
displayName = CSTRING(Deploy);
|
||||
condition = QUOTE((backpack ACE_player) == QUOTE(QUOTE(ACE_TacticalLadder_Pack)));
|
||||
statement = QUOTE(call FUNC(deployTL));
|
||||
condition = QUOTE(backpack _player == 'ACE_TacticalLadder_Pack');
|
||||
statement = QUOTE([_player] call FUNC(deployTL));
|
||||
exceptions[] = {};
|
||||
showDisabled = 1;
|
||||
priority = 4;
|
||||
@ -33,7 +33,7 @@ class CfgVehicles {
|
||||
};
|
||||
|
||||
class House;
|
||||
class ACE_Tactical_Ladder: House {
|
||||
class ACE_TacticalLadder: House {
|
||||
XEH_ENABLED;
|
||||
displayName = CSTRING(DisplayName);
|
||||
class DestructionEffects {};
|
||||
@ -42,6 +42,7 @@ class CfgVehicles {
|
||||
autocenter = 0;
|
||||
featureSize = 12;
|
||||
ladders[] = {{"start","end"}};
|
||||
|
||||
class AnimationSources {
|
||||
class rotate {
|
||||
source = "user";
|
||||
@ -62,28 +63,31 @@ class CfgVehicles {
|
||||
class extract_10: extract_1 {};
|
||||
class extract_11: extract_1 {};
|
||||
};
|
||||
|
||||
class ACE_Actions {
|
||||
class ACE_MainActions {
|
||||
selection = "roadway";
|
||||
distance = 5;
|
||||
condition = "true";
|
||||
|
||||
class ACE_PickUp {
|
||||
selection = "";
|
||||
displayName = CSTRING(Pickup);
|
||||
distance = 4;
|
||||
condition = QUOTE((backpack ACE_player) == '');
|
||||
statement = QUOTE([ARR_2(_target,_player)] call FUNC(pickupTL));
|
||||
statement = QUOTE([ARR_2(_player,_target)] call FUNC(pickupTL));
|
||||
showDisabled = 0;
|
||||
exceptions[] = {};
|
||||
priority = 5;
|
||||
};
|
||||
|
||||
class ACE_Position {
|
||||
selection = "";
|
||||
displayName = CSTRING(Position);
|
||||
distance = 4;
|
||||
condition = "true";
|
||||
//wait a frame to handle "Do When releasing action menu key" option:
|
||||
statement = QUOTE([ARR_2({_this call FUNC(positionTL)}, [ARR_2(_target,_player)])] call EFUNC(common,execNextFrame));
|
||||
statement = QUOTE([ARR_2({_this call FUNC(positionTL)},[ARR_2(_player,_target)])] call EFUNC(common,execNextFrame));
|
||||
showDisabled = 0;
|
||||
exceptions[] = {};
|
||||
priority = 5;
|
||||
|
@ -1,15 +1,28 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
GVAR(ladder) = objNull;
|
||||
GVAR(cancelTime) = 0;
|
||||
GVAR(currentStep) = 3;
|
||||
GVAR(currentAngle) = 0;
|
||||
|
||||
// Cancel tactical ladder deployment if the interact menu is opened
|
||||
["interactMenuOpened", {
|
||||
/*["interactMenuOpened", {
|
||||
if ((ACE_time > GVAR(cancelTime)) && !isNull GVAR(ladder)) then {
|
||||
GVAR(ladder) call FUNC(cancelTLdeploy);
|
||||
};
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
}] call EFUNC(common,addEventHandler);*/
|
||||
|
||||
[{(_this select 0) call FUNC(handleScrollWheel);}] call EFUNC(Common,addScrollWheelEventHandler);
|
||||
// Cancel adjustment if interact menu opens
|
||||
["interactMenuOpened", {[ACE_player] call FUNC(handleInteractMenuOpened)}] call EFUNC(common,addEventHandler);
|
||||
|
||||
[{_this call FUNC(handleScrollWheel)}] call EFUNC(common,addScrollWheelEventHandler);
|
||||
|
||||
// Cancel adjusting on player change.
|
||||
["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
|
||||
["playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
|
||||
|
||||
// handle falling unconscious
|
||||
["medical_onUnconscious", {_this call FUNC(handleUnconscious)}] call EFUNC(common,addEventhandler);
|
||||
|
||||
// @todo captivity?
|
||||
|
@ -5,7 +5,11 @@ ADDON = false;
|
||||
PREP(cancelTLdeploy);
|
||||
PREP(confirmTLdeploy);
|
||||
PREP(deployTL);
|
||||
PREP(handleKilled);
|
||||
PREP(handleInteractMenuOpened);
|
||||
PREP(handlePlayerChanged);
|
||||
PREP(handleScrollWheel);
|
||||
PREP(handleUnconscious);
|
||||
PREP(pickupTL);
|
||||
PREP(positionTL);
|
||||
|
||||
|
@ -1,9 +1,10 @@
|
||||
/*
|
||||
* Author: Rocko, Ruthberg
|
||||
* Author: Rocko, Ruthberg, commy2
|
||||
* Cancel tactical ladder deployment
|
||||
*
|
||||
* Arguments:
|
||||
* 0: ladder <OBJECT>
|
||||
* 0: unit <OBJECT>
|
||||
* 1: ladder <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
@ -17,16 +18,23 @@
|
||||
|
||||
#define __ANIMS ["extract_1","extract_2","extract_3","extract_4","extract_5","extract_6","extract_7","extract_8","extract_9","extract_10","extract_11"]
|
||||
|
||||
params ["_ladder"];
|
||||
params ["_unit", "_ladder"];
|
||||
|
||||
// enable running again
|
||||
[_unit, "ACE_Ladder", false] call EFUNC(common,setForceWalkStatus);
|
||||
|
||||
detach _ladder;
|
||||
|
||||
_ladder animate ["rotate", 0];
|
||||
|
||||
{
|
||||
_ladder animate [_x, 0];
|
||||
} count __ANIMS;
|
||||
|
||||
// remove mouse buttons and hint
|
||||
call EFUNC(interaction,hideMouseHint);
|
||||
[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler);
|
||||
[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler);
|
||||
|
||||
[_unit, "DefaultAction", _unit getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler);
|
||||
[_unit, "zoomtemp", _unit getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler);
|
||||
|
||||
GVAR(ladder) = objNull;
|
||||
|
@ -1,9 +1,10 @@
|
||||
/*
|
||||
* Author: Rocko, Ruthberg
|
||||
* Author: Rocko, Ruthberg, commy2
|
||||
* Confirm tactical ladder deployment
|
||||
*
|
||||
* Arguments:
|
||||
* 0: ladder <OBJECT>
|
||||
* 0: unit <OBJECT>
|
||||
* 1: ladder <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Success <BOOL>
|
||||
@ -15,18 +16,26 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_ladder"];
|
||||
params ["_unit", "_ladder"];
|
||||
|
||||
// enable running again
|
||||
[_unit, "ACE_Ladder", false] call EFUNC(common,setForceWalkStatus);
|
||||
|
||||
private ["_pos1", "_pos2"];
|
||||
_pos1 = getPosASL GVAR(ladder);
|
||||
_pos2 = (GVAR(ladder) modelToWorld (GVAR(ladder) selectionPosition "check2")) call EFUNC(common,positionToASL);
|
||||
if (lineIntersects [_pos1, _pos2, GVAR(ladder)]) exitWith { false };
|
||||
|
||||
call EFUNC(interaction,hideMouseHint);
|
||||
[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler);
|
||||
[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler);
|
||||
_pos1 = getPosASL _ladder;
|
||||
_pos2 = AGLToASL (_ladder modelToWorld (_ladder selectionPosition "check2"));
|
||||
|
||||
if (lineIntersects [_pos1, _pos2, _ladder]) exitWith {false};
|
||||
|
||||
detach _ladder;
|
||||
|
||||
// remove mouse buttons and hint
|
||||
call EFUNC(interaction,hideMouseHint);
|
||||
|
||||
[_unit, "DefaultAction", _unit getVariable [QGVAR(Deploy), -1]] call EFUNC(common,removeActionEventHandler);
|
||||
[_unit, "zoomtemp", _unit getVariable [QGVAR(Cancel), -1]] call EFUNC(common,removeActionEventHandler);
|
||||
|
||||
GVAR(ladder) = objNull;
|
||||
|
||||
true
|
||||
|
@ -3,32 +3,35 @@
|
||||
* Deploy tactical ladder
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
* 0: unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_tacticalladder_fnc_deployTL
|
||||
* [_unit] call ace_tacticalladder_fnc_deployTL
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if ((backpack ACE_player) != "ACE_TacticalLadder_Pack") exitWith {};
|
||||
params ["_unit"];
|
||||
|
||||
if (backpack _unit != 'ACE_TacticalLadder_Pack') exitWith {};
|
||||
|
||||
removeBackpack _unit;
|
||||
|
||||
private ["_pos", "_offset", "_ladder"];
|
||||
|
||||
removeBackpack ACE_player;
|
||||
_pos = _unit modelToWorld [0,0,0];
|
||||
_offset = if ((_unit call CBA_fnc_getUnitAnim select 0) == "prone") then { 1 } else {0.8};
|
||||
|
||||
_pos = ACE_player modelToWorld [0,0,0];
|
||||
_offset = if ((ACE_player call CBA_fnc_getUnitAnim select 0) == "prone") then { 1 } else {0.8};
|
||||
_pos set [0, (_pos select 0) + (sin (direction ACE_player) * _offset)];
|
||||
_pos set [1, (_pos select 1) + (cos (direction ACE_player) * _offset)];
|
||||
_pos set [2, [ACE_player] call CBA_fnc_realHeight];
|
||||
_pos set [0, (_pos select 0) + (sin getDir _unit) * _offset];
|
||||
_pos set [1, (_pos select 1) + (cos getDir _unit) * _offset];
|
||||
_pos set [2, [_unit] call CBA_fnc_realHeight];
|
||||
|
||||
_ladder = "ACE_Tactical_Ladder" createVehicle _pos;
|
||||
_ladder = "ACE_TacticalLadder" createVehicle _pos;
|
||||
_ladder setPos _pos;
|
||||
_ladder setDir (direction ACE_player);
|
||||
_ladder setDir getDir _unit;
|
||||
|
||||
ACE_player reveal _ladder;
|
||||
_unit reveal _ladder;
|
||||
|
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Handle opening of interaction menu.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
if (!isNull (GETMVAR(GVAR(ladder),objNull)) && {GVAR(ladder) in attachedObjects _unit}) then {
|
||||
[_unit, GVAR(ladder)] call FUNC(cancelTLdeploy);
|
||||
};
|
19
addons/tacticalladder/functions/fnc_handleKilled.sqf
Normal file
19
addons/tacticalladder/functions/fnc_handleKilled.sqf
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Handle death.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
if (!isNull (GETMVAR(ladder,objNull)) && {GVAR(ladder) in attachedObjects _unit}) then {
|
||||
[_unit, GVAR(ladder)] call FUNC(cancelTLdeploy);
|
||||
};
|
26
addons/tacticalladder/functions/fnc_handlePlayerChanged.sqf
Normal file
26
addons/tacticalladder/functions/fnc_handlePlayerChanged.sqf
Normal file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Handle player changes.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: New Player Unit <OBJECT>
|
||||
* 1: Old Player Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (isNull (GETMVAR(ladder,objNull))) exitWith {};
|
||||
|
||||
params ["_newPlayer", "_oldPlayer"];
|
||||
|
||||
if (GVAR(ladder) in attachedObjects _newPlayer) then {
|
||||
[_newPlayer, GVAR(ladder)] call FUNC(cancelTLdeploy);
|
||||
};
|
||||
|
||||
if (GVAR(ladder) in attachedObjects _oldPlayer) then {
|
||||
[_oldPlayer, GVAR(ladder)] call FUNC(cancelTLdeploy);
|
||||
};
|
@ -41,7 +41,7 @@ if (GETMVAR(ACE_Modifier,0) == 0) then {
|
||||
};
|
||||
} else {
|
||||
// Tilting
|
||||
GVAR(currentAngle) = 0 max (GVAR(currentAngle) + _scroll) min 90;
|
||||
GVAR(currentAngle) = 0 max (GVAR(currentAngle) + _scroll) min 30;
|
||||
GVAR(ladder) animate ["rotate", GVAR(currentAngle)];
|
||||
};
|
||||
|
||||
|
19
addons/tacticalladder/functions/fnc_handleUnconscious.sqf
Normal file
19
addons/tacticalladder/functions/fnc_handleUnconscious.sqf
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Handle unconsciousness.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
if (!isNull (GETMVAR(ladder,objNull)) && {GVAR(ladder) in attachedObjects _unit}) then {
|
||||
[_unit, GVAR(ladder)] call FUNC(cancelTLdeploy);
|
||||
};
|
@ -1,26 +1,27 @@
|
||||
/*
|
||||
* Author: Rocko, Ruthberg
|
||||
* Author: Rocko, Ruthberg, commy2
|
||||
* Pick up tactical ladder
|
||||
*
|
||||
* Arguments:
|
||||
* 0: ladder <OBJECT>
|
||||
* 1: unit <OBJECT>
|
||||
* 0: unit <OBJECT>
|
||||
* 1: ladder <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Success <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [_ladder, _unit] call ace_tacticalladder_fnc_pickupTL
|
||||
* [_unit, _ladder] call ace_tacticalladder_fnc_pickupTL
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if ((backpack ACE_player) != "") exitWith { false };
|
||||
params ["_unit", "_ladder"];
|
||||
|
||||
params ["_ladder", "_unit"];
|
||||
if (backpack _unit != "") exitWith {false};
|
||||
|
||||
deleteVehicle _ladder;
|
||||
|
||||
_unit addBackpack "ACE_TacticalLadder_Pack";
|
||||
|
||||
true
|
||||
|
@ -3,14 +3,14 @@
|
||||
* Position tactical ladder
|
||||
*
|
||||
* Arguments:
|
||||
* 0: sandbag <OBJECT>
|
||||
* 1: unit <OBJECT>
|
||||
* 0: unit <OBJECT>
|
||||
* 1: ladder <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [_ladder, _unit] call ace_tacticalladder_fnc_positionTL
|
||||
* [_unit, _ladder] call ace_tacticalladder_fnc_positionTL
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
@ -18,13 +18,17 @@
|
||||
|
||||
#define __ANIMS ["extract_1","extract_2","extract_3","extract_4","extract_5","extract_6","extract_7","extract_8","extract_9","extract_10","extract_11"]
|
||||
|
||||
params ["_ladder", "_unit"];
|
||||
params ["_unit", "_ladder"];
|
||||
|
||||
// prevent the placing unit from running
|
||||
[_unit, "ACE_Ladder", true] call EFUNC(common,setForceWalkStatus);
|
||||
|
||||
{
|
||||
_ladder animate [_x, 0];
|
||||
} count __ANIMS;
|
||||
|
||||
_unit switchMove "amovpercmstpslowwrfldnon_player_idlesteady03";
|
||||
[_unit, "amovpercmstpslowwrfldnon_player_idlesteady03", 2] call EFUNC(common,doAnimation);
|
||||
|
||||
_ladder attachTo [_unit, [0, 0.75, 0], ""]; // Position ladder in front of player
|
||||
|
||||
_ladder animate ["rotate", 0];
|
||||
@ -37,16 +41,17 @@ GVAR(cancelTime) = ACE_time + 1; // Workaround to prevent accidental canceling
|
||||
GVAR(currentStep) = 3;
|
||||
GVAR(currentAngle) = 0;
|
||||
|
||||
// add mouse buttons and hints
|
||||
[localize LSTRING(Deploy), localize LSTRING(Drop), localize LSTRING(Adjust)] call EFUNC(interaction,showMouseHint);
|
||||
|
||||
ACE_player setVariable [QGVAR(Deploy),
|
||||
[ACE_player, "DefaultAction",
|
||||
_unit setVariable [QGVAR(Deploy), [
|
||||
_unit, "DefaultAction",
|
||||
{!isNull GVAR(ladder)},
|
||||
{GVAR(ladder) call FUNC(confirmTLdeploy);}
|
||||
] call EFUNC(common,AddActionEventHandler)];
|
||||
{[_this select 0, GVAR(ladder)] call FUNC(confirmTLdeploy)}
|
||||
] call EFUNC(common,addActionEventHandler)];
|
||||
|
||||
ACE_player setVariable [QGVAR(Cancel),
|
||||
[ACE_player, "zoomtemp",
|
||||
_unit setVariable [QGVAR(Cancel), [
|
||||
_unit, "zoomtemp",
|
||||
{!isNull GVAR(ladder)},
|
||||
{GVAR(ladder) call FUNC(cancelTLdeploy);}
|
||||
] call EFUNC(common,AddActionEventHandler)];
|
||||
{[_this select 0, GVAR(ladder)] call FUNC(cancelTLdeploy)}
|
||||
] call EFUNC(common,addActionEventHandler)];
|
||||
|
@ -38,15 +38,8 @@
|
||||
<Portuguese>Derrubar escada</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_TacticalLadder_Adjust">
|
||||
<English>Adjust ladder</English>
|
||||
<German>Leiter einstellen</German>
|
||||
<Polish>Reguluj drabinę</Polish>
|
||||
<Czech>Upravit žebřík</Czech>
|
||||
<Spanish>Ajustar escalera</Spanish>
|
||||
<Portuguese>Ajustar escada</Portuguese>
|
||||
<French>Régler l'échelle</French>
|
||||
<Hungarian>Létra állítása</Hungarian>
|
||||
<Russian>Выровнять лестницу</Russian>
|
||||
<English>Extend, +Ctrl tilt</English>
|
||||
<German>Ausfahren, +Strg kippen</German>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_TacticalLadder_Position">
|
||||
<English>Position ladder</English>
|
||||
|
@ -1,3 +1,4 @@
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE( call COMPILE_FILE(XEH_preInit) );
|
||||
@ -17,3 +18,11 @@ class Extended_Init_EventHandlers {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_Killed_EventHandlers {
|
||||
class CAManBase {
|
||||
class ADDON {
|
||||
killed = QUOTE(_this call FUNC(handleKilled));
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -2,7 +2,6 @@ class CfgVehicles {
|
||||
class Man;
|
||||
class CAManBase: Man {
|
||||
class ACE_SelfActions {
|
||||
class ACE_Equipment {
|
||||
class GVAR(place) {
|
||||
displayName = CSTRING(Placedown);
|
||||
condition = QUOTE([ARR_2(_player,'ACE_Tripod')] call EFUNC(common,hasItem));
|
||||
@ -13,7 +12,6 @@ class CfgVehicles {
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Item_Base_F;
|
||||
class ACE_Item_Tripod: Item_Base_F {
|
||||
@ -37,9 +35,13 @@ class CfgVehicles {
|
||||
class thingX;
|
||||
class ACE_TripodObject: thingX {
|
||||
XEH_ENABLED;
|
||||
EGVAR(dragging,canDrag) = 1;
|
||||
EGVAR(dragging,dragPosition[]) = {0,1,0};
|
||||
EGVAR(dragging,dragDirection) = 0;
|
||||
scope = 2;
|
||||
displayName = CSTRING(DisplayName);
|
||||
model = PATHTOF(data\sniper_tripod.p3d);
|
||||
|
||||
class AnimationSources {
|
||||
class slide_down_tripod {
|
||||
source = "user";
|
||||
@ -52,32 +54,32 @@ class CfgVehicles {
|
||||
class retract_leg_2: retract_leg_1 {};
|
||||
class retract_leg_3: retract_leg_2 {};
|
||||
};
|
||||
EGVAR(dragging,canDrag) = 1;
|
||||
EGVAR(dragging,dragPosition[]) = {0,1,0};
|
||||
EGVAR(dragging,dragDirection) = 0;
|
||||
|
||||
class ACE_Actions {
|
||||
class ACE_MainActions {
|
||||
selection = "";
|
||||
distance = 5;
|
||||
condition = "true";
|
||||
|
||||
class ACE_Pickup {
|
||||
selection = "";
|
||||
displayName = CSTRING(PickUp);
|
||||
distance = 5;
|
||||
condition = "true";
|
||||
statement = QUOTE([ARR_2(_target,_player)] call FUNC(pickup));
|
||||
statement = QUOTE([ARR_2(_player,_target)] call FUNC(pickup));
|
||||
showDisabled = 0;
|
||||
exceptions[] = {};
|
||||
priority = 5;
|
||||
icon = PATHTOF(UI\w_sniper_tripod_ca.paa);
|
||||
};
|
||||
|
||||
class ACE_Adjust {
|
||||
selection = "";
|
||||
displayName = CSTRING(Adjust);
|
||||
distance = 5;
|
||||
condition = "true";
|
||||
//wait a frame to handle "Do When releasing action menu key" option:
|
||||
statement = QUOTE([ARR_2({_this call FUNC(adjust)}, [_target])] call EFUNC(common,execNextFrame));
|
||||
statement = QUOTE([ARR_2({_this call FUNC(adjust)}, [ARR_2(_player,_target)])] call EFUNC(common,execNextFrame));
|
||||
showDisabled = 0;
|
||||
exceptions[] = {};
|
||||
priority = 5;
|
||||
|
@ -1,16 +1,21 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
GVAR(adjuster) = objNull;
|
||||
GVAR(adjusting) = false;
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
GVAR(adjustPFH) = -1;
|
||||
|
||||
GVAR(height) = 0;
|
||||
|
||||
// Cancel adjustment if interact menu opens
|
||||
["interactMenuOpened", {
|
||||
if (GVAR(adjustPFH) != -1 && GVAR(adjusting)) then {
|
||||
GVAR(adjusting) = false;
|
||||
};
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
["interactMenuOpened", {[ACE_player] call FUNC(handleInteractMenuOpened)}] call EFUNC(common,addEventHandler);
|
||||
|
||||
[{(_this select 0) call FUNC(handleScrollWheel);}] call EFUNC(Common,addScrollWheelEventHandler);
|
||||
[{_this call FUNC(handleScrollWheel)}] call EFUNC(common,addScrollWheelEventHandler);
|
||||
|
||||
// Cancel adjusting on player change.
|
||||
["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
|
||||
["playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
|
||||
|
||||
// handle falling unconscious
|
||||
["medical_onUnconscious", {_this call FUNC(handleUnconscious)}] call EFUNC(common,addEventhandler);
|
||||
|
||||
// @todo captivity?
|
||||
|
@ -3,7 +3,11 @@
|
||||
ADDON = false;
|
||||
|
||||
PREP(adjust);
|
||||
PREP(handleInteractMenuOpened);
|
||||
PREP(handleKilled);
|
||||
PREP(handlePlayerChanged);
|
||||
PREP(handleScrollWheel);
|
||||
PREP(handleUnconscious);
|
||||
PREP(pickup);
|
||||
PREP(place);
|
||||
|
||||
|
@ -9,37 +9,39 @@
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [tripod] call ace_tripod_fnc_adjust
|
||||
* [ACE_player, tripod] call ace_tripod_fnc_adjust
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_tripod"];
|
||||
params ["_unit", "_tripod"];
|
||||
|
||||
GVAR(adjuster) = ACE_player;
|
||||
GVAR(adjusting) = true;
|
||||
_unit setVariable [QGVAR(adjusting), true, true];
|
||||
|
||||
// add PFH to adjust the tripod animation
|
||||
GVAR(adjustPFH) = [{
|
||||
params ["_args", "_pfhId"];
|
||||
_args params ["_tripod"];
|
||||
(_this select 0) params ["_unit", "_tripod"];
|
||||
|
||||
if (GVAR(adjuster) != ACE_player || !GVAR(adjusting)) exitWith {
|
||||
if (!(_unit getVariable [QGVAR(adjusting), false]) || {isNull _tripod} || {_unit distance _tripod > 5}) exitWith {
|
||||
call EFUNC(interaction,hideMouseHint);
|
||||
[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Adjust), -1]] call EFUNC(Common,removeActionEventHandler);
|
||||
[_pfhId] call cba_fnc_removePerFrameHandler;
|
||||
|
||||
[_unit, "DefaultAction", _unit getVariable [QGVAR(Adjust), -1]] call EFUNC(common,removeActionEventHandler);
|
||||
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
{
|
||||
_tripod animate [_x, 1 - GVAR(height)];
|
||||
} count ["slide_down_tripod", "retract_leg_1", "retract_leg_2", "retract_leg_3"];
|
||||
|
||||
}, 0, [_tripod]] call CBA_fnc_addPerFrameHandler;
|
||||
}, 0, [_unit, _tripod]] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
// add mouse button action and hint
|
||||
[localize "STR_ACE_Tripod_Done", "", localize "STR_ACE_Tripod_ScrollAction"] call EFUNC(interaction,showMouseHint);
|
||||
|
||||
ACE_player setVariable [QGVAR(Adjust),
|
||||
[ACE_player, "DefaultAction",
|
||||
{GVAR(adjustPFH) != -1 && GVAR(adjusting)},
|
||||
{GVAR(adjusting) = false;}
|
||||
] call EFUNC(common,AddActionEventHandler)];
|
||||
_unit setVariable [QGVAR(Adjust), [
|
||||
_unit, "DefaultAction",
|
||||
{GVAR(adjustPFH) != -1},
|
||||
{(_this select 0) setVariable [QGVAR(adjusting), false, true]}
|
||||
] call EFUNC(common,addActionEventHandler)];
|
||||
|
19
addons/tripod/functions/fnc_handleInteractMenuOpened.sqf
Normal file
19
addons/tripod/functions/fnc_handleInteractMenuOpened.sqf
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Handle opening of interaction menu.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
if (_unit getVariable [QGVAR(adjusting), false]) then {
|
||||
_unit setVariable [QGVAR(adjusting), false, true];
|
||||
};
|
19
addons/tripod/functions/fnc_handleKilled.sqf
Normal file
19
addons/tripod/functions/fnc_handleKilled.sqf
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Handle death.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
if (_unit getVariable [QGVAR(adjusting), false]) then {
|
||||
_unit setVariable [QGVAR(adjusting), false, true];
|
||||
};
|
24
addons/tripod/functions/fnc_handlePlayerChanged.sqf
Normal file
24
addons/tripod/functions/fnc_handlePlayerChanged.sqf
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Handle player changes.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: New Player Unit <OBJECT>
|
||||
* 1: Old Player Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_newPlayer", "_oldPlayer"];
|
||||
|
||||
if (_newPlayer getVariable [QGVAR(adjusting), false]) then {
|
||||
_newPlayer setVariable [QGVAR(adjusting), false, true];
|
||||
};
|
||||
|
||||
if (_oldPlayer getVariable [QGVAR(adjusting), false]) then {
|
||||
_oldPlayer setVariable [QGVAR(adjusting), false, true];
|
||||
};
|
@ -17,7 +17,7 @@
|
||||
|
||||
params ["_scroll"];
|
||||
|
||||
if (GETMVAR(ACE_Modifier,0) == 0 || GVAR(adjustPFH) == -1) exitWith { false };
|
||||
if (GVAR(adjustPFH) == -1) exitWith {false};
|
||||
|
||||
GVAR(height) = 0 max (GVAR(height) + (_scroll / 20)) min 1;
|
||||
|
||||
|
19
addons/tripod/functions/fnc_handleUnconscious.sqf
Normal file
19
addons/tripod/functions/fnc_handleUnconscious.sqf
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Handle unconsciousness.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
if (_unit getVariable [QGVAR(adjusting), false]) then {
|
||||
_unit setVariable [QGVAR(adjusting), false, true];
|
||||
};
|
@ -3,28 +3,31 @@
|
||||
* Pick up tripod
|
||||
*
|
||||
* Arguments:
|
||||
* 0: tripod <OBJECT>
|
||||
* 1: unit <OBJECT>
|
||||
* 0: unit <OBJECT>
|
||||
* 1: tripod <OBJECT>
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [tripod, player] call ace_tripod_fnc_pickup
|
||||
* [ACE_player, tripod] call ace_tripod_fnc_pickup
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_tripod", "_unit"];
|
||||
params ["_unit", "_tripod"];
|
||||
|
||||
if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then {
|
||||
_unit playMove "AmovPercMstpSrasWrflDnon_diary";
|
||||
if (stance _unit == "STAND") then {
|
||||
[_unit, "AmovPercMstpSrasWrflDnon_diary"] call EFUNC(common,doAnimation);
|
||||
};
|
||||
|
||||
[{
|
||||
params ["_tripod", "_unit"];
|
||||
params ["_unit", "_tripod"];
|
||||
|
||||
if (isNull _tripod) exitWith {};
|
||||
|
||||
deleteVehicle _tripod;
|
||||
|
||||
[_unit, "ACE_Tripod"] call EFUNC(common,addToInventory);
|
||||
deleteVehicle _tripod;
|
||||
}, [_tripod, _unit], 1, 0]call EFUNC(common,waitAndExecute);
|
||||
}, [_unit, _tripod], 1] call EFUNC(common,waitAndExecute);
|
||||
|
@ -20,34 +20,37 @@ params ["_unit", "_tripodClass"];
|
||||
|
||||
_unit removeItem _tripodClass;
|
||||
|
||||
if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then {
|
||||
_unit playMove "AmovPercMstpSrasWrflDnon_diary";
|
||||
if (stance _unit == "STAND") then {
|
||||
[_unit, "AmovPercMstpSrasWrflDnon_diary"] call EFUNC(common,doAnimation);
|
||||
};
|
||||
|
||||
[{
|
||||
params ["_unit"];
|
||||
|
||||
private ["_direction", "_position", "_tripod"];
|
||||
|
||||
_direction = getDir _unit;
|
||||
_position = (getPosASL _unit) vectorAdd [0.8 * sin(_direction), 0.8 * cos(_direction), 0.02];
|
||||
_position = getPosASL _unit vectorAdd [0.8 * sin _direction, 0.8 * cos _direction, 0.02];
|
||||
|
||||
_tripod = "ACE_TripodObject" createVehicle [0, 0, 0];
|
||||
|
||||
{
|
||||
_tripod animate [_x, 1];
|
||||
} count ["slide_down_tripod", "retract_leg_1", "retract_leg_2", "retract_leg_3"];
|
||||
|
||||
[{
|
||||
params ["_args", "_pfhId"];
|
||||
_args params ["_tripod", "_direction", "_position"];
|
||||
(_this select 0) params ["_tripod", "_direction", "_position"];
|
||||
|
||||
if (_tripod animationPhase "slide_down_tripod" == 1) then {
|
||||
_tripod setDir _direction;
|
||||
_tripod setPosASL _position;
|
||||
if ((getPosATL _tripod select 2) - (getPos _tripod select 2) < 1E-5) then {
|
||||
|
||||
if ((getPosATL _tripod select 2) - (getPos _tripod select 2) < 1E-5) then { // if not on object, then adjust to surface normale
|
||||
_tripod setVectorUp (surfaceNormal (position _tripod));
|
||||
};
|
||||
[_pfhId] call CBA_fnc_removePerFrameHandler;
|
||||
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
}, 0, [_tripod, _direction, _position]] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
}, [_unit], 1, 0] call EFUNC(common,waitAndExecute);
|
||||
}, [_unit], 1] call EFUNC(common,waitAndExecute);
|
||||
|
@ -59,15 +59,15 @@
|
||||
<Russian>Готово</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Tripod_ScrollAction">
|
||||
<English>+ Modifier, adjust</English>
|
||||
<Polish>+ Modyfikator, regulacja</Polish>
|
||||
<Spanish>+ Modificador, ajuste</Spanish>
|
||||
<Czech>+ Modifikátor, regulace</Czech>
|
||||
<German>+ Modifikator, anpassen</German>
|
||||
<Portuguese>+ Modificador, ajuste</Portuguese>
|
||||
<French>+ modifier, régler</French>
|
||||
<Hungarian>+ Módosító, szabályzás</Hungarian>
|
||||
<Russian>+ Модификатор, подстройка</Russian>
|
||||
<English>adjust</English>
|
||||
<Polish>regulacja</Polish>
|
||||
<Spanish>ajuste</Spanish>
|
||||
<Czech>regulace</Czech>
|
||||
<German>anpassen</German>
|
||||
<Portuguese>ajuste</Portuguese>
|
||||
<French>régler</French>
|
||||
<Hungarian>szabályzás</Hungarian>
|
||||
<Russian>подстройка</Russian>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
|
Loading…
Reference in New Issue
Block a user