Merge remote-tracking branch 'refs/remotes/acemod/master'

This commit is contained in:
Jonathan Pereira
2015-11-14 12:20:28 -02:00
30 changed files with 259 additions and 154 deletions

View File

@ -18,7 +18,8 @@ private ["_muzzleVelocityShiftTableUpperLimit", "_temperatureIndexFunction",
"_temperatureIndexA", "_temperatureIndexB", "_interpolationRatio"]; "_temperatureIndexA", "_temperatureIndexB", "_interpolationRatio"];
params["_muzzleVelocityShiftTable", "_temperature"]; params["_muzzleVelocityShiftTable", "_temperature"];
// Check if muzzleVelocityShiftTable is Larger Than 11 Entrys // Check if muzzleVelocityShiftTable is Less Than 11 Entrys
if ((count _muzzleVelocityShiftTable) < 11) exitWith {0};
_muzzleVelocityShiftTableUpperLimit = _muzzleVelocityShiftTable select 10; _muzzleVelocityShiftTableUpperLimit = _muzzleVelocityShiftTable select 10;
if (isNil "_muzzleVelocityShiftTableUpperLimit") exitWith { 0 }; if (isNil "_muzzleVelocityShiftTableUpperLimit") exitWith { 0 };

View File

@ -24,12 +24,12 @@ if (!hasInterface) exitWith {};
if (!GVAR(enabled)) exitWith {}; if (!GVAR(enabled)) exitWith {};
// Parameterization // Parameterization
private ["_abort", "_AmmoCacheEntry", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_bulletMass", "_bulletLength", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_barrelTwist", "_stabilityFactor"]; private ["_abort", "_AmmoCacheEntry", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_bulletMass", "_bulletLength", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletLength", "_barrelTwist", "_stabilityFactor", "_aceTimeSecond", "_barrelVelocityShift", "_ammoTemperatureVelocityShift"];
params ["_unit", "_weapon", "", "_mode", "_ammo", "_magazine", "_bullet"]; params ["_unit", "_weapon", "", "_mode", "_ammo", "_magazine", "_bullet"];
_abort = false; _abort = false;
if (!(_ammo isKindOf "BulletBase")) exitWith {}; if (!(_ammo isKindOf "BulletBase")) exitWith {};
if (!alive _bullet) exitWith {}; if (!alive _bullet) exitWith {};
if (!([_unit] call EFUNC(common,isPlayer))) exitWith {}; if (!([_unit] call EFUNC(common,isPlayer))) exitWith {};
@ -75,22 +75,22 @@ _WeaponCacheEntry params ["_barrelTwist", "_twistDirection", "_barrelLength"];
_bulletVelocity = velocity _bullet; _bulletVelocity = velocity _bullet;
_muzzleVelocity = vectorMagnitude _bulletVelocity; _muzzleVelocity = vectorMagnitude _bulletVelocity;
_barrelVelocityShift = 0;
if (GVAR(barrelLengthInfluenceEnabled)) then { if (GVAR(barrelLengthInfluenceEnabled)) then {
_barrelVelocityShift = uiNamespace getVariable [format [QGVAR(%1_muzzleVelocityShift),_weapon],nil]; _barrelVelocityShift = [_barrelLength, _muzzleVelocityTable, _barrelLengthTable, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift);
if (isNil "_barrelVelocityShift") then {
_barrelVelocityShift = [_barrelLength, _muzzleVelocityTable, _barrelLengthTable, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift);
uiNamespace setVariable [format [QGVAR(%1_muzzleVelocityShift),_weapon],_muzzleVelocityShift];
};
}; };
_ammoTemperatureVelocityShift = 0;
if (GVAR(ammoTemperatureEnabled)) then { if (GVAR(ammoTemperatureEnabled)) then {
_temperature = ((getPosASL _unit) select 2) call EFUNC(weather,calculateTemperatureAtHeight); _temperature = ((getPosASL _unit) select 2) call EFUNC(weather,calculateTemperatureAtHeight);
_temperatureVelocityShift = ([_ammoTempMuzzleVelocityShifts, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift)); _ammoTemperatureVelocityShift = ([_ammoTempMuzzleVelocityShifts, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift));
}; };
if (GVAR(ammoTemperatureEnabled) || GVAR(barrelLengthInfluenceEnabled)) then { if (GVAR(ammoTemperatureEnabled) || GVAR(barrelLengthInfluenceEnabled)) then {
_muzzleVelocityShift = _barrelVelocityShift + _ammoTemperatureVelocityShift;
TRACE_4("shift",_muzzleVelocity,_muzzleVelocityShift, _barrelVelocityShift, _ammoTemperatureVelocityShift);
if (_muzzleVelocityShift != 0) then { if (_muzzleVelocityShift != 0) then {
_muzzleVelocity = _muzzleVelocity + (_barrelVelocityShift + _ammoTemperatureVelocityShift); _muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift;
_bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift)); _bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift));
_bullet setVelocity _bulletVelocity; _bullet setVelocity _bulletVelocity;
}; };

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project name="ACE"> <Project name="ACE">
<Package name="Captives"> <Package name="Captives">
<Key ID="STR_ACE_Captives_SetCaptive"> <Key ID="STR_ACE_Captives_SetCaptive">
@ -181,9 +181,11 @@
</Key> </Key>
<Key ID="STR_ACE_Captives_ModuleHandcuffed_DisplayName"> <Key ID="STR_ACE_Captives_ModuleHandcuffed_DisplayName">
<English>Make Unit Handcuffed</English> <English>Make Unit Handcuffed</English>
<Portuguese>Fazer unidade algemada</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_Captives_ModuleHandcuffed_Description"> <Key ID="STR_ACE_Captives_ModuleHandcuffed_Description">
<English>Sync a unit to make them handcuffed.&lt;br /&gt;Source: ace_captives</English> <English>Sync a unit to make them handcuffed.&lt;br /&gt;Source: ace_captives</English>
<Portuguese>Sincronizar uma unidade para deixá-la algemada.&lt;br/&gt;Source: ace_captives</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_Captives_ModuleSettings_DisplayName"> <Key ID="STR_ACE_Captives_ModuleSettings_DisplayName">
<English>Captives Settings</English> <English>Captives Settings</English>
@ -284,4 +286,4 @@
<Spanish>Rendición o desarme</Spanish> <Spanish>Rendición o desarme</Spanish>
</Key> </Key>
</Package> </Package>
</Project> </Project>

View File

