Merge remote-tracking branch 'upstream/master' into arsenal-veh-inventory

This commit is contained in:
LinkIsGrim 2024-02-08 22:59:20 -03:00
commit 022b760962
281 changed files with 3086 additions and 1554 deletions

1
.gitignore vendored
View File

@ -20,3 +20,4 @@ CHANGELOG.md
sqfvm.exe
ArmaScriptCompiler.exe
*.sqfc
!extras/**/*.zip

View File

@ -191,3 +191,4 @@ YetheSamartaka
xrufix
Zakant <Zakant@gmx.de>
zGuba
Zman6258

View File

@ -17,7 +17,7 @@
*/
//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"];
TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret);
TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret);
if (!(_ammo isKindOf "BulletBase")) exitWith {};
if (!alive _projectile) exitWith {};

View File

@ -22,7 +22,7 @@ private _initStartTime = diag_tickTime;
private _mapSize = worldSize;
if (("ace_advanced_ballistics" callExtension format["init:%1:%2", worldName, _mapSize]) == "Terrain already initialized") exitWith {
INFO_1("Terrain already initialized [world: %1]", worldName);
INFO_1("Terrain already initialized [world: %1]",worldName);
#ifdef DEBUG_MODE_FULL
systemChat "AdvancedBallistics: Terrain already initialized";
#endif
@ -33,14 +33,14 @@ private _gridCells = _mapGrids * _mapGrids;
GVAR(currentGrid) = 0;
INFO_2("Starting Terrain Extension [cells: %1] [world: %2]", _gridCells, worldName);
INFO_2("Starting Terrain Extension [cells: %1] [world: %2]",_gridCells,worldName);
[{
params ["_args","_idPFH"];
_args params ["_mapGrids", "_gridCells", "_initStartTime"];
if (GVAR(currentGrid) >= _gridCells) exitWith {
INFO_2("Finished terrain initialization in %1 seconds [world: %2]", (diag_tickTime - _initStartTime) toFixed 2, worldName);
INFO_2("Finished terrain initialization in %1 seconds [world: %2]",(diag_tickTime - _initStartTime) toFixed 2,worldName);
#ifdef DEBUG_MODE_FULL
systemChat format["AdvancedBallistics: Finished terrain initialization in %1 seconds", (diag_tickTime - _initStartTime) toFixed 2];
#endif

View File

@ -66,7 +66,7 @@ if ((_typicalSpeed > 0) && {_typicalSpeed < 360}) then {
if (_inheritedBarrelConfig || _inheritedTempConfig) then {
private _parentConfig = inheritsFrom _ammoConfig;
private _parentSpeed = getNumber (_parentConfig >> "typicalSpeed");
WARNING_4("Subsonic Ammo %1 (%2 m/s) missing `ACE_muzzleVelocities` or `ACE_ammoTempMuzzleVelocityShifts` configs, attempting to use parent %3 (%4m/s)",_this,_typicalSpeed,configName _parentConfig, _parentSpeed);
WARNING_4("Subsonic Ammo %1 (%2 m/s) missing `ACE_muzzleVelocities` or `ACE_ammoTempMuzzleVelocityShifts` configs, attempting to use parent %3 (%4m/s)",_this,_typicalSpeed,configName _parentConfig,_parentSpeed);
if (_parentSpeed <= 0) exitWith {//Handle weird or null parent
_muzzleVelocityTable = [];
_ammoTempMuzzleVelocityShifts = [];

View File

@ -60,7 +60,7 @@ if (!hasInterface) exitWith {};
}, true] call CBA_fnc_addPlayerEventHandler;
// - Duty factors -------------------------------------------------------------
if (["ace_medical"] call EFUNC(common,isModLoaded)) then {
if (GVAR(medicalLoaded)) then {
[QEGVAR(medical,pain), { // 0->1.0, 0.5->1.05, 1->1.1
linearConversion [0, 1, (_this getVariable [QEGVAR(medical,pain), 0]), 1, 1.1, true];
}] call FUNC(addDutyFactor);

View File

@ -13,5 +13,6 @@ GVAR(dutyList) = createHashMap;
GVAR(setAnimExclusions) = [];
GVAR(inertia) = 0;
GVAR(inertiaCache) = createHashMap;
GVAR(medicalLoaded) = ["ace_medical"] call EFUNC(common,isModLoaded);
ADDON = true;

View File

@ -23,6 +23,12 @@ if (!alive ACE_player) exitWith {
_staminaBarContainer ctrlCommit 1;
};
private _oxygen = 0.9; // Default AF oxygen saturation
if (GVAR(medicalLoaded) && {EGVAR(medical_vitals,simulateSpo2)}) then {
_oxygen = (ACE_player getVariable [QEGVAR(medical,spo2), 97]) / 100;
};
private _currentWork = REE;
private _currentSpeed = (vectorMagnitude (velocity ACE_player)) min 6;
@ -42,8 +48,8 @@ GVAR(muscleDamage) = (GVAR(muscleDamage) + (_currentWork / GVAR(peakPower)) ^ 3.
private _muscleIntegritySqrt = sqrt (1 - GVAR(muscleDamage));
// Calculate available power
private _ae1PathwayPowerFatigued = GVAR(ae1PathwayPower) * sqrt (GVAR(ae1Reserve) / AE1_MAXRESERVE) * OXYGEN * _muscleIntegritySqrt;
private _ae2PathwayPowerFatigued = GVAR(ae2PathwayPower) * sqrt (GVAR(ae2Reserve) / AE2_MAXRESERVE) * OXYGEN * _muscleIntegritySqrt;
private _ae1PathwayPowerFatigued = GVAR(ae1PathwayPower) * sqrt (GVAR(ae1Reserve) / AE1_MAXRESERVE) * _oxygen * _muscleIntegritySqrt;
private _ae2PathwayPowerFatigued = GVAR(ae2PathwayPower) * sqrt (GVAR(ae2Reserve) / AE2_MAXRESERVE) * _oxygen * _muscleIntegritySqrt;
// Calculate how much power is consumed from each reserve
private _ae1Power = _currentWork min _ae1PathwayPowerFatigued;
@ -58,8 +64,8 @@ GVAR(anReserve) = GVAR(anReserve) - _anPower / WATTSPERATP;
GVAR(anFatigue) = GVAR(anFatigue) + _anPower * (0.057 / GVAR(peakPower)) * 1.1;
// Aerobic ATP reserve recovery
GVAR(ae1Reserve) = ((GVAR(ae1Reserve) + OXYGEN * 6.60 * (GVAR(ae1PathwayPower) - _ae1Power) / GVAR(ae1PathwayPower) * GVAR(recoveryFactor)) min AE1_MAXRESERVE) max 0;
GVAR(ae2Reserve) = ((GVAR(ae2Reserve) + OXYGEN * 5.83 * (GVAR(ae2PathwayPower) - _ae2Power) / GVAR(ae2PathwayPower) * GVAR(recoveryFactor)) min AE2_MAXRESERVE) max 0;
GVAR(ae1Reserve) = ((GVAR(ae1Reserve) + _oxygen * 6.60 * (GVAR(ae1PathwayPower) - _ae1Power) / GVAR(ae1PathwayPower) * GVAR(recoveryFactor)) min AE1_MAXRESERVE) max 0;
GVAR(ae2Reserve) = ((GVAR(ae2Reserve) + _oxygen * 5.83 * (GVAR(ae2PathwayPower) - _ae2Power) / GVAR(ae2PathwayPower) * GVAR(recoveryFactor)) min AE2_MAXRESERVE) max 0;
// Anaerobic ATP reserver and fatigue recovery
GVAR(anReserve) = ((GVAR(anReserve)
@ -70,9 +76,9 @@ GVAR(anFatigue) = ((GVAR(anFatigue)
- (_ae1PathwayPowerFatigued + _ae2PathwayPowerFatigued - _ae1Power - _ae2Power) * (0.057 / GVAR(peakPower)) * GVAR(anFatigue) ^ 2 * GVAR(recoveryFactor)
) min 1) max 0;
private _aeReservePercentage = (GVAR(ae1Reserve) / AE1_MAXRESERVE + GVAR(ae2Reserve) / AE2_MAXRESERVE) / 2;
private _anReservePercentage = GVAR(anReserve) / AN_MAXRESERVE;
private _perceivedFatigue = 1 - (_anReservePercentage min _aeReservePercentage);
GVAR(aeReservePercentage) = (GVAR(ae1Reserve) / AE1_MAXRESERVE + GVAR(ae2Reserve) / AE2_MAXRESERVE) / 2;
GVAR(anReservePercentage) = GVAR(anReserve) / AN_MAXRESERVE;
private _perceivedFatigue = 1 - (GVAR(anReservePercentage) min GVAR(aeReservePercentage));
[ACE_player, _perceivedFatigue, _currentSpeed, GVAR(anReserve) == 0] call FUNC(handleEffects);

View File

@ -128,7 +128,7 @@ switch (_fillingType) do {
} else {
private _pos = _building select 0;
private _nearestUnits = (_pos nearEntities ["CAManBase", 2]);
LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits, {floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]);
LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits,{floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]);
if (count _nearestUnits > 0 && {[_nearestUnits, _pos] call _fnc_comparePos}) then {
LOG(format [ARR_2("fnc_garrison: Unit present | removing position | %1 positions remaining for this building",count (_buildingsIndex select (_buildingsIndex find _building)) - 1)]);
@ -177,7 +177,7 @@ switch (_fillingType) do {
} else {
private _pos = _building select 0;
private _nearestUnits = (_pos nearEntities ["CAManBase", 2]);
LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits, {floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]);
LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits,{floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]);
if (count _nearestUnits > 0 && {[_nearestUnits, _pos] call _fnc_comparePos}) then {
LOG(format [ARR_2("fnc_garrison: Unit present | removing position | %1 positions remaining for this building",count (_buildingsIndex select (_buildingsIndex find _building)) - 1)]);
@ -224,7 +224,7 @@ switch (_fillingType) do {
} else {
private _pos = selectRandom _building;
private _nearestUnits = (_pos nearEntities ["CAManBase", 2]);
LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits, {floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]);
LOG(format [ARR_3("fnc_garrison: Unit detection | %1 units nearby | %2 units within height",count _nearestUnits,{floor ((getPos _x) select 2) == floor (_pos select 2)} count _nearestUnits)]);
if (count _nearestUnits > 0 && {[_nearestUnits, _pos] call _fnc_comparePos}) then {
LOG(format [ARR_2("fnc_garrison: Unit present | removing position | %1 positions remaining for this building",count (_buildingsIndex select (_buildingsIndex find _building)) - 1)]);
@ -258,7 +258,7 @@ switch (_fillingType) do {
};
};
TRACE_1(format [ARR_2("fnc_garrison: while loop ended | %1 units ready to be treated by PFH",count _unitMoveList)], _teleport);
TRACE_1(format [ARR_2("fnc_garrison: while loop ended | %1 units ready to be treated by PFH",count _unitMoveList)],_teleport);
// Update the unit list and remove duplicate positions and units
private _garrison_unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []];
@ -279,5 +279,5 @@ if (_teleport) then {
[_unitMoveList] call FUNC(garrisonMove);
};
TRACE_1(format [ARR_3("fnc_garrison: End | %1 units left | %2 buildings left", count _unitsArray, count _buildingsIndex)], _unitsArray);
TRACE_1(format [ARR_3("fnc_garrison: End | %1 units left | %2 buildings left",count _unitsArray,count _buildingsIndex)],_unitsArray);
_unitsArray

View File

@ -81,13 +81,13 @@ if (isNil QGVAR(garrison_moveUnitPFH)) then {
[QGVAR(enableAttack), [[_unit], true], _unit] call CBA_fnc_targetEvent;
};
LOG(format [ARR_2("garrisonMove PFH: unit in position | %1 units left", count _unitMoveList)]);
LOG(format [ARR_2("garrisonMove PFH: unit in position | %1 units left",count _unitMoveList)]);
};
// Check if unit is alive or even existing
if (!alive _unit || {_unit getVariable [QGVAR(garrisoned), false]}) then {
_unitMoveList deleteAt (_unitMoveList find _x);
LOG(format [ARR_2("garrisonMove PFH: unit dead, deleted or garrisoned via TP | %1 units left", count _unitMoveList)]);
LOG(format [ARR_2("garrisonMove PFH: unit dead, deleted or garrisoned via TP | %1 units left",count _unitMoveList)]);
} else {
private _unitPos = getPos _unit;

View File

@ -28,7 +28,7 @@ _units = _units select {local _x};
private _leader = leader _unit;
TRACE_3("fnc_ungarrison: unit and leader",_unit , _leader, (_leader == _unit));
TRACE_3("fnc_ungarrison: unit and leader",_unit,_leader,(_leader == _unit));
_unit setVariable [QGVAR(garrisonned), false, true];

View File

@ -22,7 +22,8 @@ GVAR(lastSortDirectionRight) = DESCENDING;
params ["_object"];
// If the arsenal is already open, refresh arsenal display
if (!isNil QGVAR(currentBox) && {GVAR(currentBox) isEqualTo _object}) then {
// Deliberate == check, fail on objNull
if (!isNil QGVAR(currentBox) && {GVAR(currentBox) == _object}) then {
[true, true] call FUNC(refresh);
};
}] call CBA_fnc_addEventHandler;

View File

@ -36,6 +36,15 @@ call FUNC(compileStats);
EGVAR(common,blockItemReplacement) = false;
}] call CBA_fnc_addEventHandler;
[QGVAR(cargoChanged), {
params ["_display"];
// Only update actions if necessary, this can get performance-intensive using the arrow keys
if (!GVAR(updateActionsOnCargoChange)) exitWith {};
private _actionInfo = [_display];
_actionInfo append GVAR(actionInfo);
[QGVAR(displayActions), _actionInfo] call CBA_fnc_localEvent;
}] call CBA_fnc_addEventHandler;
// Setup Tools tab
[keys (uiNamespace getVariable [QGVAR(configItemsTools), createHashMap]), LLSTRING(toolsTab), TOOLS_TAB_ICON, -1, true] call FUNC(addRightPanelButton);

View File

@ -157,6 +157,8 @@
#define IDC_statsNextPage 53
#define IDC_statsCurrentPage 54
#define IDC_actionsBox 90
#define IDC_actionsBackground1 90010
#define IDC_actionsBackground2 90011
#define IDC_actionsText1 9001
#define IDC_actionsButton1 9002
#define IDC_actionsText2 9003

View File

@ -10,6 +10,7 @@
* 3: Actions <ARRAY of ARRAYS>
* 4: Condition <CODE> (default: {true})
* 5: Scope editor <NUMBER> (default: 2)
* 6: Update when cargo content changes <BOOL> (default: false)
*
* Return Value:
* 0: Array of IDs <ARRAY of STRINGS>
@ -30,7 +31,8 @@ params [
["_title", "", [""]],
["_actions", [], [[]]],
["_rootCondition", {true}, [{}]],
["_scopeEditor", 2, [0]]
["_scopeEditor", 2, [0]],
["_updateOnCargoChange", false, [false]]
];
// Compile actions from config (in case this is called before preInit)
@ -38,13 +40,13 @@ call FUNC(compileActions);
// Skip if not allowed in editor and in editor
if (is3DEN && {_scopeEditor != 2}) exitWith {
TRACE_1("Skipping action because in editor", _rootClass);
TRACE_1("Skipping action because in editor",_rootClass);
[]
};
// Class can't contain ~, because it's used for formatting result
if ("~" in _rootClass) exitWith {
TRACE_1("Classname can't contain '~'", _rootClass);
TRACE_1("Classname can't contain '~'",_rootClass);
[]
};
@ -65,7 +67,7 @@ private _fnc_addToGroup = {
// Don't allow two of the same class
if (_group findIf {(_x select 0) == _class} != -1) then {
TRACE_1("An action with this ID already exists", _class);
TRACE_1("An action with this ID already exists",_class);
continue;
};
@ -119,4 +121,8 @@ private _group = [];
};
} forEach _tabs;
if (_updateOnCargoChange) then {
GVAR(updateActionsOnCargoChange) = true;
};
_return

View File

@ -72,7 +72,7 @@ private _fnc_addToTabs = {
_currentTab pushBack _sort;
_return pushBack _sortName;
} else {
TRACE_1("A sort with this ID already exists", _sortName);
TRACE_1("A sort with this ID already exists",_sortName);
};
} forEach _tabsToAddTo;
};

View File

@ -77,7 +77,7 @@ private _fnc_addToTabs = {
// Find if there is an entry with same ID
if (_currentTab findIf {_x select 5 == _statName} != -1) then {
TRACE_1("A stat with this ID already exists", _statName);
TRACE_1("A stat with this ID already exists",_statName);
} else {
_stat = +_finalArray;
_stat set [5, _statName];

View File

@ -17,7 +17,7 @@
params ["_display", "_control", "_nextPage"];
TRACE_1("control enabled", ctrlEnabled _control);
TRACE_1("control enabled",ctrlEnabled _control);
if !(ctrlEnabled _control) exitWith {};
GVAR(currentActionPage) = GVAR(currentActionPage) + ([-1, 1] select _nextPage);

View File

@ -17,7 +17,7 @@
params ["_display", "_control", "_nextPage"];
TRACE_1("control enabled", ctrlEnabled _control);
TRACE_1("control enabled",ctrlEnabled _control);
if !(ctrlEnabled _control) exitWith {};
GVAR(currentStatPage) = GVAR(currentStatPage) + ([-1, 1] select _nextPage);

View File

@ -38,6 +38,8 @@ private _actionList = [
private _configGroupEntries = "true" configClasses (configFile >> QGVAR(actions));
GVAR(updateActionsOnCargoChange) = false;
{
private _scopeEditor = getNumber (_x >> "scopeEditor");
@ -49,6 +51,10 @@ private _configGroupEntries = "true" configClasses (configFile >> QGVAR(actions)
private _rootDisplayName = getText (_x >> "displayName");
private _rootCondition = getText (_x >> "condition");
private _rootTabs = getArray (_x >> "tabs");
private _updateOnCargoChanged = getNumber (_x >> "updateOnCargoChanged");
if (_updateOnCargoChanged > 0) then {
GVAR(updateActionsOnCargoChange) = true;
};
if (_rootCondition != "") then {
_rootCondition = compile _rootCondition;

View File

@ -101,7 +101,7 @@ private _priority = 0;
(_finalArray select 4) set [1, compile (getText (_x >> "textStatement"))];
};
TRACE_3("stats array", _finalArray, _leftTabsList, _rightTabsList);
TRACE_3("stats array",_finalArray,_leftTabsList,_rightTabsList);
if (_leftTabsList isNotEqualTo []) then {
[_statsListLeftPanel, _leftTabsList, "L"] call _fnc_addToTabs;

View File

@ -15,7 +15,6 @@
*
* Public: No
*/
params ["_display", "_control", "_curSel", "_itemCfg"];
GVAR(actionsInfo) = [_control, _curSel, _itemCfg];
@ -47,13 +46,12 @@ private _groups = (GVAR(actionList) select _panel) select {
};
private _show = _groups isNotEqualTo [];
private _ctrl = _display displayCtrl IDC_actionsBox;
_ctrl ctrlShow _show;
_ctrl ctrlCommit 0.15;
private _actionsBoxCtrl = _display displayCtrl IDC_actionsBox;
_actionsBoxCtrl ctrlShow _show;
_actionsBoxCtrl ctrlCommit 0.15;
if (!_show) exitWith {};
private _actionsBoxCtrl = _display displayCtrl IDC_actionsBox;
private _actionsCurrentPageCtrl = _display displayCtrl IDC_actionsCurrentPage;
private _currentPage = GVAR(currentActionPage);
@ -84,10 +82,11 @@ _actionsCurrentPageCtrl ctrlSetFade 0;
_actionsCurrentPageCtrl ctrlShow true;
_actionsCurrentPageCtrl ctrlCommit 0;
private _activeCtrls = [];
{
_x params ["", "_type", "_label", "_statement"];
private _idc = 9001 + _forEachIndex * 2;
private _idc = IDC_actionsText1 + _forEachIndex * 2;
private _actionTextCtrl = _display displayCtrl _idc;
private _actionButtonCtrl = _display displayCtrl (_idc + 1);
@ -100,13 +99,23 @@ _actionsCurrentPageCtrl ctrlCommit 0;
[true] call FUNC(refresh);
}] call CBA_fnc_execNextFrame;
}];
if (_activeCtrls isNotEqualTo []) then {
(ctrlPosition (_activeCtrls select -1)) params ["", "_lastPosY", "", "_lastPosH"];
_actionButtonCtrl ctrlSetPositionY (_lastPosY + _lastPosH + GRID_H);
} else {
_actionButtonCtrl ctrlSetPositionY (6 * GRID_H);
};
_actionButtonCtrl ctrlAddEventHandler ["ButtonClick", _statement];
_actionButtonCtrl ctrlSetText _label;
_actionButtonCtrl ctrlSetFade 0;
_actionButtonCtrl ctrlEnable true;
_actionButtonCtrl ctrlCommit 0;
_actionTextCtrl ctrlSetFade 1;
_actionTextCtrl ctrlEnable false;
_actionTextCtrl ctrlCommit 0;
_activeCtrls pushBack _actionButtonCtrl;
};
case ACTION_TYPE_TEXT: {
private _text = call _statement;
@ -114,13 +123,25 @@ _actionsCurrentPageCtrl ctrlCommit 0;
if (isNil "_text") then {
_text = "";
};
if (_text isEqualType []) then {
_text = _text joinString endl;
};
if (_activeCtrls isNotEqualTo []) then {
(ctrlPosition (_activeCtrls select -1)) params ["", "_lastPosY", "", "_lastPosH"];
_actionTextCtrl ctrlSetPositionY (_lastPosY + _lastPosH + GRID_H);
} else {
_actionTextCtrl ctrlSetPositionY (5 * GRID_H);
};
_actionTextCtrl ctrlSetText _text;
_actionTextCtrl ctrlSetPositionH (ctrlTextHeight _actionTextCtrl);
_actionTextCtrl ctrlSetFade 0;
_actionTextCtrl ctrlEnable false;
_actionTextCtrl ctrlCommit 0;
_actionButtonCtrl ctrlSetFade 1;
_actionButtonCtrl ctrlEnable false;
_actionButtonCtrl ctrlCommit 0;
_activeCtrls pushBack _actionTextCtrl;
};
default {
_actionTextCtrl ctrlSetFade 1;
@ -135,7 +156,7 @@ _actionsCurrentPageCtrl ctrlCommit 0;
private _actionCount = count _items;
{
private _idc = 9001 + _x * 2;
private _idc = IDC_actionsText1 + _x * 2;
private _actionTextCtrl = _display displayCtrl _idc;
private _actionButtonCtrl = _display displayCtrl (_idc + 1);
@ -146,6 +167,11 @@ private _actionCount = count _items;
} forEach ([0, 1, 2, 3, 4] select [_actionCount, 5]);
private _pos = ctrlPosition _actionsBoxCtrl;
_pos set [3, ([11, (5 * _actionCount) + 6] select (_actionCount > 0)) * GRID_H];
_actionsBoxCtrl ctrlSetPosition _pos;
(ctrlPosition (_activeCtrls select -1)) params ["", "_lastPosY", "", "_lastPosH"];
private _actionsBoxHeight = _lastPosY + _lastPosH + GRID_H;
_actionsBoxCtrl ctrlSetPositionH _actionsBoxHeight;
_actionsBoxCtrl ctrlCommit 0;
private _background = _display displayCtrl IDC_actionsBackground1;
_background ctrlSetPositionH _actionsBoxHeight;
_background ctrlCommit 0;

View File

@ -25,6 +25,11 @@ if (canSuspend) exitWith {
[{_this call FUNC(refresh)}, _this] call CBA_fnc_directCall;
};
private _display = findDisplay IDD_ace_arsenal;
// Exit quietly if no display found
if (isNull _display) exitWith {};
if (_updateItems) then {
// Update current item list
call FUNC(updateCurrentItemsList);
@ -65,6 +70,4 @@ if (!_animate) then {
[{GVAR(refreshing) = false}, nil, 3] call CBA_fnc_execAfterNFrames;
};
private _display = findDisplay IDD_ace_arsenal;
[_display, _display displayCtrl GVAR(currentLeftPanel), _animate] call FUNC(fillLeftPanel);

View File

@ -42,8 +42,14 @@ if (_global && {isMultiplayer} && {!isNil "_id"}) then {
};
// If the arsenal is already open and not ignoring content (see FUNC(openBox)), close arsenal display
if (!isNil QGVAR(currentBox) && {GVAR(currentBox) isEqualTo _object} && {isNil QGVAR(ignoredVirtualItems)}) then {
[LLSTRING(noVirtualItems), false, 5, 1] call EFUNC(common,displayText);
// Delay a frame in case this is running on display open
[{(findDisplay IDD_ace_arsenal) closeDisplay 0}] call CBA_fnc_execNextFrame;
// Deliberate == check, fail on objNull
if (!isNil QGVAR(currentBox) && {GVAR(currentBox) == _object} && {isNil QGVAR(ignoredVirtualItems)}) then {
// Delay a frame in case this is running on display open/close
[{
private _display = findDisplay IDD_ace_arsenal;
if (isNull _display) exitWith {};
[LLSTRING(noVirtualItems), false, 5, 1] call EFUNC(common,displayText);
_display closeDisplay 0;
}] call CBA_fnc_execNextFrame;
};

View File

@ -450,22 +450,22 @@ class GVAR(display) {
h = QUOTE(55 * GRID_H);
class controls {
class actionsStaticBackground1: ctrlStaticBackground {
idc = -1;
idc = IDC_actionsBackground1;
x = QUOTE(0);
y = QUOTE(0);
w = QUOTE(47 * GRID_W);
h = QUOTE(56 * GRID_H);
h = QUOTE(55 * GRID_H);
colorBackground[]={0.1,0.1,0.1,0.5};
};
class actionsStaticBackground2: ctrlStaticBackground {
idc = -1;
idc = IDC_actionsBackground2;
x = QUOTE(0);
y = QUOTE(0);
w = QUOTE(47 * GRID_W);
h = QUOTE(5 * GRID_H);
colorBackground[]={0.1,0.1,0.1,0.8};
};
class actionsText1: RscText {
class actionsText1: RscTextMulti {
idc = IDC_actionsText1;
fade = 1;
x = QUOTE(0 * GRID_W);
@ -479,6 +479,7 @@ class GVAR(display) {
};
class actionsButton1: ctrlButton {
idc = IDC_actionsButton1;
onMouseEnter = QUOTE(ctrlSetFocus (_this select 0));
fade = 1;
text = "";
x = QUOTE(1 * GRID_W);

View File

@ -15,7 +15,7 @@
* Public: No
*/
LOG_2("Trying to load gunlist from profile [Version: %1][Count: %2]", profileNamespace getVariable [ARR_2(QGVAR(profileNamespaceVersion), 'none')], count (profileNamespace getVariable [ARR_2(QGVAR(gunList), [])]));
LOG_2("Trying to load gunlist from profile [Version: %1][Count: %2]",profileNamespace getVariable [ARR_2(QGVAR(profileNamespaceVersion),'none')],count (profileNamespace getVariable [ARR_2(QGVAR(gunList),[])]));
private _resetGunList = true;
if ((profileNamespace getVariable ["ACE_ATragMX_profileNamespaceVersion", 0]) == ATRAGMX_PROFILE_NAMESPACE_VERSION && {count (profileNamespace getVariable ["ACE_ATragMX_gunList", []]) > 0}) then {

View File

@ -16,7 +16,7 @@
*/
params ["_vehicle"];
TRACE_1("params", _vehicle);
TRACE_1("params",_vehicle);
scopeName "main";

View File

@ -15,3 +15,17 @@ class Extended_PostInit_EventHandlers {
init = QUOTE(call COMPILE_SCRIPT(XEH_postInit));
};
};
class Extended_Killed_EventHandlers {
class CAManBase {
class ADDON {
killed = QUOTE((_this select 0) call FUNC(handleDeployInterrupt));
};
};
};
class Extended_DisplayLoad_EventHandlers {
class RscDisplayMission {
ADDON = QUOTE(_this call COMPILE_SCRIPT(XEH_missionDisplayLoad));
};
};

View File

@ -2,10 +2,15 @@ PREP(addCargoItem);
PREP(addCargoVehiclesActions);
PREP(canLoadItemIn);
PREP(canUnloadItem);
PREP(deployCancel);
PREP(deployConfirm);
PREP(getCargoSpaceLeft);
PREP(getNameItem);
PREP(getSelectedItem);
PREP(getSizeItem);
PREP(handleDestroyed);
PREP(handleDeployInterrupt);
PREP(handleScrollWheel);
PREP(initObject);
PREP(initVehicle);
PREP(loadItem);
@ -16,6 +21,7 @@ PREP(removeCargoItem);
PREP(renameObject);
PREP(setSize);
PREP(setSpace);
PREP(startDeploy);
PREP(startLoadIn);
PREP(startUnload);
PREP(unloadCarryItem);

View File

@ -0,0 +1,11 @@
#include "script_component.hpp"
params ["_display"];
_display displayAddEventHandler ["MouseZChanged", {(_this select 1) call FUNC(handleScrollWheel)}];
_display displayAddEventHandler ["MouseButtonDown", {
// Right clicking cancels deployment
if (_this select 1 == 1) then {
ACE_player call FUNC(handleDeployInterrupt);
};
}];

View File

@ -17,10 +17,10 @@
}] call CBA_fnc_addEventHandler;
["ace_unloadCargo", {
params ["_item", "_vehicle", ["_unloader", objNull]];
TRACE_3("UnloadCargo EH",_item,_vehicle,_unloader);
params ["_item", "_vehicle", ["_unloader", objNull], ["_place", []]];
TRACE_4("UnloadCargo EH",_item,_vehicle,_unloader,_place);
private _unloaded = [_item, _vehicle, _unloader] call FUNC(unloadItem); // returns true if successful
private _unloaded = [_item, _vehicle, _unloader, _place] call FUNC(unloadItem); // returns true if successful
// Show hint as feedback
private _hint = [LSTRING(unloadingFailed), LSTRING(unloadedItem)] select _unloaded;
@ -36,13 +36,25 @@
};
}] call CBA_fnc_addEventHandler;
// Direction must be set before setting position according to wiki
[QGVAR(setDirAndUnload), {
params ["_item", "_emptyPosAGL", "_direction"];
_item setDir _direction;
[QGVAR(serverUnload), [_item, _emptyPosAGL]] call CBA_fnc_serverEvent;
}] call CBA_fnc_addEventHandler;
// hideObjectGlobal must be executed before setPos to ensure light objects are rendered correctly
// Do both on server to ensure they are executed in the correct order
[QGVAR(serverUnload), {
params ["_item", "_emptyPosAGL"];
_item hideObjectGlobal false;
_item setPosASL (AGLtoASL _emptyPosAGL);
[_item, "blockDamage", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set);
// Let objects remain invulernable for a short while after placement
[EFUNC(common,statusEffect_set), [_item, "blockDamage", QUOTE(ADDON), false], 2] call CBA_fnc_waitAndExecute;
}] call CBA_fnc_addEventHandler;
[QGVAR(paradropItem), {
@ -166,3 +178,38 @@ if (isServer) then {
_bodyBag setVariable [QGVAR(customName), [_target, false, true] call EFUNC(common,getName), true];
}] call CBA_fnc_addEventHandler;
};
// Set variables, even on machines without interfaces, just to be safe
GVAR(selectedItem) = objNull;
GVAR(itemPreviewObject) = objNull;
GVAR(deployPFH) = -1;
GVAR(deployDistance) = -1;
GVAR(deployDirection) = 0;
GVAR(deployHeight) = 0;
GVAR(canDeploy) = false;
if (!hasInterface) exitWith {};
// Cancel object deployment if interact menu opened
["ace_interactMenuOpened", {ACE_player call FUNC(handleDeployInterrupt)}] call CBA_fnc_addEventHandler;
// Cancel deploy on player change. This does work when returning to lobby, but not when hard disconnecting
["unit", LINKFUNC(handleDeployInterrupt)] call CBA_fnc_addPlayerEventHandler;
["vehicle", {(_this select 0) call FUNC(handleDeployInterrupt)}] call CBA_fnc_addPlayerEventHandler;
["weapon", {(_this select 0) call FUNC(handleDeployInterrupt)}] call CBA_fnc_addPlayerEventHandler;
// When changing feature cameras, stop deployment
["featureCamera", {(_this select 0) call FUNC(handleDeployInterrupt)}] call CBA_fnc_addPlayerEventHandler;
// Handle falling unconscious while trying to deploy
["ace_unconscious", {(_this select 0) call FUNC(handleDeployInterrupt)}] call CBA_fnc_addEventHandler;
// Handle surrendering and handcuffing
["ace_captiveStatusChanged", {
params ["_unit", "_state"];
// If surrendered or handcuffed, stop deployment
if (_state) then {
_unit call FUNC(handleDeployInterrupt);
};
}] call CBA_fnc_addEventHandler;

View File

@ -0,0 +1,39 @@
#include "..\script_component.hpp"
/*
* Author: Garth 'L-H' de Wet, Ruthberg, commy2, Smith
* Cancels unloading when deploying.
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* player call ace_cargo_fnc_deployCancel
*
* Public: No
*/
if (GVAR(deployPFH) == -1) exitWith {};
// Remove deployment pfh
GVAR(deployPFH) call CBA_fnc_removePerFrameHandler;
GVAR(deployPFH) = -1;
params ["_unit"];
// Enable running again
[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set);
[_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set);
// Delete placement dummy
deleteVehicle GVAR(itemPreviewObject);
// Remove mouse button actions
call EFUNC(interaction,hideMouseHint);
[_unit, "DefaultAction", _unit getVariable [QGVAR(deploy), -1]] call EFUNC(common,removeActionEventHandler);
_unit setVariable [QGVAR(deploy), -1];
_unit setVariable [QGVAR(isDeploying), false, true];

View File

@ -0,0 +1,56 @@
#include "..\script_component.hpp"
/*
* Author: Garth 'L-H' de Wet, Ruthberg, commy2, Smith
* Confirms unloading when deploying.
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* player call ace_cargo_fnc_deployConfirm
*
* Public: No
*/
if (GVAR(deployPFH) == -1) exitWith {};
params ["_unit"];
// Delete placement dummy and unload real item from cargo at dummy position
if (!isNull GVAR(itemPreviewObject) && {[GVAR(selectedItem), GVAR(interactionVehicle), _unit, false, true] call FUNC(canUnloadItem)}) then {
// Position is AGL for unloading event
private _position = ASLToAGL getPosASL GVAR(itemPreviewObject);
private _direction = getDir GVAR(itemPreviewObject);
private _duration = GVAR(loadTimeCoefficient) * (GVAR(selectedItem) call FUNC(getSizeItem));
// If unload time is 0, don't show a progress bar
if (_duration <= 0) exitWith {
["ace_unloadCargo", [GVAR(selectedItem), GVAR(interactionVehicle), _unit, [_position, _direction]]] call CBA_fnc_localEvent;
};
[
_duration,
[GVAR(selectedItem), GVAR(interactionVehicle), _unit, [_position, _direction]],
{
TRACE_1("deploy finish",_this);
["ace_unloadCargo", _this select 0] call CBA_fnc_localEvent;
},
{
TRACE_1("deploy fail",_this);
},
format [LLSTRING(unloadingItem), [GVAR(selectedItem), true] call FUNC(getNameItem), getText (configOf GVAR(interactionVehicle) >> "displayName")],
{
(_this select 0) params ["_item", "_vehicle", "_unit"];
[_item, _vehicle, _unit, false, true] call FUNC(canUnloadItem) // don't check for a suitable unloading position when deploying
},
["isNotSwimming"]
] call EFUNC(common,progressBar);
};
// Cleanup EHs and preview object
_unit call FUNC(deployCancel);

View File

@ -0,0 +1,29 @@
#include "..\script_component.hpp"
/*
* Author: Glowbal, Smith
* Get selected item from cargo menu.
*
* Arguments:
* None
*
* Return Value:
* Classname of selected item or selected object <STRING> or <OBJECT> (default: nil)
*
* Example:
* call ace_cargo_fnc_getSelectedItem
*
* Public: No
*/
disableSerialization;
private _display = uiNamespace getVariable QGVAR(menuDisplay);
if (isNil "_display") exitWith {};
private _loaded = GVAR(interactionVehicle) getVariable [QGVAR(loaded), []];
if (_loaded isEqualTo []) exitWith {};
// This can be an object or a classname string
_loaded param [lbCurSel (_display displayCtrl 100), nil]

View File

@ -0,0 +1,30 @@
#include "..\script_component.hpp"
/*
* Author: commy2, Smith
* Handle various interruption types.
*
* Arguments:
* 0: (New) unit <OBJECT>
* 1: Old unit (for player change) <OBJECT> (default: objNull)
*
* Return Value:
* None
*
* Example:
* player call ace_cargo_fnc_handleDeployInterrupt
*
* Public: No
*/
params ["_newPlayer", ["_oldPlayer", objNull]];
TRACE_2("params",_newPlayer,_oldPlayer);
if (!local _newPlayer) exitWith {};
if (_newPlayer getVariable [QGVAR(isDeploying), false]) then {
_newPlayer call FUNC(deployCancel);
};
if (_oldPlayer getVariable [QGVAR(isDeploying), false]) then {
_oldPlayer call FUNC(deployCancel);
};

View File

@ -0,0 +1,58 @@
#include "..\script_component.hpp"
/*
* Author: L-H, commy2, Smith
* Handles rotation of object to unload.
*
* Arguments:
* 0: Scroll amount <NUMBER>
*
* Return Value:
* If the scroll was handled <BOOL>
*
* Example:
* 1.2 call ace_cargo_fnc_handleScrollWheel
*
* Public: No
*/
if (GVAR(deployPFH) == -1) exitWith {false};
params ["_scrollAmount"];
private _deployedItem = GVAR(itemPreviewObject);
if (!CBA_events_control) then {
private _unit = ACE_player;
// Raise/lower
// Move deployed item 15 cm per scroll interval
_scrollAmount = _scrollAmount * 0.15;
private _position = getPosASL _deployedItem;
private _maxHeight = (_unit modelToWorldVisualWorld [0, 0, 0]) select 2;
_position set [2, ((_position select 2) + _scrollAmount min (_maxHeight + 1.5)) max _maxHeight];
// Move up/down object and reattach at current position
detach _deployedItem;
// Uses this method of selecting position because setPosATL did not have immediate effect
private _positionChange = _position vectorDiff (getPosASL _deployedItem);
private _selectionPosition = _unit worldToModel (ASLtoAGL getPosWorld _deployedItem);
_selectionPosition = _selectionPosition vectorAdd _positionChange;
_deployedItem attachTo [_unit, _selectionPosition];
// Reset the deploy direction
private _direction = _deployedItem getVariable [QGVAR(deployDirection_temp), 0];
_deployedItem setDir _direction;
} else {
// Rotate
private _direction = _deployedItem getVariable [QGVAR(deployDirection_temp), 0];
_scrollAmount = _scrollAmount * 10;
_direction = _direction + _scrollAmount;
_deployedItem setDir _direction;
_deployedItem setVariable [QGVAR(deployDirection_temp), _direction];
};
true

View File

@ -44,7 +44,7 @@ if (_item getVariable [QGVAR(initObject),false]) exitWith {};
if (_canLoadConfig) then {
GVAR(initializedItemClasses) pushBack _type;
TRACE_1("Adding load cargo action to class", _type);
TRACE_1("Adding load cargo action to class",_type);
{
[_type, 0, ["ACE_MainActions"], _x] call EFUNC(interact_menu,addActionToClass);
@ -52,7 +52,7 @@ if (_canLoadConfig) then {
} else {
_item setVariable [QGVAR(initObject), true];
TRACE_1("Adding load cargo action to object", _item);
TRACE_1("Adding load cargo action to object",_item);
{
[_item, 0, ["ACE_MainActions"], _x] call EFUNC(interact_menu,addActionToObject);

View File

@ -16,17 +16,23 @@
*/
params ["_vehicle"];
TRACE_1("params", _vehicle);
TRACE_1("params",_vehicle);
private _type = typeOf _vehicle;
private _config = configOf _vehicle;
// If vehicle had space given to it via eden/public, then override config hasCargo setting
private _hasCargoPublic = _vehicle getVariable [QGVAR(hasCargo), false];
private _hasCargoPublic = _item getVariable QGVAR(hasCargo);
private _hasCargoPublicDefined = !isNil "_canLoadPublic";
if (_hasCargoPublicDefined && {!(_hasCargoPublic isEqualType false)}) then {
WARNING_4("%1[%2] - Variable %3 is %4 - Should be bool",_item,_type,QGVAR(hasCargo),_hasCargoPublic);
};
private _hasCargoConfig = getNumber (_config >> QGVAR(hasCargo)) == 1;
// Nothing to do here if vehicle has no cargo space
if !(_hasCargoConfig || _hasCargoPublic) exitWith {};
if !((_hasCargoPublicDefined && {_hasCargoPublic in [true, 1]}) || {!_hasCargoPublicDefined && {_hasCargoConfig}}) exitWith {};
// Check if cargo is in cargo holder types (checked when trying to search for loadable objects)
private _addCargoType = GVAR(cargoHolderTypes) findIf {_type isKindOf _x} == -1;
@ -68,13 +74,13 @@ if (_type in GVAR(initializedVehicleClasses)) exitWith {};
if (_hasCargoConfig) then {
GVAR(initializedVehicleClasses) pushBack _type;
TRACE_1("Adding unload cargo action to class", _type);
TRACE_1("Adding unload cargo action to class",_type);
[_type, 0, ["ACE_MainActions"], GVAR(vehicleAction)] call EFUNC(interact_menu,addActionToClass);
} else {
_vehicle setVariable [QGVAR(initVehicle), true];
TRACE_1("Adding unload cargo action to object", _vehicle);
TRACE_1("Adding unload cargo action to object",_vehicle);
[_vehicle, 0, ["ACE_MainActions"], GVAR(vehicleAction)] call EFUNC(interact_menu,addActionToObject);
};

View File

@ -25,6 +25,9 @@ if (GVAR(interactionParadrop)) then {
(_display displayCtrl 12) ctrlSetText LLSTRING(paradropButton);
};
// Disable deploy option if paradropping or in Zeus
(_display displayCtrl 13) ctrlEnable (GVAR(enableDeploy) && !GVAR(interactionParadrop) && {isNull curatorCamera});
[{
params ["_vehicle", "_pfhID"];
@ -33,7 +36,6 @@ if (GVAR(interactionParadrop)) then {
private _display = uiNamespace getVariable QGVAR(menuDisplay);
if (isNil "_display") exitWith {
GVAR(interactionVehicle) = nil;
GVAR(interactionParadrop) = nil;
_pfhID call CBA_fnc_removePerFrameHandler;
@ -41,18 +43,18 @@ if (GVAR(interactionParadrop)) then {
// Close menu if in invalid state
if (
!alive _vehicle ||
!alive ACE_player ||
{!alive _vehicle} ||
{locked _vehicle >= 2} ||
{!(_vehicle getVariable [QGVAR(hasCargo), true])} || // if the cargo menu could be opened, the vehicle has QGVAR(hasCargo) in its config or the variable is set using FUNC(setSpace)
{
isNull findDisplay 312 && // if in Zeus, ignore the following checks
isNull curatorCamera && // if in Zeus, ignore the checks that follow
{([ACE_player, _vehicle] call EFUNC(interaction,getInteractionDistance)) >= MAX_LOAD_DISTANCE} &&
{(vehicle ACE_player) != _vehicle}
}
) exitWith {
closeDialog 0;
GVAR(interactionVehicle) = nil;
GVAR(interactionParadrop) = nil;
_pfhID call CBA_fnc_removePerFrameHandler;

View File

@ -0,0 +1,86 @@
#include "..\script_component.hpp"
/*
* Author: Garth 'L-H' de Wet, Ruthberg, commy2, Smith
* Starts the deploy process for unloading an object.
*
* Arguments:
* 0: Unit deploying <OBJECT>
*
* Return Value:
* None
*
* Example:
* player call ace_cargo_fnc_startDeploy
*
* Public: No
*/
// Deny creating preview item as it will destroy player vehicle instantly by collision
if (GVAR(interactionParadrop)) exitWith {};
params ["_unit"];
// Don't allow deploying if already deploying
if (_unit getVariable [QGVAR(isDeploying), false]) exitWith {};
// This can be an object or a classname string
private _item = call FUNC(getSelectedItem);
if (isNil "_item") exitWith {};
// Close opened cargo menu
closeDialog 0;
GVAR(selectedItem) = _item;
private _classname = _item;
if (_classname isEqualType objNull) then {
_classname = typeOf _classname;
};
// Prevent the placing unit from running
[_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set);
[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set);
// Create a local preview object
private _itemPreviewObject = createVehicleLocal [_classname, [0, 0, 0], [], 0, "CAN_COLLIDE"];
GVAR(itemPreviewObject) = _itemPreviewObject;
// Prevent collisions with object
_itemPreviewObject disableCollisionWith _unit;
_itemPreviewObject enableSimulation false;
_itemPreviewObject setMass 1e-12;
// Detect radius of zone where collision can damage the player
private _itemPreviewObjectRadius = 1 max ((boundingBoxReal [_itemPreviewObject, "FireGeometry"]) select 2);
// Add height offset of model
private _offset = ((_itemPreviewObject modelToWorldVisual [0, 0, 0]) select 2) - ((_unit modelToWorldVisual [0, 0, 0]) select 2) + 1;
// Attach object
_itemPreviewObject attachTo [_unit, [0, 1.5 * _itemPreviewObjectRadius, _offset]];
// PFH that runs while the deployment is in progress
GVAR(deployPFH) = [{
(_this select 0) params ["_unit", "_vehicle", "_item", "_itemPreviewObject"];
if !(
!isNull _itemPreviewObject &&
{[_item, _vehicle, _unit, false, true] call FUNC(canUnloadItem)} // don't check for a suitable unloading position when deploying
) exitWith {
_unit call FUNC(deployCancel);
};
}, 0.5, [_unit, GVAR(interactionVehicle), _item, _itemPreviewObject]] call CBA_fnc_addPerFrameHandler;
// Add mouse button action and hint
[LLSTRING(unloadObject), localize "STR_DISP_CANCEL", LLSTRING(scrollAction)] call EFUNC(interaction,showMouseHint);
_unit setVariable [QGVAR(deploy), [
_unit, "DefaultAction",
{GVAR(deployPFH) != -1},
{[_this select 0] call FUNC(deployConfirm)}
] call EFUNC(common,addActionEventHandler)];
_unit setVariable [QGVAR(isDeploying), true, true];

View File

@ -15,18 +15,8 @@
* Public: No
*/
disableSerialization;
private _display = uiNamespace getVariable QGVAR(menuDisplay);
if (isNil "_display") exitWith {};
private _loaded = GVAR(interactionVehicle) getVariable [QGVAR(loaded), []];
if (_loaded isEqualTo []) exitWith {};
// This can be an object or a classname string
private _item = _loaded param [lbCurSel (_display displayCtrl 100), nil];
private _item = call FUNC(getSelectedItem);
if (isNil "_item") exitWith {};
@ -60,11 +50,11 @@ if (GVAR(interactionParadrop)) exitWith {
},
format [LLSTRING(unloadingItem), [_item, true] call FUNC(getNameItem), getText (configOf GVAR(interactionVehicle) >> "displayName")],
{
(_this select 0) params ["", "_target"];
(_this select 0) params ["", "_vehicle"];
if ((acos ((vectorUp _target) select 2)) > 30) exitWith {false}; // check flight level
if (((getPos _target) select 2) < 25) exitWith {false}; // check height
if ((speed _target) < -5) exitWith {false}; // check reverse
if ((acos ((vectorUp _vehicle) select 2)) > 30) exitWith {false}; // check flight level
if (((getPos _vehicle) select 2) < 25) exitWith {false}; // check height
if ((speed _vehicle) < -5) exitWith {false}; // check reverse
true
},
@ -74,7 +64,7 @@ if (GVAR(interactionParadrop)) exitWith {
};
// If in zeus
if (!isNull findDisplay 312) exitWith {
if (!isNull curatorCamera) exitWith {
// Do not check distance to unit, but do check for valid position
if !([_item, GVAR(interactionVehicle), objNull, true] call FUNC(canUnloadItem)) exitWith {
[[LSTRING(unloadingFailed), [_item, true] call FUNC(getNameItem)], 3] call EFUNC(common,displayTextStructured);

View File

@ -7,6 +7,9 @@
* 0: Item to be unloaded <STRING> or <OBJECT> (default: "")
* 1: Holder object (vehicle) <OBJECT> (default: objNull)
* 2: Unloader <OBJECT> (default: objNull)
* 3: Deploy parameters <ARRAY> (default: [])
* - 0: Position AGL <ARRAY>
* - 1: Direction <NUMBER>
*
* Return Value:
* Object unloaded <BOOL>
@ -17,8 +20,10 @@
* Public: Yes
*/
params [["_item", "", [objNull, ""]], ["_vehicle", objNull, [objNull]], ["_unloader", objNull, [objNull]]];
TRACE_3("params",_item,_vehicle,_unloader);
params [["_item", "", [objNull, ""]], ["_vehicle", objNull, [objNull]], ["_unloader", objNull, [objNull]], ["_deploy", []]];
_deploy params ["_emptyPosAGL", "_direction"];
TRACE_4("params",_item,_vehicle,_unloader,_deploy);
// Get config sensitive case name
if (_item isEqualType "") then {
@ -41,9 +46,18 @@ if (_itemSize < 0) exitWith {
false // return
};
// This covers testing vehicle stability and finding a safe position
private _emptyPosAGL = [_vehicle, _item, _unloader] call EFUNC(common,findUnloadPosition);
TRACE_1("findUnloadPosition",_emptyPosAGL);
private _deployed = _deploy isNotEqualTo [];
if (!_deployed) then {
// This covers testing vehicle stability and finding a safe position
for "_i" from 1 to 3 do {
_emptyPosAGL = [_vehicle, _item, _unloader] call EFUNC(common,findUnloadPosition);
if (_emptyPosAGL isNotEqualTo []) exitWith {};
};
TRACE_1("findUnloadPosition",_emptyPosAGL);
};
if (_emptyPosAGL isEqualTo []) exitWith {
// Display text saying there are no safe places to exit the vehicle
@ -67,9 +81,12 @@ private _object = _item;
if (_object isEqualType objNull) then {
detach _object;
// hideObjectGlobal must be executed before setPos to ensure light objects are rendered correctly
// Do both on server to ensure they are executed in the correct order
[QGVAR(serverUnload), [_object, _emptyPosAGL]] call CBA_fnc_serverEvent;
// If player unloads via deployment, set direction first, then unload
if (_deployed) then {
[QGVAR(setDirAndUnload), [_object, _emptyPosAGL, _direction], _object] call CBA_fnc_targetEvent;
} else {
[QGVAR(serverUnload), [_object, _emptyPosAGL]] call CBA_fnc_serverEvent;
};
if (["ace_zeus"] call EFUNC(common,isModLoaded)) then {
// Get which curators had this object as editable
@ -81,6 +98,12 @@ if (_object isEqualType objNull) then {
};
} else {
_object = createVehicle [_item, _emptyPosAGL, [], 0, "NONE"];
// If player unloads via deployment, set direction. Must happen before setPosASL command according to wiki
if (_deployed) then {
_object setDir _direction;
};
_object setPosASL (AGLtoASL _emptyPosAGL);
[QEGVAR(common,fixCollision), _object] call CBA_fnc_localEvent;
@ -88,7 +111,9 @@ if (_object isEqualType objNull) then {
};
// Dragging integration
[_unloader, _object] call FUNC(unloadCarryItem);
if (!_deployed) then {
[_unloader, _object] call FUNC(unloadCarryItem);
};
// Invoke listenable event
["ace_cargoUnloaded", [_object, _vehicle, "unload"]] call CBA_fnc_globalEvent;

View File

@ -6,7 +6,7 @@ private _category = [ELSTRING(main,Category_Logistics), LSTRING(openMenu)];
[LSTRING(ModuleSettings_enable), LSTRING(ModuleSettings_enable_Description)],
_category,
true,
true,
1,
{[QGVAR(enable), _this] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_fnc_addSetting;
@ -16,7 +16,7 @@ private _category = [ELSTRING(main,Category_Logistics), LSTRING(openMenu)];
[LSTRING(loadTimeCoefficient), LSTRING(loadTimeCoefficient_description)],
_category,
[0, 10, 5, 1],
true,
1,
{[QGVAR(loadTimeCoefficient), _this, true] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_fnc_addSetting;
@ -26,7 +26,7 @@ private _category = [ELSTRING(main,Category_Logistics), LSTRING(openMenu)];
[LSTRING(paradropTimeCoefficent), LSTRING(paradropTimeCoefficent_description)],
_category,
[0, 10, 2.5, 1],
true,
1,
{[QGVAR(paradropTimeCoefficent), _this, true] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_fnc_addSetting;
@ -36,26 +36,36 @@ private _category = [ELSTRING(main,Category_Logistics), LSTRING(openMenu)];
[LSTRING(openAfterUnload), LSTRING(openAfterUnload_description)],
_category,
[[0, 1, 2, 3], [ELSTRING(common,never), LSTRING(unloadObject), LSTRING(paradropButton), ELSTRING(common,both)], 0],
false,
0,
{[QGVAR(openAfterUnload), _this, true] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_fnc_addSetting;
[
QGVAR(enableRename),
"CHECKBOX",
[LSTRING(ModuleSettings_enableRename), LSTRING(ModuleSettings_enableRename_Description)],
_category,
true,
false,
{[QGVAR(enableRename), _this, true] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_fnc_addSetting;
[
QGVAR(carryAfterUnload),
"CHECKBOX",
[LSTRING(carryAfterUnload), LSTRING(carryAfterUnload_description)],
_category,
true,
false,
0,
{[QGVAR(carryAfterUnload), _this] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_fnc_addSetting;
[
QGVAR(enableDeploy),
"CHECKBOX",
[LSTRING(enableDeploy), LSTRING(enableDeploy_description)],
_category,
true,
1,
{[QGVAR(enableDeploy), _this] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_fnc_addSetting;
[
QGVAR(enableRename),
"CHECKBOX",
[LSTRING(ModuleSettings_enableRename), LSTRING(ModuleSettings_enableRename_Description)],
_category,
true,
0,
{[QGVAR(enableRename), _this, true] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_fnc_addSetting;

View File

@ -17,7 +17,7 @@ class GVAR(menu) {
};
class CenterBackground: HeaderBackground {
y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
h = "13.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
h = "14.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
text = "#(argb,8,8,3)color(0,0,0,0.8)";
colorText[] = {0, 0, 0, "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"};
colorBackground[] = {0, 0, 0, "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"};
@ -72,7 +72,7 @@ class GVAR(menu) {
idc = 11;
x = "13.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "14.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "5 * (((safezoneW / safezoneH) min 1.2) / 40)";
w = "6 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)";
@ -96,8 +96,15 @@ class GVAR(menu) {
class btnUnload: btnCancel {
text = CSTRING(unloadObject);
idc = 12;
x = "20.9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
x = "19.9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
action = QUOTE(ACE_player call FUNC(startUnload));
};
class btnPlace: btnUnload {
text = CSTRING(deployObject);
idc = 13;
y = "15.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
action = QUOTE(ACE_player call FUNC(startDeploy));
colorDisabled[] = {0.25, 0.25, 0.25, 1};
};
};
};

View File

@ -33,6 +33,40 @@
<Chinesesimp>卸载</Chinesesimp>
<Turkish>Boşalt</Turkish>
</Key>
<Key ID="STR_ACE_Cargo_deployObject">
<English>Deploy</English>
</Key>
<Key ID="STR_ACE_Cargo_ScrollAction">
<English>Raise/Lower | (Ctrl + Scroll) Rotate</English>
<German>Heben/Senken | (Strg + Scrollen) Drehen</German>
<Italian>Alza/Abbassa | (Ctrl + Rotellina) Ruota</Italian>
<French>Lever/Baisser | (Ctrl + Scroll) Rotation</French>
<Japanese>上げる/下げる | (Ctrl + スクロール) 回転</Japanese>
<Czech>Zvednout/Snížit | (Ctrl + Kolečko myši) Otáčet</Czech>
<Russian>Поднять/опустить | (Ctrl + Скролл) Крутить</Russian>
<Polish>Wyżej/niżej | (Ctrl + Kółko myszy) obracanie</Polish>
<Turkish>Yükselt/Alçalt | (Ctrl + Tekerlek) Döndür</Turkish>
<Spanish>Subir/Bajar | (Ctrl + Scroll) Rotar</Spanish>
<Chinesesimp>抬起/放低 |Ctrl + 鼠标滚轮)旋转</Chinesesimp>
<Korean>높이기/내리기 | (컨트롤 + 스크롤) 회전</Korean>
<Portuguese>Subir/Abaixar | (Ctrl + Scroll) Rotacionar</Portuguese>
</Key>
<Key ID="STR_ACE_Cargo_BlockedAction">
<English>Blocked</English>
<Spanish>Obstruido</Spanish>
<Portuguese>Bloqueado</Portuguese>
<Russian>Заблокировано</Russian>
<Czech>Blokováno</Czech>
<Polish>Zablokowany</Polish>
<Italian>Bloccato</Italian>
<German>Blockiert</German>
<French>Bloqué</French>
<Japanese>取り付け不可</Japanese>
<Korean>막힘</Korean>
<Chinesesimp>断开</Chinesesimp>
<Chinese>斷開</Chinese>
<Turkish>Bloke Edilmiş</Turkish>
</Key>
<Key ID="STR_ACE_Cargo_renamedObject">
<English>Renamed to:&lt;br/&gt;%1</English>
<Japanese>名前を次に変更:&lt;br/&gt;%1</Japanese>
@ -528,5 +562,11 @@
<French>Active si les éléments de cargaison sont portés ou traînés après le déchargement.</French>
<Portuguese>Controla se os itens de carga são carregados ou arrastados após a descarga.</Portuguese>
</Key>
<Key ID="STR_ACE_Cargo_enableDeploy">
<English>Enable deploy</English>
</Key>
<Key ID="STR_ACE_Cargo_enableDeploy_description">
<English>Controls whether cargo items can be unloaded via the deploy method.</English>
</Key>
</Package>
</Project>

View File

@ -142,7 +142,7 @@ if (isServer) then {
if ((!isNil "_zeusLogic") && {!isNull _zeusLogic}) then {
{
if ((_x getvariable ["bis_fnc_moduleRemoteControl_owner", objnull]) isEqualTo _dcPlayer) exitWith {
INFO_3("[%1] DC - Was Zeus [%2] while controlling unit [%3] - manually clearing `bis_fnc_moduleRemoteControl_owner`", [_x] call FUNC(getName), _dcPlayer, _x);
INFO_3("[%1] DC - Was Zeus [%2] while controlling unit [%3] - manually clearing `bis_fnc_moduleRemoteControl_owner`",[_x] call FUNC(getName),_dcPlayer,_x);
_x setVariable ["bis_fnc_moduleRemoteControl_owner", nil, true];
};
nil

View File

@ -5,7 +5,7 @@
if (isFilePatchingEnabled) then {
private _notLoaded = configProperties [configfile >> "ace_notLoaded", "isText _x"];
{
INFO_2("%1 not loaded because %2",configName _x, getText _x);
INFO_2("%1 not loaded because %2",configName _x,getText _x);
} forEach _notLoaded;
};

File diff suppressed because it is too large Load Diff

View File

@ -18,11 +18,11 @@ private _allUnits = [];
{
private _class = configFile >> "CfgVehicles" >> _x;
if (isNull _class) then {
WARNING_1("in units[] but null - %1", _x);
WARNING_1("in units[] but null - %1",_x);
_testPass = false;
} else {
// if (((getNumber (_class >> "scope")) != 2) && {((getNumber (_class >> "scopeCurator")) != 2)}) then {
// WARNING_2("in units[] but not public - %1 from %2", configName _class, configSourceMod _class);
// WARNING_2("in units[] but not public - %1 from %2",configName _class,configSourceMod _class);
// _testPass = false;
// };
};
@ -36,11 +36,11 @@ private _allWeapons = [];
{
private _class = configFile >> "CfgWeapons" >> _x;
if (isNull _class) then {
WARNING_1("in weapons[] but null - %1", _x);
WARNING_1("in weapons[] but null - %1",_x);
_testPass = false;
} else {
// if (((getNumber (_class >> "scope")) != 2) && {((getNumber (_class >> "scopeCurator")) != 2)}) then {
// WARNING_2("in weapons[] but not public - %1 from %2", configName _class, configSourceMod _class);
// WARNING_2("in weapons[] but not public - %1 from %2",configName _class,configSourceMod _class);
// _testPass = false;
// };
};
@ -51,7 +51,7 @@ private _vics = "(configName _x) select [0,3] == 'ace'" configClasses (configFil
{
if (((getNumber (_x >> "scope")) == 2) || {((getNumber (_x >> "scopeCurator")) == 2)}) then {
if (!((toLower configName _x) in _allUnits)) then {
WARNING_2("Not in any units[] - %1 from %2", configName _x, configSourceMod _x);
WARNING_2("Not in any units[] - %1 from %2",configName _x,configSourceMod _x);
_testPass = false;
};
};
@ -63,7 +63,7 @@ private _weapons = "(configName _x) select [0,3] == 'ace'" configClasses (config
private _type = toLower configName _x;
if (((getNumber (_x >> "scope")) == 2) || {((getNumber (_x >> "scopeCurator")) == 2)}) then {
if (!((toLower configName _x) in _allWeapons)) then {
WARNING_2("Not in any weapons[] - %1 from %2", configName _x, configSourceMod _x);
WARNING_2("Not in any weapons[] - %1 from %2",configName _x,configSourceMod _x);
_testPass = false;
};
};

View File

@ -27,7 +27,7 @@ if (isServer) then {
params ["_eventName", "_client"];
if !(_eventName in GVAR(syncedEvents)) exitWith {
ERROR_1("Request for synced event - key [%1] not found.", _eventName);
ERROR_1("Request for synced event - key [%1] not found.",_eventName);
false
};

View File

@ -20,7 +20,7 @@
params ["_name", "_args", "_ttl"];
if !(_name in GVAR(syncedEvents)) exitWith {
ERROR_1("Synced event key [%1] not found (_handleSyncedEvent).", _name);
ERROR_1("Synced event key [%1] not found (_handleSyncedEvent).",_name);
false
};

View File

@ -22,7 +22,7 @@ private _output = [format ["// CBA Settings [ADDON: %1]:", _addon]];
private _addonSearch = _addon + "_";
private _addonSearchCount = count _addonSearch;
TRACE_2("",_addonSearch, _addonSearchCount);
TRACE_2("",_addonSearch,_addonSearchCount);
private _settings = configProperties [configFile >> "ACE_Settings", "(isClass _x) && {((configName _x) select [0, _addonSearchCount]) == _addonSearch}"];

View File

@ -34,7 +34,7 @@ private _aceSettings = configProperties [configFile >> "ACE_Settings", "isClass
if (_isClientSettable && {_currentValue isNotEqualTo _profileVar}) then {
// CBA_settings_fnc_set will do type checking for the old profile var
private _ret = [_settingName, _profileVar, 0, "client", true] call CBA_settings_fnc_set;
INFO_3("Transfering setting [%1: %2] returned %3", _settingName, _profileVar, _ret);
INFO_3("Transfering setting [%1: %2] returned %3",_settingName,_profileVar,_ret);
};
};
} forEach _aceSettings;

View File

@ -80,7 +80,7 @@ if (_oldCompats isNotEqualTo []) then {
_oldCompats = _oldCompats apply {format ["%1 (%2)", _x select 0, _x select 1]};
[{
// Lasts for ~10 seconds
ERROR_WITH_TITLE_3("The following ACE compatiblity PBOs are outdated", "%1. ACE Main version is %2 from %3.",_this select 0,_this select 1,_this select 2);
ERROR_WITH_TITLE_3("The following ACE compatiblity PBOs are outdated","%1. ACE Main version is %2 from %3.",_this select 0,_this select 1,_this select 2);
}, [_oldCompats, _mainVersion, _mainSource], 1] call CBA_fnc_waitAndExecute;
};

View File

@ -219,7 +219,7 @@ if (_state) then {
_keyPressedInfo set [1, ((_keyPressedInfo select 1) - 1) max 0];
if (_keyPressedInfo isEqualTo [false, 0]) then {
GVAR(keyboardInputMain) deleteAt _key
GVAR(keyboardInputMain) deleteAt _key;
};
}, _key, 0.5] call CBA_fnc_waitAndExecute;
}];

View File

@ -24,7 +24,7 @@
BEGIN_COUNTER(firedEH);
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile"];
TRACE_7("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile);
TRACE_7("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
if (_unit isKindOf "CAManBase") then {
// The unit it on foot

View File

@ -27,7 +27,7 @@ if (getNumber (_unitAnimationCfg >> "terminal") == 1) exitWith {_animationState}
private _unitActionsCfg = configFile >> "CfgMovesBasic" >> "Actions" >> getText (_unitAnimationCfg >> "actions");
TRACE_2("Animation/Action", configName _unitAnimationCfg, configName _unitActionsCfg);
TRACE_2("Animation/Action",configName _unitAnimationCfg,configName _unitActionsCfg);
if (vehicle _unit != _unit) then {
private _interpolateArray = getArray (_unitAnimationCfg >> "interpolateTo");

View File

@ -25,7 +25,7 @@ private _pov = getText (_turret >> "memoryPointGunnerOptics");
private _gunBeg = getText (_turret >> "gunBeg");
private _gunEnd = getText (_turret >> "gunEnd");
TRACE_3("", _pov, _gunBeg, _gunEnd);
TRACE_3("",_pov,_gunBeg,_gunEnd);
// Pull the PIP pov or barrel direction, depending on how the model is set up
private _povPos = _vehicle modelToWorldVisualWorld (_vehicle selectionPosition _pov);

View File

@ -5,10 +5,10 @@
*
* Arguments:
* 0: The Unit (usually the player) <OBJECT>
* 1: Force a return type <NUMBER, BOOLEAN>
* 1: Return imperial units <NUMBER, BOOLEAN>
*
* Return Value:
* The return value <NUMBER>
* Weight string <STRING>
*
* Example:
* [player] call ace_common_fnc_getWeight

View File

@ -22,7 +22,7 @@ params ["_soundClass", "_posASL", "_volume", "_distance"];
private _sound = getArray (configFile >> "CfgSounds" >> _soundClass >> "sound");
if (_sound isEqualTo []) exitWith {
ERROR_1("CfgSounds class [%1] does not exist or contains empty sound array", _soundClass);
ERROR_1("CfgSounds class [%1] does not exist or contains empty sound array",_soundClass);
};
TRACE_2("sound",_soundClass,_sound);

View File

@ -23,7 +23,7 @@ params ["_logic", "_settingName", "_moduleVariable"];
// Check if the variable is already defined
if (isNil _settingName) exitWith {
ERROR_1("readSettingFromModule - param [%1] is not an ace_setting", _settingName);
ERROR_1("readSettingFromModule - param [%1] is not an ace_setting",_settingName);
};
// Check if the parameter is defined in the module

View File

@ -32,7 +32,7 @@ TRACE_1("Reading missionConfigFile params",_paramsArray);
// Check if the variable is already defined
if (isNil _settingName) exitWith {
ERROR_1("readSettingsFromParamsArray - param [%1] is not an ace_setting", _settingName);
ERROR_1("readSettingsFromParamsArray - param [%1] is not an ace_setting",_settingName);
};
// The setting is not forced, so update the value
@ -52,7 +52,7 @@ TRACE_1("Reading missionConfigFile params",_paramsArray);
};
if (!_validValue) exitWith {
WARNING_3("readSettingsFromParamsArray - param [%1] type not valid [%2] - expected type [%3]", _settingName,_settingValue,_settingType);
WARNING_3("readSettingsFromParamsArray - param [%1] type not valid [%2] - expected type [%3]",_settingName,_settingValue,_settingType);
};
if ([_settingName, "mission"] call CBA_settings_fnc_isForced) then {

View File

@ -18,7 +18,7 @@
params ["_name"];
if !(_name in GVAR(syncedEvents)) exitWith {
ERROR_1("Synced event key [%1] not found (removeSyncedEventHandler).", _name);
ERROR_1("Synced event key [%1] not found (removeSyncedEventHandler)",_name);
false
};

View File

@ -22,7 +22,7 @@ private _startTime = diag_tickTime;
private _fails = [];
private _total = 0;
INFO_1("ace_common_fnc_runTests starting for [%1]", _specificTest);
INFO_1("ace_common_fnc_runTests starting for [%1]",_specificTest);
{
private _testName = configName _x;
@ -41,8 +41,8 @@ INFO_1("ace_common_fnc_runTests starting for [%1]", _specificTest);
};
} forEach (configProperties [configFile >> "ACE_Tests"]);
INFO_1("ace_common_fnc_runTests finished in %1 ms", (1000 * (diag_tickTime - _startTime)) toFixed 1);
INFO_2("[%1 / %2] Tests Passed", (_total - (count _fails)), _total);
INFO_1("ace_common_fnc_runTests finished in %1 ms",(1000 * (diag_tickTime - _startTime)) toFixed 1);
INFO_2("[%1 / %2] Tests Passed",(_total - (count _fails)),_total);
if (_fails isNotEqualTo []) then {
INFO_1("Failed: %1", _fails);
INFO_1("Failed: %1",_fails);
};

View File

@ -38,4 +38,4 @@ if (abs(_value - _oldValue) < _tolerance) exitWith {};
_object setVariable [_varName, _value, true];
_object setVariable [_oldVarName, _value];
TRACE_2("Published variable:", _varName, _value);
TRACE_2("Published variable:",_varName,_value);

View File

@ -34,7 +34,7 @@ if (_object isEqualTo (_object getVariable [format ["ACE_onEmbargo_%1", _varName
_object setVariable [_varName, _value, true];
_object setVariable [format ["ACE_onEmbargo_%1", _varName], _object];
TRACE_2("Starting Embargo", _varName, _delay);
TRACE_2("Starting Embargo",_varName,_delay);
[{
params ["_object", "_varName", "_value"];
@ -43,7 +43,7 @@ TRACE_2("Starting Embargo", _varName, _delay);
_object setVariable [format ["ACE_onEmbargo_%1", _varName], nil]; //Remove Embargo
private _curValue = _object getVariable _varName;
TRACE_4("End of embargo", _object, _varName, _value, _curValue);
TRACE_4("End of embargo",_object,_varName,_value,_curValue);
//If value at start of embargo doesn't equal current, then broadcast and start new embargo
if (_value isNotEqualTo _curValue) then {

View File

@ -41,11 +41,11 @@ if (isArray (missionConfigFile >> "showHUD")) then {
if (_reason != "") then {
_reason = toLower _reason;
if (_mask isEqualTo []) then {
TRACE_2("Removing", _reason, _mask);
TRACE_2("Removing",_reason,_mask);
GVAR(showHudHash) deleteAt _reason;
} else {
while {(count _mask) < 10} do { _mask pushBack true; };
TRACE_2("Setting", _reason, _mask);
TRACE_2("Setting",_reason,_mask);
GVAR(showHudHash) set [_reason, _mask];
};
};
@ -63,7 +63,7 @@ for "_index" from 0 to 9 do {
_resultMask pushBack _set;
};
TRACE_2("showHud", _resultMask, keys GVAR(showHudHash));
TRACE_2("showHud",_resultMask,keys GVAR(showHudHash));
showHud _resultMask;
_resultMask

View File

@ -21,8 +21,8 @@
params [["_name", "", [""]], ["_isGlobal", false, [false]], ["_commonReasonsArray", [], [[]]], ["_sendJIP", false, [false]]];
TRACE_3("params",_name,_isGlobal,_commonReasonsArray);
if (_name == "") exitWith {ERROR_1("addStatusEffect - Bad Name %1", _this)};
if (_name in GVAR(statusEffect_Names)) exitWith {WARNING_1("addStatusEffect - Effect Already Added (note, will not update global bit) %1", _this)};
if (_name == "") exitWith {ERROR_1("addStatusEffect - Bad Name %1",_this)};
if (_name in GVAR(statusEffect_Names)) exitWith {WARNING_1("addStatusEffect - Effect Already Added (note, will not update global bit) %1",_this)};
if (_sendJIP && !_isGlobal) exitWith {WARNING_1("addStatusEffect - Trying to add non-global JIP effect %1",_this)};
GVAR(statusEffect_Names) pushBack _name;

View File

@ -22,12 +22,12 @@ TRACE_2("params",_object,_isLocal);
//Only run this after the settings are initialized
//Need to wait for all EH to be installed (local event will happen between pre and post init)
if !(GVAR(settingsInitFinished)) exitWith {
TRACE_1("pushing to runAtSettingsInitialized", _this);
TRACE_1("pushing to runAtSettingsInitialized",_this);
GVAR(runAtSettingsInitialized) pushBack [FUNC(statusEffect_localEH), _this];
};
if (!_isLocal) exitWith {TRACE_1("object no longer local", _this)};
if (isNull _object) exitWith {TRACE_1("object null", _this)};
if (!_isLocal) exitWith {TRACE_1("object no longer local",_this)};
if (isNull _object) exitWith {TRACE_1("object null",_this)};
//Reset any variables because of respawn
[_object, false] call FUNC(statusEffect_resetVariables);

View File

@ -21,12 +21,12 @@ TRACE_1("params",_object);
//Only run this after the settings are initialized
//Need to wait for all EH to be installed (local event will happen between pre and post init)
if !(GVAR(settingsInitFinished)) exitWith {
TRACE_1("pushing to runAtSettingsInitialized", _this);
TRACE_1("pushing to runAtSettingsInitialized",_this);
GVAR(runAtSettingsInitialized) pushBack [FUNC(statusEffect_respawnEH), _this];
};
if (!local _object) exitWith {TRACE_1("object no longer local", _this)};
if (isNull _object) exitWith {TRACE_1("object null", _this)};
if (!local _object) exitWith {TRACE_1("object no longer local",_this)};
if (isNull _object) exitWith {TRACE_1("object null",_this)};
//Reset any variables on "real" respawn
[_object, false] call FUNC(statusEffect_resetVariables);

View File

@ -32,17 +32,17 @@ if (isNull _object) exitWith {};
private _eventName = format [QGVAR(%1), _x];
switch (true) do {
case (GVAR(statusEffect_sendJIP) select _forEachIndex): {
TRACE_2("Sending Global JIP Event", _object, _effectNumber);
TRACE_2("Sending Global JIP Event",_object,_effectNumber);
private _jipID = format [QGVAR(effect_%1_%2), _eventName, hashValue _object];
[_eventName, [_object, _effectNumber], _jipID] call CBA_fnc_globalEventJIP;
[_jipID, _object] call CBA_fnc_removeGlobalEventJIP;
};
case (GVAR(statusEffect_isGlobal) select _forEachIndex): {
TRACE_2("Sending Global Event", _object, _effectNumber);
TRACE_2("Sending Global Event",_object,_effectNumber);
[_eventName, [_object, _effectNumber]] call CBA_fnc_globalEvent;
};
default {
TRACE_2("Sending Target Event", _object, _effectNumber);
TRACE_2("Sending Target Event",_object,_effectNumber);
[_eventName, [_object, _effectNumber], _object] call CBA_fnc_targetEvent;
};
};

View File

@ -23,7 +23,7 @@ TRACE_4("params",_object,_effectName,_ID,_set);
//Only run this after the settings are initialized
if !(GVAR(settingsInitFinished)) exitWith {
TRACE_1("pushing to runAtSettingsInitialized", _this);
TRACE_1("pushing to runAtSettingsInitialized",_this);
GVAR(runAtSettingsInitialized) pushBack [FUNC(statusEffect_set), _this];
};

View File

@ -20,7 +20,7 @@
params ["_name", "_args", ["_ttl", 0]];
if !(_name in GVAR(syncedEvents)) exitWith {
ERROR_1("Synced event key [%1] not found (syncedEvent).", _name);
ERROR_1("Synced event key [%1] not found (syncedEvent)",_name);
false
};

View File

@ -35,7 +35,7 @@ if (_emptyPos isEqualTo []) then {
};
if (count _emptyPos != 3) exitwith {
WARNING_4("Could not find unload pos %1-ASL: %2 isTouchingGround: %3 Speed: %4",_vehicle, getPosASL _vehicle, isTouchingGround _vehicle, speed _vehicle);
WARNING_4("Could not find unload pos %1-ASL: %2 isTouchingGround: %3 Speed: %4",_vehicle,getPosASL _vehicle,isTouchingGround _vehicle,speed _vehicle);
if ((!isNull _unloader) && {[_unloader] call FUNC(isPlayer)}) then {
//display text saying there are no safe places to exit the vehicle
[QGVAR(displayTextStructured), [localize LSTRING(NoRoomToUnload)], [_unloader]] call CBA_fnc_targetEvent;

View File

@ -0,0 +1 @@
z\ace\addons\compat_cup_terrains

View File

@ -0,0 +1,5 @@
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_SCRIPT(XEH_postInit));
};
};

View File

@ -0,0 +1,48 @@
class CfgVehicles {
class House;
class House_Small_F;
class Strategic;
class House_EP1: House {};
class Land_Benzina_schnell: House {
transportFuel = 0;
EGVAR(refuel,hooks)[] = {{-1.5,-3.93,-1.25}, {2.35,-3.93,-1.25}};
EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL;
class ACE_Actions {
class ACE_MainActions {
displayName = ECSTRING(interaction,MainAction);
position = "[0,-3.93,-1.25]";
distance = 5;
condition = "true";
};
};
};
class Land_A_FuelStation_Feed: Strategic {
transportFuel = 0;
EGVAR(refuel,hooks)[] = {{-0.34,0,0}, {0.34,0,0}};
EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL;
};
class Land_Ind_FuelStation_Feed_EP1: House_EP1 {
transportFuel = 0;
EGVAR(refuel,hooks)[] = {{-0.34,0,0}, {0.34,0,0}};
EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL;
};
class Land_FuelStation_Feed_PMC: Strategic {
transportFuel = 0;
EGVAR(refuel,hooks)[] = {{-0.34,0,0}, {0.34,0,0}};
EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL;
};
class FuelStation: House_Small_F {
transportFuel = 0;
EGVAR(refuel,hooks)[] = {{1.25, .2, -1.1}};
EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL;
class ACE_Actions {
class ACE_MainActions {
displayName = ECSTRING(interaction,MainAction);
position = "[1.25, .2, -1]";
distance = 5;
condition = "true";
};
};
};
};

View File

@ -0,0 +1,5 @@
#include "script_component.hpp"
if (["CUP_Terrains_ACE_compat"] call EFUNC(common,isModLoaded)) exitWith {
ERROR_WITH_TITLE("Duplicate CUP/ACE Compats","Compats are now part of ACE - Uninstall 'CUP ACE3 Compatibility Addon - Terrains'");
};

View File

@ -0,0 +1,27 @@
#include "script_component.hpp"
#include "\z\ace\addons\refuel\defines.hpp"
class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {
"CABuildings",
"CAStructuresHouse_A_FuelStation",
"CAStructures_E_Ind_Ind_FuelStation",
"CAStructures_PMC_FuelStation",
"CUP_Buildings_Config",
"ace_refuel" // not a sub-component because it's all this compat does
};
skipWhenMissingDependencies = 1;
author = ECSTRING(common,ACETeam);
authors[] = {"Community Upgrade Project", "Mike"};
url = ECSTRING(main,URL);
VERSION_CONFIG;
};
};
#include "CfgVehicles.hpp"
#include "CfgEventHandlers.hpp"

View File

@ -0,0 +1,5 @@
#define COMPONENT compat_cup_terrains
#define COMPONENT_BEAUTIFIED CUP Terrains Compatibility
#include "\z\ace\addons\main\script_mod.hpp"
#include "\z\ace\addons\main\script_macros.hpp"

View File

@ -1,7 +1,14 @@
class CfgWeapons {
// Last update: RHSAFRF 0.5.6
class rhs_acc_perst3;
class rhs_acc_perst3_2dp: rhs_acc_perst3 {
baseWeapon = "rhs_acc_perst3_2dp";
class rhs_acc_perst3_2dp_light;
class rhs_acc_perst3_2dp_light_h: rhs_acc_perst3_2dp_light {
baseWeapon = "rhs_acc_perst3_2dp_h";
};
class acc_pointer_IR;
class rhs_acc_perst1ik: acc_pointer_IR {
MRT_SwitchItemHintText = ""; // prevent false info for illuminator stat
MRT_SwitchItemNextClass = "";
MRT_SwitchItemPrevClass = "";
};
};

View File

@ -15,4 +15,4 @@ class CfgPatches {
};
};
//#include "CfgWeapons.hpp"
#include "CfgWeapons.hpp"

View File

@ -3,6 +3,9 @@ class CfgWeapons {
class acc_pointer_IR;
class rhsusf_acc_anpeq15: acc_pointer_IR {
baseWeapon = "rhsusf_acc_anpeq15";
MRT_SwitchItemHintText = ""; // prevent false info for illuminator stat
MRT_SwitchItemNextClass = "";
MRT_SwitchItemPrevClass = "";
};
class rhsusf_acc_anpeq15_bk: rhsusf_acc_anpeq15 {
baseWeapon = "rhsusf_acc_anpeq15_bk";
@ -28,8 +31,12 @@ class CfgWeapons {
class rhsusf_acc_wmx_bk: rhsusf_acc_M952V {
baseWeapon = "rhsusf_acc_wmx_bk";
};
class rhsusf_acc_anpeq15A: acc_pointer_IR {
baseWeapon = "rhsusf_acc_anpeq15A";
MRT_SwitchItemHintText = ""; // prevent false info for illuminator stat
MRT_SwitchItemNextClass = "";
MRT_SwitchItemPrevClass = "";
};
class rhsusf_acc_anpeq15_top: rhsusf_acc_anpeq15A {
baseWeapon = "rhsusf_acc_anpeq15_top";
@ -37,8 +44,12 @@ class CfgWeapons {
class rhsusf_acc_anpeq15_bk_top: rhsusf_acc_anpeq15_top {
baseWeapon = "rhsusf_acc_anpeq15_bk_top";
};
class rhsusf_acc_anpeq15side: acc_pointer_IR {
baseWeapon = "rhsusf_acc_anpeq15side";
MRT_SwitchItemHintText = ""; // prevent false info for illuminator stat
MRT_SwitchItemNextClass = "";
MRT_SwitchItemPrevClass = "";
};
class rhsusf_acc_anpeq15side_bk: rhsusf_acc_anpeq15side {
baseWeapon = "rhsusf_acc_anpeq15side_bk";

View File

@ -33,7 +33,7 @@ private _magazine = _magazines select _magazineIndex;
_magazine params ["_magazineClassname", "_amountOfMagazines"];
if (_amountOfMagazines < 0) exitWith {
ERROR_1("mag with no ammo - %1", _magazine);
ERROR_1("mag with no ammo - %1",_magazine);
};
private _removed = _amountOfMagazines min floor(1 + random(6 / GVAR(ammoCookoffDuration)));

View File

@ -4,7 +4,7 @@ class CfgVehicles {
class ACE_SelfActions {
class GVAR(deploy) {
displayName = CSTRING(PlaceTripod_displayName);
condition = QUOTE(call FUNC(assemble_canDeployTripod));
condition = QUOTE(call FUNC(canDeployTripod));
statement = QUOTE(call FUNC(assemble_deployTripod));
exceptions[] = {};
};
@ -36,7 +36,7 @@ class CfgVehicles {
condition = "true";
class GVAR(pickUp) {
displayName = CSTRING(Pickup_displayName);
condition = QUOTE(call FUNC(assemble_canPickupTripod));
condition = QUOTE(call FUNC(canPickupTripod));
statement = QUOTE(call FUNC(assemble_pickupTripod));
};
class GVAR(mountWeapon) {
@ -125,10 +125,11 @@ class CfgVehicles {
class StaticWeapon: LandVehicle {
class ACE_Actions {
class ACE_MainActions {
// Workaround for static weapons' Get In memory point being at the front of the gun
class GVAR(getIn) {
displayName = CSTRING(GetIn_displayName);
condition = QUOTE(call FUNC(canGetIn));
statement = QUOTE(call FUNC(getIn));
statement = QUOTE(_player moveInTurret [ARR_2(_target,[0])]);
};
};
};

View File

@ -6,9 +6,9 @@ PREP(ai_handleFired);
PREP(ai_handleGetIn);
PREP(ai_reload);
PREP(assemble_canDeployTripod);
PREP(canDeployTripod);
PREP(assemble_canDeployWeapon);
PREP(assemble_canPickupTripod);
PREP(canPickupTripod);
PREP(assemble_canPickupWeapon);
PREP(assemble_deployTripod);
PREP(assemble_deployWeapon);
@ -17,13 +17,12 @@ PREP(assemble_pickupTripod);
PREP(assemble_pickupWeapon);
PREP(canGetIn);
PREP(getIn);
PREP(getCarryMagazine);
PREP(proxyWeapon);
PREP(reload_actionsLoad);
PREP(reload_actionsUnload);
PREP(getLoadActions);
PREP(getUnloadActions);
PREP(reload_canLoadMagazine);
PREP(reload_canUnloadMagazine);
PREP(reload_getLoadableMagazines);
@ -33,5 +32,5 @@ PREP(reload_handleRemoveTurretMag);
PREP(reload_handleReturnAmmo);
PREP(reload_loadMagazine);
PREP(staticWeaponInit);
PREP(initVehicle);
PREP(staticWeaponInit_unloadExtraMags);

View File

@ -6,18 +6,27 @@ GVAR(vehicleMagCache) = createHashMap;
TRACE_3("settingsInit",GVAR(defaultAssemblyMode),GVAR(handleExtraMagazines),GVAR(ammoHandling));
["StaticWeapon", "Init", {
// needs a small delay for network syncing, or we end up with duplicate mags with ammo handling
[LINKFUNC(staticWeaponInit), _this, 1] call CBA_fnc_waitAndExecute;
[LINKFUNC(initVehicle), _this, 1] call CBA_fnc_waitAndExecute;
}, true, [], true] call CBA_fnc_addClassEventHandler;
GVAR(quickmountEnabled) = (
missionNamespace getVariable [QEGVAR(quickmount,enabled), false] &&
{(missionNamespace getVariable [QEGVAR(quickmount,enableMenu), -1]) in [1,3]}
);
}] call CBA_fnc_addEventHandler;
["CBA_SettingChanged", {
GVAR(quickmountEnabled) = (
missionNamespace getVariable [QEGVAR(quickmount,enabled), false] &&
{(missionNamespace getVariable [QEGVAR(quickmount,enableMenu), -1]) in [1,3]}
);
}] call CBA_fnc_addEventHandler;
// Event handlers:
[QGVAR(addTurretMag), LINKFUNC(reload_handleAddTurretMag)] call CBA_fnc_addEventHandler;
[QGVAR(removeTurretMag), LINKFUNC(reload_handleRemoveTurretMag)] call CBA_fnc_addEventHandler;
[QGVAR(returnAmmo), LINKFUNC(reload_handleReturnAmmo)] call CBA_fnc_addEventHandler;
#ifdef DEBUG_MODE_FULL
call compile preprocessFileLineNumbers QPATHTOF(dev\checkStaticWeapons.sqf);
#endif

View File

@ -7,14 +7,14 @@ INFO("Checking static weapons");
private _staticWeaponConfigs = configProperties [configFile >> "CfgVehicles", "(isClass _x) && {(configName _x) isKindOf 'StaticWeapon'}", true];
private _staticPublic = _staticWeaponConfigs select {(getNumber (_x >> "scope")) == 2};
INFO_2("Static Weapons [%1] - CSW Enabled [%2]",count _staticPublic, {(getNumber (_x >> "ace_csw" >> "enabled")) == 1} count _staticPublic);
INFO_2("Static Weapons [%1] - CSW Enabled [%2]",count _staticPublic,{(getNumber (_x >> QUOTE(ADDON) >> "enabled")) == 1} count _staticPublic);
INFO("------ Checking static weapons inheritance ------");
private _explicitBases = [];
private _inherited = [];
{
private _config = _x;
private _configEnabled = (getNumber (_config >> "ace_csw" >> "enabled")) == 1;
private _configEnabled = (getNumber (_config >> QUOTE(ADDON) >> "enabled")) == 1;
if (_configEnabled) then {
private _configExplicit = (count configProperties [_config, "configName _x == 'ace_csw'", false]) == 1;
if (_configExplicit) then {
@ -69,7 +69,7 @@ private _logAll = false;
{
//IGNORE_PRIVATE_WARNING ["_x", "_y"];
INFO_2("[%1] has no carry varient - Used in %2",_x,_y);
INFO_2("[%1] has no carry variant - Used in %2",_x,_y);
} forEach _hash;
INFO("------ End -------");

View File

@ -12,12 +12,12 @@
* Public: No
*/
params ["_staticWeapon", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
TRACE_8("firedEH:",_staticWeapon,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_gunner);
params ["_vehicle", "_weapon", "", "", "", "_magazine", "", "_gunner"];
TRACE_4("firedEH:",_vehicle,_weapon,_magazine,_gunner);
if (someAmmo _vehicle) exitWith {};
if ((!local _gunner) || {[_gunner] call EFUNC(common,isPlayer)}) exitWith {};
if (someAmmo _staticWeapon) exitWith {};
TRACE_2("need ammo",someAmmo _staticWeapon,magazinesAllTurrets _staticWeapon);
TRACE_1("need ammo",magazinesAllTurrets _vehicle);
[_staticWeapon, _gunner, _weapon, _magazine] call FUNC(ai_reload);
[_vehicle, _gunner, _weapon, _magazine] call FUNC(ai_reload);

View File

@ -11,12 +11,13 @@
*
* Public: No
*/
params ["_staticWeapon", "_role", "_gunner"];
TRACE_3("getInEH:",_staticWeapon,_role,_gunner);
params ["_vehicle", "", "_gunner"];
TRACE_2("getInEH:",_vehicle,_gunner);
if (someAmmo _vehicle) exitWith {};
if ((!local _gunner) || {[_gunner] call EFUNC(common,isPlayer)}) exitWith {};
if (someAmmo _staticWeapon) exitWith {};
TRACE_2("need ammo",someAmmo _staticWeapon,magazinesAllTurrets _staticWeapon);
TRACE_1("need ammo",magazinesAllTurrets _vehicle);
[_staticWeapon, _gunner, currentWeapon _staticWeapon] call FUNC(ai_reload);
[_vehicle, _gunner, currentWeapon _vehicle] call FUNC(ai_reload);

View File

@ -14,6 +14,7 @@
*
* Public: No
*/
params ["_staticWeapon", "_gunner", "_weapon", ["_magazine", ""]];
private _turretPath = [_gunner] call EFUNC(common,getTurretIndex);

View File

@ -1,21 +0,0 @@
#include "..\script_component.hpp"
/*
* Author:tcvm
* Checks if the player can deploy the tripod.
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* Can deploy <BOOL>
*
* Example:
* [player] call ace_csw_fnc_assemble_canDeployTripod
*
* Public: No
*/
params ["_player"];
(getText(configFile >> "CfgWeapons" >> (secondaryWeapon _player) >> QUOTE(ADDON) >> "type") == "mount")

View File

@ -1,6 +1,6 @@
#include "..\script_component.hpp"
/*
* Author:tcvm
* Author: tcvm
* Checks if you can deploy a weapon on the tripod
*
* Arguments:
@ -22,4 +22,3 @@ if (isNil "_carryWeaponClassname") then { _carryWeaponClassname = secondaryWeapo
// If the current launcher has a config-value that defines the tripod, it is a CSW
(alive _target) &&
{(getText(configFile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON) >> "assembleTo" >> (typeOf _target))) != ""}

View File

@ -1,22 +0,0 @@
#include "..\script_component.hpp"
/*
* Author:tcvm
* Checks if the player can pick-up the tripod.
*
* Arguments:
* 0: Tripod <OBJECT>
* 1: Unit <OBJECT>
*
* Return Value:
* Can pickup <BOOL>
*
* Example:
* [tripod, player] call ace_csw_fnc_assemble_canPickupTripod
*
* Public: No
*/
params ["_tripod", "_player"];
((secondaryWeapon _player) isEqualTo "") && {alive _tripod}

View File

@ -1,6 +1,6 @@
#include "..\script_component.hpp"
/*
* Author:tcvm
* Author: tcvm
* If the CSW is mounted or in use this will not allow you to dismount the weapon
*
* Arguments:
@ -23,4 +23,3 @@ private _notCrewed = (crew _staticWeapon) isEqualTo [];
private _deadCrew = !(alive (gunner _staticWeapon)); // need to eject body???
_assemblyMode && {_notCrewed || _deadCrew}

View File

@ -1,6 +1,6 @@
#include "..\script_component.hpp"
/*
* Author:tcvm
* Author: tcvm
* Deploys the tripod
*
* Arguments:
@ -40,7 +40,7 @@
_cswTripod setVariable [QGVAR(secondaryWeaponMagazine), _secondaryWeaponMagazine];
};
if (!GVAR(defaultAssemblyMode)) then {
[_cswTripod, "disableWeaponAssembly", "ace_csw", true] call EFUNC(common,statusEffect_set);
[_cswTripod, "disableWeaponAssembly", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set);
};
private _posATL = _player getRelPos [2, 0];

View File

@ -1,6 +1,6 @@
#include "..\script_component.hpp"
/*
* Author:tcvm
* Author: tcvm
* Deploys the current CSW
*
* Arguments:

View File

@ -1,6 +1,6 @@
#include "..\script_component.hpp"
/*
* Author:tcvm
* Author: tcvm
* Picks up the tripod and adds it to the player launcher slot
*
* Arguments:
@ -44,4 +44,3 @@
TRACE_3("",_pickupTime,typeOf _tripod,_tripodClassname);
[TIME_PROGRESSBAR(_pickupTime), [_tripod, _player, _tripodClassname], _onFinish, {}, localize LSTRING(PickupTripod_progressBar), _condition] call EFUNC(common,progressBar);
}, _this] call CBA_fnc_execNextFrame;

View File

@ -1,6 +1,6 @@
#include "..\script_component.hpp"
/*
* Author:tcvm
* Author: tcvm
* Dismounts the weapon from the tripod and drops its backpack beside
*
* Arguments:

View File

@ -0,0 +1,22 @@
#include "..\script_component.hpp"
/*
* Author: tcvm
* Checks if the unit can deploy a tripod
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* Can deploy <BOOL>
*
* Example:
* player call ace_csw_fnc_canDeployTripod
*
* Public: No
*/
params ["_unit"];
private _secondaryWeapon = secondaryWeapon _unit;
_secondaryWeapon != "" && {getText (configFile >> "CfgWeapons" >> _secondaryWeapon >> QUOTE(ADDON) >> "type") == "mount"} // return

Some files were not shown because too many files have changed in this diff Show More