mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge branch 'master' into parseList
Conflicts: addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf
This commit is contained in:
commit
db2572acfd
@ -3,9 +3,9 @@
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://github.com/acemod/ACE3/releases">
|
||||
<img src="https://img.shields.io/badge/Version-3.3.1-blue.svg" alt="ACE3 Version">
|
||||
<img src="https://img.shields.io/badge/Version-3.3.2-blue.svg" alt="ACE3 Version">
|
||||
</a>
|
||||
<a href="https://github.com/acemod/ACE3/releases/download/v3.3.1/ace3_3.3.1.zip">
|
||||
<a href="https://github.com/acemod/ACE3/releases/download/v3.3.2/ace3_3.3.2.zip">
|
||||
<img src="http://img.shields.io/badge/Download-62.0_MB-green.svg" alt="ACE3 Download">
|
||||
</a>
|
||||
<a href="https://github.com/acemod/ACE3/issues">
|
||||
|
BIN
ace_medical.dll
BIN
ace_medical.dll
Binary file not shown.
@ -1,3 +1,3 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
["backpackOpened", DFUNC(backpackOpened)] call EFUNC(common,addEventHandler);
|
||||
["backpackOpened", {_this call FUNC(backpackOpened)}] call EFUNC(common,addEventHandler);
|
||||
|
@ -1,18 +1,19 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Someone opened your backpack. Play sound and camshake. Execute locally.
|
||||
*
|
||||
* Someone opened your backpack. Execute locally.
|
||||
*
|
||||
* Argument:
|
||||
* Arguments:
|
||||
* 0: Who accessed your inventory? (Object)
|
||||
* 1: Unit that wields the backpack (Object)
|
||||
* 2: The backpack object (Object)
|
||||
*
|
||||
* Return value:
|
||||
* None.
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private ["_sounds", "_position"];
|
||||
|
||||
params ["_target", "_backpack"];
|
||||
|
||||
// do cam shake if the target is the player
|
||||
@ -20,7 +21,8 @@ if ([_target] call EFUNC(common,isPlayer)) then {
|
||||
addCamShake [4, 0.5, 5];
|
||||
};
|
||||
|
||||
// play a rustling sound
|
||||
// play a zipper sound effect
|
||||
private ["_sounds", "_position"];
|
||||
|
||||
_sounds = [
|
||||
/*"a3\sounds_f\characters\ingame\AinvPknlMstpSlayWpstDnon_medic.wss",
|
||||
@ -32,8 +34,7 @@ _sounds = [
|
||||
QUOTE(PATHTO_R(sounds\zip_out.wav))
|
||||
];
|
||||
|
||||
_position = _target modelToWorldVisual (_target selectionPosition "Spine3");
|
||||
_position = _position call EFUNC(common,positionToASL);
|
||||
_position = AGLToASL (_target modelToWorldVisual (_target selectionPosition "Spine3"));
|
||||
|
||||
playSound3D [
|
||||
_sounds select floor random count _sounds,
|
||||
|
@ -1,23 +1,24 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Check if the given backpack is an actual backpack that can store items. Parachute, static weapon packs, etc. will return false.
|
||||
*
|
||||
* Check if the given backpack is an actual backpack that can store items. Parachute backpacks will return false for example.
|
||||
* Arguments:
|
||||
* 0: Backpack <OBJECT, STRING>
|
||||
*
|
||||
* Argument:
|
||||
* 0: A backpack (Object or String)
|
||||
* Return Value:
|
||||
* Boolean <BOOL>
|
||||
*
|
||||
* Return value:
|
||||
* Boolean (Bool)
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_config"];
|
||||
params ["_backpack"];
|
||||
|
||||
if (typeName _backpack == "OBJECT") then {
|
||||
_backpack = typeOf _backpack;
|
||||
};
|
||||
|
||||
private "_config";
|
||||
_config = configFile >> "CfgVehicles" >> _backpack;
|
||||
|
||||
getText (_config >> "vehicleClass") == "backpacks" && {getNumber (_config >> "maximumLoad") > 0}
|
||||
getText (_config >> "vehicleClass") == "backpacks" && {getNumber (_config >> "maximumLoad") > 0} // return
|
||||
|
@ -1,17 +1,19 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Handle the open inventory event. Camshake and sound on target client.
|
||||
*
|
||||
* Handle the open inventory event. Display message on target client.
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
* 1: Backpack <OBJECT>
|
||||
*
|
||||
* Argument:
|
||||
* Input from "InventoryOpened" eventhandler
|
||||
*
|
||||
* Return value:
|
||||
* Return Value:
|
||||
* false. Always open the inventory dialog. (Bool)
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit","_backpack"];
|
||||
params ["_unit", "_backpack"];
|
||||
|
||||
// exit if the target is not a real backpack, i.e. parachute, static weapon bag etc.
|
||||
if !([_backpack] call FUNC(isBackpack)) exitWith {false};
|
||||
|
@ -18,7 +18,6 @@ if (isServer) then {
|
||||
}];
|
||||
};
|
||||
|
||||
["playerVehicleChanged", {_this call FUNC(handleVehicleChanged)}] call EFUNC(common,addEventHandler);
|
||||
["zeusDisplayChanged", {_this call FUNC(handleZeusDisplayChanged)}] call EFUNC(common,addEventHandler);
|
||||
["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
|
||||
["MoveInCaptive", {_this call FUNC(vehicleCaptiveMoveIn)}] call EFUNC(common,addEventHandler);
|
||||
|
@ -23,4 +23,9 @@ params ["_unit", "_target"];
|
||||
("ACE_CableTie" in (items _unit)) &&
|
||||
{alive _target} &&
|
||||
{!(_target getVariable [QGVAR(isHandcuffed), false])} &&
|
||||
(GVAR(requireSurrender) == 0 || ((_target getVariable [QGVAR(isSurrendering), false]) || (currentWeapon _target == "" && GVAR(requireSurrender) == 2)))
|
||||
{
|
||||
(_target getVariable ["ACE_isUnconscious", false]) || //isUnconscious
|
||||
{GVAR(requireSurrender) == 0} || //or don't require surrendering
|
||||
{_target getVariable [QGVAR(isSurrendering), false]} || //or is surrendering
|
||||
{(GVAR(requireSurrender) == 2) && {(currentWeapon _target) == ""}} //or "SurrenderOrNoWeapon" and no weapon
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ if (local _unit) then {
|
||||
};
|
||||
|
||||
if (_unit getVariable [QGVAR(isSurrendering), false]) then {
|
||||
[_unit, false] call FUNC(setSurrender);
|
||||
[_unit, false] call FUNC(setSurrendered);
|
||||
};
|
||||
|
||||
if (_unit getVariable [QGVAR(isHandcuffed), false]) then {
|
||||
|
@ -16,85 +16,73 @@ class Extended_Killed_EventHandlers {
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_Init_EventHandlers {
|
||||
//Need initPost or we have problems with setVariable with 'ACE_Cargo'
|
||||
class Extended_InitPost_EventHandlers {
|
||||
class StaticWeapon {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(initObject));
|
||||
};
|
||||
};
|
||||
|
||||
class ReammoBox_F {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(initObject));
|
||||
};
|
||||
};
|
||||
|
||||
class Cargo_base_F {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle));
|
||||
};
|
||||
};
|
||||
|
||||
class CargoNet_01_box_F {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle));
|
||||
};
|
||||
};
|
||||
|
||||
class Land_CargoBox_V1_F {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle));
|
||||
};
|
||||
};
|
||||
|
||||
class Land_PaperBox_closed_F {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle));
|
||||
};
|
||||
};
|
||||
|
||||
class Car {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(initVehicle));
|
||||
};
|
||||
};
|
||||
|
||||
class Tank {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(initVehicle));
|
||||
};
|
||||
};
|
||||
|
||||
class Helicopter {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(initVehicle));
|
||||
};
|
||||
};
|
||||
|
||||
class Plane {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(initVehicle));
|
||||
};
|
||||
};
|
||||
|
||||
class Ship_F {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(initVehicle));
|
||||
};
|
||||
};
|
||||
|
||||
class ACE_RepairItem_Base {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(initObject));
|
||||
};
|
||||
};
|
||||
|
||||
class ACE_bodyBagObject {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(initObject));
|
||||
};
|
||||
};
|
||||
|
||||
class ACE_ConcertinaWireCoil {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(initObject));
|
||||
|
@ -6,6 +6,7 @@
|
||||
* 0: Item Classname <STRING>
|
||||
* 1: Vehicle <OBJECT>
|
||||
* 2: Amount <NUMBER> (default: 1)
|
||||
* 3: Show Hint <BOOL> (default: false)
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
@ -18,7 +19,7 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_position", "_item", "_i"];
|
||||
params ["_itemClass", "_vehicle", ["_amount", 1]];
|
||||
params ["_itemClass", "_vehicle", ["_amount", 1], ["_showHint", false, [false]] ];
|
||||
TRACE_3("params",_itemClass,_vehicle,_amount);
|
||||
|
||||
_position = getPos _vehicle;
|
||||
@ -29,9 +30,11 @@ for "_i" from 1 to _amount do {
|
||||
_item = createVehicle [_itemClass, _position, [], 0, "CAN_COLLIDE"];
|
||||
|
||||
// Load item or delete it if no space left
|
||||
if !([_item, _vehicle] call FUNC(loadItem)) exitWith {
|
||||
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);
|
||||
|
@ -25,7 +25,11 @@ _initializedClasses = GETMVAR(GVAR(initializedClasses),[]);
|
||||
if (isServer) then {
|
||||
{
|
||||
if (isClass _x) then {
|
||||
["AddCargoByClass", [getText (_x >> "type"), _vehicle, getNumber (_x >> "amount")]] call EFUNC(common,localEvent);
|
||||
private ["_cargoClassname", "_cargoCount"];
|
||||
_cargoClassname = getText (_x >> "type");
|
||||
_cargoCount = getNumber (_x >> "amount");
|
||||
TRACE_3("adding ACE_Cargo", (configName _x), _cargoClassname, _cargoCount);
|
||||
["AddCargoByClass", [_cargoClassname, _vehicle, _cargoCount]] call EFUNC(common,localEvent);
|
||||
};
|
||||
} count ("true" configClasses (configFile >> "CfgVehicles" >> _type >> "ACE_Cargo" >> "Cargo"));
|
||||
};
|
||||
@ -41,7 +45,7 @@ if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) != 1) ex
|
||||
private ["_text", "_condition", "_statement", "_icon", "_action"];
|
||||
_condition = {
|
||||
params ["_target", "_player"];
|
||||
GVAR(enable) && {locked _target < 2} && {[_player, _target, []] call EFUNC(common,canInteractWith)}
|
||||
GVAR(enable) && {locked _target < 2} && {alive _target} && {[_player, _target, []] call EFUNC(common,canInteractWith)}
|
||||
};
|
||||
_text = localize LSTRING(openMenu);
|
||||
_statement = {GVAR(interactionVehicle) = _target; createDialog QGVAR(menu);};
|
||||
|
@ -5,6 +5,7 @@
|
||||
* Arguments:
|
||||
* 0: Object <OBJECT>
|
||||
* 1: Vehicle <OBJECT>
|
||||
* 2: Show Hint <BOOL> (default: true)
|
||||
*
|
||||
* Return value:
|
||||
* Object loaded <BOOL>
|
||||
@ -18,14 +19,20 @@
|
||||
|
||||
private ["_loaded", "_space", "_itemSize"];
|
||||
|
||||
params ["_item", "_vehicle"];
|
||||
params ["_item", "_vehicle", ["_showHint", true, [true]] ];
|
||||
TRACE_2("params",_item,_vehicle);
|
||||
|
||||
if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitWith {false};
|
||||
if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitWith {
|
||||
TRACE_2("canLoadItemIn failed",_item,_vehicle);
|
||||
false
|
||||
};
|
||||
|
||||
_loaded = _vehicle getVariable [QGVAR(loaded), []];
|
||||
_loaded pushback _item;
|
||||
_vehicle setVariable [QGVAR(loaded), _loaded, true];
|
||||
|
||||
TRACE_1("added to loaded array",_loaded);
|
||||
|
||||
_space = [_vehicle] call FUNC(getCargoSpaceLeft);
|
||||
_itemSize = [_item] call FUNC(getSizeItem);
|
||||
_vehicle setVariable [QGVAR(space), _space - _itemSize, true];
|
||||
@ -40,7 +47,9 @@ private ["_itemName", "_vehicleName"];
|
||||
_itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName");
|
||||
_vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
|
||||
|
||||
["displayTextStructured", [[localize LSTRING(LoadedItem), _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent);
|
||||
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);
|
||||
|
@ -1,6 +1,8 @@
|
||||
#define COMPONENT cargo
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
// #define DEBUG_MODE_FULL
|
||||
|
||||
#ifdef DEBUG_ENABLED_CARGO
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
@ -17,8 +17,6 @@
|
||||
|
||||
params ["_projectile", "_adjustDir", "_adjustUp", ["_adjustSpeed",0]];
|
||||
|
||||
//["CPD", [_fnc_scriptNameParent, _adjustDir, _adjustUp, _adjustSpeed], nil, false] call FUNC(log);
|
||||
|
||||
private ["_vdir", "_dir", "_up", "_vlat", "_vup", "_vel"];
|
||||
|
||||
// get old direction vector
|
||||
|
@ -92,5 +92,5 @@ if (!isServer) then {
|
||||
};
|
||||
|
||||
if (_checkAll) then {
|
||||
0 spawn COMPILE_FILE(scripts\Version\checkVersionNumber); // @todo
|
||||
0 spawn COMPILE_FILE(scripts\checkVersionNumber); // @todo
|
||||
};
|
||||
|
@ -14,4 +14,6 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
ACE_DEPRECATED("ace_common_fnc_codeToLetter","3.5.0","-");
|
||||
|
||||
["", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] select ([2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 44, 21] find (_this select 0)) + 1
|
||||
|
@ -38,8 +38,7 @@ if (_level <= _defaultLoglevel) then {
|
||||
};
|
||||
diag_log _message;
|
||||
|
||||
// pass it onwards to the log function:
|
||||
// [0, [], compile format["%1",_msg], true] call FUNC(log);
|
||||
|
||||
};
|
||||
|
||||
true
|
||||
|
@ -44,11 +44,7 @@ if (_state) then {
|
||||
|
||||
private ["_dlg", "_ctrl"];
|
||||
|
||||
_dlg = finddisplay 49;
|
||||
_dlg displayAddEventHandler ["KeyDown", {
|
||||
params ["", "_key"];
|
||||
!(_key == 1)
|
||||
}];
|
||||
_dlg = findDisplay 49;
|
||||
|
||||
for "_index" from 100 to 2000 do {
|
||||
(_dlg displayCtrl _index) ctrlEnable false;
|
||||
@ -97,16 +93,17 @@ if (_state) then {
|
||||
|
||||
_dlg displayAddEventHandler ["KeyUp", {true}];
|
||||
|
||||
["ACE_DisableUserInput", "onEachFrame", {
|
||||
GVAR(disableInputPFH) = [{
|
||||
if (isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) && {!visibleMap && isNull findDisplay 49 && isNull findDisplay 312 && isNull findDisplay 632}) then {
|
||||
["ACE_DisableUserInput", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
|
||||
[GVAR(disableInputPFH)] call CBA_fnc_removePerFrameHandler;
|
||||
GVAR(disableInputPFH) = nil;
|
||||
[true] call FUNC(disableUserInput);
|
||||
};
|
||||
}] call BIS_fnc_addStackedEventHandler;
|
||||
|
||||
}, 0, []] call CBA_fnc_addPerFrameHandler;
|
||||
} else {
|
||||
if ("ACE_DisableUserInput" in ([BIS_stackedEventHandlers_onEachFrame, {_this select 0}] call FUNC(map))) then {
|
||||
["ACE_DisableUserInput", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
|
||||
if (!isNil QGVAR(disableInputPFH)) then {
|
||||
[GVAR(disableInputPFH)] call CBA_fnc_removePerFrameHandler;
|
||||
GVAR(disableInputPFH) = nil;
|
||||
};
|
||||
|
||||
(uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0;
|
||||
|
@ -19,14 +19,17 @@ _object = _this;
|
||||
if (!local _object) exitWith {};
|
||||
|
||||
// save and restore hitpoints, see below why
|
||||
private ["_hitPoints", "_hitPointDamages"];
|
||||
private "_hitPointDamages";
|
||||
_hitPointDamages = getAllHitPointsDamage _object;
|
||||
|
||||
_hitPoints = [_object] call FUNC(getHitpoints);
|
||||
_hitPointDamages = [_hitPoints, {_object getHitPointDamage _this}] call FUNC(map);
|
||||
// get correct format for objects without hitpoints
|
||||
if (_hitPointDamages isEqualTo []) then {
|
||||
_hitPointDamages = [[],[],[]];
|
||||
};
|
||||
|
||||
// this prevents physx objects from floating when near other physx objects with allowDamage false
|
||||
_object setDamage damage _object;
|
||||
|
||||
{
|
||||
_object setHitPointDamage [_x, _hitPointDamages select _forEachIndex];
|
||||
} forEach _hitPoints;
|
||||
_object setHitIndex [_forEachIndex, _x];
|
||||
} forEach (_hitPointDamages select 2);
|
||||
|
@ -14,6 +14,8 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
ACE_DEPRECATED("ace_common_fnc_getHitPoints","3.5.0","getAllHitPointsDamage");
|
||||
|
||||
params ["_vehicle"];
|
||||
|
||||
(getAllHitPointsDamage _vehicle select 0) - [""]
|
||||
|
@ -15,6 +15,8 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
ACE_DEPRECATED("ace_common_fnc_getHitPointsWithSelections","3.5.0","getAllHitPointsDamage");
|
||||
|
||||
params ["_vehicle"];
|
||||
|
||||
private "_hitPointsWithSelections";
|
||||
|
@ -17,6 +17,8 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
ACE_DEPRECATED("ace_common_fnc_inheritsFrom","3.5.0","inheritsFrom ARRAY");
|
||||
|
||||
params ["_configEntry", "_configMatch"];
|
||||
|
||||
if (configName _configEntry == _configMatch) exitWith {true};
|
||||
|
@ -14,6 +14,8 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
ACE_DEPRECATED("ace_common_fnc_isAlive","3.5.0","alive");
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
!isNull _unit && {alive _unit} // return
|
||||
|
@ -14,6 +14,8 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
ACE_DEPRECATED("ace_common_fnc_isTurnedOut","3.5.0","isTurnedOut");
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
isTurnedOut _unit // return
|
||||
|
@ -14,4 +14,6 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
ACE_DEPRECATED("ace_common_fnc_letterToCode","3.5.0","-");
|
||||
|
||||
[-1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 44, 21] select (["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] find toUpper (_this select 0)) + 1
|
||||
|
@ -17,7 +17,7 @@
|
||||
params ["_unit", "_vehicle", "_caller"];
|
||||
|
||||
if (!alive _unit) then {
|
||||
_unit = [_unit, _caller] call FUNC(makeCopyOfBody);
|
||||
// _unit = [_unit, _caller] call FUNC(makeCopyOfBody); //func does not exist
|
||||
};
|
||||
|
||||
private "_slotsOpen";
|
||||
@ -41,8 +41,7 @@ if (_slotsOpen) then {
|
||||
|
||||
_vehicle setVariable [QGVAR(loaded_persons), _loaded, true];
|
||||
|
||||
// @todo never used. Remove?
|
||||
/*if !([_unit] call FUNC(isAwake)) then {
|
||||
if !([_unit] call FUNC(isAwake)) then {
|
||||
[{
|
||||
(_this select 0) params ["_unit", "_vehicle"];
|
||||
|
||||
@ -60,5 +59,5 @@ if (_slotsOpen) then {
|
||||
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
}, 0.5, [_unit, _vehicle]] call CBA_fnc_addPerFrameHandler;
|
||||
};*/
|
||||
};
|
||||
};
|
||||
|
@ -19,10 +19,10 @@ _unit setvariable ["ACE_isUnconscious", nil, true];
|
||||
|
||||
if (isPlayer _unit) then {
|
||||
[true] call FUNC(setVolume);
|
||||
[false] call FUNC(disableKeyInput);
|
||||
|
||||
if (["ace_medical"] call FUNC(isModLoader)) then {
|
||||
[false] call EFUNC(medical,effectBlackOut);
|
||||
// [false] call FUNC(disableKeyInput); //func does not exist
|
||||
|
||||
if (["ace_medical"] call FUNC(isModLoaded)) then {
|
||||
// [false] call EFUNC(medical,effectBlackOut); //func does not exist
|
||||
};
|
||||
|
||||
if !(isNil QGVAR(DISABLE_USER_INPUT_COLLECTION)) then {
|
||||
|
@ -14,6 +14,8 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
ACE_DEPRECATED("ace_common_fnc_sortAlphabeticallyBy","3.5.0","sort");
|
||||
|
||||
params ["_array", "_elementN"];
|
||||
|
||||
private ["_elements", "_indexes", "_theElement", "_tmp", "_tempIndex", "_returnArray"];
|
||||
|
@ -14,4 +14,6 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
ACE_DEPRECATED("ace_common_fnc_uniqueElementsOnly","3.5.0","ace_common_fnc_uniqueElements");
|
||||
|
||||
_this call FUNC(uniqueElements)
|
||||
|
@ -73,9 +73,7 @@ _unit action ["Eject", vehicle _unit];
|
||||
|
||||
_unit setPosASL AGLToASL _emptyPos;
|
||||
|
||||
// @todo never used. Remove?
|
||||
/*if !([_unit] call FUNC(isAwake)) then {
|
||||
|
||||
if !([_unit] call FUNC(isAwake)) then {
|
||||
TRACE_1("Check if isAwake", [_unit] call FUNC(isAwake));
|
||||
|
||||
if (driver _unit == _unit) then {
|
||||
@ -92,7 +90,7 @@ _unit action ["Eject", vehicle _unit];
|
||||
};
|
||||
}, [_unit, _anim], 0.5, 0] call FUNC(waitAndExecute);
|
||||
};
|
||||
};*/
|
||||
};
|
||||
}, [_unit, _emptyPos], 0.5, 0] call FUNC(waitAndExecute);
|
||||
|
||||
[_unit, false, GROUP_SWITCH_ID, side group _unit] call FUNC(switchToGroupSide);
|
||||
|
@ -1 +0,0 @@
|
||||
#include "\z\ace\addons\common\script_component.hpp"
|
@ -5,21 +5,25 @@
|
||||
<English>DAGR</English>
|
||||
<Polish>DAGR</Polish>
|
||||
<Spanish>DAGR</Spanish>
|
||||
<Russian>DAGR</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_DAGR_ConfigureDAGR">
|
||||
<English>Configure DAGR</English>
|
||||
<Polish>Konfiguruj DAGR</Polish>
|
||||
<Spanish>Configurar DAGR</Spanish>
|
||||
<Russian>Настроить DAGR</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_DAGR_ToggleDAGR">
|
||||
<English>Toggle DAGR</English>
|
||||
<Polish>Przełącz DAGR</Polish>
|
||||
<Spanish>Mostrar DAGR</Spanish>
|
||||
<Russian>Вкл./выкл. DAGR</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_DAGR_Description">
|
||||
<English>Defense Advanced GPS Receiver</English>
|
||||
<Polish>Defense Advanced GPS Receiver</Polish>
|
||||
<Spanish>Defense Advanced GPS Receiver</Spanish>
|
||||
<Russian>Военный многофункциональный GPS-приёмник</Russian>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
|
@ -25,7 +25,7 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {
|
||||
};
|
||||
|
||||
// drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled))
|
||||
if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then {
|
||||
if (!alive _target || {_unit distance _target > 10}) then {
|
||||
[_unit, _target] call FUNC(dropObject_carry);
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
@ -25,7 +25,7 @@ if !(_unit getVariable [QGVAR(isDragging), false]) exitWith {
|
||||
};
|
||||
|
||||
// drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled))
|
||||
if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then {
|
||||
if (!alive _target || {_unit distance _target > 10}) then {
|
||||
[_unit, _target] call FUNC(dropObject);
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
@ -26,7 +26,7 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {
|
||||
};
|
||||
|
||||
// same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled))
|
||||
if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then {
|
||||
if (!alive _target || {_unit distance _target > 10}) then {
|
||||
[_unit, _target] call FUNC(dropObject);
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
@ -26,7 +26,7 @@ if !(_unit getVariable [QGVAR(isDragging), false]) exitWith {
|
||||
};
|
||||
|
||||
// same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled))
|
||||
if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then {
|
||||
if (!alive _target || {_unit distance _target > 10}) then {
|
||||
[_unit, _target] call FUNC(dropObject);
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
@ -45,7 +45,7 @@ _children = [];
|
||||
format ["Explosive_%1", _forEachIndex],
|
||||
format [_name + " (%1)", _itemCount select _forEachIndex],
|
||||
getText(_x >> "picture"),
|
||||
{_this call FUNC(setupExplosive);},
|
||||
{[{_this call FUNC(setupExplosive)}, _this] call EFUNC(common,execNextFrame)},
|
||||
{true},
|
||||
{},
|
||||
(configName _x)
|
||||
|
@ -87,8 +87,6 @@ if (_suitCoef == 0) then {_suitCoef = 0.001};
|
||||
_gBlackOut = MAXVIRTUALG / _classCoef + MAXVIRTUALG / _suitCoef - MAXVIRTUALG;
|
||||
_gRedOut = MINVIRTUALG / _classCoef;
|
||||
|
||||
["GForces", [], {format ["_g _gBO _coef: %1, %2, %3", _average, _gBlackOut, 2 * ((1.0 - ((_average - 0.30 * _gBlackOut) / (0.70 * _gBlackOut)) ^ 2) max 0) ]}] call EFUNC(common,log);
|
||||
|
||||
// @todo: Sort the interaction with medical
|
||||
if ((_average > _gBlackOut) and {isClass (configFile >> "CfgPatches" >> "ACE_Medical") and {!(ACE_player getVariable ["ACE_isUnconscious", false])}}) then {
|
||||
[ACE_player, true, (10 + floor(random 5))] call EFUNC(medical,setUnconscious);
|
||||
|
@ -17,7 +17,7 @@
|
||||
if (isNull(ace_player)) exitWith {};
|
||||
GVAR(FrameEvent) set [0, !(GVAR(FrameEvent) select 0)];
|
||||
if (GVAR(FrameEvent) select 0) exitWith {
|
||||
if (vehicle ace_player != ace_player && {!([ace_player] call EFUNC(common,isTurnedOut))}) exitWith {(GVAR(FrameEvent) select 1) set [0, false]; };
|
||||
if (vehicle ace_player != ace_player && {!isTurnedOut ACE_player}) exitWith {(GVAR(FrameEvent) select 1) set [0, false]; };
|
||||
GVAR(FrameEvent) set [1, ([ace_player] call FUNC(isInRotorWash))];
|
||||
};
|
||||
private ["_rotorWash","_safe"];
|
||||
|
@ -19,7 +19,7 @@ if (isNull(ace_player) || {!(alive ace_player)}) exitWith {};
|
||||
_fnc_underCover = {
|
||||
private ["_pos", "_unit"];
|
||||
_unit = (_this select 0);
|
||||
if (vehicle _unit != _unit && {!([_unit] call EFUNC(common,isTurnedOut))}) exitWith {true};
|
||||
if (vehicle _unit != _unit && {!isTurnedOut _unit}) exitWith {true};
|
||||
_pos = eyePos _unit;
|
||||
((positionCameraToWorld [0,0,1] select 2) < ((positionCameraToWorld [0,0,0] select 2) - 0.4)) || {(lineIntersects [_pos, _pos vectorAdd [0,0,15], _unit])}
|
||||
};
|
||||
|
@ -1,3 +1,4 @@
|
||||
|
||||
class CfgAmmo {
|
||||
class FlareCore;
|
||||
class FlareBase: FlareCore {
|
||||
|
@ -1,19 +1,20 @@
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE( call COMPILE_FILE(XEH_preInit) );
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE( call COMPILE_FILE(XEH_postInit) );
|
||||
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_FiredBIS_EventHandlers {
|
||||
class CAManBase {
|
||||
class ADDON {
|
||||
clientFiredBIS = QUOTE( _this call FUNC(throwGrenade) );
|
||||
firedBIS = QUOTE(_this call FUNC(throwGrenade));
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -1,9 +1,6 @@
|
||||
|
||||
class CfgVehicles {
|
||||
class NATO_Box_Base;
|
||||
class EAST_Box_Base;
|
||||
class IND_Box_Base;
|
||||
class Box_NATO_Support_F;
|
||||
|
||||
class Box_NATO_Grenades_F: NATO_Box_Base {
|
||||
class TransportItems {
|
||||
MACRO_ADDITEM(ACE_HandFlare_White,12);
|
||||
@ -12,6 +9,7 @@ class CfgVehicles {
|
||||
};
|
||||
};
|
||||
|
||||
class EAST_Box_Base;
|
||||
class Box_East_Grenades_F: EAST_Box_Base {
|
||||
class TransportItems {
|
||||
MACRO_ADDITEM(ACE_HandFlare_Yellow,12);
|
||||
@ -20,6 +18,7 @@ class CfgVehicles {
|
||||
};
|
||||
};
|
||||
|
||||
class IND_Box_Base;
|
||||
class Box_IND_Grenades_F: IND_Box_Base {
|
||||
class TransportItems {
|
||||
MACRO_ADDITEM(ACE_HandFlare_Yellow,12);
|
||||
@ -28,6 +27,7 @@ class CfgVehicles {
|
||||
};
|
||||
};
|
||||
|
||||
class Box_NATO_Support_F;
|
||||
class ACE_Box_Misc: Box_NATO_Support_F {
|
||||
class TransportItems {
|
||||
MACRO_ADDITEM(ACE_HandFlare_White,12);
|
||||
|
@ -1,21 +1,26 @@
|
||||
|
||||
class CfgWeapons {
|
||||
class GrenadeLauncher;
|
||||
|
||||
class Throw: GrenadeLauncher {
|
||||
muzzles[] += {"ACE_HandFlare_WhiteMuzzle", "ACE_HandFlare_RedMuzzle", "ACE_HandFlare_GreenMuzzle", "ACE_HandFlare_YellowMuzzle", "ACE_M84Muzzle"};
|
||||
muzzles[] += {"ACE_HandFlare_WhiteMuzzle","ACE_HandFlare_RedMuzzle","ACE_HandFlare_GreenMuzzle","ACE_HandFlare_YellowMuzzle","ACE_M84Muzzle"};
|
||||
|
||||
class ThrowMuzzle;
|
||||
class ACE_HandFlare_WhiteMuzzle: ThrowMuzzle {
|
||||
magazines[] = {"ACE_HandFlare_White"};
|
||||
};
|
||||
|
||||
class ACE_HandFlare_RedMuzzle: ThrowMuzzle {
|
||||
magazines[] = {"ACE_HandFlare_Red"};
|
||||
};
|
||||
|
||||
class ACE_HandFlare_GreenMuzzle: ThrowMuzzle {
|
||||
magazines[] = {"ACE_HandFlare_Green"};
|
||||
};
|
||||
|
||||
class ACE_HandFlare_YellowMuzzle: ThrowMuzzle {
|
||||
magazines[] = {"ACE_HandFlare_Yellow"};
|
||||
};
|
||||
|
||||
class ACE_M84Muzzle: ThrowMuzzle {
|
||||
magazines[] = {"ACE_M84"};
|
||||
};
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
["flashbangExplosion", DFUNC(flashbangExplosionEH)] call EFUNC(common,addEventHandler);
|
||||
["flashbangExplosion", {_this call FUNC(flashbangExplosionEH)}] call EFUNC(common,addEventHandler);
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
@ -21,4 +21,4 @@ GVAR(flashbangPPEffectCC) ppEffectForceInNVG true;
|
||||
[] call FUNC(nextMode);
|
||||
},
|
||||
{false},
|
||||
[9, [false, false, false]], false] call cba_fnc_addKeybind; //8 Key
|
||||
[9, [false, false, false]], false] call CBA_fnc_addKeybind; //8 Key
|
||||
|
@ -15,13 +15,14 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_affected", "_strength", "_posGrenade", "_angleDiff", "_light", "_losCount", "_dirToUnitVector", "_eyeDir", "_eyePos"];
|
||||
params ["_grenade"];
|
||||
|
||||
private ["_affected", "_strength", "_posGrenade", "_eyePos", "_losCount", "_eyeDir", "_dirToUnitVector", "_angleDiff", "_light"];
|
||||
|
||||
_affected = _grenade nearEntities ["CAManBase", 20];
|
||||
|
||||
{
|
||||
if ((local _x) && {alive _x}) then {
|
||||
if (local _x && {alive _x}) then {
|
||||
|
||||
_strength = 1 - ((_x distance _grenade) min 15) / 15;
|
||||
|
||||
@ -30,16 +31,19 @@ _affected = _grenade nearEntities ["CAManBase", 20];
|
||||
if (_x != ACE_player) then {
|
||||
//must be AI
|
||||
[_x, true] call EFUNC(common,disableAI);
|
||||
_x setSkill ((skill _x) / 50);
|
||||
|
||||
_x setSkill (skill _x / 50);
|
||||
|
||||
[{
|
||||
params ["_unit"];
|
||||
|
||||
//Make sure we don't enable AI for unconscious units
|
||||
if (!(_unit getVariable ["ace_isunconscious", false])) then {
|
||||
if !(_unit getVariable ["ace_isUnconscious", false]) then {
|
||||
[_unit, false] call EFUNC(common,disableAI);
|
||||
};
|
||||
|
||||
_unit setSkill (skill _unit * 50);
|
||||
}, [_x], (7 * _strength)] call EFUNC(common,waitAndExecute);
|
||||
}, [_x], 7 * _strength] call EFUNC(common,waitAndExecute);
|
||||
} else {
|
||||
//Do effects for player
|
||||
// is there line of sight to the grenade?
|
||||
@ -49,7 +53,7 @@ _affected = _grenade nearEntities ["CAManBase", 20];
|
||||
|
||||
//Check for line of sight (check 4 points in case grenade is stuck in an object or underground)
|
||||
_losCount = {
|
||||
(!lineIntersects [(_posGrenade vectorAdd _x), _eyePos, _grenade, ACE_player])
|
||||
!lineIntersects [_posGrenade vectorAdd _x, _eyePos, _grenade, ACE_player]
|
||||
} count [[0,0,0], [0,0,0.2], [0.1, 0.1, 0.1], [-0.1, -0.1, 0.1]];
|
||||
|
||||
TRACE_1("Line of sight count (out of 4)",_losCount);
|
||||
@ -57,9 +61,9 @@ _affected = _grenade nearEntities ["CAManBase", 20];
|
||||
_strength = _strength / 10;
|
||||
};
|
||||
|
||||
//Add ace_hearing ear ringing sound effect
|
||||
if ((isClass (configFile >> "CfgPatches" >> "ACE_Hearing")) && {_strength > 0}) then {
|
||||
[_x, (20 * _strength)] call EFUNC(hearing,earRinging);
|
||||
// add ace_hearing ear ringing sound effect
|
||||
if (isClass (configFile >> "CfgPatches" >> "ACE_Hearing") && {_strength > 0}) then {
|
||||
[_x, 20 * _strength] call EFUNC(hearing,earRinging);
|
||||
};
|
||||
|
||||
// account for people looking away by slightly
|
||||
@ -68,16 +72,16 @@ _affected = _grenade nearEntities ["CAManBase", 20];
|
||||
_dirToUnitVector = _eyePos vectorFromTo _posGrenade;
|
||||
_angleDiff = acos (_eyeDir vectorDotProduct _dirToUnitVector);
|
||||
|
||||
//From 0-45deg, full effect
|
||||
// from 0-45deg, full effect
|
||||
if (_angleDiff > 45) then {
|
||||
_strength = _strength - _strength * ((_angleDiff - 45) / 120);
|
||||
};
|
||||
|
||||
TRACE_1("Final strength for player",_strength);
|
||||
|
||||
//Add ace_medical pain effect:
|
||||
if ((isClass (configFile >> "CfgPatches" >> "ACE_Medical")) && {_strength > 0.1}) then {
|
||||
[ACE_player, (_strength / 2)] call EFUNC(medical,adjustPainLevel);
|
||||
// add ace_medical pain effect:
|
||||
if (isClass (configFile >> "CfgPatches" >> "ACE_Medical") && {_strength > 0.1}) then {
|
||||
[ACE_player, _strength / 2] call EFUNC(medical,adjustPainLevel);
|
||||
};
|
||||
|
||||
// create flash to illuminate environment
|
||||
@ -87,14 +91,14 @@ _affected = _grenade nearEntities ["CAManBase", 20];
|
||||
_light setLightColor [1,1,1];
|
||||
_light setLightDayLight true;
|
||||
|
||||
//Delete the light after 0.1 seconds
|
||||
// delete the light after 0.1 seconds
|
||||
[{
|
||||
params ["_light"];
|
||||
deleteVehicle _light;
|
||||
}, [_light], 0.1] call EFUNC(common,waitAndExecute);
|
||||
|
||||
// blind player
|
||||
if (_strength > 0.1 && hasInterface) then {
|
||||
if (hasInterface && {_strength > 0.1}) then {
|
||||
GVAR(flashbangPPEffectCC) ppEffectEnable true;
|
||||
GVAR(flashbangPPEffectCC) ppEffectAdjust [1,1,(0.8 + _strength) min 1,[1,1,1,0],[0,0,0,1],[0,0,0,0]];
|
||||
GVAR(flashbangPPEffectCC) ppEffectCommit 0.01;
|
||||
@ -102,14 +106,15 @@ _affected = _grenade nearEntities ["CAManBase", 20];
|
||||
//PARTIALRECOVERY - start decreasing effect over ACE_time
|
||||
[{
|
||||
params ["_strength"];
|
||||
|
||||
GVAR(flashbangPPEffectCC) ppEffectAdjust [1,1,0,[1,1,1,0],[0,0,0,1],[0,0,0,0]];
|
||||
GVAR(flashbangPPEffectCC) ppEffectCommit (10 * _strength);
|
||||
}, [_strength], (7 * _strength), 0] call EFUNC(common,waitAndExecute);
|
||||
}, [_strength], 7 * _strength] call EFUNC(common,waitAndExecute);
|
||||
|
||||
//FULLRECOVERY - end effect
|
||||
[{
|
||||
GVAR(flashbangPPEffectCC) ppEffectEnable false;
|
||||
}, [], (17 * _strength)] call EFUNC(common,waitAndExecute);
|
||||
}, [], 17 * _strength] call EFUNC(common,waitAndExecute);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -14,6 +14,7 @@
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_projectile"];
|
||||
|
||||
if (alive _projectile) then {
|
||||
@ -21,5 +22,6 @@ if (alive _projectile) then {
|
||||
|
||||
private "_affected";
|
||||
_affected = _projectile nearEntities ["CAManBase", 50];
|
||||
|
||||
["flashbangExplosion", _affected, [_projectile]] call EFUNC(common,targetEvent);
|
||||
};
|
||||
|
@ -138,6 +138,7 @@
|
||||
<German>Aktiviere Taubheit im Gefecht?</German>
|
||||
<Czech>Povolit ztrátu sluchu?</Czech>
|
||||
<Portuguese>Ativar surdez em combate?</Portuguese>
|
||||
<Russian>Уменьшает возможность игрока слышать звуки при повреждении органов слуха</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Hearing_Module_Description">
|
||||
<English>Controls combat deafness and ear ringing. When activated, players can be deafened when a gun is fired in their vicinity or an explosion takes place without hearing protection</English>
|
||||
@ -165,4 +166,4 @@
|
||||
<Spanish>Permitir a las unidades por control remoto de zeus que puedan tener daños auditivos.</Spanish>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
</Project>
|
@ -1,3 +1,4 @@
|
||||
|
||||
class ACE_Settings {
|
||||
class GVAR(minDamageToTrigger) {
|
||||
//Minimum mamage needed to trigger falling down while moving. Set to -1 to disable completely.
|
||||
|
@ -1,39 +1,52 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
* Adds reactions to a unit that was hit. EH only runs where to unit is local. Adds screams, falling down, falling from ladders, ejecting from static weapons and camshake for players
|
||||
*
|
||||
* Arguments:
|
||||
* 0: unit <OBJECT>
|
||||
* 1: firer <OBJECT>
|
||||
* 2: damage taken <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit", "_firer", "_damage"];
|
||||
|
||||
// exit if system is disabled
|
||||
if (GVAR(minDamageToTrigger) == -1) exitWith {};
|
||||
|
||||
// don't fall after minor damage
|
||||
if (_damage < GVAR(minDamageToTrigger)) exitWith {};
|
||||
|
||||
// don't fall on collision damage
|
||||
if (_unit == _firer) exitWith {};
|
||||
|
||||
//Exit if system disabled:
|
||||
if (GVAR(minDamageToTrigger) == -1) exitWith {};
|
||||
|
||||
// cam shake for player
|
||||
// camshake for player
|
||||
if (_unit == ACE_player) then {
|
||||
addCamShake [3, 5, _damage + random 10];
|
||||
};
|
||||
|
||||
// play scream sound
|
||||
if (!isNil QUOTE(EFUNC(medical,playInjuredSound))) then {
|
||||
[_unit] call EFUNC(medical,playInjuredSound);
|
||||
};
|
||||
|
||||
private "_vehicle";
|
||||
_vehicle = vehicle _unit;
|
||||
|
||||
// handle static weapons
|
||||
if (_vehicle isKindOf "StaticWeapon") exitwith {
|
||||
if (_vehicle isKindOf "StaticWeapon") exitWith {
|
||||
if (!alive _unit) then {
|
||||
_unit action ["Eject", _vehicle];
|
||||
unassignVehicle _unit;
|
||||
};
|
||||
};
|
||||
|
||||
// don't fall after minor damage
|
||||
if (_damage < GVAR(minDamageToTrigger)) exitWith {};
|
||||
|
||||
// play sound
|
||||
if (!isNil QUOTE(EFUNC(medical,playInjuredSound))) then {
|
||||
[_unit] call EFUNC(medical,playInjuredSound);
|
||||
};
|
||||
|
||||
//Don't do animations if in a vehicle (looks weird and animations never reset):
|
||||
// don't do animations if in a vehicle (looks weird and animations never reset):
|
||||
if (_vehicle != _unit) exitWith {};
|
||||
|
||||
// this checks most things, so it doesn't mess with being inside vehicles or while dragging etc.
|
||||
@ -54,40 +67,52 @@ _velocity = vectorMagnitude velocity _unit;
|
||||
if (_velocity < 2) exitWith {};
|
||||
|
||||
// get correct animation by weapon
|
||||
private ["_isPlayer", "_isRunning", "_anim"];
|
||||
private "_anim";
|
||||
|
||||
_isPlayer = [_unit] call EFUNC(common,isPlayer);
|
||||
_isRunning = _velocity > 4;
|
||||
call {
|
||||
private "_weapon";
|
||||
_weapon = currentWeapon _unit;
|
||||
|
||||
_anim = switch (currentWeapon _unit) do {
|
||||
case (""): {"AmovPercMsprSnonWnonDf_AmovPpneMstpSnonWnonDnon"};
|
||||
case (primaryWeapon _unit): {
|
||||
if !(_isPlayer) exitWith {"AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"};
|
||||
|
||||
[
|
||||
["AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon_2", "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"] select _isRunning,
|
||||
["AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon_2", "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"] select _isRunning,
|
||||
"AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDleft",
|
||||
"AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDright"
|
||||
] select floor random 4;
|
||||
if (_weapon == "") exitWith {
|
||||
_anim = "AmovPercMsprSnonWnonDf_AmovPpneMstpSnonWnonDnon"
|
||||
};
|
||||
case (handgunWeapon _unit): {
|
||||
if !(_isPlayer) exitWith {"AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon"};
|
||||
|
||||
[
|
||||
"AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon",
|
||||
"AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon",
|
||||
"AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDleft",
|
||||
"AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDright"
|
||||
] select floor random 4;
|
||||
if (_weapon == primaryWeapon _unit) exitWith {
|
||||
if ([_unit] call EFUNC(common,isPlayer)) then {
|
||||
private "_isRunning";
|
||||
_isRunning = _velocity > 4;
|
||||
|
||||
_anim = [
|
||||
["AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon_2", "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"] select _isRunning,
|
||||
["AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon_2", "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"] select _isRunning,
|
||||
"AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDleft",
|
||||
"AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDright"
|
||||
] select floor random 4;
|
||||
} else {
|
||||
_anim = "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon";
|
||||
};
|
||||
};
|
||||
default {""};
|
||||
|
||||
if (_weapon == handgunWeapon _unit) exitWith {
|
||||
if ([_unit] call EFUNC(common,isPlayer)) then {
|
||||
_anim = [
|
||||
"AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon",
|
||||
"AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon",
|
||||
"AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDleft",
|
||||
"AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDright"
|
||||
] select floor random 4;
|
||||
} else {
|
||||
_anim = "AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon";
|
||||
};
|
||||
};
|
||||
|
||||
_anim = "";
|
||||
};
|
||||
|
||||
// exit if no animation for this weapon exists, i.E. binocular or rocket launcher
|
||||
// exit if no animation for this weapon exists, i.e. binocular or rocket launcher
|
||||
if (_anim == "") exitWith {};
|
||||
|
||||
// don't mess with transitions. don't fall then.
|
||||
if ([_unit] call EFUNC(common,inTransitionAnim)) exitWith {};
|
||||
|
||||
[_unit, _anim, 2] call EFUNC(common,doAnimation);
|
||||
if !([_unit] call EFUNC(common,inTransitionAnim)) then {
|
||||
[_unit, _anim, 2] call EFUNC(common,doAnimation);
|
||||
};
|
||||
|
@ -111,7 +111,8 @@ addMissionEventHandler ["Draw3D", DFUNC(render)];
|
||||
private ["_badClassnames"];
|
||||
_badClassnames = [];
|
||||
{
|
||||
if ((isNil (format [QGVAR(Act_%1), typeOf _x])) || {isNil (format [QGVAR(SelfAct_%1), typeOf _x])}) then {
|
||||
//Only check Land objects (WeaponHolderSimulated show up in `vehicles` for some reason)
|
||||
if ((_x isKindOf "Land") && {(isNil (format [QGVAR(Act_%1), typeOf _x])) || {isNil (format [QGVAR(SelfAct_%1), typeOf _x])}}) then {
|
||||
if (!((typeOf _x) in _badClassnames)) then {
|
||||
_badClassnames pushBack (typeOf _x);
|
||||
ACE_LOGERROR_3("Compile checks bad for (classname: %1)(addon: %2) %3", (typeOf _x), (unitAddons (typeOf _x)), _x);
|
||||
|
@ -99,6 +99,11 @@
|
||||
|
||||
#define ACE_isHC (!hasInterface && !isDedicated)
|
||||
|
||||
//By default CBA's TRACE/LOG/WARNING spawn a buffer, which can cause messages to be logged out of order:
|
||||
#ifdef CBA_DEBUG_SYNCHRONOUS
|
||||
#define CBA_fnc_log { params ["_file","_lineNum","_message"]; diag_log [diag_frameNo, diag_tickTime, time, _file + ":"+str(_lineNum + 1), _message]; }
|
||||
#endif
|
||||
|
||||
#define ACE_LOG(module,level,message) diag_log text ACE_LOGFORMAT(module,level,message)
|
||||
#define ACE_LOGFORMAT(module,level,message) FORMAT_2(QUOTE([ACE] (module) %1: %2),level,message)
|
||||
|
||||
@ -182,4 +187,6 @@
|
||||
#define ACE_DEBUGFORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_DEBUGFORMAT(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7))
|
||||
#define ACE_DEBUGFORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_DEBUGFORMAT(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8))
|
||||
|
||||
#define ACE_DEPRECATED(arg1,arg2,arg3) ACE_LOGWARNING_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3",arg1,arg2,arg3)
|
||||
|
||||
#include "script_debug.hpp"
|
||||
|
@ -5,8 +5,8 @@
|
||||
|
||||
#define MAJOR 3
|
||||
#define MINOR 3
|
||||
#define PATCHLVL 1
|
||||
#define BUILD 2
|
||||
#define PATCHLVL 2
|
||||
#define BUILD 0
|
||||
|
||||
#define VERSION MAJOR.MINOR.PATCHLVL.BUILD
|
||||
#define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD
|
||||
|
@ -67,7 +67,7 @@ class CfgVehicles {
|
||||
displayName = CSTRING(BFT_Module_DisplayName);
|
||||
function = QFUNC(blueForceTrackingModule);
|
||||
scope = 2;
|
||||
isGlobal = 1;
|
||||
isGlobal = 0;
|
||||
icon = PATHTOF(UI\Icon_Module_BFTracking_ca.paa);
|
||||
class Arguments {
|
||||
class Enabled {
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Author: KoffeinFlummi
|
||||
*
|
||||
* Initializes the blue force tracking module.
|
||||
*
|
||||
* Arguments:
|
||||
@ -12,15 +11,12 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
if (!isServer) exitWith {};
|
||||
|
||||
PARAMS_3(_logic,_units,_activated);
|
||||
|
||||
if !(_activated) exitWith {};
|
||||
params ["_logic"];
|
||||
|
||||
[_logic, QGVAR(BFT_Enabled), "Enabled"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(BFT_Interval), "Interval"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(BFT_HideAiGroups), "HideAiGroups"] call EFUNC(common,readSettingFromModule);
|
||||
|
||||
ACE_LOGINFO("Blue Force Tracking Module Initialized.");
|
||||
TRACE_2("[ACE]: Blue Force Tracking Module initialized.", GVAR(BFT_Interval), GVAR(BFT_HideAiGroups));
|
||||
ACE_LOGINFO_3("Blue Force Tracking Module Initialized:", GVAR(BFT_Enabled), GVAR(BFT_Interval), GVAR(BFT_HideAiGroups));
|
||||
|
@ -91,6 +91,4 @@ if (_dir != 1) then {
|
||||
_handled
|
||||
};
|
||||
|
||||
diag_log text format ["HJa %1", _handled];
|
||||
|
||||
_handled
|
||||
|
@ -122,6 +122,17 @@ class ACE_Torso {
|
||||
enableInside = 1;
|
||||
icon = PATHTOF(UI\icons\triageCard.paa);
|
||||
};
|
||||
class Diagnose {
|
||||
displayName = CSTRING(Actions_Diagnose);
|
||||
distance = 5.0;
|
||||
condition = QUOTE([ARR_4(_player, _target, 'body', 'Diagnose')] call DFUNC(canTreatCached));
|
||||
statement = QUOTE([ARR_4(_player, _target, 'body', 'Diagnose')] call DFUNC(treatment));
|
||||
EXCEPTIONS
|
||||
showDisabled = 0;
|
||||
priority = 2;
|
||||
hotkey = "";
|
||||
icon = "";
|
||||
};
|
||||
|
||||
// Advanced medical
|
||||
class FieldDressing {
|
||||
|
@ -23,7 +23,7 @@ if (!local _unit) exitwith {
|
||||
[_this, QFUNC(addToLog), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
||||
};
|
||||
|
||||
date params ["", "", "", "_minute", "_hour"];
|
||||
date params ["", "", "", "_hour", "_minute"];
|
||||
|
||||
_moment = format [ (["%1:%2", "%1:0%2"] select (_minute < 10)), _hour, _minute];
|
||||
|
||||
|
@ -18,7 +18,7 @@ private ["_log", "_inList", "_amount"];
|
||||
params ["_unit", "_newItem"];
|
||||
|
||||
if (!local _unit) exitwith {
|
||||
[_this, QUOTE(DFUNC(addToTriageList)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
||||
[_this, QUOTE(DFUNC(addToTriageCard)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
||||
};
|
||||
|
||||
_log = _unit getvariable [QGVAR(triageCard), []];
|
||||
|
@ -109,7 +109,7 @@ if (_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) exitW
|
||||
if (_delayedUnconsicous) then {
|
||||
[{
|
||||
[_this select 0, true] call FUNC(setUnconscious);
|
||||
}, [_unit], 0.7, 0] call EFUNC(common,waitAndExec);
|
||||
}, [_unit], 0.7, 0] call EFUNC(common,waitAndExecute);
|
||||
} else {
|
||||
[{
|
||||
[_this select 0, true] call FUNC(setUnconscious);
|
||||
|
@ -21,6 +21,11 @@
|
||||
|
||||
#define DEFAULT_DELAY (round(random(10)+5))
|
||||
|
||||
// only run this after the settings are initialized
|
||||
if !(EGVAR(common,settingsInitFinished)) exitWith {
|
||||
EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(setUnconscious), _this];
|
||||
};
|
||||
|
||||
private ["_animState", "_originalPos", "_startingTime", "_isDead"];
|
||||
params ["_unit", ["_set", true], ["_minWaitingTime", DEFAULT_DELAY], ["_force", false]];
|
||||
|
||||
|
@ -28,7 +28,7 @@ if (count _items == 0) exitwith {false};
|
||||
|
||||
_part = [_selectionName] call FUNC(selectionNameToNumber);
|
||||
if (_part == 0 || _part == 1) exitwith {
|
||||
// [_caller,"You cannot apply a CAT on this body part!"] call EFUNC(common,sendHintTo);
|
||||
// ["displayTextStructured", [_caller], ["You cannot apply a CAT on this body part!"]] call EFUNC(common,targetEvent);
|
||||
false;
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project name="ACE">
|
||||
<Package name="Medical">
|
||||
<Key ID="STR_ACE_Medical_Injuries">
|
||||
@ -2106,6 +2106,9 @@
|
||||
<Russian>%1 провел сердечно-легочную реанимацию</Russian>
|
||||
<Spanish>%1 realicó RCP</Spanish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Medical_Activity_fullHeal">
|
||||
<English>%1 used Personal Aid Kit</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Medical_HeavilyWounded">
|
||||
<English>Heavily wounded</English>
|
||||
<German>Schwer verwundet:</German>
|
||||
@ -2218,6 +2221,7 @@
|
||||
<English>Heal fully bandaged hitpoints</English>
|
||||
<Polish>Lecz w pełni zabandażowane hitpointy</Polish>
|
||||
<Spanish>Curar miembros totalmente vendados</Spanish>
|
||||
<Russian>Исцелять полностью перебинтованные части тела</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Medical_painIsOnlySuppressed">
|
||||
<English>Pain is only temporarily suppressed</English>
|
||||
@ -3435,11 +3439,13 @@
|
||||
<English>Heal hitpoints</English>
|
||||
<Polish>Lecz hitpointy</Polish>
|
||||
<Spanish>Curar puntos de vida</Spanish>
|
||||
<Russian>Исцелять части тела</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Medical_AdvancedMedicalSettings_healHitPointAfterAdvBandage_Description">
|
||||
<English>Heal fully bandaged hitpoints</English>
|
||||
<Polish>Po bandażowaniu ulecz hitpointy, usuwając z nich ślady krwi i przywracając im pełną sprawność.</Polish>
|
||||
<Spanish>Curar miembros totalmente vendados</Spanish>
|
||||
<Russian>Исцелять полностью перебинтованные части тела</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Medical_AdvancedMedicalSettings_painIsOnlySuppressed_DisplayName">
|
||||
<English>Pain suppression</English>
|
||||
@ -3836,11 +3842,13 @@
|
||||
<English>This person (%1) is awake and cannot be loaded</English>
|
||||
<Polish>Ta osoba (%1) jest przytomna i nie może zostać załadowana</Polish>
|
||||
<Spanish>Esta persona (%1) está despierto y no puede ser cargado</Spanish>
|
||||
<Russian>Боец (%1) в сознании и не может быть погружен</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Medical_noTourniquetOnBodyPart">
|
||||
<English>There is no tourniquet on this body part!</English>
|
||||
<Polish>Na tej części ciała nie ma stazy!</Polish>
|
||||
<Spanish>No hay torniquete en esta parte del cuerpo!</Spanish>
|
||||
<Russian>Нет жгута на этой части тела!</Russian>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
class ACE_Settings {
|
||||
class GVAR(allow) {
|
||||
displayName = CSTRING(allow);
|
||||
@ -6,6 +5,7 @@ class ACE_Settings {
|
||||
value = 1;
|
||||
typeName = "SCALAR";
|
||||
values[] = {ECSTRING(common,Disabled), ECSTRING(common,Enabled), ECSTRING(common,VehiclesOnly)};
|
||||
category = ECSTRING(medical,Category_Medical);
|
||||
};
|
||||
class GVAR(useMenu) {
|
||||
displayName = CSTRING(useMenu);
|
||||
@ -14,6 +14,7 @@ class ACE_Settings {
|
||||
typeName = "SCALAR";
|
||||
values[] = {ECSTRING(common,Disabled), ECSTRING(common,Enabled), ECSTRING(common,VehiclesOnly)};
|
||||
isClientSettable = 1;
|
||||
category = ECSTRING(medical,Category_Medical);
|
||||
};
|
||||
class GVAR(openAfterTreatment) {
|
||||
displayName = CSTRING(openAfterTreatment);
|
||||
@ -21,5 +22,6 @@ class ACE_Settings {
|
||||
typeName = "BOOL";
|
||||
value = 1;
|
||||
isClientSettable = 1;
|
||||
category = ECSTRING(medical,Category_Medical);
|
||||
};
|
||||
};
|
||||
|
@ -74,7 +74,7 @@ GVAR(MenuPFHID) = [{
|
||||
[GVAR(INTERACTION_TARGET)] call FUNC(updateIcons);
|
||||
[GVAR(LatestDisplayOptionMenu)] call FUNC(handleUI_DisplayOptions);
|
||||
|
||||
_status = [GVAR(INTERACTION_TARGET)] call FUNC(getTriageStatus);
|
||||
_status = [GVAR(INTERACTION_TARGET)] call EFUNC(medical,getTriageStatus);
|
||||
(_display displayCtrl 2000) ctrlSetText (_status select 0);
|
||||
(_display displayCtrl 2000) ctrlSetBackgroundColor (_status select 2);
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
* ARRAY - [NUMBER - Elevation In Degrees, NUMBER - Shot Durration]
|
||||
*
|
||||
* Example:
|
||||
* [_rangeToHit, _heightToHit, _muzzleVelocity, _airFriction, TIME_STEP] call FUNC(simulateFindSolution);
|
||||
* [_rangeToHit, _heightToHit, _muzzleVelocity, _airFriction, TIME_STEP] call ace_mk6mortar_fnc_dev_simulateFindSolution;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
clientInit = QUOTE(call COMPILE_FILE(XEH_post_initClient));
|
||||
serverInit = QUOTE(call COMPILE_FILE(XEH_post_initServer));
|
||||
};
|
||||
};
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||
};
|
||||
};
|
||||
|
24
addons/noradio/XEH_postInit.sqf
Normal file
24
addons/noradio/XEH_postInit.sqf
Normal file
@ -0,0 +1,24 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
// unmute unit if that player disconnects
|
||||
if (isServer) then {
|
||||
addMissionEventHandler ["HandleDisconnect", {
|
||||
[_this select 0, "isPlayer"] call EFUNC(common,unmuteUnit);
|
||||
}];
|
||||
};
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
// mutes/unmutes units when the player changes
|
||||
["playerChanged", {
|
||||
params ["_newPlayer", "_oldPlayer"];
|
||||
|
||||
// mute the new player
|
||||
[_newPlayer, "isPlayer"] call EFUNC(common,muteUnit);
|
||||
|
||||
// unmute the old player
|
||||
if (alive _oldPlayer) then {
|
||||
[_oldPlayer, "isPlayer"] call EFUNC(common,unmuteUnit);
|
||||
};
|
||||
}] call EFUNC(common,addEventhandler);
|
@ -1,27 +0,0 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
[{
|
||||
if (!isNull ACE_player) then {
|
||||
[(_this select 1)] call cba_fnc_removePerFrameHandler;
|
||||
|
||||
[ACE_player, "isPlayer"] call EFUNC(common,muteUnit);
|
||||
};
|
||||
}, 0, []] call CBA_fnc_addPerFrameHandler;
|
||||
*/
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
// Mutes/unmutes units when the player changes
|
||||
["playerChanged", {
|
||||
EXPLODE_2_PVT(_this,_newPlayer,_oldPlayer);
|
||||
|
||||
// On player change mute the new player
|
||||
[_newPlayer, "isPlayer"] call EFUNC(common,muteUnit);
|
||||
|
||||
// Unmute the old player
|
||||
if (alive _oldPlayer) then {
|
||||
[_oldPlayer, "isPlayer"] call EFUNC(common,unmuteUnit);
|
||||
};
|
||||
}] call EFUNC(common,addEventhandler);
|
@ -1,6 +0,0 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
addMissionEventHandler ["HandleDisconnect", {
|
||||
[_this select 0, "isPlayer"] call EFUNC(common,unmuteUnit);
|
||||
}];
|
@ -7,7 +7,7 @@ if (!hasInterface) exitWith {};
|
||||
["ACE3 Weapons", QGVAR(unjamWeapon), localize LSTRING(UnjamWeapon),
|
||||
{
|
||||
// Conditions: canInteract
|
||||
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
// Conditions: specific
|
||||
if !([ACE_player] call EFUNC(common,canUseWeapon) &&
|
||||
{currentWeapon ACE_player in (ACE_player getVariable [QGVAR(jammedWeapons), []])}
|
||||
|
@ -28,8 +28,6 @@ _barrelMass = 0.50 * (getNumber (configFile >> "CfgWeapons" >> _weapon >> "Weapo
|
||||
// Calculate cooling
|
||||
_temperature = [_temperature, _barrelMass, ACE_time - _time] call FUNC(cooldown);
|
||||
|
||||
//["Overheating", _temperature, {format ["Temperature: %1 °C", _this]}] call EFUNC(common,log);
|
||||
|
||||
// Store new temperature
|
||||
_time = ACE_time;
|
||||
_player setVariable [_string, [_temperature, _time], false];
|
||||
|
@ -165,8 +165,6 @@ if ("Jam" in (missionNamespace getvariable ["ACE_Debug", []])) then {
|
||||
_jamChance = 0.5;
|
||||
};
|
||||
|
||||
["Overheating", [_temperature, _jamChance], {format ["Temperature: %1 - JamChance: %2", _this select 0, _this select 1]}] call EFUNC(common,log);
|
||||
|
||||
if (random 1 < _jamChance) then {
|
||||
[_unit, _weapon] call FUNC(jamWeapon);
|
||||
};
|
||||
|
@ -62,7 +62,7 @@ if (_distance < _backblastRange) then {
|
||||
[_damage * 100] call BIS_fnc_bloodEffect;
|
||||
|
||||
if (isClass (configFile >> "CfgPatches" >> "ACE_Medical") && {([_firer] call EFUNC(medical,hasMedicalEnabled))}) then {
|
||||
[_firer, "HitBody", [_firer, "body", ((_firer getHitPointDamage "HitBody") + _damage), _firer, "backblast"] call EFUNC(medical,handleDamage)] call EFUNC(medical,setHitPointDamage);
|
||||
[_firer, "body", ((_firer getvariable [QEGVAR(medical,bodyPartStatus), [0,0,0,0,0,0]]) select 1) + _damage, _firer, "backblast", 0] call EFUNC(medical,handleDamage);
|
||||
} else {
|
||||
_firer setDamage (damage _firer + _damage);
|
||||
};
|
||||
|
@ -62,7 +62,7 @@ if (!surfaceIsWater _pos) then {
|
||||
if (_x == ACE_player) then {[_damage * 100] call BIS_fnc_bloodEffect};
|
||||
|
||||
if (isClass (configFile >> "CfgPatches" >> "ACE_Medical") && {([_x] call EFUNC(medical,hasMedicalEnabled))}) then {
|
||||
[_x, "HitBody", [_x, "body", (_x getHitPointDamage "HitBody") + _damage, _firer, "backblast"] call EFUNC(medical,handleDamage)] call EFUNC(medical,setHitPointDamage);
|
||||
[_x, "body", ((_x getvariable [QEGVAR(medical,bodyPartStatus), [0,0,0,0,0,0]]) select 1) + _damage, _firer, "backblast", 0] call EFUNC(medical,handleDamage);
|
||||
} else {
|
||||
_x setDamage (damage _x + _damage);
|
||||
};
|
||||
|
@ -10,35 +10,32 @@ class Extended_PostInit_EventHandlers {
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_Init_EventHandlers {
|
||||
//Need initPost or we have problems with setVariable with addSpareParts
|
||||
class Extended_InitPost_EventHandlers {
|
||||
class Car {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(addRepairActions));
|
||||
serverInit = QUOTE(_this call DFUNC(addSpareParts));
|
||||
};
|
||||
};
|
||||
|
||||
class Tank {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(addRepairActions));
|
||||
serverInit = QUOTE(_this call DFUNC(addSpareParts));
|
||||
};
|
||||
};
|
||||
|
||||
class Helicopter {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(addRepairActions));
|
||||
serverInit = QUOTE(_this call DFUNC(addSpareParts));
|
||||
};
|
||||
};
|
||||
|
||||
class Plane {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(addRepairActions));
|
||||
serverInit = QUOTE(_this call DFUNC(addSpareParts));
|
||||
};
|
||||
};
|
||||
|
||||
class Ship_F {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(addRepairActions));
|
||||
|
@ -127,7 +127,7 @@ class CfgVehicles {
|
||||
author = ECSTRING(common,ACETeam);
|
||||
class Arguments {
|
||||
class EnableList {
|
||||
displayName = CSTRING(AssignEngineerRole_EnableList_DisplayName);
|
||||
displayName = CSTRING(EnableList_DisplayName);
|
||||
description = CSTRING(AssignEngineerRole_EnableList_Description);
|
||||
defaultValue = "";
|
||||
typeName = "STRING";
|
||||
@ -171,7 +171,7 @@ class CfgVehicles {
|
||||
author = ECSTRING(common,ACETeam);
|
||||
class Arguments {
|
||||
class EnableList {
|
||||
displayName = CSTRING(AssignRepairVehicle_EnableList_DisplayName);
|
||||
displayName = CSTRING(EnableList_DisplayName);
|
||||
description = CSTRING(AssignRepairVehicle_EnableList_Description);
|
||||
defaultValue = "";
|
||||
typeName = "STRING";
|
||||
@ -203,7 +203,7 @@ class CfgVehicles {
|
||||
function = QFUNC(moduleAssignRepairFacility);
|
||||
class Arguments {
|
||||
class EnableList {
|
||||
displayName = CSTRING(AssignRepairFacility_EnableList_DisplayName);
|
||||
displayName = CSTRING(EnableList_DisplayName);
|
||||
description = CSTRING(AssignRepairFacility_EnableList_Description);
|
||||
defaultValue = "";
|
||||
typeName = "STRING";
|
||||
@ -243,7 +243,7 @@ class CfgVehicles {
|
||||
author = ECSTRING(common,ACETeam);
|
||||
class Arguments {
|
||||
class List {
|
||||
displayName = CSTRING(AddSpareParts_List_DisplayName);
|
||||
displayName = CSTRING(EnableList_DisplayName);
|
||||
description = CSTRING(AddSpareParts_List_Description);
|
||||
defaultValue = "";
|
||||
typeName = "STRING";
|
||||
|
@ -10,3 +10,4 @@ The people responsible for merging changes to this component or answering potent
|
||||
|
||||
- [commy2](https://github.com/commy2)
|
||||
- [Glowbal](https://github.com/Glowbal)
|
||||
- [Jonpas](https://github.com/jonpas)
|
||||
|
@ -6,7 +6,7 @@ class CfgPatches {
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_interaction"};
|
||||
author[] = {"commy2", "Glowbal"};
|
||||
author[] = {"commy2", "Glowbal", "Jonpas"};
|
||||
authorUrl = "https://ace3mod.com";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
|
@ -18,7 +18,7 @@
|
||||
params ["_vehicle"];
|
||||
TRACE_1("params", _vehicle);
|
||||
|
||||
private ["_type", "_initializedClasses"];
|
||||
private ["_type", "_initializedClasses", "_condition", "_statement", "_action"];
|
||||
|
||||
_type = typeOf _vehicle;
|
||||
|
||||
@ -44,28 +44,25 @@ _hitPointsAddedAmount = [];
|
||||
if (_x in _wheelHitPoints) then {
|
||||
// add wheel repair action
|
||||
|
||||
private ["_icon", "_selection"];
|
||||
private ["_icon", "_selection", "_name", "_text"];
|
||||
|
||||
_icon = QUOTE(PATHTOF(ui\tire_ca.paa));
|
||||
_icon = "A3\ui_f\data\igui\cfg\actions\repair_ca.paa";
|
||||
// textDefault = "<img image='\A3\ui_f\data\igui\cfg\actions\repair_ca.paa' size='1.8' shadow=2 />";
|
||||
_selection = _wheelHitPointSelections select (_wheelHitPoints find _x);
|
||||
|
||||
private ["_name", "_text", "_condition", "_statement"];
|
||||
|
||||
// remove wheel action
|
||||
_name = format ["Remove_%1", _x];
|
||||
_name = format ["Remove_%1", _x];
|
||||
_text = localize LSTRING(RemoveWheel);
|
||||
|
||||
_condition = {[_this select 1, _this select 0, _this select 2 select 0, "RemoveWheel"] call DFUNC(canRepair)};
|
||||
_statement = {[_this select 1, _this select 0, _this select 2 select 0, "RemoveWheel"] call DFUNC(repair)};
|
||||
|
||||
private "_action";
|
||||
_action = [_name, _text, _icon, _statement, _condition, {}, [_x], _selection, 2] call EFUNC(interact_menu,createAction);
|
||||
[_type, 0, [], _action] call EFUNC(interact_menu,addActionToClass);
|
||||
|
||||
// replace wheel action
|
||||
_name = format ["Replace_%1", _x];
|
||||
_name = format ["Replace_%1", _x];
|
||||
_text = localize LSTRING(ReplaceWheel);
|
||||
|
||||
_condition = {[_this select 1, _this select 0, _this select 2 select 0, "ReplaceWheel"] call DFUNC(canRepair)};
|
||||
@ -102,7 +99,7 @@ _hitPointsAddedAmount = [];
|
||||
if (isText (configFile >> "CfgVehicles" >> _type >> "HitPoints" >> _x >> "depends")) exitWith {};
|
||||
|
||||
// add misc repair action
|
||||
private ["_name", "_icon", "_selection", "_condition", "_statement"];
|
||||
private ["_name", "_icon", "_selection", "_customSelectionsConfig"];
|
||||
|
||||
_name = format ["Repair_%1", _x];
|
||||
|
||||
@ -150,11 +147,9 @@ _hitPointsAddedAmount = [];
|
||||
} else {
|
||||
_selection = [1.75, 0, -1.75];
|
||||
};
|
||||
private "_action";
|
||||
_action = [_name, _text, _icon, _statement, _condition, {}, [_x, "RepairTrack"], _selection, 4] call EFUNC(interact_menu,createAction);
|
||||
[_type, 0, [], _action] call EFUNC(interact_menu,addActionToClass);
|
||||
} else {
|
||||
private "_action";
|
||||
_action = [_name, _text, _icon, _statement, _condition, {}, [_x, "MiscRepair"], _selection, 4] call EFUNC(interact_menu,createAction);
|
||||
// Put inside main actions if no other position was found above
|
||||
if (_selection isEqualTo [0, 0, 0]) then {
|
||||
@ -166,8 +161,6 @@ _hitPointsAddedAmount = [];
|
||||
};
|
||||
} forEach _hitPoints;
|
||||
|
||||
private ["_action", "_condition", "_statement"];
|
||||
|
||||
_condition = {[_this select 1, _this select 0, _this select 2 select 0, _this select 2 select 1] call DFUNC(canRepair)};
|
||||
_statement = {[_this select 1, _this select 0, _this select 2 select 0, _this select 2 select 1] call DFUNC(repair)};
|
||||
_action = [QGVAR(fullRepair), localize LSTRING(fullRepair), "A3\ui_f\data\igui\cfg\actions\repair_ca.paa", _statement, _condition, {}, ["", "fullRepair"], "", 4] call EFUNC(interact_menu,createAction);
|
||||
|
@ -20,6 +20,8 @@
|
||||
private ["_hitpointGroupConfig", "_hitpointGroup", "_postRepairDamage", "_return"];
|
||||
params ["_caller", "_target", "_hitPoint"];
|
||||
|
||||
if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
|
||||
// Get hitpoint groups if available
|
||||
_hitpointGroupConfig = configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(hitpointGroups);
|
||||
_hitpointGroup = [];
|
||||
@ -47,8 +49,4 @@ _return = false;
|
||||
};
|
||||
} forEach _hitpointGroup;
|
||||
|
||||
if (typeOf _target == "B_MRAP_01_F") then {
|
||||
diag_log format ["%1 - %2", _hitPoint, _hitpointGroup];
|
||||
};
|
||||
|
||||
_return
|
||||
|
@ -20,4 +20,6 @@
|
||||
params ["_unit", "_target", "_hitPoint"];
|
||||
TRACE_3("params",_unit,_target,_hitPoint);
|
||||
|
||||
if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
|
||||
alive _target && {_target getHitPointDamage _hitPoint < 1}
|
||||
|
@ -21,6 +21,8 @@ params ["_unit", "_target", "_hitPoint", ["_wheel",false]];
|
||||
TRACE_4("params",_unit,_target,_hitPoint,_wheel);
|
||||
// TODO [_unit, _wheel] call EFUNC(common,claim); on start of action
|
||||
|
||||
if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
|
||||
if (typeName _wheel == "OBJECT") then {
|
||||
// not near interpret as objNull
|
||||
if !(_wheel in nearestObjects [_unit, ["ACE_Track"], 5]) then {
|
||||
|
@ -22,6 +22,8 @@ params ["_unit", "_target", "_hitPoint", ["_track", false]];
|
||||
TRACE_4("params",_unit,_target,_hitPoint,_track);
|
||||
// TODO [_unit, _track] call EFUNC(common,claim); on start of action
|
||||
|
||||
if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
|
||||
if (typeName _track == "OBJECT") then {
|
||||
// not near interpret as objNull
|
||||
if !(_track in nearestObjects [_unit, ["ACE_Track"], 5]) then {
|
||||
|
@ -23,7 +23,7 @@ TRACE_4("params",_unit,_target,_hitPoint,_wheel);
|
||||
// TODO [_unit, _wheel] call EFUNC(common,claim); on start of action
|
||||
//if !([_unit, _target, _hitpoint, "ReplaceWheel"] call FUNC(canRepair)) exitwith {false};
|
||||
|
||||
//if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
|
||||
//if !([_unit, GVAR(engineerSetting_Wheel)] call FUNC(isEngineer)) exitWith {false};
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
#define COMPONENT repair
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
// #define DEBUG_MODE_FULL
|
||||
|
||||
#ifdef DEBUG_ENABLED_REPAIR
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project name="ACE">
|
||||
<Package name="repair">
|
||||
<Key ID="STR_ACE_Repair_SpareTrack">
|
||||
@ -183,12 +183,14 @@
|
||||
<Polish>Dodaj części zam.</Polish>
|
||||
<Portuguese>Adicionar partes sobressalentes</Portuguese>
|
||||
<Spanish>Añadir repuestos</Spanish>
|
||||
<Russian>Добавлять запчасти</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_addSpareParts_description">
|
||||
<English>Add spare parts to vehicles (requires Cargo component)?</English>
|
||||
<Polish>Czy dodać do pojazdów części zamienne? Wymaga włączonego cargo.</Polish>
|
||||
<Portuguese>Adicionar partes sobressalentes aos veículos (requer o componente de carga)?</Portuguese>
|
||||
<Spanish>¿Añadir repuestos para vehículos (requiere componente de carga)?</Spanish>
|
||||
<Russian>Добавлять запасные части в технику (требуется модуль Грузоперевозок)?</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_Repair">
|
||||
<English>Repair >></English>
|
||||
@ -791,7 +793,7 @@
|
||||
<Czech>Přiřadit Inženýra</Czech>
|
||||
<Spanish>Asignar ingeniero</Spanish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_AssignEngineerRole_EnableList_DisplayName">
|
||||
<Key ID="STR_ACE_Repair_EnableList_DisplayName">
|
||||
<English>List</English>
|
||||
<Polish>Lista</Polish>
|
||||
<Portuguese>Lista</Portuguese>
|
||||
@ -942,58 +944,68 @@
|
||||
<Polish>Dodaj części zam.</Polish>
|
||||
<Portuguese>Adicionar partes sobressalentes</Portuguese>
|
||||
<Spanish>Añadir repuestos</Spanish>
|
||||
<Russian>Добавить запчасти</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_AddSpareParts_Module_Description">
|
||||
<English>Add spare parts to one or multiple objects</English>
|
||||
<Polish>Dodaj części zamienne do jednego lub wielu obiektów.</Polish>
|
||||
<Portuguese>Adicionar partes sobressalentes para um ou mais objetos</Portuguese>
|
||||
<Spanish>Añadir repuestos a uno o varios objetos</Spanish>
|
||||
<Russian>Добавить запасные части в одно или несколько транспортных средств</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_AddSpareParts_List_DisplayName">
|
||||
<English>List</English>
|
||||
<Polish>Lista</Polish>
|
||||
<Portuguese>Lista</Portuguese>
|
||||
<Spanish>Lista</Spanish>
|
||||
<Russian>Список</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_AddSpareParts_List_Description">
|
||||
<English>List of objects that will get spare parts added, separated by commas.</English>
|
||||
<Polish>Lista obiektów, które otrzymają części zamienne, oddzielone przecinkiem.</Polish>
|
||||
<Portuguese>Lista de objetos que ganharão partes sobressalentes, dividos por vírgulas.</Portuguese>
|
||||
<Spanish>Lista de los objetos que tendrán repuestos añadidos, separados por comas.</Spanish>
|
||||
<Russian>Список транспортных средств, в которые будут добавляться запчасти, разделенный запятыми.</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_AddSpareParts_Part_DisplayName">
|
||||
<English>Part</English>
|
||||
<Polish>Część</Polish>
|
||||
<Portuguese>Parte</Portuguese>
|
||||
<Spanish>Pieza</Spanish>
|
||||
<Russian>Запчасть</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_AddSpareParts_Part_Description">
|
||||
<English>Spare part.</English>
|
||||
<Polish>Część zamienna.</Polish>
|
||||
<Portuguese>Parte sobressalente</Portuguese>
|
||||
<Spanish>Pieza de recambio.</Spanish>
|
||||
<Russian>Запасная часть.</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_AddSpareParts_Amount_DisplayName">
|
||||
<English>Amount</English>
|
||||
<Polish>Ilość</Polish>
|
||||
<Portuguese>Quantidade</Portuguese>
|
||||
<Spanish>Cantidad</Spanish>
|
||||
<Russian>Количество</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_AddSpareParts_Amount_Description">
|
||||
<English>Number of selected spare parts.</English>
|
||||
<Polish>Ilość wybranych części zamiennych.</Polish>
|
||||
<Portuguese>Número de partes sobressalentes.</Portuguese>
|
||||
<Spanish>Número de piezas de repuesto seleccionados.</Spanish>
|
||||
<Russian>Число выбранных запасных частей.</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_wheelRepairRequiredItems_name">
|
||||
<English>Wheel repair requirements</English>
|
||||
<Polish>Wym. naprawy kół</Polish>
|
||||
<Spanish>Requisitos de reparación de ruedas</Spanish>
|
||||
<Russian>Для ремонта колес требуется</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_wheelRepairRequiredItems_description">
|
||||
<English>Items required to remove/replace wheels</English>
|
||||
<Polish>Przedmioty potrzebne do wymiany kół</Polish>
|
||||
<Spanish>Elementos necesarios para quitar/cambiar ruedas</Spanish>
|
||||
<Russian>Предметы, которые требуются для снятия/замены колес</Russian>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
|
@ -1,3 +1,4 @@
|
||||
|
||||
class ACE_Settings {
|
||||
class GVAR(SavePreDeathGear) {
|
||||
value = 0;
|
||||
|
@ -1,3 +1,4 @@
|
||||
|
||||
class CfgAddons {
|
||||
class GVAR(Rallypoints) {
|
||||
list[] = {"ACE_Rallypoint_West", "ACE_Rallypoint_East", "ACE_Rallypoint_Independent", "ACE_Rallypoint_West_Base", "ACE_Rallypoint_East_Base", "ACE_Rallypoint_Independent_Base"};
|
||||
|
@ -1,3 +1,4 @@
|
||||
|
||||
class CfgVehicleClasses {
|
||||
class GVAR(Rallypoints) {
|
||||
displayName = CSTRING(EditorCategory);
|
||||
|
@ -1,3 +1,4 @@
|
||||
|
||||
class CfgVehicles {
|
||||
class ACE_Module;
|
||||
class ACE_ModuleRespawn: ACE_Module {
|
||||
@ -6,7 +7,7 @@ class CfgVehicles {
|
||||
displayName = CSTRING(Module_DisplayName);
|
||||
function = QFUNC(module);
|
||||
scope = 2;
|
||||
isGlobal = 1;
|
||||
isGlobal = 0;
|
||||
icon = QUOTE(PATHTOF(UI\Icon_Module_Respawn_ca.paa));
|
||||
|
||||
class Arguments {
|
||||
@ -24,6 +25,7 @@ class CfgVehicles {
|
||||
defaultValue = 1;
|
||||
};
|
||||
};
|
||||
|
||||
class ModuleDescription {
|
||||
description = CSTRING(Module_Description);
|
||||
};
|
||||
|
@ -2,4 +2,4 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
["rallypointMoved", {_this call FUNC(updateRallypoint)}] call EFUNC(common,addEventhandler);
|
||||
["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); // hide enemy rallypoint markers
|
||||
["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); // hide enemy rallypoint markers
|
||||
|
@ -13,7 +13,6 @@ PREP(moduleFriendlyFire);
|
||||
PREP(moduleRallypoint);
|
||||
PREP(moveRallypoint);
|
||||
PREP(removeBody);
|
||||
PREP(removeDisconnectedPlayer);
|
||||
PREP(restoreGear);
|
||||
PREP(showFriendlyFireMessage);
|
||||
PREP(teleportToRallypoint);
|
||||
|
@ -1,33 +1,30 @@
|
||||
/*
|
||||
Name: ACE_Respawn_fnc_canMoveRallypoint
|
||||
|
||||
Author(s):
|
||||
commy2
|
||||
|
||||
Description:
|
||||
checks if a unit can move a rally point
|
||||
|
||||
Parameters:
|
||||
0: OBJECT - unit
|
||||
1: OBJECT - side
|
||||
|
||||
Returns:
|
||||
BOOLEAN
|
||||
*/
|
||||
|
||||
* Author: commy2
|
||||
* Checks if a unit can move a rally point.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
* 1: Side <SIDE>
|
||||
*
|
||||
* Return Value:
|
||||
* Can move <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [ACE_Player, side ACE_Player] call ace_respawn_fnc_canMoveRallypoint
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_side"];
|
||||
params ["_unit", "_side"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_side = _this select 1;
|
||||
// player has to be a rallypoint mover. group leader by default
|
||||
if !(_unit getVariable ["ACE_canMoveRallypoint", false]) exitWith {false};
|
||||
|
||||
// rallypoint names are defined in CfgVehicles.hpp
|
||||
|
||||
_unit getVariable ["ACE_canMoveRallypoint", false]
|
||||
&& {!isNull ([
|
||||
// rallypoint of that side has to exist
|
||||
!isNull ([
|
||||
objNull,
|
||||
missionNamespace getVariable ["ACE_Rallypoint_West", objNull],
|
||||
missionNamespace getVariable ["ACE_Rallypoint_East", objNull],
|
||||
missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]
|
||||
] select ([west, east, independent] find _side) + 1)}
|
||||
] select ([west, east, independent] find _side) + 1) // return
|
||||
|
@ -1,26 +1,39 @@
|
||||
// by commy2
|
||||
// execute on server only!
|
||||
/*
|
||||
* Author: commy2
|
||||
* Handle XEH Init Post on Server.
|
||||
* Execution on server only.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [ACE_Player] call ace_respawn_fnc_handleInitPostServer
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_1(_unit);
|
||||
params ["_unit"];
|
||||
|
||||
private ["_group0", "_rallypoint"];
|
||||
private ["_groupUnit", "_rallypoint", "_leaderVarName"];
|
||||
|
||||
_group0 = group _unit; // _group-is a reserved veriable and shouldn't be used
|
||||
_groupUnit = group _unit; // _group is a reserved veriable and shouldn't be used
|
||||
|
||||
_rallypoint = [
|
||||
objNull,
|
||||
missionNamespace getVariable ["ACE_Rallypoint_West", objNull],
|
||||
missionNamespace getVariable ["ACE_Rallypoint_East", objNull],
|
||||
missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]
|
||||
] select ([west, east, independent] find side _group0) + 1;
|
||||
] select ([west, east, independent] find side _groupUnit) + 1;
|
||||
|
||||
// exit if no moveable rallypoint is placed for that side
|
||||
if (isNull _rallypoint) exitWith {};
|
||||
|
||||
// find leader
|
||||
private "_leaderVarName";
|
||||
_leaderVarName = _group0 getVariable [QGVAR(leaderVarName), ""];
|
||||
_leaderVarName = _groupUnit getVariable [QGVAR(leaderVarName), ""];
|
||||
|
||||
// exit if group already has a playable slot assigned as rallypoint leader
|
||||
if (_leaderVarName != "") exitWith {
|
||||
@ -31,7 +44,7 @@ if (_leaderVarName != "") exitWith {
|
||||
};
|
||||
|
||||
// treat group leader
|
||||
_unit = leader _group0;
|
||||
_unit = leader _groupUnit;
|
||||
|
||||
_leaderVarName = vehicleVarName _unit;
|
||||
|
||||
@ -47,6 +60,6 @@ if (_leaderVarName == "") then {
|
||||
};
|
||||
|
||||
// prevent group from getting multiple leaders; use this to assign rallypoint moving ability on JIP
|
||||
_group0 setVariable [QGVAR(leaderVarName), _leaderVarName];
|
||||
_groupUnit setVariable [QGVAR(leaderVarName), _leaderVarName];
|
||||
|
||||
_unit setVariable ["ACE_canMoveRallypoint", true, true];
|
||||
|
@ -1,31 +1,30 @@
|
||||
/*
|
||||
Name: ACE_Respawn_fnc_handleKilled
|
||||
|
||||
Author(s):
|
||||
bux578
|
||||
|
||||
Description:
|
||||
Handles the XEH Killed event
|
||||
|
||||
Parameters:
|
||||
0: OBJECT - Killed unit
|
||||
1: OBJECT - Attacker
|
||||
|
||||
Returns:
|
||||
VOID
|
||||
*/
|
||||
|
||||
* Author: bux578
|
||||
* Handles the XEH killed event.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
* 1: Killer <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [ACE_player, bad_dude] call ace_respawn_fnc_handleKilled
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_1(_killedUnit);
|
||||
params ["_unit"];
|
||||
|
||||
// Saves the gear when the player! (and only him) is killed
|
||||
if (ACE_player == _killedUnit) then {
|
||||
if (ACE_player == _unit) then {
|
||||
GVAR(unitGear) = [];
|
||||
|
||||
if (GVAR(SavePreDeathGear)) then {
|
||||
GVAR(unitGear) = [_killedUnit] call EFUNC(common,getAllGear);
|
||||
GVAR(unitGear) pushBack [currentWeapon _killedUnit, currentMuzzle _killedUnit, currentWeaponMode _killedUnit];
|
||||
GVAR(unitGear) = [_unit] call EFUNC(common,getAllGear);
|
||||
GVAR(unitGear) pushBack [currentWeapon _unit, currentMuzzle _unit, currentWeaponMode _unit];
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -1,44 +1,28 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
* Handle player changed event. Updates visibility of Rallypoint markers.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: New Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [ACE_player] call ace_respawn_fnc_handlePlayerChanged
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private "_newUnit";
|
||||
params ["_newUnit"];
|
||||
|
||||
_newUnit = _this select 0;
|
||||
private "_side";
|
||||
_side = side group _newUnit;
|
||||
|
||||
switch (side group _newUnit) do {
|
||||
case (west): {
|
||||
((missionNamespace getVariable ["ACE_Rallypoint_West", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 1;
|
||||
((missionNamespace getVariable ["ACE_Rallypoint_East", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0;
|
||||
((missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0;
|
||||
((missionNamespace getVariable ["ACE_Rallypoint_West_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 1;
|
||||
((missionNamespace getVariable ["ACE_Rallypoint_East_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0;
|
||||
((missionNamespace getVariable ["ACE_Rallypoint_Independent_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0;
|
||||
};
|
||||
|
||||
case (east): {
|
||||
((missionNamespace getVariable ["ACE_Rallypoint_West", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0;
|
||||
((missionNamespace getVariable ["ACE_Rallypoint_East", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 1;
|
||||
((missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0;
|
||||
((missionNamespace getVariable ["ACE_Rallypoint_West_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0;
|
||||
((missionNamespace getVariable ["ACE_Rallypoint_East_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 1;
|
||||
((missionNamespace getVariable ["ACE_Rallypoint_Independent_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0;
|
||||
};
|
||||
|
||||
case (independent): {
|
||||
((missionNamespace getVariable ["ACE_Rallypoint_West", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0;
|
||||
((missionNamespace getVariable ["ACE_Rallypoint_East", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0;
|
||||
((missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 1;
|
||||
((missionNamespace getVariable ["ACE_Rallypoint_West_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0;
|
||||
((missionNamespace getVariable ["ACE_Rallypoint_East_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0;
|
||||
((missionNamespace getVariable ["ACE_Rallypoint_Independent_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 1;
|
||||
};
|
||||
|
||||
default {
|
||||
((missionNamespace getVariable ["ACE_Rallypoint_West", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0;
|
||||
((missionNamespace getVariable ["ACE_Rallypoint_East", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0;
|
||||
((missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0;
|
||||
((missionNamespace getVariable ["ACE_Rallypoint_West_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0;
|
||||
((missionNamespace getVariable ["ACE_Rallypoint_East_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0;
|
||||
((missionNamespace getVariable ["ACE_Rallypoint_Independent_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0;
|
||||
};
|
||||
};
|
||||
((GETMVAR(ACE_Rallypoint_West, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == west));
|
||||
((GETMVAR(ACE_Rallypoint_West_Base, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == west));
|
||||
((GETMVAR(ACE_Rallypoint_East, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == east));
|
||||
((GETMVAR(ACE_Rallypoint_East_Base, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == east));
|
||||
((GETMVAR(ACE_Rallypoint_Independent, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == independent));
|
||||
((GETMVAR(ACE_Rallypoint_Independent_Base, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == independent));
|
||||
|
@ -1,32 +1,29 @@
|
||||
/*
|
||||
Name: ACE_Respawn_fnc_handleRespawn
|
||||
|
||||
Author(s):
|
||||
bux578
|
||||
|
||||
Description:
|
||||
Handles the XEH Respawn event
|
||||
|
||||
Parameters:
|
||||
0: OBJECT - Respawned Unit
|
||||
1: ?
|
||||
|
||||
Returns:
|
||||
VOID
|
||||
*/
|
||||
|
||||
* Author: bux578
|
||||
* Handles the XEH Respawn event.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
* 1: Corpse <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [ACE_Player, old_body_lying_on_floor] call ace_respawn_fnc_handleRespawn
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_respawnedUnit"];
|
||||
|
||||
_respawnedUnit = _this select 0;
|
||||
params ["_unit"];
|
||||
|
||||
// Restores the gear when the player respawns
|
||||
if (GVAR(SavePreDeathGear)) then {
|
||||
[_respawnedUnit, GVAR(unitGear)] call FUNC(restoreGear);
|
||||
[_unit, GVAR(unitGear)] call FUNC(restoreGear);
|
||||
};
|
||||
|
||||
// fix for setVariable public being lost on respawn for machines that JIP after the command was broadcasted
|
||||
if (_respawnedUnit getVariable ["ACE_canMoveRallypoint", false]) then {
|
||||
_respawnedUnit setVariable ["ACE_canMoveRallypoint", true, true];
|
||||
if (_unit getVariable ["ACE_canMoveRallypoint", false]) then {
|
||||
_unit setVariable ["ACE_canMoveRallypoint", true, true];
|
||||
};
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user