@ -1,5 +1,45 @@
#include "script_component.hpp" #include "script_component.hpp"
["LoadCargo", {_this call FUNC(loadItem)}] call EFUNC(common,addEventHandler);
["UnloadCargo", {_this call FUNC(unloadItem)}] call EFUNC(common,addEventHandler);
["AddCargoByClass", {_this call FUNC(addCargoItem)}] call EFUNC(common,addEventHandler); ["AddCargoByClass", {_this call FUNC(addCargoItem)}] call EFUNC(common,addEventHandler);
["LoadCargo", {
(_this select 0) params ["_item","_vehicle"];
private ["_loaded", "_hint", "_itemName", "_vehicleName"];
_loaded = [_item, _vehicle] call FUNC(loadItem);
// Show hint as feedback
_hint = [LSTRING(LoadingFailed), LSTRING(LoadedItem)] select _loaded;
_itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName");
_vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
["displayTextStructured", [[_hint, _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent);
if (_loaded) then {
// Invoke listenable event
["cargoLoaded", [_item, _vehicle]] call EFUNC(common,globalEvent);
};
}] call EFUNC(common,addEventHandler);
["UnloadCargo", {
(_this select 0) params ["_item","_vehicle"];
private ["_unloaded", "_itemClass", "_hint", "_itemName", "_vehicleName"];
_unloaded = [_item, _vehicle] call FUNC(unloadItem);
_itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item};
// Show hint as feedback
_hint = [LSTRING(UnloadingFailed), LSTRING(UnloadedItem)] select _unloaded;
_itemName = getText (configFile >> "CfgVehicles" >> _itemClass >> "displayName");
_vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
["displayTextStructured", [[_hint, _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent);
if (_unloaded) then {
// Invoke listenable event
["cargoUnloaded", [_item, _vehicle]] call EFUNC(common,globalEvent);
};
// TOOO maybe drag/carry the unloaded item?
}] call EFUNC(common,addEventHandler);

View File

@ -22,20 +22,9 @@ private ["_position", "_item", "_i"];
params ["_itemClass", "_vehicle", ["_amount", 1], ["_showHint", false, [false]] ]; params ["_itemClass", "_vehicle", ["_amount", 1], ["_showHint", false, [false]] ];
TRACE_3("params",_itemClass,_vehicle,_amount); TRACE_3("params",_itemClass,_vehicle,_amount);
_position = getPos _vehicle;
_position set [1, (_position select 1) + 1];
_position set [2, (_position select 2) + 7.5];
for "_i" from 1 to _amount do { for "_i" from 1 to _amount do {
_item = createVehicle [_itemClass, _position, [], 0, "CAN_COLLIDE"]; [_item, _vehicle] call FUNC(loadItem);
// Load item or delete it if no space left
if !([_item, _vehicle, _showHint] call FUNC(loadItem)) exitWith {
TRACE_1("no room to load item - deleting",_item);
deleteVehicle _item;
};
TRACE_1("Item Loaded",_item);
// Invoke listenable event
["cargoAddedByClass", [_itemClass, _vehicle, _amount]] call EFUNC(common,globalEvent);
}; };
// Invoke listenable event
["cargoAddedByClass", [_itemClass, _vehicle, _amount]] call EFUNC(common,globalEvent);

View File

@ -3,7 +3,7 @@
* Check if item can be loaded into other Object. * Check if item can be loaded into other Object.
* *
* Arguments: * Arguments:
* 0: Item Object <OBJECT> * 0: Item <OBJECT or STRING>
* 1: Holder Object (Vehicle) <OBJECT> * 1: Holder Object (Vehicle) <OBJECT>
* *
* Return value: * Return value:
@ -16,14 +16,24 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_item", "_vehicle"]; params [["_item", "", [objNull,""]], "_vehicle"];
if (speed _vehicle > 1 || (((getPos _vehicle) select 2) > 3)) exitWith {false}; if (speed _vehicle > 1 || (((getPos _vehicle) select 2) > 3)) exitWith {false};
private "_itemSize"; private ["_itemSize", "_validItem"];
_itemSize = ([_item] call FUNC(getSizeItem)); _itemSize = [_item] call FUNC(getSizeItem);
(_itemSize > 0) && if (typeName _item == "STRING") then {
{alive _item && alive _vehicle} && _validItem =
{(_item distance _vehicle <= MAX_LOAD_DISTANCE)} && isClass (configFile >> "CfgVehicles" >> _item) &&
{getNumber (configFile >> "CfgVehicles" >> _item >> QGVAR(canLoad)) == 1};
} else {
_validItem =
(alive _item) &&
{(_item distance _vehicle) <= MAX_LOAD_DISTANCE};
};
_validItem &&
{_itemSize > 0} &&
{alive _vehicle} &&
{_itemSize <= ([_vehicle] call FUNC(getCargoSpaceLeft))} {_itemSize <= ([_vehicle] call FUNC(getCargoSpaceLeft))}

View File

@ -16,18 +16,19 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_loaded", "_validVehiclestate", "_emptyPos"];
params ["_item", "_vehicle"]; params ["_item", "_vehicle"];
private ["_loaded", "_itemClass", "_validVehiclestate", "_emptyPos"];
_loaded = _vehicle getVariable [QGVAR(loaded), []]; _loaded = _vehicle getVariable [QGVAR(loaded), []];
if !(_item in _loaded) exitWith {false}; if !(_item in _loaded) exitWith {false};
_itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item};
_validVehiclestate = true; _validVehiclestate = true;
_emptyPos = []; _emptyPos = [];
if (_vehicle isKindOf "Ship" ) then { if (_vehicle isKindOf "Ship" ) then {
if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false}; if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false};
_emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, typeOf _item]); // TODO: if spot is underwater pick another spot. _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, _itemClass]); // TODO: if spot is underwater pick another spot.
} else { } else {
if (_vehicle isKindOf "Air" ) then { if (_vehicle isKindOf "Air" ) then {
if !(speed _vehicle <1 && {isTouchingGround _vehicle}) then {_validVehiclestate = false}; if !(speed _vehicle <1 && {isTouchingGround _vehicle}) then {_validVehiclestate = false};
@ -35,7 +36,7 @@ if (_vehicle isKindOf "Ship" ) then {
_emptyPos = [(_emptyPos select 0) + random(5), (_emptyPos select 1) + random(5), _emptyPos select 2 ]; _emptyPos = [(_emptyPos select 0) + random(5), (_emptyPos select 1) + random(5), _emptyPos select 2 ];
} else { } else {
if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false}; if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false};
_emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, typeOf _item]); _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, _itemClass]);
}; };
}; };

View File

@ -3,7 +3,7 @@
* Get the cargo size of an object. * Get the cargo size of an object.
* *
* Arguments: * Arguments:
* 0: Object <OBJECT> * 0: Item <OBJECT or STRING>
* *
* Return value: * Return value:
* Cargo size <NUMBER> (default: -1) * Cargo size <NUMBER> (default: -1)
@ -15,14 +15,24 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private "_config";
params ["_item"]; params ["_item"];
private ["_isVirtual","_itemClass","_config"];
scopeName "return";
_config = (configFile >> "CfgVehicles" >> typeOf _item >> QGVAR(size)); _isVirtual = (typeName _item == "STRING");
_itemClass = if (_isVirtual) then {_item} else {typeOf _item};
_config = (configFile >> "CfgVehicles" >> _itemClass >> QGVAR(size));
if (isNumber (_config)) exitWith { if (_isVirtual) then {
_item getVariable [QGVAR(size), getNumber (_config)] if (isNumber _config) then {
(getNumber _config) breakOut "return";
};
} else {
_config = (configFile >> "CfgVehicles" >> typeOf _item >> QGVAR(size));
if (isNumber _config) then {
(_item getVariable [QGVAR(size), getNumber _config]) breakOut "return";
};
}; };
-1 -1

View File

@ -20,12 +20,13 @@ params ["_vehicle"];
private["_loaded"]; private["_loaded"];
_loaded = _vehicle getVariable [QGVAR(loaded), []]; _loaded = _vehicle getVariable [QGVAR(loaded), []];
if (count _loaded == 0) exitWith {}; if (_loaded isEqualTo []) exitWith {};
{ {
// TODO deleteVehicle or just delete vehicle? Do we want to be able to recover destroyed equipment? // TODO Do we want to be able to recover destroyed equipment?
deleteVehicle _x; if (typeName _x == "OBJECT") then {
//_x setDamage 1; deleteVehicle _x;
};
} count _loaded; } count _loaded;
[_vehicle] call FUNC(validateCargoSpace); [_vehicle] call FUNC(validateCargoSpace);

View File

@ -1,9 +1,10 @@
/* /*
* Author: Glowbal * Author: Glowbal
* Load object into vehicle. * Load object into vehicle.
* Objects loaded via classname remain virtual until unloaded.
* *
* Arguments: * Arguments:
* 0: Object <OBJECT> * 0: Item <OBJECT or STRING>
* 1: Vehicle <OBJECT> * 1: Vehicle <OBJECT>
* 2: Show Hint <BOOL> (default: true) * 2: Show Hint <BOOL> (default: true)
* *
@ -17,15 +18,10 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params [["_item","",[objNull,""]], ["_vehicle",objNull,[objNull]]];
private ["_loaded", "_space", "_itemSize"]; private ["_loaded", "_space", "_itemSize"];
params ["_item", "_vehicle", ["_showHint", true, [true]] ]; if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitWith {false};
TRACE_2("params",_item,_vehicle);
if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitWith {
TRACE_2("canLoadItemIn failed",_item,_vehicle);
false
};
_loaded = _vehicle getVariable [QGVAR(loaded), []]; _loaded = _vehicle getVariable [QGVAR(loaded), []];
_loaded pushback _item; _loaded pushback _item;
@ -37,21 +33,10 @@ _space = [_vehicle] call FUNC(getCargoSpaceLeft);
_itemSize = [_item] call FUNC(getSizeItem); _itemSize = [_item] call FUNC(getSizeItem);
_vehicle setVariable [QGVAR(space), _space - _itemSize, true]; _vehicle setVariable [QGVAR(space), _space - _itemSize, true];
detach _item; if (typeName _item == "OBJECT") then {
_item attachTo [_vehicle,[0,0,100]]; detach _item;
["hideObjectGlobal", [_item, true]] call EFUNC(common,serverEvent); _item attachTo [_vehicle,[0,0,-100]];
["hideObjectGlobal", [_item, true]] call EFUNC(common,serverEvent);
// show hint
private ["_itemName", "_vehicleName"];
_itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName");
_vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
if (_showHint) then {
["displayTextStructured", [[localize LSTRING(LoadedItem), _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent);
}; };
// Invoke listenable event
["cargoLoaded", [_item, _vehicle]] call EFUNC(common,globalEvent);
true true

View File

@ -22,7 +22,7 @@ params ["_display"];
uiNamespace setVariable [QGVAR(menuDisplay), _display]; uiNamespace setVariable [QGVAR(menuDisplay), _display];
[{ [{
private ["_display","_loaded", "_ctrl", "_label"]; private ["_display","_loaded", "_ctrl", "_class", "_label"];
disableSerialization; disableSerialization;
_display = uiNamespace getVariable QGVAR(menuDisplay); _display = uiNamespace getVariable QGVAR(menuDisplay);
if (isnil "_display") exitWith { if (isnil "_display") exitWith {
@ -40,7 +40,8 @@ uiNamespace setVariable [QGVAR(menuDisplay), _display];
lbClear _ctrl; lbClear _ctrl;
{ {
_ctrl lbAdd (getText(configfile >> "CfgVehicles" >> typeOf _x >> "displayName")); _class = if (typeName _x == "STRING") then {_x} else {typeOf _x};
_ctrl lbAdd (getText(configfile >> "CfgVehicles" >> _class >> "displayName"));
true true
} count _loaded; } count _loaded;

View File

@ -16,16 +16,25 @@
#include "script_component.hpp" #include "script_component.hpp"
params ["_player", "_object"]; params ["_player", "_object"];
private ["_vehicle", "_size", "_displayName"];
private ["_nearestVehicle"]; _vehicle = [_player] call FUNC(findNearestVehicle);
_nearestVehicle = [_player] call FUNC(findNearestVehicle);
if (isNull _nearestVehicle || _nearestVehicle isKindOf "Cargo_Base_F") then { if (isNull _vehicle || _vehicle isKindOf "Cargo_Base_F") then {
{ {
if ([_object, _x] call FUNC(canLoadItemIn)) exitWith {_nearestVehicle = _x}; if ([_object, _x] call FUNC(canLoadItemIn)) exitWith {_vehicle = _x};
} foreach (nearestObjects [_player, ["Cargo_base_F", "Land_PaperBox_closed_F"], MAX_LOAD_DISTANCE]); } foreach (nearestObjects [_player, ["Cargo_base_F", "Land_PaperBox_closed_F"], MAX_LOAD_DISTANCE]);
}; };
if (isNull _nearestVehicle) exitWith {false}; if (isNull _vehicle) exitWith {false};
[_object, _nearestVehicle] call FUNC(loadItem) // Start progress bar
if ([_object, _vehicle] call FUNC(canLoadItemIn)) then {
_size = [_object] call FUNC(getSizeItem);
[5 * _size, [_object,_vehicle], "LoadCargo", {}, localize LSTRING(LoadingItem)] call EFUNC(common,progressBar);
} else {
_displayName = getText (configFile >> "CfgVehicles" >> typeOf _object >> "displayName");
["displayTextStructured", [[LSTRING(LoadingFailed), _displayName], 3.0]] call EFUNC(common,localEvent);
};

View File

@ -20,7 +20,7 @@ private ["_display", "_loaded", "_ctrl", "_selected", "_item"];
disableSerialization; disableSerialization;
_display = uiNamespace getVariable QGVAR(menuDisplay); _display = uiNamespace getVariable QGVAR(menuDisplay);
if (isnil "_display") exitWith {}; if (isNil "_display") exitWith {};
_loaded = GVAR(interactionVehicle) getVariable [QGVAR(loaded), []]; _loaded = GVAR(interactionVehicle) getVariable [QGVAR(loaded), []];
if (count _loaded == 0) exitWith {}; if (count _loaded == 0) exitWith {};
@ -32,4 +32,17 @@ _selected = (lbCurSel _ctrl) max 0;
if (count _loaded <= _selected) exitWith {}; if (count _loaded <= _selected) exitWith {};
_item = _loaded select _selected; _item = _loaded select _selected;
[_item, GVAR(interactionVehicle)] call FUNC(unloadItem);
// Start progress bar
private ["_size", "_itemClass", "_displayName"];
if ([_item, GVAR(interactionVehicle)] call FUNC(canUnloadItem)) then {
_size = [_item] call FUNC(getSizeItem);
[5 * _size, [_item, GVAR(interactionVehicle)], "UnloadCargo", {}, localize LSTRING(UnloadingItem)] call EFUNC(common,progressBar);
} else {
_itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item};
_displayName = getText (configFile >> "CfgVehicles" >> _itemClass >> "displayName");
["displayTextStructured", [[LSTRING(UnloadingFailed), _displayName], 3.0]] call EFUNC(common,localEvent);
};

View File

@ -3,7 +3,7 @@
* Unload object from vehicle. * Unload object from vehicle.
* *
* Arguments: * Arguments:
* 0: Object <OBJECT> * 0: Item <OBJECT or STRING>
* 1: Vehicle <OBJECT> * 1: Vehicle <OBJECT>
* *
* Return value: * Return value:
@ -16,20 +16,21 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_loaded", "_space", "_itemSize", "_emptyPos", "_validVehiclestate"];
params ["_item", "_vehicle"]; params ["_item", "_vehicle"];
private ["_loaded", "_space", "_itemSize", "_emptyPos", "_validVehiclestate"];
if !([_item, _vehicle] call FUNC(canUnloadItem)) exitWith { if !([_item, _vehicle] call FUNC(canUnloadItem)) exitWith {
false false
}; };
_itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item};
_validVehiclestate = true; _validVehiclestate = true;
_emptyPos = []; _emptyPos = [];
if (_vehicle isKindOf "Ship" ) then { if (_vehicle isKindOf "Ship" ) then {
if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false}; if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false};
TRACE_1("SHIP Ground Check", getPosATL _vehicle ); TRACE_1("SHIP Ground Check", getPosATL _vehicle );
_emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, typeOf _item]); // TODO: if spot is underwater pick another spot. _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, _itemClass]); // TODO: if spot is underwater pick another spot.
} else { } else {
if (_vehicle isKindOf "Air" ) then { if (_vehicle isKindOf "Air" ) then {
if !(speed _vehicle <1 && {isTouchingGround _vehicle}) then {_validVehiclestate = false}; if !(speed _vehicle <1 && {isTouchingGround _vehicle}) then {_validVehiclestate = false};
@ -39,38 +40,29 @@ if (_vehicle isKindOf "Ship" ) then {
} else { } else {
if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false}; if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false};
TRACE_1("Vehicle Ground Check", isTouchingGround _vehicle); TRACE_1("Vehicle Ground Check", isTouchingGround _vehicle);
_emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 13, typeOf _item]); _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 13, _itemClass]);
}; };
}; };
TRACE_1("getPosASL Vehicle Check", getPosASL _vehicle); TRACE_1("getPosASL Vehicle Check", getPosASL _vehicle);
if (!_validVehiclestate) exitWith {false}; if (!_validVehiclestate) exitWith {false};
if (count _emptyPos == 0) exitWith {false}; //consider displaying text saying there are no safe places to exit the vehicle if (count _emptyPos == 0) exitWith {false};
_loaded = _vehicle getVariable [QGVAR(loaded), []]; _loaded = _vehicle getVariable [QGVAR(loaded), []];
_loaded = _loaded - [_item]; _loaded deleteAt (_loaded find _item);
_vehicle setVariable [QGVAR(loaded), _loaded, true]; _vehicle setVariable [QGVAR(loaded), _loaded, true];
_space = [_vehicle] call FUNC(getCargoSpaceLeft); _space = [_vehicle] call FUNC(getCargoSpaceLeft);
_itemSize = [_item] call FUNC(getSizeItem); _itemSize = [_item] call FUNC(getSizeItem);
_vehicle setVariable [QGVAR(space), (_space + _itemSize), true]; _vehicle setVariable [QGVAR(space), (_space + _itemSize), true];
detach _item; if (typeName _item == "OBJECT") then {
_item setPosASL (_emptyPos call EFUNC(common,PositiontoASL)); detach _item;
["hideObjectGlobal", [_item, false]] call EFUNC(common,serverEvent); _item setPosASL (_emptyPos call EFUNC(common,PositiontoASL));
["hideObjectGlobal", [_item, false]] call EFUNC(common,serverEvent);
// show hint } else {
private ["_itemName", "_vehicleName"]; createVehicle [_item, _emptyPos, [], 0, ""];
};
_itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName");
_vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
["displayTextStructured", [[localize LSTRING(UnloadedItem), _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent);
// TOOO maybe drag/carry the unloaded item?
// Invoke listenable event
["cargoUnloaded", [_item, _vehicle]] call EFUNC(common,globalEvent);
true true

View File

@ -24,7 +24,7 @@ _loaded = _vehicle getVariable [QGVAR(loaded), []];
_newLoaded = []; _newLoaded = [];
_totalSpaceOccupied = 0; _totalSpaceOccupied = 0;
{ {
if !(isNull _x) then { if ((typeName _x == "STRING") || {!isNull _x}) then {
_newLoaded pushback _x; _newLoaded pushback _x;
_totalSpaceOccupied = _totalSpaceOccupied + ([_x] call FUNC(getSizeItem)); _totalSpaceOccupied = _totalSpaceOccupied + ([_x] call FUNC(getSizeItem));
}; };
@ -35,4 +35,4 @@ if (count _loaded != count _newLoaded) then {
_vehicle setVariable [QGVAR(loaded), _newLoaded, true]; _vehicle setVariable [QGVAR(loaded), _newLoaded, true];
}; };
_vehicle setVariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeof _vehicle >> QGVAR(space)) - _totalSpaceOccupied, true]; _vehicle setVariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(space)) - _totalSpaceOccupied, true];

View File

@ -95,5 +95,17 @@
<Hungarian>1%&lt;br/&gt;kirakodva ebből:&lt;br/&gt;%2</Hungarian> <Hungarian>1%&lt;br/&gt;kirakodva ebből:&lt;br/&gt;%2</Hungarian>
<Russian>%1&lt;br/&gt;разгружен из&lt;br/&gt;%2</Russian> <Russian>%1&lt;br/&gt;разгружен из&lt;br/&gt;%2</Russian>
</Key> </Key>
<Key ID="STR_ACE_Cargo_LoadingItem">
<English>Loading Cargo</English>
</Key>
<Key ID="STR_ACE_Cargo_UnloadingItem">
<English>Unloading Cargo</English>
</Key>
<Key ID="STR_ACE_Cargo_LoadingFailed">
<English>%1&lt;br/&gt;could not be loaded</English>
</Key>
<Key ID="STR_ACE_Cargo_UnloadingFailed">
<English>%1&lt;br/&gt;could not be unloaded</English>
</Key>
</Package> </Package>
</Project> </Project>

View File

@ -30,4 +30,4 @@ GVAR(vectorConnected) = false;
GVAR(noVectorData) = true; GVAR(noVectorData) = true;
GVAR(vectorGrid) = "00000000"; GVAR(vectorGrid) = "00000000";
["RangerfinderData", {_this call FUNC(handleRangeFinderData)}] call EFUNC(common,addEventHandler); ["RangerfinderData", FUNC(handleRangeFinderData)] call EFUNC(common,addEventHandler);

View File

@ -74,13 +74,13 @@ GVAR(menuRun) = true;
GVAR(menuRun) = false; GVAR(menuRun) = false;
[_this select 1] call CBA_fnc_removePerFrameHandler; [_this select 1] call CBA_fnc_removePerFrameHandler;
}; };
if (GVAR(MENU_B)) then { if (GVAR(MENU_B)) then {
GVAR(menu) = "main"; GVAR(menu) = "main";
GVAR(selection) = 0; GVAR(selection) = 0;
GVAR(numSelections) = 5; GVAR(numSelections) = 5;
}; };
if (!GVAR(add) && !GVAR(edit)) then { if (!GVAR(add) && !GVAR(edit)) then {
if (GVAR(DOWN)) then { if (GVAR(DOWN)) then {
GVAR(selection) = (GVAR(numSelections) + GVAR(selection) + 1); GVAR(selection) = (GVAR(numSelections) + GVAR(selection) + 1);
@ -90,7 +90,7 @@ GVAR(menuRun) = true;
}; };
GVAR(selection) = if (GVAR(numSelections) > 0) then { GVAR(selection) % GVAR(numSelections) } else { 0 }; GVAR(selection) = if (GVAR(numSelections) > 0) then { GVAR(selection) % GVAR(numSelections) } else { 0 };
}; };
if (GVAR(LEFT)) then { if (GVAR(LEFT)) then {
GVAR(pointer) = (8 + GVAR(pointer) - 1); GVAR(pointer) = (8 + GVAR(pointer) - 1);
}; };
@ -98,7 +98,7 @@ GVAR(menuRun) = true;
GVAR(pointer) = (8 + GVAR(pointer) + 1); GVAR(pointer) = (8 + GVAR(pointer) + 1);
}; };
GVAR(pointer) = GVAR(pointer) % 8; GVAR(pointer) = GVAR(pointer) % 8;
(__dsp displayCtrl __PSelection1) ctrlSetText ""; (__dsp displayCtrl __PSelection1) ctrlSetText "";
(__dsp displayCtrl __PSelection2) ctrlSetText ""; (__dsp displayCtrl __PSelection2) ctrlSetText "";
(__dsp displayCtrl __PSelection3) ctrlSetText ""; (__dsp displayCtrl __PSelection3) ctrlSetText "";
@ -113,7 +113,7 @@ GVAR(menuRun) = true;
(__dsp displayCtrl __Selection2) ctrlSetText ""; (__dsp displayCtrl __Selection2) ctrlSetText "";
(__dsp displayCtrl __Selection3) ctrlSetText ""; (__dsp displayCtrl __Selection3) ctrlSetText "";
(__dsp displayCtrl __Selection4) ctrlSetText ""; (__dsp displayCtrl __Selection4) ctrlSetText "";
(__dsp displayCtrl __F1) ctrlSetText ""; (__dsp displayCtrl __F1) ctrlSetText "";
(__dsp displayCtrl __F2) ctrlSetText ""; (__dsp displayCtrl __F2) ctrlSetText "";
(__dsp displayCtrl __F3) ctrlSetText ""; (__dsp displayCtrl __F3) ctrlSetText "";
@ -124,7 +124,7 @@ GVAR(menuRun) = true;
(__dsp displayCtrl __Option2) ctrlSetText ""; (__dsp displayCtrl __Option2) ctrlSetText "";
(__dsp displayCtrl __Option3) ctrlSetText ""; (__dsp displayCtrl __Option3) ctrlSetText "";
(__dsp displayCtrl __Option4) ctrlSetText ""; (__dsp displayCtrl __Option4) ctrlSetText "";
switch (GVAR(menu)) do { switch (GVAR(menu)) do {
case "main": { case "main": {
if (GVAR(SEL)) then { if (GVAR(SEL)) then {
@ -500,7 +500,7 @@ GVAR(menuRun) = true;
case 6: { GVAR(digit6) = (10 + GVAR(digit6) - 1) % 10 }; case 6: { GVAR(digit6) = (10 + GVAR(digit6) - 1) % 10 };
case 7: { GVAR(digit7) = (10 + GVAR(digit7) - 1) % 10 }; case 7: { GVAR(digit7) = (10 + GVAR(digit7) - 1) % 10 };
case 8: { GVAR(digit8) = (10 + GVAR(digit8) - 1) % 10 }; case 8: { GVAR(digit8) = (10 + GVAR(digit8) - 1) % 10 };
}; };
}; };
}; };
}; };
@ -590,7 +590,7 @@ GVAR(menuRun) = true;
}; };
}; };
}; };
if (!GVAR(busy)) then { if (!GVAR(busy)) then {
GVAR(F3) = false; GVAR(F3) = false;
GVAR(F2) = false; GVAR(F2) = false;

View File

@ -31,18 +31,19 @@ if (GVAR(outputPFH) != -1) exitWith {};
GVAR(outputPFH) = [{ GVAR(outputPFH) = [{
private["_dagrElevation", "_dagrGrid", "_dagrHeading", "_dagrSpeed", "_dagrTime", "_elevation", "_gridArray", "_speed"]; private["_dagrElevation", "_dagrGrid", "_dagrHeading", "_dagrSpeed", "_dagrTime", "_elevation", "_gridArray", "_speed"];
// Abort Condition // Abort Condition
if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith { if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith {
GVAR(outputPFH) = -1; GVAR(outputPFH) = -1;
135471 cutText ["", "PLAIN"]; 135471 cutText ["", "PLAIN"];
[_this select 1] call CBA_fnc_removePerFrameHandler; [_this select 1] call CBA_fnc_removePerFrameHandler;
}; };
// GRID // GRID
_gridArray = [(getPos ACE_player), false] call EFUNC(common,getMapGridFromPos); _gridArray = [(getPos ACE_player), false] call EFUNC(common,getMapGridFromPos);
_dagrGrid = format ["%1 %2", ((_gridArray select 0) select [0,4]), ((_gridArray select 1) select [0,4])]; _gridArray params ["_gridArrayX","_gridArrayY"];
_dagrGrid = format ["%1 %2", ((_gridArrayX) select [0,4]), ((_gridArrayY) select [0,4])];
// SPEED // SPEED
_speed = speed (vehicle ACE_player); _speed = speed (vehicle ACE_player);
_speed = floor (_speed * 10) / 10; _speed = floor (_speed * 10) / 10;
@ -68,7 +69,7 @@ GVAR(outputPFH) = [{
__gridControl ctrlSetText format ["%1", _dagrGrid]; __gridControl ctrlSetText format ["%1", _dagrGrid];
__speedControl ctrlSetText format ["%1", _dagrSpeed]; __speedControl ctrlSetText format ["%1", _dagrSpeed];
__elevationControl ctrlSetText format ["%1", _dagrElevation]; __elevationControl ctrlSetText format ["%1", _dagrElevation];
__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1 <20>", _dagrHeading] }); __headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1 <20>", _dagrHeading] });
__timeControl ctrlSetText format ["%1", _dagrTime]; __timeControl ctrlSetText format ["%1", _dagrTime];
}, GVAR(updateInterval), []] call CBA_fnc_addPerFrameHandler; }, GVAR(updateInterval), []] call CBA_fnc_addPerFrameHandler;

View File

@ -1,4 +1,4 @@
/* /*
* Author: Rosuto * Author: Rosuto
* DAGR vector output loop * DAGR vector output loop
* *
@ -14,7 +14,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_pos", "_xGrid", "_yGrid", "_dagrGrid", "_bearing", "_dagrDist", "_dagrElevation", "_dagrTime", "_elevation", "_xCoord", "_yCoord"]; private ["_xGrid", "_yGrid", "_dagrGrid", "_bearing", "_dagrDist", "_dagrElevation", "_dagrTime", "_elevation", "_xCoord", "_yCoord"];
135471 cutRsc ["DAGR_DISPLAY", "plain down"]; 135471 cutRsc ["DAGR_DISPLAY", "plain down"];
@ -30,15 +30,14 @@ private ["_pos", "_xGrid", "_yGrid", "_dagrGrid", "_bearing", "_dagrDist", "_dag
__background ctrlSetText QUOTE(PATHTOF(UI\dagr_vector.paa)); __background ctrlSetText QUOTE(PATHTOF(UI\dagr_vector.paa));
if (GVAR(noVectorData)) exitwith {}; if (GVAR(noVectorData)) exitwith {};
GVAR(LAZPOS) params ["_lazPosX", "_lazPosY", "_lazPosZ"];
_pos = [GVAR(LAZPOS) select 0, GVAR(LAZPOS) select 1];
// Incase grids go neg due to 99-00 boundry // Incase grids go neg due to 99-00 boundry
if (_pos select 0 < 0) then {_pos set [0, (_pos select 0) + 99999];}; if (_lazPosX < 0) then { _lazPosX = _lazPosX + 99999;};
if (_pos select 1 < 0) then {_pos set [1, (_pos select 1) + 99999];}; if (_lazPosY < 0) then {_lazPosY = _lazPosY + 99999;};
// Find laser position // Find laser position
_xGrid = toArray Str(round(_pos select 0)); _xGrid = toArray Str(round _lazPosX);
while {count _xGrid < 5} do { while {count _xGrid < 5} do {
_xGrid = [48] + _xGrid; _xGrid = [48] + _xGrid;
@ -47,7 +46,7 @@ _xGrid resize 4;
_xGrid = toString _xGrid; _xGrid = toString _xGrid;
_xGrid = parseNumber _xGrid; _xGrid = parseNumber _xGrid;
_yGrid = toArray Str(round(_pos select 1)); _yGrid = toArray Str(round _lazPosY);
while {count _yGrid < 5} do { while {count _yGrid < 5} do {
_yGrid = [48] + _yGrid; _yGrid = [48] + _yGrid;
}; };
@ -72,7 +71,7 @@ _yCoord = switch true do {
_dagrGrid = _xCoord + " " + _yCoord; _dagrGrid = _xCoord + " " + _yCoord;
// Find target elevation // Find target elevation
_elevation = floor ((GVAR(LAZPOS) select 2) + EGVAR(common,mapAltitude)); _elevation = floor ((_lazPosZ) + EGVAR(common,mapAltitude));
_dagrElevation = str _elevation + "m"; _dagrElevation = str _elevation + "m";
// Time // Time
@ -94,5 +93,5 @@ GVAR(vectorGrid) = _dagrGrid;
__gridControl ctrlSetText format ["%1", _dagrGrid]; __gridControl ctrlSetText format ["%1", _dagrGrid];
__speedControl ctrlSetText format ["%1", _dagrDist]; __speedControl ctrlSetText format ["%1", _dagrDist];
__elevationControl ctrlSetText format ["%1", _dagrElevation]; __elevationControl ctrlSetText format ["%1", _dagrElevation];
__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _bearing] } else { format ["%1<EFBFBD>", _bearing] }); __headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _bearing] } else { format ["%1°", _bearing] });
__timeControl ctrlSetText format ["%1", _dagrTime]; __timeControl ctrlSetText format ["%1", _dagrTime];

View File

@ -1,4 +1,4 @@
/* /*
* Author: Rosuto * Author: Rosuto
* DAGR waypoint output loop * DAGR waypoint output loop
* *
@ -31,22 +31,23 @@ if (GVAR(outputPFH) != -1) exitWith {};
GVAR(outputPFH) = [{ GVAR(outputPFH) = [{
private["_MYpos", "_WPpos", "_bearing", "_dagrDistance", "_dagrGrid", "_dagrHeading", "_distance", "_gridArray"]; private["_MYpos", "_WPpos", "_bearing", "_dagrDistance", "_dagrGrid", "_dagrHeading", "_distance", "_gridArray"];
// Abort Condition // Abort Condition
if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith { if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith {
GVAR(outputPFH) = -1; GVAR(outputPFH) = -1;
135471 cutText ["", "PLAIN"]; 135471 cutText ["", "PLAIN"];
[_this select 1] call CBA_fnc_removePerFrameHandler; [_this select 1] call CBA_fnc_removePerFrameHandler;
}; };
// GRID // GRID
_gridArray = [(getPos ACE_player), false] call EFUNC(common,getMapGridFromPos); _gridArray = [(getPos ACE_player), false] call EFUNC(common,getMapGridFromPos);
_dagrGrid = format ["%1 %2", ((_gridArray select 0) select [0,4]), ((_gridArray select 1) select [0,4])]; _gridArray params ["_gridArrayX","_gridArrayY"];
_dagrGrid = format ["%1 %2", (_gridArrayX select [0,4]), (_gridArrayY select [0,4])];
// WP Grid // WP Grid
_xGrid2 = floor (DAGR_WP_INFO / 10000); _xGrid2 = floor (DAGR_WP_INFO / 10000);
_yGrid2 = DAGR_WP_INFO - _xGrid2 * 10000; _yGrid2 = DAGR_WP_INFO - _xGrid2 * 10000;
_xCoord2 = switch true do { _xCoord2 = switch true do {
case (_xGrid2 >= 1000): { "" + Str(_xGrid2) }; case (_xGrid2 >= 1000): { "" + Str(_xGrid2) };
case (_xGrid2 >= 100): { "0" + Str(_xGrid2) }; case (_xGrid2 >= 100): { "0" + Str(_xGrid2) };
@ -60,7 +61,7 @@ GVAR(outputPFH) = [{
case (_yGrid2 >= 10): { "00" + Str(_yGrid2) }; case (_yGrid2 >= 10): { "00" + Str(_yGrid2) };
default { "000" + Str(_yGrid2) }; default { "000" + Str(_yGrid2) };
}; };
_dagrGrid2 = _xCoord2 + " " + _yCoord2; _dagrGrid2 = _xCoord2 + " " + _yCoord2;
// Distance // Distance
@ -69,7 +70,7 @@ GVAR(outputPFH) = [{
_distance = _MYpos distance _WPpos; _distance = _MYpos distance _WPpos;
_distance = floor (_distance * 10) / 10; _distance = floor (_distance * 10) / 10;
_dagrDistance = str _distance + "m"; _dagrDistance = str _distance + "m";
// Heading // Heading
_dagrHeading = floor (if (GVAR(useDegrees)) then { _dagrHeading = floor (if (GVAR(useDegrees)) then {
direction (vehicle ACE_player) direction (vehicle ACE_player)
@ -79,12 +80,12 @@ GVAR(outputPFH) = [{
// WP Heading // WP Heading
_bearing = floor ((_WPpos vectorDiff _MYpos) call CBA_fnc_vectDir); _bearing = floor ((_WPpos vectorDiff _MYpos) call CBA_fnc_vectDir);
// Output // Output
__gridControl ctrlSetText format ["%1", _dagrGrid]; __gridControl ctrlSetText format ["%1", _dagrGrid];
__speedControl ctrlSetText format ["%1", _bearing]; __speedControl ctrlSetText format ["%1", _bearing];
__elevationControl ctrlSetText format ["%1", _dagrGrid2]; __elevationControl ctrlSetText format ["%1", _dagrGrid2];
__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1<EFBFBD>", _dagrHeading] }); __headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1°", _dagrHeading] });
__timeControl ctrlSetText format ["%1", _dagrDistance]; __timeControl ctrlSetText format ["%1", _dagrDistance];
}, GVAR(updateInterval), []] call CBA_fnc_addPerFrameHandler; }, GVAR(updateInterval), []] call CBA_fnc_addPerFrameHandler;

View File

@ -23,11 +23,12 @@ if (GVAR(run)) then {
}; };
GVAR(hidden) = true; GVAR(hidden) = true;
[{ [{
EXPLODE_1_PVT(_this select 0,_vehicle); params ["_args", "_idPFH"];
_args params ["_vehicle"];
if (!GVAR(run) || (!alive ACE_player) || (vehicle ACE_player != _vehicle)) exitWith { if (!GVAR(run) || (!alive ACE_player) || (vehicle ACE_player != _vehicle)) exitWith {
GVAR(run) = false; GVAR(run) = false;
135471 cutText ["", "PLAIN"]; 135471 cutText ["", "PLAIN"];
[_this select 1] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
}; };
if (cameraView == "GUNNER") then { if (cameraView == "GUNNER") then {
if (!GVAR(hidden)) then { if (!GVAR(hidden)) then {

View File

@ -6,7 +6,7 @@ class CfgAmmo {
class F_20mm_White: FlareBase {}; class F_20mm_White: FlareBase {};
class ACE_FlashlightProxy_White: F_20mm_White { class ACE_FlashlightProxy_White: F_20mm_White {
model = ""; model = "\A3\Weapons_f\empty";
effectFlare = "FlareShell"; effectFlare = "FlareShell";
triggerTime = 0; triggerTime = 0;

View File

@ -1,5 +1,22 @@
#include "script_component.hpp" #include "script_component.hpp"
//Delete map glow lights from disconnecting players #2810
if (isServer) then {
addMissionEventHandler ["HandleDisconnect",{
params ["_disconnectedPlayer"];
if ((!GVAR(mapGlow)) || {isNull _disconnectedPlayer}) exitWith {};
{
if (_x isKindOf "ACE_FlashlightProxy_White") then {
// ACE_LOGINFO_2("Deleting leftover light [%1:%2] from DC player [%3]", _x, typeOf _x, _disconnectedPlayer);
deleteVehicle _x;
};
} forEach attachedObjects _disconnectedPlayer;
nil
}];
};
// Exit on Headless as well // Exit on Headless as well
if (!hasInterface) exitWith {}; if (!hasInterface) exitWith {};

View File

@ -54,7 +54,7 @@ if (_show) then {
_allInjuryTexts = []; _allInjuryTexts = [];
_genericMessages = []; _genericMessages = [];
if (GVAR(level) >= 2) then { if (GVAR(level) >= 2 && {([_unit] call FUNC(hasMedicalEnabled))}) then {
_partText = [LSTRING(Head), LSTRING(Torso), LSTRING(LeftArm) ,LSTRING(RightArm) ,LSTRING(LeftLeg), LSTRING(RightLeg)] select _selectionN; _partText = [LSTRING(Head), LSTRING(Torso), LSTRING(LeftArm) ,LSTRING(RightArm) ,LSTRING(LeftLeg), LSTRING(RightLeg)] select _selectionN;
_genericMessages pushback [localize _partText, [1, 1, 1, 1]]; _genericMessages pushback [localize _partText, [1, 1, 1, 1]];
}; };
@ -87,7 +87,7 @@ if (_show) then {
_damaged = [false, false, false, false, false, false]; _damaged = [false, false, false, false, false, false];
_selectionBloodLoss = [0,0,0,0,0,0]; _selectionBloodLoss = [0,0,0,0,0,0];
if (GVAR(level) >= 2) then { if (GVAR(level) >= 2 && {([_target] call FUNC(hasMedicalEnabled))}) then {
_openWounds = _target getvariable [QGVAR(openWounds), []]; _openWounds = _target getvariable [QGVAR(openWounds), []];
private "_amountOf"; private "_amountOf";
{ {

View File

@ -19,7 +19,7 @@
params ["_target", "_player", "_selectionN", "_actionData"]; params ["_target", "_player", "_selectionN", "_actionData"];
if (GVAR(level) < 2) exitwith { if (GVAR(level) < 2 || {!([_target] call FUNC(hasMedicalEnabled))}) exitwith {
private ["_pointDamage"]; private ["_pointDamage"];
_pointDamage = (_target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]) select _selectionN; _pointDamage = (_target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]) select _selectionN;

View File

@ -62,7 +62,7 @@ _damaged = [false, false, false, false, false, false];
_selectionBloodLoss = [0, 0, 0, 0, 0, 0]; _selectionBloodLoss = [0, 0, 0, 0, 0, 0];
_allInjuryTexts = []; _allInjuryTexts = [];
if (EGVAR(medical,level) >= 2) then { if ((EGVAR(medical,level) >= 2) && {([_target] call EFUNC(medical,hasMedicalEnabled))}) then {
_openWounds = _target getVariable [QEGVAR(medical,openWounds), []]; _openWounds = _target getVariable [QEGVAR(medical,openWounds), []];
private "_amountOf"; private "_amountOf";
{ {

View File

@ -308,6 +308,9 @@ class CfgVehicles {
class O_Heli_Light_02_F: Heli_Light_02_base_F { class O_Heli_Light_02_F: Heli_Light_02_base_F {
displayName = CSTRING(Heli_Light_02_Name); displayName = CSTRING(Heli_Light_02_Name);
}; };
class O_Heli_Light_02_v2_F: Heli_Light_02_base_F {
displayName = CSTRING(Heli_Light_02_v2_Name);
};
class Heli_Light_02_unarmed_base_F; class Heli_Light_02_unarmed_base_F;
class O_Heli_Light_02_unarmed_F: Heli_Light_02_unarmed_base_F { class O_Heli_Light_02_unarmed_F: Heli_Light_02_unarmed_base_F {
displayName = CSTRING(Heli_Light_02_unarmed_Name); displayName = CSTRING(Heli_Light_02_unarmed_Name);

View File

@ -817,6 +817,17 @@
<Hungarian>Ka-60 Kasatka</Hungarian> <Hungarian>Ka-60 Kasatka</Hungarian>
<Italian>Ka-60 Kasatka</Italian> <Italian>Ka-60 Kasatka</Italian>
</Key> </Key>
<Key ID="STR_ACE_RealisticNames_Heli_Light_02_v2_Name">
<English>Ka-60 Kasatka (Black &amp; White)</English>
<Czech>Ka-60 Kasatka (černobílá)</Czech>
<French>Ka-60 Kasatka (noir et blanc)</French>
<German>Ka-60 Kasatka (Schwarz-weiß)</German>
<Italian>Ka-60 Kasatka (bianco e nero)</Italian>
<Polish>Ka-60 Kasatka (czarno-biały)</Polish>
<Portuguese>Ka-60 Kasatka (preto e branco)</Portuguese>
<Russian>Ka-60 Касатка (белый и черный)</Russian>
<Spanish>Ka-60 Kasatka (blanco y negro)</Spanish>
</Key>
<Key ID="STR_ACE_RealisticNames_Heli_Light_02_unarmed_Name"> <Key ID="STR_ACE_RealisticNames_Heli_Light_02_unarmed_Name">
<English>Ka-60 Kasatka (unarmed)</English> <English>Ka-60 Kasatka (unarmed)</English>
<German>Ka-60 Kasatka (unbewaffnet)</German> <German>Ka-60 Kasatka (unbewaffnet)</German>

View File

@ -16,7 +16,7 @@ def get_private_declare(content):
priv_dec_str = ''.join(priv_srch_declared) priv_dec_str = ''.join(priv_srch_declared)
srch = re.compile('(?<![_a-zA-Z0-9])(_[a-zA-Z]*?)[ ,\}\]\)";]') srch = re.compile('(?<![_a-zA-Z0-9])(_[a-zA-Z0-9]*?)[ ,\}\]\)";]')
priv_split = srch.findall(priv_dec_str) priv_split = srch.findall(priv_dec_str)
priv_split = sorted(set(priv_split)) priv_split = sorted(set(priv_split))
priv_declared += priv_split; priv_declared += priv_split;
@ -27,12 +27,18 @@ def get_private_declare(content):
priv_dec_str = ''.join(priv_srch_declared) priv_dec_str = ''.join(priv_srch_declared)
srch = re.compile('(?<![_a-zA-Z0-9])(_[a-zA-Z]*?)[ ,\}\]\)";]') srch = re.compile('(?<![_a-zA-Z0-9])(_[a-zA-Z0-9]*?)[ ,\}\]\)";]')
priv_split = srch.findall(priv_dec_str) priv_split = srch.findall(priv_dec_str)
priv_split = sorted(set(priv_split)) priv_split = sorted(set(priv_split))
priv_declared += priv_split; priv_declared += priv_split;
srch = re.compile('(?i)[\s]*local[\s]+(_[\w\d]*)[\s]*=.*')
priv_local = srch.findall(content)
priv_local_declared = sorted(set(priv_local))
priv_declared += priv_local_declared;
return priv_declared return priv_declared
@ -53,7 +59,7 @@ def check_privates(filepath):
# Regex search privates # Regex search privates
srch = re.compile('(?<![_a-zA-Z0-9])(_[a-zA-Z]*?)[ ,\^\-\+\/\*\%\}\]\)";]') srch = re.compile('(?<![_a-zA-Z0-9])(_[a-zA-Z0-9]*?)[ =,\^\-\+\/\*\%\}\]\)";]')
priv_use = srch.findall(content) priv_use = srch.findall(content)
priv_use = sorted(set(priv_use)) priv_use = sorted(set(priv_use))