mirror of
https://github.com/acemod/ACE3.git
synced 2025-07-25 04:42:48 +00:00
Merge branch 'master' into vehDetachLocalfix
This commit is contained in:
@ -1,3 +1,3 @@
|
|||||||
#include "script_component.hpp"
|
#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
|
* Author: commy2
|
||||||
|
* Someone opened your backpack. Play sound and camshake. Execute locally.
|
||||||
*
|
*
|
||||||
* Someone opened your backpack. Execute locally.
|
* Arguments:
|
||||||
*
|
|
||||||
* Argument:
|
|
||||||
* 0: Who accessed your inventory? (Object)
|
* 0: Who accessed your inventory? (Object)
|
||||||
* 1: Unit that wields the backpack (Object)
|
* 1: Unit that wields the backpack (Object)
|
||||||
* 2: The backpack object (Object)
|
* 2: The backpack object (Object)
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return Value:
|
||||||
* None.
|
* None
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
private ["_sounds", "_position"];
|
|
||||||
params ["_target", "_backpack"];
|
params ["_target", "_backpack"];
|
||||||
|
|
||||||
// do cam shake if the target is the player
|
// 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];
|
addCamShake [4, 0.5, 5];
|
||||||
};
|
};
|
||||||
|
|
||||||
// play a rustling sound
|
// play a zipper sound effect
|
||||||
|
private ["_sounds", "_position"];
|
||||||
|
|
||||||
_sounds = [
|
_sounds = [
|
||||||
/*"a3\sounds_f\characters\ingame\AinvPknlMstpSlayWpstDnon_medic.wss",
|
/*"a3\sounds_f\characters\ingame\AinvPknlMstpSlayWpstDnon_medic.wss",
|
||||||
@ -32,8 +34,7 @@ _sounds = [
|
|||||||
QUOTE(PATHTO_R(sounds\zip_out.wav))
|
QUOTE(PATHTO_R(sounds\zip_out.wav))
|
||||||
];
|
];
|
||||||
|
|
||||||
_position = _target modelToWorldVisual (_target selectionPosition "Spine3");
|
_position = AGLToASL (_target modelToWorldVisual (_target selectionPosition "Spine3"));
|
||||||
_position = _position call EFUNC(common,positionToASL);
|
|
||||||
|
|
||||||
playSound3D [
|
playSound3D [
|
||||||
_sounds select floor random count _sounds,
|
_sounds select floor random count _sounds,
|
||||||
|
@ -1,23 +1,24 @@
|
|||||||
/*
|
/*
|
||||||
* Author: commy2
|
* 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:
|
* Return Value:
|
||||||
* 0: A backpack (Object or String)
|
* Boolean <BOOL>
|
||||||
*
|
*
|
||||||
* Return value:
|
* Public: Yes
|
||||||
* Boolean (Bool)
|
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_config"];
|
|
||||||
params ["_backpack"];
|
params ["_backpack"];
|
||||||
|
|
||||||
if (typeName _backpack == "OBJECT") then {
|
if (typeName _backpack == "OBJECT") then {
|
||||||
_backpack = typeOf _backpack;
|
_backpack = typeOf _backpack;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private "_config";
|
||||||
_config = configFile >> "CfgVehicles" >> _backpack;
|
_config = configFile >> "CfgVehicles" >> _backpack;
|
||||||
|
|
||||||
getText (_config >> "vehicleClass") == "backpacks" && {getNumber (_config >> "maximumLoad") > 0}
|
getText (_config >> "vehicleClass") == "backpacks" && {getNumber (_config >> "maximumLoad") > 0} // return
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
/*
|
/*
|
||||||
* Author: commy2
|
* 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:
|
* Return Value:
|
||||||
* Input from "InventoryOpened" eventhandler
|
|
||||||
*
|
|
||||||
* Return value:
|
|
||||||
* false. Always open the inventory dialog. (Bool)
|
* false. Always open the inventory dialog. (Bool)
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ if (isServer) then {
|
|||||||
["SetHandcuffed", {_this call FUNC(setHandcuffed)}] call EFUNC(common,addEventHandler);
|
["SetHandcuffed", {_this call FUNC(setHandcuffed)}] call EFUNC(common,addEventHandler);
|
||||||
["SetSurrendered", {_this call FUNC(setSurrendered)}] call EFUNC(common,addEventHandler);
|
["SetSurrendered", {_this call FUNC(setSurrendered)}] call EFUNC(common,addEventHandler);
|
||||||
|
|
||||||
//Medical Integration Events???
|
//Medical Integration Events
|
||||||
["medical_onUnconscious", {_this call ACE_Captives_fnc_handleOnUnconscious}] call EFUNC(common,addEventHandler);
|
["medical_onUnconscious", {_this call ACE_Captives_fnc_handleOnUnconscious}] call EFUNC(common,addEventHandler);
|
||||||
|
|
||||||
if (!hasInterface) exitWith {};
|
if (!hasInterface) exitWith {};
|
||||||
|
@ -109,3 +109,6 @@ if (_state) then {
|
|||||||
showHUD true;
|
showHUD true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//Global Event after changes:
|
||||||
|
["CaptiveStatusChanged", [_unit, _state, "SetHandcuffed"]] call EFUNC(common,globalEvent);
|
||||||
|
@ -101,3 +101,6 @@ if (_state) then {
|
|||||||
}, 0, [_unit, (ACE_time + 20)]] call CBA_fnc_addPerFrameHandler;
|
}, 0, [_unit, (ACE_time + 20)]] call CBA_fnc_addPerFrameHandler;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//Global Event after changes:
|
||||||
|
["CaptiveStatusChanged", [_unit, _state, "SetSurrendered"]] call EFUNC(common,globalEvent);
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
* 0: Item Classname <STRING>
|
* 0: Item Classname <STRING>
|
||||||
* 1: Vehicle <OBJECT>
|
* 1: Vehicle <OBJECT>
|
||||||
* 2: Amount <NUMBER> (default: 1)
|
* 2: Amount <NUMBER> (default: 1)
|
||||||
|
* 3: Show Hint <BOOL> (default: false)
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* None
|
* None
|
||||||
@ -18,7 +19,7 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_position", "_item", "_i"];
|
private ["_position", "_item", "_i"];
|
||||||
params ["_itemClass", "_vehicle", ["_amount", 1]];
|
params ["_itemClass", "_vehicle", ["_amount", 1], ["_showHint", false, [false]] ];
|
||||||
TRACE_3("params",_itemClass,_vehicle,_amount);
|
TRACE_3("params",_itemClass,_vehicle,_amount);
|
||||||
|
|
||||||
_position = getPos _vehicle;
|
_position = getPos _vehicle;
|
||||||
@ -29,7 +30,7 @@ for "_i" from 1 to _amount do {
|
|||||||
_item = createVehicle [_itemClass, _position, [], 0, "CAN_COLLIDE"];
|
_item = createVehicle [_itemClass, _position, [], 0, "CAN_COLLIDE"];
|
||||||
|
|
||||||
// Load item or delete it if no space left
|
// 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);
|
TRACE_1("no room to load item - deleting",_item);
|
||||||
deleteVehicle _item;
|
deleteVehicle _item;
|
||||||
};
|
};
|
||||||
|
@ -45,7 +45,7 @@ if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) != 1) ex
|
|||||||
private ["_text", "_condition", "_statement", "_icon", "_action"];
|
private ["_text", "_condition", "_statement", "_icon", "_action"];
|
||||||
_condition = {
|
_condition = {
|
||||||
params ["_target", "_player"];
|
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);
|
_text = localize LSTRING(openMenu);
|
||||||
_statement = {GVAR(interactionVehicle) = _target; createDialog QGVAR(menu);};
|
_statement = {GVAR(interactionVehicle) = _target; createDialog QGVAR(menu);};
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Object <OBJECT>
|
* 0: Object <OBJECT>
|
||||||
* 1: Vehicle <OBJECT>
|
* 1: Vehicle <OBJECT>
|
||||||
|
* 2: Show Hint <BOOL> (default: true)
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return value:
|
||||||
* Object loaded <BOOL>
|
* Object loaded <BOOL>
|
||||||
@ -18,7 +19,7 @@
|
|||||||
|
|
||||||
private ["_loaded", "_space", "_itemSize"];
|
private ["_loaded", "_space", "_itemSize"];
|
||||||
|
|
||||||
params ["_item", "_vehicle"];
|
params ["_item", "_vehicle", ["_showHint", true, [true]] ];
|
||||||
TRACE_2("params",_item,_vehicle);
|
TRACE_2("params",_item,_vehicle);
|
||||||
|
|
||||||
if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitWith {
|
if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitWith {
|
||||||
@ -46,7 +47,9 @@ private ["_itemName", "_vehicleName"];
|
|||||||
_itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName");
|
_itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName");
|
||||||
_vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
|
_vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
|
||||||
|
|
||||||
|
if (_showHint) then {
|
||||||
["displayTextStructured", [[localize LSTRING(LoadedItem), _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent);
|
["displayTextStructured", [[localize LSTRING(LoadedItem), _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent);
|
||||||
|
};
|
||||||
|
|
||||||
// Invoke listenable event
|
// Invoke listenable event
|
||||||
["cargoLoaded", [_item, _vehicle]] call EFUNC(common,globalEvent);
|
["cargoLoaded", [_item, _vehicle]] call EFUNC(common,globalEvent);
|
||||||
|
@ -83,9 +83,13 @@
|
|||||||
["setDir", {(_this select 0) setDir (_this select 1)}] call FUNC(addEventhandler);
|
["setDir", {(_this select 0) setDir (_this select 1)}] call FUNC(addEventhandler);
|
||||||
["setFuel", {(_this select 0) setFuel (_this select 1)}] call FUNC(addEventhandler);
|
["setFuel", {(_this select 0) setFuel (_this select 1)}] call FUNC(addEventhandler);
|
||||||
["setSpeaker", {(_this select 0) setSpeaker (_this select 1)}] call FUNC(addEventhandler);
|
["setSpeaker", {(_this select 0) setSpeaker (_this select 1)}] call FUNC(addEventhandler);
|
||||||
|
["selectLeader", {(_this select 0) selectLeader (_this select 1)}] call FUNC(addEventHandler);
|
||||||
|
["assignTeam", {(_this select 0) assignTeam (_this select 1)}] call FUNC(addEventHandler);
|
||||||
|
["setVelocity", {(_this select 0) setVelocity (_this select 1)}] call FUNC(addEventHandler);
|
||||||
|
|
||||||
if (isServer) then {
|
if (isServer) then {
|
||||||
["hideObjectGlobal", {(_this select 0) hideObjectGlobal (_this select 1)}] call FUNC(addEventHandler);
|
["hideObjectGlobal", {(_this select 0) hideObjectGlobal (_this select 1)}] call FUNC(addEventHandler);
|
||||||
|
["enableSimulationGlobal", {(_this select 0) enableSimulationGlobal (_this select 1)}] call FUNC(addEventHandler);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -94,8 +98,8 @@ if (isServer) then {
|
|||||||
//////////////////////////////////////////////////
|
//////////////////////////////////////////////////
|
||||||
|
|
||||||
// ACE events
|
// ACE events
|
||||||
"ACEg" addPublicVariableEventHandler { _this call FUNC(_handleNetEvent); };
|
"ACEg" addPublicVariableEventHandler {_this call FUNC(_handleNetEvent)};
|
||||||
"ACEc" addPublicVariableEventHandler { _this call FUNC(_handleNetEvent); };
|
"ACEc" addPublicVariableEventHandler {_this call FUNC(_handleNetEvent)};
|
||||||
|
|
||||||
// Synced ACE events
|
// Synced ACE events
|
||||||
// Handle JIP scenario
|
// Handle JIP scenario
|
||||||
@ -219,8 +223,29 @@ call FUNC(assignedItemFix);
|
|||||||
|
|
||||||
GVAR(ScrollWheelFrame) = diag_frameno;
|
GVAR(ScrollWheelFrame) = diag_frameno;
|
||||||
|
|
||||||
addMissionEventHandler ["Loaded", {call FUNC(handleScrollWheelInit)}];
|
["mainDisplayLoaded", {
|
||||||
|
[{
|
||||||
call FUNC(handleScrollWheelInit);
|
call FUNC(handleScrollWheelInit);
|
||||||
|
call FUNC(handleModifierKeyInit);
|
||||||
|
}, [], 0.1] call FUNC(waitAndExecute); // needs delay, otherwise doesn't work without pressing "RESTART" in editor once. Tested in 1.52RC
|
||||||
|
}] call FUNC(addEventHandler);
|
||||||
|
|
||||||
|
// add PFH to execute event that fires when the main display (46) is created
|
||||||
|
private "_fnc_initMainDisplayCheck";
|
||||||
|
_fnc_initMainDisplayCheck = {
|
||||||
|
[{
|
||||||
|
if !(isNull findDisplay 46) then {
|
||||||
|
// Raise ACE event locally
|
||||||
|
["mainDisplayLoaded", [findDisplay 46]] call FUNC(localEvent);
|
||||||
|
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||||
|
};
|
||||||
|
}, 0, []] call CBA_fnc_addPerFrameHandler;
|
||||||
|
};
|
||||||
|
|
||||||
|
call _fnc_initMainDisplayCheck;
|
||||||
|
|
||||||
|
// repeat this every time a savegame is loaded
|
||||||
|
addMissionEventHandler ["Loaded", _fnc_initMainDisplayCheck];
|
||||||
|
|
||||||
// @todo remove?
|
// @todo remove?
|
||||||
enableCamShake true;
|
enableCamShake true;
|
||||||
@ -273,7 +298,7 @@ if (!isNil QGVAR(PreInit_playerChanged_PFHID)) then {
|
|||||||
|
|
||||||
// "playerChanged" event
|
// "playerChanged" event
|
||||||
_data = call FUNC(player);
|
_data = call FUNC(player);
|
||||||
if !(_data isEqualTo GVAR(OldPlayerVehicle)) then {
|
if !(_data isEqualTo ACE_player) then {
|
||||||
private "_oldPlayer";
|
private "_oldPlayer";
|
||||||
_oldPlayer = ACE_player;
|
_oldPlayer = ACE_player;
|
||||||
|
|
||||||
@ -375,8 +400,8 @@ if (!isNil QGVAR(PreInit_playerChanged_PFHID)) then {
|
|||||||
// @todo still needed?
|
// @todo still needed?
|
||||||
[QGVAR(StateArrested), false, true, QUOTE(ADDON)] call FUNC(defineVariable);
|
[QGVAR(StateArrested), false, true, QUOTE(ADDON)] call FUNC(defineVariable);
|
||||||
|
|
||||||
["displayTextStructured", FUNC(displayTextStructured)] call FUNC(addEventhandler);
|
["displayTextStructured", {_this call FUNC(displayTextStructured)}] call FUNC(addEventhandler);
|
||||||
["displayTextPicture", FUNC(displayTextPicture)] call FUNC(addEventhandler);
|
["displayTextPicture", {_this call FUNC(displayTextPicture)}] call FUNC(addEventhandler);
|
||||||
|
|
||||||
["medical_onUnconscious", {
|
["medical_onUnconscious", {
|
||||||
params ["_unit", "_isUnconscious"];
|
params ["_unit", "_isUnconscious"];
|
||||||
|
@ -91,6 +91,9 @@ PREP(getWindDirection);
|
|||||||
PREP(getZoom);
|
PREP(getZoom);
|
||||||
PREP(goKneeling);
|
PREP(goKneeling);
|
||||||
PREP(hadamardProduct);
|
PREP(hadamardProduct);
|
||||||
|
PREP(handleModifierKey);
|
||||||
|
PREP(handleModifierKeyUp);
|
||||||
|
PREP(handleModifierKeyInit);
|
||||||
PREP(handleScrollWheel);
|
PREP(handleScrollWheel);
|
||||||
PREP(handleScrollWheelInit);
|
PREP(handleScrollWheelInit);
|
||||||
PREP(hasItem);
|
PREP(hasItem);
|
||||||
@ -204,6 +207,7 @@ PREP(getReflectorsWithSelections);
|
|||||||
PREP(getLightProperties);
|
PREP(getLightProperties);
|
||||||
PREP(getLightPropertiesWeapon);
|
PREP(getLightPropertiesWeapon);
|
||||||
PREP(getVehicleCrew);
|
PREP(getVehicleCrew);
|
||||||
|
PREP(getVehicleUAVCrew);
|
||||||
|
|
||||||
// turrets
|
// turrets
|
||||||
PREP(getTurrets);
|
PREP(getTurrets);
|
||||||
|
@ -19,14 +19,17 @@ _object = _this;
|
|||||||
if (!local _object) exitWith {};
|
if (!local _object) exitWith {};
|
||||||
|
|
||||||
// save and restore hitpoints, see below why
|
// save and restore hitpoints, see below why
|
||||||
private ["_hitPoints", "_hitPointDamages"];
|
private "_hitPointDamages";
|
||||||
|
_hitPointDamages = getAllHitPointsDamage _object;
|
||||||
|
|
||||||
_hitPoints = [_object] call FUNC(getHitpoints);
|
// get correct format for objects without hitpoints
|
||||||
_hitPointDamages = [_hitPoints, {_object getHitPointDamage _this}] call FUNC(map);
|
if (_hitPointDamages isEqualTo []) then {
|
||||||
|
_hitPointDamages = [[],[],[]];
|
||||||
|
};
|
||||||
|
|
||||||
// this prevents physx objects from floating when near other physx objects with allowDamage false
|
// this prevents physx objects from floating when near other physx objects with allowDamage false
|
||||||
_object setDamage damage _object;
|
_object setDamage damage _object;
|
||||||
|
|
||||||
{
|
{
|
||||||
_object setHitPointDamage [_x, _hitPointDamages select _forEachIndex];
|
_object setHitIndex [_forEachIndex, _x];
|
||||||
} forEach _hitPoints;
|
} forEach (_hitPointDamages select 2);
|
||||||
|
@ -18,4 +18,12 @@ ACE_DEPRECATED("ace_common_fnc_getHitPoints","3.5.0","getAllHitPointsDamage");
|
|||||||
|
|
||||||
params ["_vehicle"];
|
params ["_vehicle"];
|
||||||
|
|
||||||
(getAllHitPointsDamage _vehicle select 0) - [""]
|
private "_hitPointsWithSelections";
|
||||||
|
_hitPointsWithSelections = getAllHitPointsDamage _vehicle;
|
||||||
|
|
||||||
|
// get correct format on vehicles without any hitpoints
|
||||||
|
if (_hitPointsWithSelections isEqualTo []) then {
|
||||||
|
_hitPointsWithSelections = [[],[],[]];
|
||||||
|
};
|
||||||
|
|
||||||
|
(_hitPointsWithSelections select 0) - [""]
|
||||||
|
@ -22,6 +22,11 @@ params ["_vehicle"];
|
|||||||
private "_hitPointsWithSelections";
|
private "_hitPointsWithSelections";
|
||||||
_hitPointsWithSelections = getAllHitPointsDamage _vehicle;
|
_hitPointsWithSelections = getAllHitPointsDamage _vehicle;
|
||||||
|
|
||||||
|
// get correct format on vehicles without any hitpoints
|
||||||
|
if (_hitPointsWithSelections isEqualTo []) then {
|
||||||
|
_hitPointsWithSelections = [[],[],[]];
|
||||||
|
};
|
||||||
|
|
||||||
_hitPointsWithSelections resize 2;
|
_hitPointsWithSelections resize 2;
|
||||||
|
|
||||||
_hitPointsWithSelections
|
_hitPointsWithSelections
|
||||||
|
17
addons/common/functions/fnc_getVehicleUAVCrew.sqf
Normal file
17
addons/common/functions/fnc_getVehicleUAVCrew.sqf
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
* Author: commy2
|
||||||
|
* Returns array of uav dummy ais.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: Vehicle <OBJECT>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* UAV Dummy Crew <ARRAY>
|
||||||
|
*
|
||||||
|
* Public: Yes
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
params ["_vehicle"];
|
||||||
|
|
||||||
|
[crew _vehicle, {getText (configFile >> "CfgVehicles" >> typeOf _this >> "simulation") == "UAVPilot"}] call FUNC(filter) // return
|
17
addons/common/functions/fnc_handleModifierKey.sqf
Normal file
17
addons/common/functions/fnc_handleModifierKey.sqf
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
* Author: commy2
|
||||||
|
* Handles key down event for modifier key.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Public : No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
if (_this select 3) then {ACE_modifier = 1};
|
||||||
|
|
||||||
|
false
|
16
addons/common/functions/fnc_handleModifierKeyInit.sqf
Normal file
16
addons/common/functions/fnc_handleModifierKeyInit.sqf
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
* Author: commy2
|
||||||
|
* Initializes the modifier key handler.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Public : No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
(findDisplay 46) displayAddEventHandler ["KeyDown", FUNC(handleModifierKey)];
|
||||||
|
(findDisplay 46) displayAddEventHandler ["KeyUp", FUNC(handleModifierKeyUp)];
|
17
addons/common/functions/fnc_handleModifierKeyUp.sqf
Normal file
17
addons/common/functions/fnc_handleModifierKeyUp.sqf
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
* Author: commy2
|
||||||
|
* Handles key up event for modifier key.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Public : No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
ACE_modifier = 0;
|
||||||
|
|
||||||
|
false
|
@ -41,8 +41,7 @@ if (_slotsOpen) then {
|
|||||||
|
|
||||||
_vehicle setVariable [QGVAR(loaded_persons), _loaded, true];
|
_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"];
|
(_this select 0) params ["_unit", "_vehicle"];
|
||||||
|
|
||||||
@ -60,5 +59,5 @@ if (_slotsOpen) then {
|
|||||||
|
|
||||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||||
}, 0.5, [_unit, _vehicle]] call CBA_fnc_addPerFrameHandler;
|
}, 0.5, [_unit, _vehicle]] call CBA_fnc_addPerFrameHandler;
|
||||||
};*/
|
};
|
||||||
};
|
};
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* Return Value:
|
* Return Value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
* Public: No
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
@ -73,9 +73,7 @@ _unit action ["Eject", vehicle _unit];
|
|||||||
|
|
||||||
_unit setPosASL AGLToASL _emptyPos;
|
_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));
|
TRACE_1("Check if isAwake", [_unit] call FUNC(isAwake));
|
||||||
|
|
||||||
if (driver _unit == _unit) then {
|
if (driver _unit == _unit) then {
|
||||||
@ -92,7 +90,7 @@ _unit action ["Eject", vehicle _unit];
|
|||||||
};
|
};
|
||||||
}, [_unit, _anim], 0.5, 0] call FUNC(waitAndExecute);
|
}, [_unit, _anim], 0.5, 0] call FUNC(waitAndExecute);
|
||||||
};
|
};
|
||||||
};*/
|
};
|
||||||
}, [_unit, _emptyPos], 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);
|
[_unit, false, GROUP_SWITCH_ID, side group _unit] call FUNC(switchToGroupSide);
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
* Example:
|
* Example:
|
||||||
* [{(_this select 0) setVelocity [0,0,200];}, [player], 10] call ace_common_fnc_waitAndExecute
|
* [{(_this select 0) setVelocity [0,0,200];}, [player], 10] call ace_common_fnc_waitAndExecute
|
||||||
*
|
*
|
||||||
* Public: No
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
@ -5,21 +5,25 @@
|
|||||||
<English>DAGR</English>
|
<English>DAGR</English>
|
||||||
<Polish>DAGR</Polish>
|
<Polish>DAGR</Polish>
|
||||||
<Spanish>DAGR</Spanish>
|
<Spanish>DAGR</Spanish>
|
||||||
|
<Russian>DAGR</Russian>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_DAGR_ConfigureDAGR">
|
<Key ID="STR_ACE_DAGR_ConfigureDAGR">
|
||||||
<English>Configure DAGR</English>
|
<English>Configure DAGR</English>
|
||||||
<Polish>Konfiguruj DAGR</Polish>
|
<Polish>Konfiguruj DAGR</Polish>
|
||||||
<Spanish>Configurar DAGR</Spanish>
|
<Spanish>Configurar DAGR</Spanish>
|
||||||
|
<Russian>Настроить DAGR</Russian>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_DAGR_ToggleDAGR">
|
<Key ID="STR_ACE_DAGR_ToggleDAGR">
|
||||||
<English>Toggle DAGR</English>
|
<English>Toggle DAGR</English>
|
||||||
<Polish>Przełącz DAGR</Polish>
|
<Polish>Przełącz DAGR</Polish>
|
||||||
<Spanish>Mostrar DAGR</Spanish>
|
<Spanish>Mostrar DAGR</Spanish>
|
||||||
|
<Russian>Вкл./выкл. DAGR</Russian>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_DAGR_Description">
|
<Key ID="STR_ACE_DAGR_Description">
|
||||||
<English>Defense Advanced GPS Receiver</English>
|
<English>Defense Advanced GPS Receiver</English>
|
||||||
<Polish>Defense Advanced GPS Receiver</Polish>
|
<Polish>Defense Advanced GPS Receiver</Polish>
|
||||||
<Spanish>Defense Advanced GPS Receiver</Spanish>
|
<Spanish>Defense Advanced GPS Receiver</Spanish>
|
||||||
|
<Russian>Военный многофункциональный GPS-приёмник</Russian>
|
||||||
</Key>
|
</Key>
|
||||||
</Package>
|
</Package>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -7,8 +7,7 @@ class Extended_PreInit_EventHandlers {
|
|||||||
|
|
||||||
class Extended_PostInit_EventHandlers {
|
class Extended_PostInit_EventHandlers {
|
||||||
class ADDON {
|
class ADDON {
|
||||||
clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit));
|
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||||
serverInit = QUOTE(call COMPILE_FILE(XEH_serverInit));
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,7 +1,14 @@
|
|||||||
// by PabstMirror, commy2
|
// by PabstMirror, commy2
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
[DFUNC(handleScrollWheel)] call EFUNC(common,addScrollWheelEventHandler);
|
if (isServer) then {
|
||||||
|
// release object on hard disconnection. Function is identical to killed
|
||||||
|
addMissionEventHandler ["HandleDisconnect", {_this call FUNC(handleKilled)}];
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!hasInterface) exitWith {};
|
||||||
|
|
||||||
|
[{_this call FUNC(handleScrollWheel)}] call EFUNC(common,addScrollWheelEventHandler);
|
||||||
|
|
||||||
if (isNil "ACE_maxWeightDrag") then {
|
if (isNil "ACE_maxWeightDrag") then {
|
||||||
ACE_maxWeightDrag = 800;
|
ACE_maxWeightDrag = 800;
|
||||||
@ -15,11 +22,11 @@ if (isNil "ACE_maxWeightCarry") then {
|
|||||||
["isNotCarrying", {!((_this select 0) getVariable [QGVAR(isCarrying), false])}] call EFUNC(common,addCanInteractWithCondition);
|
["isNotCarrying", {!((_this select 0) getVariable [QGVAR(isCarrying), false])}] call EFUNC(common,addCanInteractWithCondition);
|
||||||
|
|
||||||
// release object on player change. This does work when returning to lobby, but not when hard disconnecting.
|
// release object on player change. This does work when returning to lobby, but not when hard disconnecting.
|
||||||
["playerChanged", DFUNC(handlePlayerChanged)] call EFUNC(common,addEventhandler);
|
["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
|
||||||
["playerVehicleChanged", {[ACE_player, objNull] call DFUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
|
["playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
|
||||||
["playerWeaponChanged", DFUNC(handlePlayerWeaponChanged)] call EFUNC(common,addEventhandler);
|
["playerWeaponChanged", {_this call FUNC(handlePlayerWeaponChanged)}] call EFUNC(common,addEventhandler);
|
||||||
|
|
||||||
// handle waking up dragged unit and falling unconscious while dragging
|
// handle waking up dragged unit and falling unconscious while dragging
|
||||||
["medical_onUnconscious", DFUNC(handleUnconscious)] call EFUNC(common,addEventhandler);
|
["medical_onUnconscious", {_this call FUNC(handleUnconscious)}] call EFUNC(common,addEventhandler);
|
||||||
|
|
||||||
//@todo Captivity?
|
//@todo Captivity?
|
@ -1,5 +0,0 @@
|
|||||||
// by commy2
|
|
||||||
#include "script_component.hpp"
|
|
||||||
|
|
||||||
// release object on hard disconnection. Function is identical to killed
|
|
||||||
addMissionEventHandler ["HandleDisconnect", DFUNC(handleKilled)];
|
|
@ -18,7 +18,7 @@ params ["_unit", "_target"];
|
|||||||
|
|
||||||
if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||||
|
|
||||||
// a static weapon has to be empty for dragging
|
// a static weapon has to be empty for dragging (ignore UAV AI)
|
||||||
if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false};
|
if (((typeOf _target) isKindOf "StaticWeapon") && {{(getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "simulation")) != "UAVPilot"} count crew _target > 0}) exitWith {false};
|
||||||
|
|
||||||
alive _target && {vehicle _target == _target} && {_target getVariable [QGVAR(canCarry), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false]) || (_target isKindOf "CAManBase" && {(_target getHitPointDamage "HitLegs") > 0.4})}
|
alive _target && {vehicle _target == _target} && {_target getVariable [QGVAR(canCarry), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false]) || (_target isKindOf "CAManBase" && {(_target getHitPointDamage "HitLegs") > 0.4})}
|
||||||
|
@ -21,7 +21,7 @@ _target = _this select 1;
|
|||||||
|
|
||||||
if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||||
|
|
||||||
// a static weapon has to be empty for dragging
|
// a static weapon has to be empty for dragging (ignore UAV AI)
|
||||||
if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false};
|
if ((typeOf _target) isKindOf "StaticWeapon" && {{(getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "simulation")) != "UAVPilot"} count crew _target > 0}) exitWith {false};
|
||||||
|
|
||||||
alive _target && {vehicle _target == _target} && {_target getVariable [QGVAR(canDrag), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false]) || (_target isKindOf "CAManBase" && {(_target getHitPointDamage "HitLegs") > 0.4})};
|
alive _target && {vehicle _target == _target} && {_target getVariable [QGVAR(canDrag), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false]) || (_target isKindOf "CAManBase" && {(_target getHitPointDamage "HitLegs") > 0.4})};
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
params ["_unit", "_target"];
|
params ["_unit", "_target"];
|
||||||
|
|
||||||
// get attachTo offset and direction.
|
// get attachTo offset and direction.
|
||||||
private ["_position", "_direction"];
|
private ["_position", "_direction", "_UAVCrew"];
|
||||||
|
|
||||||
_position = _target getVariable [QGVAR(carryPosition), [0, 0, 0]];
|
_position = _target getVariable [QGVAR(carryPosition), [0, 0, 0]];
|
||||||
_direction = _target getVariable [QGVAR(carryDirection), 0];
|
_direction = _target getVariable [QGVAR(carryDirection), 0];
|
||||||
@ -48,29 +48,26 @@ if (_target isKindOf "CAManBase") then {
|
|||||||
_unit setVariable [QGVAR(isCarrying), true, true];
|
_unit setVariable [QGVAR(isCarrying), true, true];
|
||||||
_unit setVariable [QGVAR(carriedObject), _target, true];
|
_unit setVariable [QGVAR(carriedObject), _target, true];
|
||||||
|
|
||||||
// add scrollwheel action to release object
|
// add drop action
|
||||||
private "_actionID";
|
_unit setVariable [QGVAR(ReleaseActionID), [
|
||||||
_actionID = _unit getVariable [QGVAR(ReleaseActionID), -1];
|
_unit, "DefaultAction",
|
||||||
|
{!isNull ((_this select 0) getVariable [QGVAR(carriedObject), objNull])},
|
||||||
|
{[_this select 0, (_this select 0) getVariable [QGVAR(carriedObject), objNull]] call FUNC(dropObject_carry)}
|
||||||
|
] call EFUNC(common,addActionEventHandler)];
|
||||||
|
|
||||||
if (_actionID != -1) then {
|
// show mouse hint
|
||||||
_unit removeAction _actionID;
|
[localize LSTRING(Drop), "", localize LSTRING(LowerRaise)] call EFUNC(interaction,showMouseHint);
|
||||||
};
|
|
||||||
|
|
||||||
_actionID = _unit addAction [
|
|
||||||
format ["<t color='#FF0000'>%1</t>", localize LSTRING(Drop)],
|
|
||||||
QUOTE([ARR_2(_this select 0, (_this select 0) getVariable [ARR_2(QUOTE(QGVAR(carriedObject)),objNull)])] call FUNC(dropObject_carry)),
|
|
||||||
nil,
|
|
||||||
20,
|
|
||||||
false,
|
|
||||||
true,
|
|
||||||
"",
|
|
||||||
QUOTE(!isNull (_this getVariable [ARR_2(QUOTE(QGVAR(carriedObject)),objNull)]))
|
|
||||||
];
|
|
||||||
|
|
||||||
_unit setVariable [QGVAR(ReleaseActionID), _actionID];
|
|
||||||
|
|
||||||
// check everything
|
// check everything
|
||||||
[FUNC(carryObjectPFH), 0.5, [_unit, _target]] call CBA_fnc_addPerFrameHandler;
|
[FUNC(carryObjectPFH), 0.5, [_unit, _target]] call CBA_fnc_addPerFrameHandler;
|
||||||
|
|
||||||
// reset current dragging height.
|
// reset current dragging height.
|
||||||
GVAR(currentHeightChange) = 0;
|
GVAR(currentHeightChange) = 0;
|
||||||
|
|
||||||
|
// prevent UAVs from firing
|
||||||
|
_UAVCrew = _target call EFUNC(common,getVehicleUAVCrew);
|
||||||
|
|
||||||
|
if !(_UAVCrew isEqualTo []) then {
|
||||||
|
{_target deleteVehicleCrew _x} count _UAVCrew;
|
||||||
|
_target setVariable [QGVAR(isUAV), true, true];
|
||||||
|
};
|
||||||
|
@ -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))
|
// 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);
|
[_unit, _target] call FUNC(dropObject_carry);
|
||||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||||
};
|
};
|
||||||
|
@ -14,9 +14,10 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_position", "_direction", "_offset", "_actionID"];
|
|
||||||
params ["_unit", "_target"];
|
params ["_unit", "_target"];
|
||||||
|
|
||||||
|
private ["_position", "_direction", "_offset", "_UAVCrew"];
|
||||||
|
|
||||||
// get attachTo offset and direction.
|
// get attachTo offset and direction.
|
||||||
_position = _target getVariable [QGVAR(dragPosition), [0, 0, 0]];
|
_position = _target getVariable [QGVAR(dragPosition), [0, 0, 0]];
|
||||||
_direction = _target getVariable [QGVAR(dragDirection), 0];
|
_direction = _target getVariable [QGVAR(dragDirection), 0];
|
||||||
@ -37,28 +38,26 @@ if (_target isKindOf "CAManBase") then {
|
|||||||
_unit setVariable [QGVAR(isDragging), true, true];
|
_unit setVariable [QGVAR(isDragging), true, true];
|
||||||
_unit setVariable [QGVAR(draggedObject), _target, true];
|
_unit setVariable [QGVAR(draggedObject), _target, true];
|
||||||
|
|
||||||
// add scrollwheel action to release object
|
// add drop action
|
||||||
_actionID = _unit getVariable [QGVAR(ReleaseActionID), -1];
|
_unit setVariable [QGVAR(ReleaseActionID), [
|
||||||
|
_unit, "DefaultAction",
|
||||||
|
{!isNull ((_this select 0) getVariable [QGVAR(draggedObject), objNull])},
|
||||||
|
{[_this select 0, (_this select 0) getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject)}
|
||||||
|
] call EFUNC(common,addActionEventHandler)];
|
||||||
|
|
||||||
if (_actionID != -1) then {
|
// show mouse hint
|
||||||
_unit removeAction _actionID;
|
[localize LSTRING(Drop), ""] call EFUNC(interaction,showMouseHint);
|
||||||
};
|
|
||||||
|
|
||||||
_actionID = _unit addAction [
|
|
||||||
format ["<t color='#FF0000'>%1</t>", localize LSTRING(Drop)],
|
|
||||||
QUOTE([ARR_2(_this select 0, (_this select 0) getVariable [ARR_2(QUOTE(QGVAR(draggedObject)),objNull)])] call FUNC(dropObject)),
|
|
||||||
nil,
|
|
||||||
20,
|
|
||||||
false,
|
|
||||||
true,
|
|
||||||
"",
|
|
||||||
QUOTE(!isNull (_this getVariable [ARR_2(QUOTE(QGVAR(draggedObject)),objNull)]))
|
|
||||||
];
|
|
||||||
|
|
||||||
_unit setVariable [QGVAR(ReleaseActionID), _actionID];
|
|
||||||
|
|
||||||
// check everything
|
// check everything
|
||||||
[FUNC(dragObjectPFH), 0.5, [_unit, _target]] call CBA_fnc_addPerFrameHandler;
|
[FUNC(dragObjectPFH), 0.5, [_unit, _target]] call CBA_fnc_addPerFrameHandler;
|
||||||
|
|
||||||
// reset current dragging height.
|
// reset current dragging height.
|
||||||
GVAR(currentHeightChange) = 0;
|
GVAR(currentHeightChange) = 0;
|
||||||
|
|
||||||
|
// prevent UAVs from firing
|
||||||
|
_UAVCrew = _target call EFUNC(common,getVehicleUAVCrew);
|
||||||
|
|
||||||
|
if !(_UAVCrew isEqualTo []) then {
|
||||||
|
{_target deleteVehicleCrew _x} count _UAVCrew;
|
||||||
|
_target setVariable [QGVAR(isUAV), true, true];
|
||||||
|
};
|
||||||
|
@ -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))
|
// 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);
|
[_unit, _target] call FUNC(dropObject);
|
||||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||||
};
|
};
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
params ["_unit", "_target"];
|
params ["_unit", "_target"];
|
||||||
|
|
||||||
// remove scroll wheel action
|
// remove drop action
|
||||||
_unit removeAction (_unit getVariable [QGVAR(ReleaseActionID), -1]);
|
[_unit, "DefaultAction", _unit getVariable [QGVAR(ReleaseActionID), -1]] call EFUNC(common,removeActionEventHandler);
|
||||||
|
|
||||||
private "_inBuilding";
|
private "_inBuilding";
|
||||||
_inBuilding = [_unit] call FUNC(isObjectOnObject);
|
_inBuilding = [_unit] call FUNC(isObjectOnObject);
|
||||||
@ -49,6 +49,9 @@ if (_inBuilding) then {
|
|||||||
_target setPosASL (getPosASL _target vectorAdd [0, 0, 0.05]);
|
_target setPosASL (getPosASL _target vectorAdd [0, 0, 0.05]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// hide mouse hint
|
||||||
|
[] call EFUNC(interaction,hideMouseHint);
|
||||||
|
|
||||||
_unit setVariable [QGVAR(isDragging), false, true];
|
_unit setVariable [QGVAR(isDragging), false, true];
|
||||||
_unit setVariable [QGVAR(draggedObject), objNull, true];
|
_unit setVariable [QGVAR(draggedObject), objNull, true];
|
||||||
|
|
||||||
@ -63,3 +66,8 @@ if !(_target isKindOf "CAManBase") then {
|
|||||||
if (_unit getvariable ["ACE_isUnconscious", false]) then {
|
if (_unit getvariable ["ACE_isUnconscious", false]) then {
|
||||||
[_unit, "unconscious", 2, true] call EFUNC(common,doAnimation);
|
[_unit, "unconscious", 2, true] call EFUNC(common,doAnimation);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// recreate UAV crew
|
||||||
|
if (_target getVariable [QGVAR(isUAV), false]) then {
|
||||||
|
createVehicleCrew _target;
|
||||||
|
};
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
params ["_unit", "_target"];
|
params ["_unit", "_target"];
|
||||||
|
|
||||||
// remove scroll wheel action
|
// remove drop action
|
||||||
_unit removeAction (_unit getVariable [QGVAR(ReleaseActionID), -1]);
|
[_unit, "DefaultAction", _unit getVariable [QGVAR(ReleaseActionID), -1]] call EFUNC(common,removeActionEventHandler);
|
||||||
|
|
||||||
private "_inBuilding";
|
private "_inBuilding";
|
||||||
_inBuilding = [_unit] call FUNC(isObjectOnObject);
|
_inBuilding = [_unit] call FUNC(isObjectOnObject);
|
||||||
@ -55,6 +55,9 @@ if (_inBuilding) then {
|
|||||||
_target setPosASL (getPosASL _target vectorAdd [0, 0, 0.05]);
|
_target setPosASL (getPosASL _target vectorAdd [0, 0, 0.05]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// hide mouse hint
|
||||||
|
[] call EFUNC(interaction,hideMouseHint);
|
||||||
|
|
||||||
_unit setVariable [QGVAR(isCarrying), false, true];
|
_unit setVariable [QGVAR(isCarrying), false, true];
|
||||||
_unit setVariable [QGVAR(carriedObject), objNull, true];
|
_unit setVariable [QGVAR(carriedObject), objNull, true];
|
||||||
|
|
||||||
@ -65,3 +68,8 @@ if !(_target isKindOf "CAManBase") then {
|
|||||||
["fixPosition", _target, _target] call EFUNC(common,targetEvent);
|
["fixPosition", _target, _target] call EFUNC(common,targetEvent);
|
||||||
["fixFloating", _target, _target] call EFUNC(common,targetEvent);
|
["fixFloating", _target, _target] call EFUNC(common,targetEvent);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// recreate UAV crew
|
||||||
|
if (_target getVariable [QGVAR(isUAV), false]) then {
|
||||||
|
createVehicleCrew _target;
|
||||||
|
};
|
||||||
|
@ -13,20 +13,15 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_unit", "_carriedItem", "_position", "_maxHeight"];
|
|
||||||
|
|
||||||
params ["_scrollAmount"];
|
params ["_scrollAmount"];
|
||||||
|
|
||||||
// requires modifier key to be hold down
|
private ["_unit", "_carriedItem", "_position", "_maxHeight"];
|
||||||
if (missionNamespace getVariable ["ACE_Modifier", 0] == 0) exitWith {false};
|
|
||||||
|
|
||||||
_unit = ACE_player;
|
_unit = ACE_player;
|
||||||
|
|
||||||
// EH is always assigned. Exit and don't overwrite input if not carrying
|
// EH is always assigned. Exit and don't overwrite input if not carrying
|
||||||
if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {false};
|
if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {false};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// move carried item 15 cm per scroll interval
|
// move carried item 15 cm per scroll interval
|
||||||
_scrollAmount = _scrollAmount * 0.15;
|
_scrollAmount = _scrollAmount * 0.15;
|
||||||
|
|
||||||
|
@ -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))
|
// 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);
|
[_unit, _target] call FUNC(dropObject);
|
||||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
[_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))
|
// 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);
|
[_unit, _target] call FUNC(dropObject);
|
||||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||||
};
|
};
|
||||||
|
@ -49,5 +49,9 @@
|
|||||||
<Italian>Trasporta</Italian>
|
<Italian>Trasporta</Italian>
|
||||||
<Russian>Нести</Russian>
|
<Russian>Нести</Russian>
|
||||||
</Key>
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Dragging_LowerRaise">
|
||||||
|
<English>Raise/Lower</English>
|
||||||
|
<German>Heben/Senken</German>
|
||||||
|
</Key>
|
||||||
</Package>
|
</Package>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -45,7 +45,7 @@ _children = [];
|
|||||||
format ["Explosive_%1", _forEachIndex],
|
format ["Explosive_%1", _forEachIndex],
|
||||||
format [_name + " (%1)", _itemCount select _forEachIndex],
|
format [_name + " (%1)", _itemCount select _forEachIndex],
|
||||||
getText(_x >> "picture"),
|
getText(_x >> "picture"),
|
||||||
{_this call FUNC(setupExplosive);},
|
{[{_this call FUNC(setupExplosive)}, _this] call EFUNC(common,execNextFrame)},
|
||||||
{true},
|
{true},
|
||||||
{},
|
{},
|
||||||
(configName _x)
|
(configName _x)
|
||||||
|
@ -94,16 +94,16 @@
|
|||||||
<Russian>Отмена</Russian>
|
<Russian>Отмена</Russian>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Explosives_ScrollAction">
|
<Key ID="STR_ACE_Explosives_ScrollAction">
|
||||||
<English>+ Modifier, rotates</English>
|
<English>+Ctrl rotate</English>
|
||||||
<German>+ Modifikator, drehen</German>
|
<German>+Strg drehen</German>
|
||||||
<Spanish>+ Modificador, girar</Spanish>
|
<Spanish>+Ctrl girar</Spanish>
|
||||||
<French>+ Modificateur, tourner</French>
|
<French>+Ctrl tourner</French>
|
||||||
<Italian>+ Modificatore, rotazione</Italian>
|
<Italian>+Ctrl rotazione</Italian>
|
||||||
<Czech>+ Modifikátor, otočit</Czech>
|
<Czech>+Ctrl otočit</Czech>
|
||||||
<Hungarian>+ Változtatás, forgatás</Hungarian>
|
<Hungarian>+Ctrl forgatás</Hungarian>
|
||||||
<Polish>+ Modyfikator, obrót</Polish>
|
<Polish>+Ctrl obrót</Polish>
|
||||||
<Portuguese>+ Modificador, rotaciona</Portuguese>
|
<Portuguese>+Ctrl rotaciona</Portuguese>
|
||||||
<Russian>+ Bращать</Russian>
|
<Russian>+Ctrl Bращать</Russian>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Explosives_Jammer_TurnOn">
|
<Key ID="STR_ACE_Explosives_Jammer_TurnOn">
|
||||||
<English>Turn On Thor III</English>
|
<English>Turn On Thor III</English>
|
||||||
|
@ -1,4 +1,11 @@
|
|||||||
|
|
||||||
class ACE_Settings {
|
class ACE_Settings {
|
||||||
|
/*class GVAR(enable) { // @todo
|
||||||
|
value = 0;
|
||||||
|
typeName = "BOOL";
|
||||||
|
isClientSettable = 1;
|
||||||
|
displayName = CSTRING(enable);
|
||||||
|
};*/
|
||||||
class GVAR(showInThirdPerson) {
|
class GVAR(showInThirdPerson) {
|
||||||
value = 0;
|
value = 0;
|
||||||
typeName = "BOOL";
|
typeName = "BOOL";
|
||||||
|
@ -1,10 +1,36 @@
|
|||||||
|
|
||||||
class Extended_PreInit_EventHandlers {
|
class Extended_PreInit_EventHandlers {
|
||||||
class ADDON {
|
class ADDON {
|
||||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class Extended_PostInit_EventHandlers {
|
class Extended_PostInit_EventHandlers {
|
||||||
class ADDON {
|
class ADDON {
|
||||||
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Extended_Killed_EventHandlers {
|
||||||
|
class CAManBase {
|
||||||
|
class ADDON {
|
||||||
|
killed = QUOTE(_this call FUNC(handleKilled));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
class Extended_Fired_EventHandlers {
|
||||||
|
class CAManBase {
|
||||||
|
class ADDON {
|
||||||
|
fired = QUOTE(if (local (_this select 0)) then {_this call FUNC(handleFired)});
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
class Extended_Explosion_EventHandlers {
|
||||||
|
class CAManBase {
|
||||||
|
class ADDON {
|
||||||
|
explosion = QUOTE(if (local (_this select 0)) then {_this call FUNC(handleExplosion)});
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
@ -1,24 +1,8 @@
|
|||||||
/*
|
|
||||||
* Author: Garth 'L-H' de Wet
|
|
||||||
* Sets up the glasses mod for usage. Initialises variables and event handlers.
|
|
||||||
* Shouldn't be called by a user/modder ever. Done by the engine.
|
|
||||||
*
|
|
||||||
* Arguments:
|
|
||||||
* None
|
|
||||||
*
|
|
||||||
* Return Value:
|
|
||||||
* None
|
|
||||||
*
|
|
||||||
* Example:
|
|
||||||
* None
|
|
||||||
*
|
|
||||||
* Public: No
|
|
||||||
*/
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
if (!hasInterface) exitWith {};
|
if (!hasInterface) exitWith {};
|
||||||
|
|
||||||
["ACE3 Common", QGVAR(wipeGlasses), localize LSTRING(WipeGlasses),
|
["ACE3 Common", QGVAR(wipeGlasses), localize LSTRING(WipeGlasses), {
|
||||||
{
|
|
||||||
if (!(GETVAR(ace_player,ACE_isUnconscious,false))) exitWith {
|
if (!(GETVAR(ace_player,ACE_isUnconscious,false))) exitWith {
|
||||||
call FUNC(clearGlasses);
|
call FUNC(clearGlasses);
|
||||||
true
|
true
|
||||||
@ -26,20 +10,27 @@ if (!hasInterface) exitWith {};
|
|||||||
false
|
false
|
||||||
},
|
},
|
||||||
{false},
|
{false},
|
||||||
[20, [true, true, false]], false] call cba_fnc_addKeybind;
|
[20, [true, true, false]], false] call CBA_fnc_addKeybind;
|
||||||
|
|
||||||
if isNil(QGVAR(UsePP)) then {
|
// make sure to stack effect layers in correct order
|
||||||
|
GVAR(GogglesEffectsLayer) = QGVAR(GogglesEffectsLayer) call BIS_fnc_RSCLayer;
|
||||||
|
GVAR(GogglesLayer) = QGVAR(GogglesLayer) call BIS_fnc_RSCLayer;
|
||||||
|
|
||||||
|
if (isNil QGVAR(UsePP)) then {
|
||||||
GVAR(UsePP) = true;
|
GVAR(UsePP) = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// init pp effects
|
||||||
GVAR(PostProcess) = ppEffectCreate ["ColorCorrections", 1995];
|
GVAR(PostProcess) = ppEffectCreate ["ColorCorrections", 1995];
|
||||||
GVAR(PostProcessEyes) = ppEffectCreate ["ColorCorrections", 1992];
|
GVAR(PostProcessEyes) = ppEffectCreate ["ColorCorrections", 1992];
|
||||||
GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [1, 1, 1, 0]];
|
GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [1, 1, 1, 0]];
|
||||||
GVAR(PostProcessEyes) ppEffectCommit 0;
|
GVAR(PostProcessEyes) ppEffectCommit 0;
|
||||||
GVAR(PostProcessEyes) ppEffectEnable false;
|
GVAR(PostProcessEyes) ppEffectEnable false;
|
||||||
|
|
||||||
GVAR(EffectsActive) = false;
|
GVAR(EffectsActive) = false;
|
||||||
|
|
||||||
SETGLASSES(ace_player,GLASSESDEFAULT);
|
SETGLASSES(ace_player,GLASSESDEFAULT);
|
||||||
GVAR(Current) = "None";
|
|
||||||
GVAR(EyesDamageScript) = -1;
|
GVAR(EyesDamageScript) = -1;
|
||||||
GVAR(FrameEvent) = [false, [false, 20]];
|
GVAR(FrameEvent) = [false, [false, 20]];
|
||||||
GVAR(PostProcessEyes_Enabled) = false;
|
GVAR(PostProcessEyes_Enabled) = false;
|
||||||
@ -50,82 +41,89 @@ GVAR(RainLastLevel) = 0;
|
|||||||
GVAR(surfaceCache) = "";
|
GVAR(surfaceCache) = "";
|
||||||
GVAR(surfaceCacheIsDust) = false;
|
GVAR(surfaceCacheIsDust) = false;
|
||||||
|
|
||||||
FUNC(CheckGlasses) = {
|
// init GlassesChanged eventhandler
|
||||||
if (GVAR(Current) != (goggles ace_player)) then {
|
GVAR(OldGlasses) = "#NULLSTRING";
|
||||||
GVAR(Current) = (goggles ace_player);
|
|
||||||
["GlassesChanged",[GVAR(Current)]] call EFUNC(common,localEvent);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
player addEventHandler ["Explosion", {
|
["playerInventoryChanged", {
|
||||||
private "_effects";
|
(_this select 1) params ["", "_currentGlasses"];
|
||||||
if (alive ace_player) then {
|
|
||||||
call FUNC(ApplyDirtEffect);
|
|
||||||
if (GETBROKEN) exitWith {};
|
|
||||||
if (((_this select 1) call FUNC(GetExplosionIndex)) < getNumber(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Resistance")) exitWith {};
|
|
||||||
if !([ace_player] call FUNC(isGogglesVisible)) exitWith {["GlassesCracked",[ace_player]] call EFUNC(common,localEvent);};
|
|
||||||
_effects = GETGLASSES(ace_player);
|
|
||||||
_effects set [BROKEN, true];
|
|
||||||
SETGLASSES(ace_player,_effects);
|
|
||||||
if (getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked") != "" && {cameraOn == ace_player}) then {
|
|
||||||
if (call FUNC(ExternalCamera)) exitWith {};
|
|
||||||
if (isNull(GLASSDISPLAY)) then {
|
|
||||||
150 cutRsc["RscACE_Goggles", "PLAIN",1, false];
|
|
||||||
};
|
|
||||||
(GLASSDISPLAY displayCtrl 10650) ctrlSetText getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked");
|
|
||||||
};
|
|
||||||
["GlassesCracked",[ace_player]] call EFUNC(common,localEvent);
|
|
||||||
};
|
|
||||||
}];
|
|
||||||
player addEventHandler ["Killed",{
|
|
||||||
GVAR(PostProcessEyes) ppEffectEnable false;
|
|
||||||
SETGLASSES(ace_player,GLASSESDEFAULT);
|
|
||||||
call FUNC(removeGlassesEffect);
|
|
||||||
GVAR(EffectsActive)=false;
|
|
||||||
ace_player setVariable ["ACE_EyesDamaged", false];
|
|
||||||
if (GVAR(EyesDamageScript) != -1) then {
|
|
||||||
[GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler);
|
|
||||||
};
|
|
||||||
if (GVAR(DustHandler) != -1) then {
|
|
||||||
[GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
|
|
||||||
GVAR(DustHandler) = -1;
|
|
||||||
};
|
|
||||||
}];
|
|
||||||
player addEventHandler ["Fired",{[_this select 0, _this select 1] call FUNC(dustHandler);}];
|
|
||||||
player AddEventHandler ["Take",{call FUNC(checkGlasses);}];
|
|
||||||
player AddEventHandler ["Put", {call FUNC(checkGlasses);}];
|
|
||||||
|
|
||||||
|
if (GVAR(OldGlasses) != _currentGlasses) then {
|
||||||
|
["GlassesChanged", [ACE_player, _currentGlasses]] call EFUNC(common,localEvent);
|
||||||
|
GVAR(OldGlasses) = _currentGlasses;
|
||||||
|
};
|
||||||
|
}] call EFUNC(common,addEventHandler);
|
||||||
|
|
||||||
|
// add glasses eventhandlers
|
||||||
["GlassesChanged", {
|
["GlassesChanged", {
|
||||||
SETGLASSES(ace_player,GLASSESDEFAULT);
|
params ["_unit", "_glasses"];
|
||||||
|
|
||||||
|
SETGLASSES(_unit,GLASSESDEFAULT);
|
||||||
|
|
||||||
if (call FUNC(ExternalCamera)) exitWith {call FUNC(RemoveGlassesEffect)};
|
if (call FUNC(ExternalCamera)) exitWith {call FUNC(RemoveGlassesEffect)};
|
||||||
|
|
||||||
if ([ace_player] call FUNC(isGogglesVisible)) then {
|
if ([_unit] call FUNC(isGogglesVisible)) then {
|
||||||
[_this select 0] call FUNC(applyGlassesEffect);
|
_glasses call FUNC(applyGlassesEffect);
|
||||||
} else {
|
} else {
|
||||||
call FUNC(removeGlassesEffect);
|
call FUNC(removeGlassesEffect);
|
||||||
};
|
};
|
||||||
}] call EFUNC(common,addEventHandler);
|
}] call EFUNC(common,addEventHandler);
|
||||||
|
|
||||||
["GlassesCracked", {
|
["GlassesCracked", {
|
||||||
if (_this select 0 != ace_player) exitWith {};
|
params ["_unit"];
|
||||||
ace_player setVariable ["ACE_EyesDamaged", true];
|
|
||||||
if (GVAR(EyesDamageScript) != -1) then {
|
_unit setVariable ["ACE_EyesDamaged", true];
|
||||||
[GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler);
|
|
||||||
};
|
|
||||||
GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0.5, 0.5, 0.5, 0.5], [1, 1, 1, 0]];
|
GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0.5, 0.5, 0.5, 0.5], [1, 1, 1, 0]];
|
||||||
GVAR(PostProcessEyes) ppEffectCommit 0;
|
GVAR(PostProcessEyes) ppEffectCommit 0;
|
||||||
GVAR(PostProcessEyes) ppEffectEnable true;
|
GVAR(PostProcessEyes) ppEffectEnable true;
|
||||||
GVAR(EyesDamageScript) = [{
|
|
||||||
|
[{
|
||||||
GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [1, 1, 1, 1], [1, 1, 1, 0]];
|
GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [1, 1, 1, 1], [1, 1, 1, 0]];
|
||||||
GVAR(PostProcessEyes) ppEffectCommit 5;
|
GVAR(PostProcessEyes) ppEffectCommit 5;
|
||||||
|
|
||||||
GVAR(EyesDamageScript) = [{
|
GVAR(EyesDamageScript) = [{
|
||||||
|
params ["_unit"];
|
||||||
|
|
||||||
GVAR(PostProcessEyes) ppEffectEnable false;
|
GVAR(PostProcessEyes) ppEffectEnable false;
|
||||||
ace_player setVariable ["ACE_EyesDamaged", false];
|
|
||||||
GVAR(EyesDamageScript) = -1;
|
_unit setVariable ["ACE_EyesDamaged", false];
|
||||||
}, [], 5, 1] call EFUNC(common,waitAndExecute);
|
|
||||||
}, [], 25, 5] call EFUNC(common,waitAndExecute);
|
}, _this, 5] call EFUNC(common,waitAndExecute);
|
||||||
|
|
||||||
|
}, _unit, 25] call EFUNC(common,waitAndExecute);
|
||||||
|
|
||||||
}] call EFUNC(common,addEventHandler);
|
}] call EFUNC(common,addEventHandler);
|
||||||
call FUNC(checkGlasses);
|
|
||||||
[FUNC(CheckGoggles), 1, []] call CBA_fnc_addPerFrameHandler;
|
// check goggles
|
||||||
[FUNC(rainEffect), 0.5, []] call CBA_fnc_addPerFrameHandler;
|
local _fnc_checkGoggles = {
|
||||||
[FUNC(onEachFrame), 0, []] call CBA_fnc_addPerFrameHandler;
|
params ["_unit"];
|
||||||
|
|
||||||
|
if (GVAR(EffectsActive)) then {
|
||||||
|
if (call FUNC(externalCamera) || {!([_unit] call FUNC(isGogglesVisible))}) then {
|
||||||
|
call FUNC(removeGlassesEffect);
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
if (!(call FUNC(externalCamera)) && {[_unit] call FUNC(isGogglesVisible)}) then {
|
||||||
|
[goggles _unit] call FUNC(applyGlassesEffect);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
["cameraViewChanged", _fnc_checkGoggles] call EFUNC(common,addEventHandler);
|
||||||
|
["activeCameraChanged", _fnc_checkGoggles] call EFUNC(common,addEventHandler);
|
||||||
|
|
||||||
|
// goggles effects main PFH
|
||||||
|
[{
|
||||||
|
// rain
|
||||||
|
call FUNC(applyRainEffect);
|
||||||
|
|
||||||
|
// auto remove effects under water
|
||||||
|
if (GVAR(EffectsActive) && {[goggles ACE_player] call FUNC(isDivingGoggles) && {underwater ACE_player}}) then {
|
||||||
|
call FUNC(removeRainEffect);
|
||||||
|
call FUNC(removeDirtEffect);
|
||||||
|
call FUNC(removeDustEffect);
|
||||||
|
};
|
||||||
|
|
||||||
|
// rotor wash effect
|
||||||
|
call FUNC(applyRotorWashEffect)
|
||||||
|
}, 0.5, _fnc_checkGoggles] call CBA_fnc_addPerFrameHandler;
|
||||||
|
@ -1,42 +1,31 @@
|
|||||||
/*
|
|
||||||
* Author: Garth 'L-H' de Wet
|
|
||||||
* Initialises Goggles.
|
|
||||||
*
|
|
||||||
* Arguments:
|
|
||||||
* None
|
|
||||||
*
|
|
||||||
* Return Value:
|
|
||||||
* None
|
|
||||||
*
|
|
||||||
* Example:
|
|
||||||
* None
|
|
||||||
*
|
|
||||||
* Public: No
|
|
||||||
*/
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
ADDON = false;
|
ADDON = false;
|
||||||
|
|
||||||
|
// effects
|
||||||
PREP(applyDirtEffect);
|
PREP(applyDirtEffect);
|
||||||
PREP(applyDust);
|
PREP(applyDustEffect);
|
||||||
PREP(applyGlassesEffect);
|
PREP(applyGlassesEffect);
|
||||||
|
PREP(applyRainEffect);
|
||||||
PREP(checkGoggles);
|
PREP(applyRotorWashEffect);
|
||||||
PREP(clearGlasses);
|
|
||||||
PREP(dustHandler);
|
|
||||||
PREP(externalCamera);
|
|
||||||
PREP(getExplosionIndex);
|
|
||||||
|
|
||||||
PREP(isDivingGoggles);
|
|
||||||
PREP(isGogglesVisible);
|
|
||||||
PREP(isInRotorWash);
|
|
||||||
|
|
||||||
PREP(onEachFrame);
|
|
||||||
PREP(rainEffect);
|
|
||||||
|
|
||||||
PREP(removeDirtEffect);
|
PREP(removeDirtEffect);
|
||||||
PREP(removeDustEffect);
|
PREP(removeDustEffect);
|
||||||
PREP(removeGlassesEffect);
|
PREP(removeGlassesEffect);
|
||||||
PREP(removeRainEffect);
|
PREP(removeRainEffect);
|
||||||
|
|
||||||
|
// public
|
||||||
|
PREP(externalCamera);
|
||||||
|
PREP(isDivingGoggles);
|
||||||
|
PREP(isGogglesVisible);
|
||||||
|
PREP(isInRotorWash);
|
||||||
|
|
||||||
|
// general
|
||||||
|
PREP(clearGlasses);
|
||||||
|
PREP(getExplosionIndex);
|
||||||
|
|
||||||
|
// eventhandlers
|
||||||
|
PREP(handleExplosion);
|
||||||
|
PREP(handleFired);
|
||||||
|
PREP(handleKilled);
|
||||||
|
|
||||||
ADDON = true;
|
ADDON = true;
|
||||||
|
@ -1,17 +1,15 @@
|
|||||||
class CfgSkeletons
|
|
||||||
{
|
class CfgSkeletons {
|
||||||
class Default
|
class Default {
|
||||||
{
|
|
||||||
isDiscrete = 1;
|
isDiscrete = 1;
|
||||||
skeletonInherit = "";
|
skeletonInherit = "";
|
||||||
skeletonBones[] = {};
|
skeletonBones[] = {};
|
||||||
};
|
};
|
||||||
class OFP2_ManSkeleton
|
|
||||||
{
|
class OFP2_ManSkeleton {
|
||||||
isDiscrete = 0;
|
isDiscrete = 0;
|
||||||
skeletonInherit = "";
|
skeletonInherit = "";
|
||||||
skeletonBones[] =
|
skeletonBones[] = {
|
||||||
{
|
|
||||||
"Pelvis","",
|
"Pelvis","",
|
||||||
"Spine","Pelvis",
|
"Spine","Pelvis",
|
||||||
"Spine1","Spine",
|
"Spine1","Spine",
|
||||||
@ -20,10 +18,12 @@ class CfgSkeletons
|
|||||||
"Camera","Pelvis",
|
"Camera","Pelvis",
|
||||||
"weapon","Spine1",
|
"weapon","Spine1",
|
||||||
"launcher","Spine1",
|
"launcher","Spine1",
|
||||||
|
|
||||||
//Head skeleton in hierarchy
|
//Head skeleton in hierarchy
|
||||||
"neck","Spine3",
|
"neck","Spine3",
|
||||||
"neck1","neck",
|
"neck1","neck",
|
||||||
"head","neck1",
|
"head","neck1",
|
||||||
|
|
||||||
//New facial features
|
//New facial features
|
||||||
"Face_Hub","head",
|
"Face_Hub","head",
|
||||||
"Face_Jawbone","Face_Hub",
|
"Face_Jawbone","Face_Hub",
|
||||||
@ -61,6 +61,7 @@ class CfgSkeletons
|
|||||||
"Face_EyelidLowerLeft","Face_Hub",
|
"Face_EyelidLowerLeft","Face_Hub",
|
||||||
"EyeLeft","Face_Hub",
|
"EyeLeft","Face_Hub",
|
||||||
"EyeRight","Face_Hub",
|
"EyeRight","Face_Hub",
|
||||||
|
|
||||||
//Left upper side
|
//Left upper side
|
||||||
"LeftShoulder","Spine3",
|
"LeftShoulder","Spine3",
|
||||||
"LeftArm","LeftShoulder",
|
"LeftArm","LeftShoulder",
|
||||||
@ -84,6 +85,7 @@ class CfgSkeletons
|
|||||||
"LeftHandThumb1","LeftHand",
|
"LeftHandThumb1","LeftHand",
|
||||||
"LeftHandThumb2","LeftHandThumb1",
|
"LeftHandThumb2","LeftHandThumb1",
|
||||||
"LeftHandThumb3","LeftHandThumb2",
|
"LeftHandThumb3","LeftHandThumb2",
|
||||||
|
|
||||||
//Right upper side
|
//Right upper side
|
||||||
"RightShoulder","Spine3",
|
"RightShoulder","Spine3",
|
||||||
"RightArm","RightShoulder",
|
"RightArm","RightShoulder",
|
||||||
@ -107,6 +109,7 @@ class CfgSkeletons
|
|||||||
"RightHandThumb1","RightHand",
|
"RightHandThumb1","RightHand",
|
||||||
"RightHandThumb2","RightHandThumb1",
|
"RightHandThumb2","RightHandThumb1",
|
||||||
"RightHandThumb3","RightHandThumb2",
|
"RightHandThumb3","RightHandThumb2",
|
||||||
|
|
||||||
//Left lower side
|
//Left lower side
|
||||||
"LeftUpLeg","Pelvis",
|
"LeftUpLeg","Pelvis",
|
||||||
"LeftUpLegRoll","LeftUpLeg",
|
"LeftUpLegRoll","LeftUpLeg",
|
||||||
@ -114,6 +117,7 @@ class CfgSkeletons
|
|||||||
"LeftLegRoll","LeftLeg",
|
"LeftLegRoll","LeftLeg",
|
||||||
"LeftFoot","LeftLegRoll",
|
"LeftFoot","LeftLegRoll",
|
||||||
"LeftToeBase","LeftFoot",
|
"LeftToeBase","LeftFoot",
|
||||||
|
|
||||||
//Right lower side
|
//Right lower side
|
||||||
"RightUpLeg","Pelvis",
|
"RightUpLeg","Pelvis",
|
||||||
"RightUpLegRoll","RightUpLeg",
|
"RightUpLegRoll","RightUpLeg",
|
||||||
@ -122,6 +126,7 @@ class CfgSkeletons
|
|||||||
"RightFoot","RightLegRoll",
|
"RightFoot","RightLegRoll",
|
||||||
"RightToeBase","RightFoot"
|
"RightToeBase","RightFoot"
|
||||||
};
|
};
|
||||||
|
|
||||||
// location of pivot points (local axes) for hierarchical animation
|
// location of pivot points (local axes) for hierarchical animation
|
||||||
pivotsModel="A3\anims_f\data\skeleton\SkeletonPivots.p3d";
|
pivotsModel="A3\anims_f\data\skeleton\SkeletonPivots.p3d";
|
||||||
};
|
};
|
||||||
|
@ -9,23 +9,29 @@
|
|||||||
* Succeeded <BOOL>
|
* Succeeded <BOOL>
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* _applied = call ace_goggles_fnc_ApplyDirtEffect;
|
* _applied = call ace_goggles_fnc_applyDirtEffect
|
||||||
*
|
*
|
||||||
* Public: Yes
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
if (cameraOn != ace_player || {call FUNC(externalCamera)}) exitWith{false};
|
if (GVAR(showInThirdPerson)) exitWith {false};
|
||||||
private ["_dirtImage", "_applied", "_effects"];
|
if (call FUNC(externalCamera)) exitWith {false};
|
||||||
_effects = GETGLASSES(ace_player);
|
|
||||||
|
private ["_unit", "_effects"];
|
||||||
|
|
||||||
|
_unit = ACE_player;
|
||||||
|
|
||||||
|
_effects = GETGLASSES(_unit);
|
||||||
_effects set [DIRT, true];
|
_effects set [DIRT, true];
|
||||||
SETGLASSES(ace_player,_effects);
|
|
||||||
|
|
||||||
if ([ace_player] call FUNC(isGogglesVisible)) then{
|
SETGLASSES(_unit,_effects);
|
||||||
_dirtImage = getText(ConfigFile >> "CfgGlasses" >> (goggles ace_player) >> "ACE_OverlayDirt");
|
|
||||||
|
if ([_unit] call FUNC(isGogglesVisible)) then {
|
||||||
|
local _dirtImage = getText (configFile >> "CfgGlasses" >> goggles _unit >> "ACE_OverlayDirt");
|
||||||
|
|
||||||
if (_dirtImage != "") then {
|
if (_dirtImage != "") then {
|
||||||
100 cutRsc["RscACE_GogglesEffects", "PLAIN",0.1, false];
|
GVAR(GogglesEffectsLayer) cutRsc ["RscACE_GogglesEffects", "PLAIN", 0.1, false];
|
||||||
|
|
||||||
(GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText _dirtImage;
|
(GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText _dirtImage;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,60 +0,0 @@
|
|||||||
/*
|
|
||||||
* Author: Garth 'L-H' de Wet
|
|
||||||
* Applies dust to screen.
|
|
||||||
*
|
|
||||||
* Arguments:
|
|
||||||
* None
|
|
||||||
*
|
|
||||||
* Return Value:
|
|
||||||
* None
|
|
||||||
*
|
|
||||||
* Example:
|
|
||||||
* call ace_goggles_fnc_ApplyDust;
|
|
||||||
*
|
|
||||||
* Public: Yes
|
|
||||||
*/
|
|
||||||
#include "script_component.hpp"
|
|
||||||
|
|
||||||
if (call FUNC(ExternalCamera)) exitWith {};
|
|
||||||
if ([ace_player] call FUNC(isGogglesVisible)) exitWith {
|
|
||||||
100 cutRsc["RscACE_GogglesEffects", "PLAIN",2,false];
|
|
||||||
(uiNamespace getVariable ["ACE_Goggles_DisplayEffects", displayNull] displayCtrl 10662) ctrlSetText format[getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_DustPath"), GETDUSTT(DAMOUNT)+1];
|
|
||||||
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)+1,0,1));
|
|
||||||
SETDUST(DBULLETS,0);
|
|
||||||
};
|
|
||||||
|
|
||||||
if (GETVAR(ace_player,ACE_EyesDamaged,false)) exitWith {SETDUST(DACTIVE,false);SETDUST(DBULLETS,0);SETDUST(DAMOUNT,0);};
|
|
||||||
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)+1,0,2));
|
|
||||||
|
|
||||||
private "_amount";
|
|
||||||
_amount = 1 - (GETDUSTT(DAMOUNT) * 0.125);
|
|
||||||
|
|
||||||
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [_amount,_amount,_amount,_amount],[1,1,1,0]];
|
|
||||||
GVAR(PostProcessEyes) ppEffectCommit 1;
|
|
||||||
GVAR(PostProcessEyes) ppEffectEnable true;
|
|
||||||
SETDUST(DBULLETS,0);
|
|
||||||
|
|
||||||
if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA
|
|
||||||
[GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
|
|
||||||
GVAR(DustHandler) = -1;
|
|
||||||
};
|
|
||||||
GVAR(DustHandler) = [{
|
|
||||||
if (ACE_diagTime >= GETDUSTT(DTIME) + 3) then {
|
|
||||||
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2));
|
|
||||||
private "_amount";
|
|
||||||
_amount = 1 - (GETDUSTT(DAMOUNT) * 0.125);
|
|
||||||
if !(ace_player getVariable ["ACE_EyesDamaged", false]) then {
|
|
||||||
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [_amount,_amount,_amount,_amount],[1,1,1,0]];
|
|
||||||
GVAR(PostProcessEyes) ppEffectCommit 0.5;
|
|
||||||
};
|
|
||||||
if (GETDUSTT(DAMOUNT) <= 0) then {
|
|
||||||
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]];
|
|
||||||
GVAR(PostProcessEyes) ppEffectCommit 2;
|
|
||||||
[{GVAR(PostProcessEyes) ppEffectEnable false;}, [], 2, 0.5] call EFUNC(common,waitAndExecute);
|
|
||||||
SETDUST(DACTIVE,false);
|
|
||||||
SETDUST(DBULLETS,0);
|
|
||||||
[GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
|
|
||||||
GVAR(DustHandler) = -1;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
},0,[]] call CALLSTACK(CBA_fnc_addPerFrameHandler);
|
|
81
addons/goggles/functions/fnc_applyDustEffect.sqf
Normal file
81
addons/goggles/functions/fnc_applyDustEffect.sqf
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
/*
|
||||||
|
* Author: Garth 'L-H' de Wet
|
||||||
|
* Applies dust to screen.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* call ace_goggles_fnc_applyDustEffect
|
||||||
|
*
|
||||||
|
* Public: Yes
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
if (GVAR(showInThirdPerson)) exitWith {};
|
||||||
|
if (call FUNC(ExternalCamera)) exitWith {};
|
||||||
|
|
||||||
|
private ["_unit", "_amount"];
|
||||||
|
|
||||||
|
_unit = ACE_player;
|
||||||
|
|
||||||
|
if ([_unit] call FUNC(isGogglesVisible)) exitWith {
|
||||||
|
GVAR(GogglesEffectsLayer) cutRsc ["RscACE_GogglesEffects", "PLAIN", 2, false];
|
||||||
|
|
||||||
|
((GETUVAR(GVAR(DisplayEffects),displayNull)) displayCtrl 10662) ctrlSetText format [getText (configFile >> "CfgGlasses" >> goggles _unit >> "ACE_DustPath"), GETDUSTT(DAMOUNT) + 1];
|
||||||
|
|
||||||
|
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT) + 1,0,1));
|
||||||
|
SETDUST(DBULLETS,0);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (GETVAR(_unit,ACE_EyesDamaged,false)) exitWith {
|
||||||
|
SETDUST(DACTIVE,false);
|
||||||
|
SETDUST(DBULLETS,0);
|
||||||
|
SETDUST(DAMOUNT,0);
|
||||||
|
};
|
||||||
|
|
||||||
|
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT) + 1,0,2));
|
||||||
|
|
||||||
|
_amount = 1 - (GETDUSTT(DAMOUNT) * 0.125);
|
||||||
|
|
||||||
|
GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [_amount, _amount, _amount, _amount], [1, 1, 1, 0]];
|
||||||
|
GVAR(PostProcessEyes) ppEffectCommit 1;
|
||||||
|
GVAR(PostProcessEyes) ppEffectEnable true;
|
||||||
|
|
||||||
|
SETDUST(DBULLETS,0);
|
||||||
|
|
||||||
|
[GVAR(DustHandler)] call CBA_fnc_removePerFrameHandler;
|
||||||
|
GVAR(DustHandler) = -1;
|
||||||
|
|
||||||
|
GVAR(DustHandler) = [{
|
||||||
|
if (ACE_diagTime >= GETDUSTT(DTIME) + 3) then {
|
||||||
|
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2));
|
||||||
|
|
||||||
|
local _amount = 1 - (GETDUSTT(DAMOUNT) * 0.125);
|
||||||
|
|
||||||
|
if !(_unit getVariable ["ACE_EyesDamaged", false]) then {
|
||||||
|
GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [_amount, _amount, _amount, _amount], [1, 1, 1, 0]];
|
||||||
|
GVAR(PostProcessEyes) ppEffectCommit 0.5;
|
||||||
|
};
|
||||||
|
|
||||||
|
if (GETDUSTT(DAMOUNT) <= 0) then {
|
||||||
|
SETDUST(DACTIVE,false);
|
||||||
|
SETDUST(DBULLETS,0);
|
||||||
|
|
||||||
|
GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [1, 1, 1, 1], [1, 1, 1, 0]];
|
||||||
|
GVAR(PostProcessEyes) ppEffectCommit 2;
|
||||||
|
|
||||||
|
[{
|
||||||
|
if (GVAR(DustHandler) == -1) then {
|
||||||
|
GVAR(PostProcessEyes) ppEffectEnable false
|
||||||
|
};
|
||||||
|
}, [], 2] call EFUNC(common,waitAndExecute);
|
||||||
|
|
||||||
|
[GVAR(DustHandler)] call CBA_fnc_removePerFrameHandler;
|
||||||
|
GVAR(DustHandler) = -1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}, 0, []] call CBA_fnc_addPerFrameHandler;
|
@ -11,20 +11,23 @@
|
|||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [goggles ace_player] call ace_goggles_fnc_ApplyGlassesEffect;
|
* [goggles ace_player] call ace_goggles_fnc_applyGlassesEffect
|
||||||
*
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private["_postProcessColour", "_postProcessTintAmount", "_glassesClassname", "_glassImagePath"];
|
params ["_glasses"];
|
||||||
|
|
||||||
_glassesClassname = _this select 0;
|
|
||||||
_postProcessColour = getArray(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_Color");
|
|
||||||
_postProcessTintAmount = getNumber(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_TintAmount");
|
|
||||||
|
|
||||||
|
// remove old effect
|
||||||
call FUNC(removeGlassesEffect);
|
call FUNC(removeGlassesEffect);
|
||||||
GVAR(EffectsActive) = true;
|
|
||||||
|
private ["_config", "_postProcessColour", "_postProcessTintAmount", "_imagePath"];
|
||||||
|
|
||||||
|
_config = configFile >> "CfgGlasses" >> _glasses;
|
||||||
|
|
||||||
|
_postProcessColour = getArray (_config >> "ACE_Color");
|
||||||
|
_postProcessTintAmount = getNumber (_config >> "ACE_TintAmount");
|
||||||
|
|
||||||
if (_postProcessTintAmount != 0 && {GVAR(UsePP)}) then {
|
if (_postProcessTintAmount != 0 && {GVAR(UsePP)}) then {
|
||||||
_postProcessColour set [3, _postProcessTintAmount/100];
|
_postProcessColour set [3, _postProcessTintAmount/100];
|
||||||
@ -36,20 +39,20 @@ if (_postProcessTintAmount != 0 && {GVAR(UsePP)}) then {
|
|||||||
GVAR(PostProcess) ppEffectCommit 30;
|
GVAR(PostProcess) ppEffectCommit 30;
|
||||||
};
|
};
|
||||||
|
|
||||||
_glassImagePath = getText(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_Overlay");
|
_imagePath = getText (_config >> ["ACE_Overlay", "ACE_OverlayCracked"] select GETBROKEN);
|
||||||
if GETBROKEN then {
|
|
||||||
_glassImagePath = getText(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_OverlayCracked");
|
if (_imagePath != "") then {
|
||||||
};
|
GVAR(GogglesLayer) cutRsc ["RscACE_Goggles", "PLAIN", 1, false];
|
||||||
if (_glassImagePath != "") then {
|
(GLASSDISPLAY displayCtrl 10650) ctrlSetText _imagePath;
|
||||||
150 cutRsc["RscACE_Goggles", "PLAIN",1, false];
|
|
||||||
(GLASSDISPLAY displayCtrl 10650) ctrlSetText _glassImagePath;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if GETDIRT then {
|
if (GETDIRT) then {
|
||||||
call FUNC(applyDirtEffect);
|
call FUNC(applyDirtEffect);
|
||||||
};
|
};
|
||||||
|
|
||||||
if GETDUSTT(DACTIVE) then {
|
if (GETDUSTT(DACTIVE)) then {
|
||||||
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2));
|
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2));
|
||||||
call FUNC(applyDust);
|
call FUNC(applyDustEffect);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GVAR(EffectsActive) = true;
|
||||||
|
68
addons/goggles/functions/fnc_applyRainEffect.sqf
Normal file
68
addons/goggles/functions/fnc_applyRainEffect.sqf
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* Author: Garth 'L-H' de Wet
|
||||||
|
* Handles rain effects being created on glasses.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* call ace_goggles_fnc_applyRainEffect;
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
private ["_unit", "_fnc_underCover"];
|
||||||
|
|
||||||
|
_unit = ACE_player;
|
||||||
|
|
||||||
|
if (!alive _unit) exitWith {};
|
||||||
|
|
||||||
|
_fnc_underCover = {
|
||||||
|
params ["_unit"];
|
||||||
|
|
||||||
|
if (vehicle _unit != _unit && {!isTurnedOut _unit}) exitWith {true};
|
||||||
|
|
||||||
|
// looking up and no roof over head
|
||||||
|
local _position = eyePos _unit;
|
||||||
|
positionCameraToWorld [0, 0, 1] select 2 < (positionCameraToWorld [0, 0, 0] select 2) - 0.4 || {(lineIntersects [_position, _position vectorAdd [0, 0, 15], _unit])} // return
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!isNull findDisplay 312) exitWith {
|
||||||
|
if (GVAR(RainActive)) then {
|
||||||
|
call FUNC(removeRainEffect);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
// Ignore if unit is under water
|
||||||
|
if !(GVAR(EffectsActive) || {underwater _unit}) exitWith {
|
||||||
|
call FUNC(RemoveRainEffect);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (GVAR(RainLastLevel) != rain) then {
|
||||||
|
call FUNC(RemoveRainEffect);
|
||||||
|
|
||||||
|
GVAR(RainLastLevel) = rain;
|
||||||
|
|
||||||
|
// Rain is happening
|
||||||
|
if (GVAR(RainLastLevel) > 0.05 && {!([_unit] call _fnc_underCover)}) then {
|
||||||
|
GVAR(RainActive) = true;
|
||||||
|
GVAR(RainDrops) = "#particlesource" createVehicleLocal position _unit;
|
||||||
|
GVAR(RainDrops) setParticleClass "ACERainEffect";
|
||||||
|
GVAR(RainDrops) setDropInterval (0.07 * (1.1 - GVAR(RainLastLevel)));
|
||||||
|
GVAR(RainDrops) attachTo [vehicle _unit, [0,0,0]];
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
if (GVAR(RainLastLevel) > 0.05) then {
|
||||||
|
if (GVAR(RainActive) && {[_unit] call _fnc_underCover}) exitWith {
|
||||||
|
call FUNC(RemoveRainEffect);
|
||||||
|
};
|
||||||
|
|
||||||
|
if !(GVAR(RainActive)) then {
|
||||||
|
GVAR(RainLastLevel) = -1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
108
addons/goggles/functions/fnc_applyRotorWashEffect.sqf
Normal file
108
addons/goggles/functions/fnc_applyRotorWashEffect.sqf
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
/*
|
||||||
|
* Author: Garth 'L-H' de Wet, commy2
|
||||||
|
* Handles the rotor wash effects.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* call ace_goggles_fnc_applyRotorWashEffect;
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
private ["_unit", "_fnc_underCover"];
|
||||||
|
|
||||||
|
_unit = ACE_player;
|
||||||
|
|
||||||
|
if (!alive _unit) exitWith {};
|
||||||
|
|
||||||
|
// idk. chaching magic? ends with isInRotorWash check.
|
||||||
|
GVAR(FrameEvent) set [0, !(GVAR(FrameEvent) select 0)];
|
||||||
|
|
||||||
|
if (GVAR(FrameEvent) select 0) exitWith {
|
||||||
|
if (vehicle _unit != _unit && {!isTurnedOut _unit}) exitWith {
|
||||||
|
(GVAR(FrameEvent) select 1) set [0, false];
|
||||||
|
};
|
||||||
|
|
||||||
|
GVAR(FrameEvent) set [1, ([_unit] call FUNC(isInRotorWash))];
|
||||||
|
};
|
||||||
|
|
||||||
|
// check if the unit is affected by rotor wash
|
||||||
|
private ["_rotorWash", "_safe"];
|
||||||
|
|
||||||
|
_rotorWash = GVAR(FrameEvent) select 1;
|
||||||
|
_safe = false;
|
||||||
|
|
||||||
|
// no rotor wash? remove effects.
|
||||||
|
if !(_rotorWash select 0) exitWith {
|
||||||
|
if (GVAR(PostProcessEyes_Enabled)) then {
|
||||||
|
GVAR(PostProcessEyes_Enabled) = false;
|
||||||
|
|
||||||
|
GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [1, 1, 1, 0]];
|
||||||
|
GVAR(PostProcessEyes) ppEffectCommit 2;
|
||||||
|
|
||||||
|
[{
|
||||||
|
if (GVAR(DustHandler) == -1) then {
|
||||||
|
GVAR(PostProcessEyes) ppEffectEnable false;
|
||||||
|
}
|
||||||
|
}, [], 2] call EFUNC(common,waitAndExecute);
|
||||||
|
|
||||||
|
[GVAR(DustHandler)] call CBA_fnc_removePerFrameHandler;
|
||||||
|
GVAR(DustHandler) = -1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
// check protection of helmet
|
||||||
|
if (headgear _unit != "") then {
|
||||||
|
_safe = getNumber (configFile >> "CfgWeapons" >> headgear _unit >> "ACE_Protection") == 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
// check protection of goggles
|
||||||
|
if !(_safe) then {
|
||||||
|
if !([_unit] call FUNC(isGogglesVisible)) exitWith {};
|
||||||
|
|
||||||
|
if (GETDUSTT(DAMOUNT) < 2) then {
|
||||||
|
if !(GETDUSTT(DACTIVE)) then {
|
||||||
|
SETDUST(DACTIVE,true);
|
||||||
|
|
||||||
|
call FUNC(applyDustEffect);
|
||||||
|
} else {
|
||||||
|
if (_rotorWash select 1 > 0.5) then {
|
||||||
|
call FUNC(applyDustEffect);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
_safe = getNumber (ConfigFile >> "CfgGlasses" >> goggles _unit >> "ACE_Protection") == 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
// quit if protected by goggles or helmet
|
||||||
|
if (_safe) exitWith {};
|
||||||
|
|
||||||
|
// apply rotor wash effect
|
||||||
|
if (_rotorWash select 1 > 0) then {
|
||||||
|
local _scale = 0.7;
|
||||||
|
|
||||||
|
if (_rotorWash select 1 > 0) then {
|
||||||
|
_scale = CLAMP(0.3 * (_rotorWash select 1),0.1,0.3);
|
||||||
|
} else {
|
||||||
|
_scale = 0.1;
|
||||||
|
};
|
||||||
|
|
||||||
|
_scale = 1 - _scale;
|
||||||
|
|
||||||
|
[GVAR(DustHandler)] call CBA_fnc_removePerFrameHandler;
|
||||||
|
GVAR(DustHandler) = -1;
|
||||||
|
|
||||||
|
if !(_unit getVariable ["ACE_EyesDamaged", false]) then {
|
||||||
|
GVAR(PostProcessEyes_Enabled) = true;
|
||||||
|
GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [_scale, _scale, _scale, _scale], [1, 1, 1, 0]];
|
||||||
|
GVAR(PostProcessEyes) ppEffectCommit 0.5;
|
||||||
|
GVAR(PostProcessEyes) ppEffectEnable true;
|
||||||
|
};
|
||||||
|
};
|
@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* Author: Garth 'L-H' de Wet
|
|
||||||
* Performs rain checks and checks to see whether glasses effects have been applied or not.
|
|
||||||
* Checks for external camera and removes effects.
|
|
||||||
*
|
|
||||||
* Arguments:
|
|
||||||
* None
|
|
||||||
*
|
|
||||||
* Return Value:
|
|
||||||
* None
|
|
||||||
*
|
|
||||||
* Example:
|
|
||||||
* None
|
|
||||||
*
|
|
||||||
* Public: No
|
|
||||||
*/
|
|
||||||
#include "script_component.hpp"
|
|
||||||
if (!alive ace_player) exitWith {};
|
|
||||||
if (true) then {
|
|
||||||
// Detect if curator interface is open and disable effects
|
|
||||||
if !(isNull curatorCamera) exitWith {
|
|
||||||
if (GVAR(EffectsActive)) then {
|
|
||||||
call FUNC(removeGlassesEffect);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
call FUNC(checkGlasses);
|
|
||||||
if !([ace_player] call FUNC(isGogglesVisible)) exitWith {
|
|
||||||
if (GVAR(EffectsActive)) then {
|
|
||||||
call FUNC(removeGlassesEffect);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
if (call FUNC(externalCamera)) exitWith {
|
|
||||||
if (GVAR(EffectsActive)) then {
|
|
||||||
call FUNC(removeGlassesEffect);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
if !(GVAR(EffectsActive)) then {
|
|
||||||
[goggles ace_player] call FUNC(applyGlassesEffect);
|
|
||||||
} else {
|
|
||||||
if ([goggles ace_player] call FUNC(isDivingGoggles) && {underwater ace_player}) then {
|
|
||||||
call FUNC(removeRainEffect);
|
|
||||||
call FUNC(removeDirtEffect);
|
|
||||||
call FUNC(removeDustEffect);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
@ -10,27 +10,31 @@
|
|||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* call ace_goggles_fnc_ClearGlasses;
|
* call ace_goggles_fnc_clearGlasses
|
||||||
*
|
*
|
||||||
* Public: Yes
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_broken", "_effects"];
|
private ["_unit", "_broken", "_effects"];
|
||||||
|
|
||||||
|
_unit = ACE_player;
|
||||||
|
|
||||||
_broken = GETBROKEN;
|
_broken = GETBROKEN;
|
||||||
_effects = GLASSESDEFAULT;
|
_effects = GLASSESDEFAULT;
|
||||||
_effects set [BROKEN, _broken];
|
_effects set [BROKEN, _broken];
|
||||||
SETGLASSES(ace_player,_effects);
|
|
||||||
|
|
||||||
if ((stance ace_player) != "PRONE") then {
|
SETGLASSES(_unit,_effects);
|
||||||
ace_player playActionNow "gestureWipeFace";
|
|
||||||
|
if (stance _unit != "PRONE") then {
|
||||||
|
_unit playActionNow "gestureWipeFace";
|
||||||
};
|
};
|
||||||
|
|
||||||
[{
|
[{
|
||||||
if (cameraView == "INTERNAL") then {
|
if (cameraView == "INTERNAL") then {
|
||||||
addCamShake [5, 1.75, 2];
|
addCamShake [5, 1.75, 2];
|
||||||
};
|
};
|
||||||
}, [], 0.3, 0] call EFUNC(common,waitAndExecute);
|
}, [], 0.3] call EFUNC(common,waitAndExecute);
|
||||||
|
|
||||||
call FUNC(removeDirtEffect);
|
call FUNC(removeDirtEffect);
|
||||||
call FUNC(removeRainEffect);
|
call FUNC(removeRainEffect);
|
||||||
|
@ -1,73 +0,0 @@
|
|||||||
/*
|
|
||||||
* Author: Garth 'L-H' de Wet
|
|
||||||
* Determines whether to place dust on the goggles, based on calibre of weapon fired and other requirements.
|
|
||||||
*
|
|
||||||
* Arguments:
|
|
||||||
* 0: Unit <OBJECT>
|
|
||||||
* 1: Weapon <STRING>
|
|
||||||
*
|
|
||||||
* Return Value:
|
|
||||||
* None
|
|
||||||
*
|
|
||||||
* Example:
|
|
||||||
*ace_player addEventHandler ["Fired", {[_this select 0, _this select 1] call ace_goggles_fnc_dustHandler;}];
|
|
||||||
*
|
|
||||||
* Public: No
|
|
||||||
*/
|
|
||||||
#include "script_component.hpp"
|
|
||||||
private ["_bullets", "_position", "_surface", "_weapon", "_cloudType", "_unit"];
|
|
||||||
EXPLODE_2_PVT(_this,_unit,_weapon);
|
|
||||||
if (_unit != ace_player) exitWith {true};
|
|
||||||
_cloudType = "";
|
|
||||||
|
|
||||||
if (rain > 0.1) exitWith {true};
|
|
||||||
if ((stance _unit) != "PRONE") exitWith {true};
|
|
||||||
|
|
||||||
if (isClass(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEffect")) then {
|
|
||||||
_cloudType = getText(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEffect" >> "effectName");
|
|
||||||
} else {
|
|
||||||
if (isClass(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "effect1")) then {
|
|
||||||
_cloudType = getText(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "effect1" >> "effectName");
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
if (_cloudType == "") exitWith {true};
|
|
||||||
|
|
||||||
_position = getPosATL _unit;
|
|
||||||
|
|
||||||
if (surfaceIsWater _position) exitWith {};
|
|
||||||
if ((_position select 2) > 0.2) exitWith {};
|
|
||||||
|
|
||||||
_surface = surfaceType _position;
|
|
||||||
|
|
||||||
if (_surface != GVAR(surfaceCache)) then {
|
|
||||||
GVAR(surfaceCache) = _surface;
|
|
||||||
_surface = ([_surface, "#"] call CBA_fnc_split) select 1;
|
|
||||||
GVAR(surfaceCacheIsDust) = getNumber (ConfigFile >> "CfgSurfaces" >> _surface >> "dust") >= 0.1;
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!GVAR(surfaceCacheIsDust)) exitWith {};
|
|
||||||
|
|
||||||
_bullets = GETDUSTT(DBULLETS);
|
|
||||||
|
|
||||||
if ((ACE_diagTime - GETDUSTT(DTIME)) > 1) then {
|
|
||||||
_bullets = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
_bullets = _bullets + 1;
|
|
||||||
SETDUST(DBULLETS,_bullets);
|
|
||||||
SETDUST(DTIME,ACE_diagTime);
|
|
||||||
|
|
||||||
if (GETDUSTT(DAMOUNT) < 2) then {
|
|
||||||
private "_bulletsRequired";
|
|
||||||
_bulletsRequired = 100;
|
|
||||||
if (isNumber (ConfigFile >> _cloudType >> "ACE_Goggles_BulletCount")) then {
|
|
||||||
_bulletsRequired = getNumber (ConfigFile >> _cloudType >> "ACE_Goggles_BulletCount");
|
|
||||||
};
|
|
||||||
|
|
||||||
if (_bulletsRequired <= _bullets) then {
|
|
||||||
SETDUST(DACTIVE,true);
|
|
||||||
call FUNC(applyDust);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
true
|
|
@ -6,15 +6,13 @@
|
|||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Whether the camera is in external view or not. If the "showInThirdPerson" option is checked, this will always return false. <BOOL>
|
* Whether the camera is in external view or not. <BOOL>
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* call ace_goggles_fnc_removeRainEffect;
|
* call ace_goggles_fnc_externalCamera;
|
||||||
*
|
*
|
||||||
* Public: Yes
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
if (GVAR(showInThirdPerson)) exitWith { false };
|
cameraView in ["EXTERNAL", "GROUP"] || EFUNC(common,isFeatureCameraActive) // return
|
||||||
|
|
||||||
(cameraView in ["EXTERNAL", "GROUP"] || {call EFUNC(common,isFeatureCameraActive)})
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Garth 'L-H' de Wet
|
* Author: Garth 'L-H' de Wet, commy2
|
||||||
* Turns 0-1 damage of explosion Event into a rating system of 0-3
|
* Turns 0-1 damage of explosion Event into a rating system of 0-3
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
@ -13,13 +13,12 @@
|
|||||||
*
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
private ["_effectIndex"];
|
#include "script_component.hpp"
|
||||||
|
|
||||||
_effectIndex = switch true do {
|
params ["_damage"];
|
||||||
case (_this <= 0.04): {0};
|
|
||||||
case (_this <= 0.06): {1};
|
|
||||||
case (_this <= 0.09): {2};
|
|
||||||
default {3};
|
|
||||||
};
|
|
||||||
|
|
||||||
_effectIndex
|
if (_damage <= 0.04) exitWith {0};
|
||||||
|
if (_damage <= 0.06) exitWith {1};
|
||||||
|
if (_damage <= 0.09) exitWith {2};
|
||||||
|
|
||||||
|
3
|
||||||
|
51
addons/goggles/functions/fnc_handleExplosion.sqf
Normal file
51
addons/goggles/functions/fnc_handleExplosion.sqf
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
* Author: Garth 'L-H' de Wet, commy2
|
||||||
|
* Handles explosions.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: Unit <OBJECT>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* Function is handled? <BOOL>
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
params ["_unit"];
|
||||||
|
|
||||||
|
if (_unit != ACE_player) exitWith {true};
|
||||||
|
|
||||||
|
call FUNC(applyDirtEffect);
|
||||||
|
|
||||||
|
if (GETBROKEN) exitWith {true};
|
||||||
|
|
||||||
|
private ["_config", "_effects"];
|
||||||
|
|
||||||
|
_config = configFile >> "CfgGlasses" >> goggles _unit;
|
||||||
|
|
||||||
|
if ((_this select 1) call FUNC(GetExplosionIndex) < getNumber (_config >> "ACE_Resistance")) exitWith {true};
|
||||||
|
|
||||||
|
if !([_unit] call FUNC(isGogglesVisible)) exitWith {
|
||||||
|
["GlassesCracked", [_unit]] call EFUNC(common,localEvent);
|
||||||
|
true
|
||||||
|
};
|
||||||
|
|
||||||
|
_effects = GETGLASSES(_unit);
|
||||||
|
_effects set [BROKEN, true];
|
||||||
|
|
||||||
|
SETGLASSES(_unit,_effects);
|
||||||
|
|
||||||
|
if (getText (_config >> "ACE_OverlayCracked") != "") then {
|
||||||
|
if (GVAR(showInThirdPerson)) exitWith {};
|
||||||
|
if (call FUNC(ExternalCamera)) exitWith {};
|
||||||
|
|
||||||
|
if (isNull (GLASSDISPLAY)) then {
|
||||||
|
GVAR(GogglesLayer) cutRsc ["RscACE_Goggles", "PLAIN", 1, false];
|
||||||
|
};
|
||||||
|
|
||||||
|
(GLASSDISPLAY displayCtrl 10650) ctrlSetText getText (_config >> "ACE_OverlayCracked");
|
||||||
|
};
|
||||||
|
|
||||||
|
["GlassesCracked", [_unit]] call EFUNC(common,localEvent);
|
||||||
|
true
|
88
addons/goggles/functions/fnc_handleFired.sqf
Normal file
88
addons/goggles/functions/fnc_handleFired.sqf
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
/*
|
||||||
|
* Author: Garth 'L-H' de Wet, commy2
|
||||||
|
* Determines whether to place dust on the goggles, based on calibre of weapon fired and other requirements.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: Unit <OBJECT>
|
||||||
|
* 1: Weapon <STRING>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* Function is handled? <BOOL>
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
params ["_unit", "_weapon"];
|
||||||
|
|
||||||
|
if (_unit != ACE_player) exitWith {true};
|
||||||
|
|
||||||
|
// no dust in rain
|
||||||
|
if (rain > 0.1) exitWith {true};
|
||||||
|
|
||||||
|
// effect only aplies when lying on the ground
|
||||||
|
if (stance _unit != "PRONE") exitWith {true};
|
||||||
|
|
||||||
|
private ["_position", "_particleConfig", "_cloudType", "_surface", "_bullets"];
|
||||||
|
|
||||||
|
// check if the unit really is on the ground and not in a building
|
||||||
|
_position = getPosATL _unit;
|
||||||
|
|
||||||
|
if (_position select 2 > 0.2) exitWith {true};
|
||||||
|
|
||||||
|
// get weapon dust effect
|
||||||
|
_particleConfig = configFile >> "CfgWeapons" >> _weapon >> "GunParticles";
|
||||||
|
|
||||||
|
_cloudType = "";
|
||||||
|
|
||||||
|
if (isClass (_particleConfig >> "FirstEffect")) then { // @todo read this with custom / non-standard config classnames
|
||||||
|
_cloudType = getText (_particleConfig >> "FirstEffect" >> "effectName");
|
||||||
|
} else {
|
||||||
|
if (isClass (_particleConfig >> "effect1")) then {
|
||||||
|
_cloudType = getText (_particleConfig >> "effect1" >> "effectName");
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
// quit if the weapon causes no dust effect
|
||||||
|
if (_cloudType == "") exitWith {true};
|
||||||
|
|
||||||
|
// get if the surface is dusty
|
||||||
|
if (surfaceIsWater _position) exitWith {true};
|
||||||
|
|
||||||
|
_surface = surfaceType _position select [1]; // cuts of the leading #
|
||||||
|
|
||||||
|
if (_surface != GVAR(surfaceCache)) then {
|
||||||
|
GVAR(surfaceCache) = _surface;
|
||||||
|
GVAR(surfaceCacheIsDust) = getNumber (configFile >> "CfgSurfaces" >> _surface >> "dust") >= 0.1;
|
||||||
|
};
|
||||||
|
|
||||||
|
// quit if surface isn't dusty
|
||||||
|
if (!GVAR(surfaceCacheIsDust)) exitWith {true};
|
||||||
|
|
||||||
|
// increment dust value with type bullet
|
||||||
|
_bullets = GETDUSTT(DBULLETS);
|
||||||
|
|
||||||
|
if (ACE_diagTime - GETDUSTT(DTIME) > 1) then {
|
||||||
|
_bullets = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
_bullets = _bullets + 1;
|
||||||
|
|
||||||
|
SETDUST(DBULLETS,_bullets);
|
||||||
|
SETDUST(DTIME,ACE_diagTime);
|
||||||
|
|
||||||
|
// apply dust effect if the amount of fired bullets is over the threshold
|
||||||
|
if (GETDUSTT(DAMOUNT) < 2) then {
|
||||||
|
local _bulletsRequired = 100;
|
||||||
|
|
||||||
|
if (isNumber (configFile >> _cloudType >> QGVAR(BulletCount))) then {
|
||||||
|
_bulletsRequired = getNumber (configFile >> _cloudType >> QGVAR(BulletCount));
|
||||||
|
};
|
||||||
|
|
||||||
|
if (_bullets > _bulletsRequired) then {
|
||||||
|
SETDUST(DACTIVE,true);
|
||||||
|
call FUNC(applyDustEffect);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
true
|
32
addons/goggles/functions/fnc_handleKilled.sqf
Normal file
32
addons/goggles/functions/fnc_handleKilled.sqf
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* Author: Garth 'L-H' de Wet, commy2
|
||||||
|
* Handles the player dying.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: Unit <OBJECT>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* Function is handled? <BOOL>
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
params ["_unit"];
|
||||||
|
|
||||||
|
if (_unit != ACE_player) exitWith {true};
|
||||||
|
|
||||||
|
GVAR(PostProcessEyes) ppEffectEnable false;
|
||||||
|
|
||||||
|
SETGLASSES(_unit,GLASSESDEFAULT);
|
||||||
|
|
||||||
|
call FUNC(removeGlassesEffect);
|
||||||
|
|
||||||
|
GVAR(EffectsActive) = false;
|
||||||
|
|
||||||
|
_unit setVariable ["ACE_EyesDamaged", false];
|
||||||
|
|
||||||
|
[GVAR(DustHandler)] call CBA_fnc_removePerFrameHandler;
|
||||||
|
GVAR(DustHandler) = -1;
|
||||||
|
|
||||||
|
true
|
@ -1,22 +1,24 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Garth 'L-H' de Wet
|
* Author: commy2
|
||||||
* Determines whether passed goggles is diving goggles or a variant of them.
|
* Determines whether passed goggles is diving goggles or a variant of them.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Glasses classname <STRING>
|
* 0: Glasses classname <STRING>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Whether diving goggles are worn <BOOL>
|
* Check if these goggles are diving goggles <BOOL>
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [(goggles ace_player)] call ace_goggles_fnc_isDivingGoggles;
|
* [goggles ace_player] call ace_goggles_fnc_isDivingGoggles;
|
||||||
*
|
*
|
||||||
* Public: Yes
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
private ["_result", "_glasses"];
|
|
||||||
_glasses = _this select 0;
|
params ["_glasses"];
|
||||||
_result = _glasses == "G_Diving";
|
|
||||||
if (_result) exitWith {true};
|
local _config = configFile >> "CfgGlasses" >> _glasses;
|
||||||
_result = [configFile >> "CfgGlasses" >> _glasses, configFile >> "CfgGlasses" >> "G_Diving"] call CBA_fnc_inheritsFrom;
|
|
||||||
_result
|
if (!isClass _config) exitWith {false};
|
||||||
|
|
||||||
|
getNumber (_config >> "mode") == 1 // return
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Garth 'L-H' de Wet
|
* Author: Garth 'L-H' de Wet
|
||||||
* Determines if goggles are visible on passed unit (Also checks if unit is in vehicle and cameraView is set to GUNNER)
|
* Determines if goggles are visible on passed unit.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Unit <OBJECT>
|
* 0: Unit <OBJECT>
|
||||||
@ -16,20 +16,17 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
params ["_unit"];
|
params ["_unit"];
|
||||||
private ["_currentGlasses", "_result", "_position", "_visible"];
|
|
||||||
|
private ["_currentGlasses", "_position"];
|
||||||
|
|
||||||
_currentGlasses = goggles _unit;
|
_currentGlasses = goggles _unit;
|
||||||
_result = false;
|
|
||||||
|
|
||||||
if (_currentGlasses != "") then {
|
if (_currentGlasses == "") exitWith {false};
|
||||||
|
|
||||||
|
// requires ACE_Resistance config entry. Returns false for balaclavas and bandanas.
|
||||||
|
if (getNumber (configFile >> "CfgGlasses" >> _currentGlasses >> "ACE_Resistance") == 0) exitWith {false};
|
||||||
|
|
||||||
|
// check if in water and has diving goggles or on land and not diving goggles
|
||||||
_position = getPosASLW _unit;
|
_position = getPosASLW _unit;
|
||||||
if (surfaceIsWater _position && {((_position select 2) < 0.25)}) exitWith {
|
|
||||||
_result = ([_currentGlasses] call FUNC(isDivingGoggles));
|
|
||||||
};
|
|
||||||
if (getNumber (ConfigFile >> "CfgGlasses" >> _currentGlasses >> "ACE_Resistance") == 0) exitWith {
|
|
||||||
_result = false;
|
|
||||||
};
|
|
||||||
_result = !([_currentGlasses] call FUNC(isDivingGoggles));
|
|
||||||
};
|
|
||||||
|
|
||||||
_result
|
(surfaceIsWater _position && {_position select 2 < 0.25}) isEqualTo (_currentGlasses call FUNC(isDivingGoggles)) // return
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Garth 'L-H' de Wet
|
* Author: Garth 'L-H' de Wet, commy2
|
||||||
* Checks for nearby running helicopters (within 15m)
|
* Checks for nearby running helicopters (within 15m)
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Unit <OBJECT>
|
* 0: Unit <OBJECT>
|
||||||
* 1: Radius to check for helicopter Default: 15 (optional) <NUMBER>
|
* 1: Radius to check for helicopter (default: 15) <NUMBER>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* <ARRAY>:
|
* <ARRAY>:
|
||||||
@ -12,35 +12,31 @@
|
|||||||
* 1: Amount of rotor wash. <NUMBER>
|
* 1: Amount of rotor wash. <NUMBER>
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* if (([ace_player, 10] call ace_goggles_fnc_isInRotorWash) select 0) then { hint "Rotor wash"; };
|
* if ([ace_player, 10] call ace_goggles_fnc_isInRotorWash select 0) then { hint "Rotor wash"; };
|
||||||
* if (([ace_player] call ace_goggles_fnc_isInRotorWash) select 0) then { hint "Rotor wash"; };
|
* if ([ace_player] call ace_goggles_fnc_isInRotorWash select 0) then { hint "Rotor wash"; };
|
||||||
*
|
*
|
||||||
* Public: Yes
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
private ["_heli", "_unit", "_result", "_radius"];
|
|
||||||
_unit = _this select 0;
|
|
||||||
_radius = 15;
|
|
||||||
if (count _this > 1) then {
|
|
||||||
_radius = _this select 1;
|
|
||||||
};
|
|
||||||
_result = [false, _radius + 2];
|
|
||||||
|
|
||||||
_heli = (getPosATL _unit) nearEntities [["Helicopter"], _radius];
|
params ["_unit", ["_radius", 15]];
|
||||||
|
|
||||||
|
local _rotorWash = [false, 0];
|
||||||
|
|
||||||
{
|
{
|
||||||
if !(_x isKindOf "ParachuteBase") then {
|
|
||||||
if (isEngineOn _x) then {
|
if (isEngineOn _x) then {
|
||||||
private "_distance";
|
local _distance = _unit distance _x;
|
||||||
_distance = (_radius - (_unit distance _x));
|
|
||||||
if (_distance != 0) then {
|
// convert distance to 0...1 range, where 0 is the maximum radius
|
||||||
_distance = _distance / _radius;
|
_distance = 1 - _distance / _radius;
|
||||||
};
|
|
||||||
if (_distance < (_result select 1)) then {
|
// use highest amount of rotor wash as return value in case of multiple helicopters
|
||||||
_result = [true, _distance];
|
if (_distance > _rotorWash select 1) then {
|
||||||
};
|
_rotorWash set [0, true];
|
||||||
|
_rotorWash set [1, _distance];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
false
|
false
|
||||||
} count _heli;
|
} count (position _unit nearEntities [["Helicopter"], _radius]);
|
||||||
|
|
||||||
_result
|
_rotorWash
|
||||||
|
@ -1,78 +0,0 @@
|
|||||||
/*
|
|
||||||
* Author: Garth 'L-H' de Wet
|
|
||||||
* Checks whether the player is in the downwash of a helicopter and handles applying effects of that.
|
|
||||||
*
|
|
||||||
* Arguments:
|
|
||||||
* None
|
|
||||||
*
|
|
||||||
* Return Value:
|
|
||||||
* None
|
|
||||||
*
|
|
||||||
* Example:
|
|
||||||
* ["ACE_Goggles_RotorWash", "OnEachFrame", "call ace_goggles_fnc_OnEachFrame;"] call BIS_fnc_addStackedEventHandler;
|
|
||||||
*
|
|
||||||
* Public: No
|
|
||||||
*/
|
|
||||||
#include "script_component.hpp"
|
|
||||||
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 && {!isTurnedOut ACE_player}) exitWith {(GVAR(FrameEvent) select 1) set [0, false]; };
|
|
||||||
GVAR(FrameEvent) set [1, ([ace_player] call FUNC(isInRotorWash))];
|
|
||||||
};
|
|
||||||
private ["_rotorWash","_safe"];
|
|
||||||
_rotorWash = GVAR(FrameEvent) select 1;
|
|
||||||
_safe = false;
|
|
||||||
if !(_rotorWash select 0) exitWith {
|
|
||||||
if (GVAR(PostProcessEyes_Enabled)) then {
|
|
||||||
GVAR(PostProcessEyes_Enabled) = false;
|
|
||||||
if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA
|
|
||||||
[GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
|
|
||||||
GVAR(DustHandler) = -1;
|
|
||||||
};
|
|
||||||
GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0,0,0,0], [0,0,0,1],[1,1,1,0]];
|
|
||||||
GVAR(PostProcessEyes) ppEffectCommit 2;
|
|
||||||
GVAR(DustHandler) = [{
|
|
||||||
GVAR(PostProcessEyes) ppEffectEnable false;
|
|
||||||
GVAR(DustHandler) = -1;
|
|
||||||
}, [], 2, 0.5] call EFUNC(common,waitAndExecute);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
if ((headgear ace_player) != "") then {
|
|
||||||
_safe = (getNumber (ConfigFile >> "CfgWeapons" >> (headgear ace_player) >> "ACE_Protection") == 1);
|
|
||||||
};
|
|
||||||
if !(_safe) then {
|
|
||||||
if !([ace_player] call FUNC(isGogglesVisible)) exitWith{};
|
|
||||||
if (GETDUSTT(DAMOUNT) < 2) then {
|
|
||||||
if (!GETDUSTT(DACTIVE)) then {
|
|
||||||
SETDUST(DACTIVE,true);
|
|
||||||
call FUNC(ApplyDust);
|
|
||||||
} else {
|
|
||||||
if ((_rotorWash select 1) > 0.5) then {
|
|
||||||
call FUNC(ApplyDust);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
_safe = (getNumber (ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Protection") == 1);
|
|
||||||
};
|
|
||||||
if (_safe) exitWith {};
|
|
||||||
if ((_rotorWash select 1) <= 15) then {
|
|
||||||
private "_scale";
|
|
||||||
_scale = 0.7;
|
|
||||||
if ((_rotorWash select 1) != 0) then {
|
|
||||||
_scale = CLAMP(0.3*(_rotorWash select 1),0.1,0.3);
|
|
||||||
} else {
|
|
||||||
_scale = 0.1;
|
|
||||||
};
|
|
||||||
_scale = 1 - _scale;
|
|
||||||
if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA
|
|
||||||
[GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
|
|
||||||
GVAR(DustHandler) = -1;
|
|
||||||
};
|
|
||||||
if !(ace_player getVariable ["ACE_EyesDamaged", false]) then {
|
|
||||||
GVAR(PostProcessEyes_Enabled) = true;
|
|
||||||
GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0,0,0,0], [_scale,_scale,_scale,_scale],[1,1,1,0]];
|
|
||||||
GVAR(PostProcessEyes) ppEffectCommit 0.5;
|
|
||||||
GVAR(PostProcessEyes) ppEffectEnable true;
|
|
||||||
};
|
|
||||||
};
|
|
@ -1,53 +0,0 @@
|
|||||||
/*
|
|
||||||
* Author: Garth 'L-H' de Wet
|
|
||||||
* Handles rain effects being created on glasses.
|
|
||||||
*
|
|
||||||
* Arguments:
|
|
||||||
* None
|
|
||||||
*
|
|
||||||
* Return Value:
|
|
||||||
* None
|
|
||||||
*
|
|
||||||
* Example:
|
|
||||||
* call ace_goggles_fnc_rainEffect;
|
|
||||||
*
|
|
||||||
* Public: No
|
|
||||||
*/
|
|
||||||
#include "script_component.hpp"
|
|
||||||
private ["_fnc_underCover"];
|
|
||||||
if (isNull(ace_player) || {!(alive ace_player)}) exitWith {};
|
|
||||||
_fnc_underCover = {
|
|
||||||
private ["_pos", "_unit"];
|
|
||||||
_unit = (_this select 0);
|
|
||||||
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])}
|
|
||||||
};
|
|
||||||
if (!isNull(findDisplay 312)) exitWith {
|
|
||||||
if (GVAR(RainActive)) then {
|
|
||||||
call FUNC(RemoveRainEffect);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
// Ignore if ace_player is under water
|
|
||||||
if (!GVAR(EffectsActive) || {underwater ace_player}) exitWith{call FUNC(RemoveRainEffect);};
|
|
||||||
if (GVAR(RainLastLevel) != rain) then {
|
|
||||||
call FUNC(RemoveRainEffect);
|
|
||||||
GVAR(RainLastLevel) = rain;
|
|
||||||
// Rain is happening
|
|
||||||
if (GVAR(RainLastLevel) > 0.05 && {!([ace_player] call _fnc_underCover)}) then {
|
|
||||||
GVAR(RainActive) = true;
|
|
||||||
GVAR(RainDrops) = "#particlesource" createVehicleLocal GetPos ace_player;
|
|
||||||
GVAR(RainDrops) setParticleClass "ACERainEffect";
|
|
||||||
GVAR(RainDrops) setDropInterval (0.07 * (1.1 - GVAR(RainLastLevel)));
|
|
||||||
GVAR(RainDrops) attachTo [vehicle ace_player,[0,0,0]];
|
|
||||||
};
|
|
||||||
}else{
|
|
||||||
if (GVAR(RainLastLevel) > 0.05) then {
|
|
||||||
if (GVAR(RainActive) && {[ace_player] call _fnc_underCover}) exitWith {
|
|
||||||
call FUNC(RemoveRainEffect);
|
|
||||||
};
|
|
||||||
if (!GVAR(RainActive)) then {
|
|
||||||
GVAR(RainLastLevel) = -1;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
@ -9,11 +9,12 @@
|
|||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* call ace_goggles_fnc_removeDirtEffect;
|
* call ace_goggles_fnc_removeDirtEffect
|
||||||
*
|
*
|
||||||
* Public: Yes
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
if (!isNull (GETUVAR(GVAR(DisplayEffects),displayNull))) then {
|
if (!isNull (GETUVAR(GVAR(DisplayEffects),displayNull))) then {
|
||||||
(GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText "";
|
(GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText "";
|
||||||
};
|
};
|
||||||
|
@ -9,11 +9,12 @@
|
|||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* call ace_goggles_fnc_removeDustEffect;
|
* call ace_goggles_fnc_removeDustEffect
|
||||||
*
|
*
|
||||||
* Public: Yes
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
if (!isNull (GETUVAR(GVAR(DisplayEffects),displayNull))) then {
|
if (!isNull (GETUVAR(GVAR(DisplayEffects),displayNull))) then {
|
||||||
(GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10662) ctrlSetText "";
|
(GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10662) ctrlSetText "";
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Garth 'L-H' de Wet
|
* Author: Garth 'L-H' de Wet
|
||||||
* Removes the glasses effect from the screen, removes dirt effect, removes rain effect,
|
* Removes the glasses effect from the screen, removes dirt effect, removes rain effect, removes dust effect. Does not reset array (glasses will still be broken, dirty, ect.)
|
||||||
* removes dust effect. Does not reset array (glasses will still be broken, dirty, ect.)
|
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* None
|
* None
|
||||||
@ -10,11 +9,12 @@
|
|||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* call ace_goggles_fnc_removeGlassesEffect;
|
* call ace_goggles_fnc_removeGlassesEffect
|
||||||
*
|
*
|
||||||
* Public: Yes
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
GVAR(EffectsActive) = false;
|
GVAR(EffectsActive) = false;
|
||||||
GVAR(PostProcess) ppEffectEnable false;
|
GVAR(PostProcess) ppEffectEnable false;
|
||||||
|
|
||||||
|
@ -9,13 +9,15 @@
|
|||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* call ace_goggles_fnc_removeRainEffect;
|
* call ace_goggles_fnc_removeRainEffect
|
||||||
*
|
*
|
||||||
* Public: Yes
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
if (!isNull (GVAR(RainDrops))) then {
|
|
||||||
deleteVehicle (GVAR(RainDrops));
|
if (!isNull GVAR(RainDrops)) then {
|
||||||
|
deleteVehicle GVAR(RainDrops);
|
||||||
};
|
};
|
||||||
|
|
||||||
GVAR(RainActive) = false;
|
GVAR(RainActive) = false;
|
||||||
GVAR(RainLastLevel) = 0;
|
GVAR(RainLastLevel) = 0;
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
class CfgAmmo {
|
class CfgAmmo {
|
||||||
class FlareCore;
|
class FlareCore;
|
||||||
class FlareBase: FlareCore {
|
class FlareBase: FlareCore {
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
class Extended_PreInit_EventHandlers {
|
class Extended_PreInit_EventHandlers {
|
||||||
class ADDON {
|
class ADDON {
|
||||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||||
@ -13,7 +14,7 @@ class Extended_PostInit_EventHandlers {
|
|||||||
class Extended_FiredBIS_EventHandlers {
|
class Extended_FiredBIS_EventHandlers {
|
||||||
class CAManBase {
|
class CAManBase {
|
||||||
class ADDON {
|
class ADDON {
|
||||||
clientFiredBIS = QUOTE( _this call FUNC(throwGrenade) );
|
firedBIS = QUOTE(_this call FUNC(throwGrenade));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
|
|
||||||
class CfgVehicles {
|
class CfgVehicles {
|
||||||
class NATO_Box_Base;
|
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 Box_NATO_Grenades_F: NATO_Box_Base {
|
||||||
class TransportItems {
|
class TransportItems {
|
||||||
MACRO_ADDITEM(ACE_HandFlare_White,12);
|
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 Box_East_Grenades_F: EAST_Box_Base {
|
||||||
class TransportItems {
|
class TransportItems {
|
||||||
MACRO_ADDITEM(ACE_HandFlare_Yellow,12);
|
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 Box_IND_Grenades_F: IND_Box_Base {
|
||||||
class TransportItems {
|
class TransportItems {
|
||||||
MACRO_ADDITEM(ACE_HandFlare_Yellow,12);
|
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 ACE_Box_Misc: Box_NATO_Support_F {
|
||||||
class TransportItems {
|
class TransportItems {
|
||||||
MACRO_ADDITEM(ACE_HandFlare_White,12);
|
MACRO_ADDITEM(ACE_HandFlare_White,12);
|
||||||
|
@ -1,21 +1,26 @@
|
|||||||
|
|
||||||
class CfgWeapons {
|
class CfgWeapons {
|
||||||
class GrenadeLauncher;
|
class GrenadeLauncher;
|
||||||
|
|
||||||
class Throw: 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 ThrowMuzzle;
|
||||||
class ACE_HandFlare_WhiteMuzzle: ThrowMuzzle {
|
class ACE_HandFlare_WhiteMuzzle: ThrowMuzzle {
|
||||||
magazines[] = {"ACE_HandFlare_White"};
|
magazines[] = {"ACE_HandFlare_White"};
|
||||||
};
|
};
|
||||||
|
|
||||||
class ACE_HandFlare_RedMuzzle: ThrowMuzzle {
|
class ACE_HandFlare_RedMuzzle: ThrowMuzzle {
|
||||||
magazines[] = {"ACE_HandFlare_Red"};
|
magazines[] = {"ACE_HandFlare_Red"};
|
||||||
};
|
};
|
||||||
|
|
||||||
class ACE_HandFlare_GreenMuzzle: ThrowMuzzle {
|
class ACE_HandFlare_GreenMuzzle: ThrowMuzzle {
|
||||||
magazines[] = {"ACE_HandFlare_Green"};
|
magazines[] = {"ACE_HandFlare_Green"};
|
||||||
};
|
};
|
||||||
|
|
||||||
class ACE_HandFlare_YellowMuzzle: ThrowMuzzle {
|
class ACE_HandFlare_YellowMuzzle: ThrowMuzzle {
|
||||||
magazines[] = {"ACE_HandFlare_Yellow"};
|
magazines[] = {"ACE_HandFlare_Yellow"};
|
||||||
};
|
};
|
||||||
|
|
||||||
class ACE_M84Muzzle: ThrowMuzzle {
|
class ACE_M84Muzzle: ThrowMuzzle {
|
||||||
magazines[] = {"ACE_M84"};
|
magazines[] = {"ACE_M84"};
|
||||||
};
|
};
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
["flashbangExplosion", DFUNC(flashbangExplosionEH)] call EFUNC(common,addEventHandler);
|
["flashbangExplosion", {_this call FUNC(flashbangExplosionEH)}] call EFUNC(common,addEventHandler);
|
||||||
|
|
||||||
if (!hasInterface) exitWith {};
|
if (!hasInterface) exitWith {};
|
||||||
|
|
||||||
@ -21,4 +21,4 @@ GVAR(flashbangPPEffectCC) ppEffectForceInNVG true;
|
|||||||
[] call FUNC(nextMode);
|
[] call FUNC(nextMode);
|
||||||
},
|
},
|
||||||
{false},
|
{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"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_affected", "_strength", "_posGrenade", "_angleDiff", "_light", "_losCount", "_dirToUnitVector", "_eyeDir", "_eyePos"];
|
|
||||||
params ["_grenade"];
|
params ["_grenade"];
|
||||||
|
|
||||||
|
private ["_affected", "_strength", "_posGrenade", "_eyePos", "_losCount", "_eyeDir", "_dirToUnitVector", "_angleDiff", "_light"];
|
||||||
|
|
||||||
_affected = _grenade nearEntities ["CAManBase", 20];
|
_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;
|
_strength = 1 - ((_x distance _grenade) min 15) / 15;
|
||||||
|
|
||||||
@ -30,16 +31,19 @@ _affected = _grenade nearEntities ["CAManBase", 20];
|
|||||||
if (_x != ACE_player) then {
|
if (_x != ACE_player) then {
|
||||||
//must be AI
|
//must be AI
|
||||||
[_x, true] call EFUNC(common,disableAI);
|
[_x, true] call EFUNC(common,disableAI);
|
||||||
_x setSkill ((skill _x) / 50);
|
|
||||||
|
_x setSkill (skill _x / 50);
|
||||||
|
|
||||||
[{
|
[{
|
||||||
params ["_unit"];
|
params ["_unit"];
|
||||||
|
|
||||||
//Make sure we don't enable AI for unconscious units
|
//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, false] call EFUNC(common,disableAI);
|
||||||
};
|
};
|
||||||
|
|
||||||
_unit setSkill (skill _unit * 50);
|
_unit setSkill (skill _unit * 50);
|
||||||
}, [_x], (7 * _strength)] call EFUNC(common,waitAndExecute);
|
}, [_x], 7 * _strength] call EFUNC(common,waitAndExecute);
|
||||||
} else {
|
} else {
|
||||||
//Do effects for player
|
//Do effects for player
|
||||||
// is there line of sight to the grenade?
|
// 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)
|
//Check for line of sight (check 4 points in case grenade is stuck in an object or underground)
|
||||||
_losCount = {
|
_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]];
|
} 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);
|
TRACE_1("Line of sight count (out of 4)",_losCount);
|
||||||
@ -57,9 +61,9 @@ _affected = _grenade nearEntities ["CAManBase", 20];
|
|||||||
_strength = _strength / 10;
|
_strength = _strength / 10;
|
||||||
};
|
};
|
||||||
|
|
||||||
//Add ace_hearing ear ringing sound effect
|
// add ace_hearing ear ringing sound effect
|
||||||
if ((isClass (configFile >> "CfgPatches" >> "ACE_Hearing")) && {_strength > 0}) then {
|
if (isClass (configFile >> "CfgPatches" >> "ACE_Hearing") && {_strength > 0}) then {
|
||||||
[_x, (20 * _strength)] call EFUNC(hearing,earRinging);
|
[_x, 20 * _strength] call EFUNC(hearing,earRinging);
|
||||||
};
|
};
|
||||||
|
|
||||||
// account for people looking away by slightly
|
// account for people looking away by slightly
|
||||||
@ -68,16 +72,16 @@ _affected = _grenade nearEntities ["CAManBase", 20];
|
|||||||
_dirToUnitVector = _eyePos vectorFromTo _posGrenade;
|
_dirToUnitVector = _eyePos vectorFromTo _posGrenade;
|
||||||
_angleDiff = acos (_eyeDir vectorDotProduct _dirToUnitVector);
|
_angleDiff = acos (_eyeDir vectorDotProduct _dirToUnitVector);
|
||||||
|
|
||||||
//From 0-45deg, full effect
|
// from 0-45deg, full effect
|
||||||
if (_angleDiff > 45) then {
|
if (_angleDiff > 45) then {
|
||||||
_strength = _strength - _strength * ((_angleDiff - 45) / 120);
|
_strength = _strength - _strength * ((_angleDiff - 45) / 120);
|
||||||
};
|
};
|
||||||
|
|
||||||
TRACE_1("Final strength for player",_strength);
|
TRACE_1("Final strength for player",_strength);
|
||||||
|
|
||||||
//Add ace_medical pain effect:
|
// add ace_medical pain effect:
|
||||||
if ((isClass (configFile >> "CfgPatches" >> "ACE_Medical")) && {_strength > 0.1}) then {
|
if (isClass (configFile >> "CfgPatches" >> "ACE_Medical") && {_strength > 0.1}) then {
|
||||||
[ACE_player, (_strength / 2)] call EFUNC(medical,adjustPainLevel);
|
[ACE_player, _strength / 2] call EFUNC(medical,adjustPainLevel);
|
||||||
};
|
};
|
||||||
|
|
||||||
// create flash to illuminate environment
|
// create flash to illuminate environment
|
||||||
@ -87,14 +91,14 @@ _affected = _grenade nearEntities ["CAManBase", 20];
|
|||||||
_light setLightColor [1,1,1];
|
_light setLightColor [1,1,1];
|
||||||
_light setLightDayLight true;
|
_light setLightDayLight true;
|
||||||
|
|
||||||
//Delete the light after 0.1 seconds
|
// delete the light after 0.1 seconds
|
||||||
[{
|
[{
|
||||||
params ["_light"];
|
params ["_light"];
|
||||||
deleteVehicle _light;
|
deleteVehicle _light;
|
||||||
}, [_light], 0.1] call EFUNC(common,waitAndExecute);
|
}, [_light], 0.1] call EFUNC(common,waitAndExecute);
|
||||||
|
|
||||||
// blind player
|
// blind player
|
||||||
if (_strength > 0.1 && hasInterface) then {
|
if (hasInterface && {_strength > 0.1}) then {
|
||||||
GVAR(flashbangPPEffectCC) ppEffectEnable true;
|
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) 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;
|
GVAR(flashbangPPEffectCC) ppEffectCommit 0.01;
|
||||||
@ -102,14 +106,15 @@ _affected = _grenade nearEntities ["CAManBase", 20];
|
|||||||
//PARTIALRECOVERY - start decreasing effect over ACE_time
|
//PARTIALRECOVERY - start decreasing effect over ACE_time
|
||||||
[{
|
[{
|
||||||
params ["_strength"];
|
params ["_strength"];
|
||||||
|
|
||||||
GVAR(flashbangPPEffectCC) ppEffectAdjust [1,1,0,[1,1,1,0],[0,0,0,1],[0,0,0,0]];
|
GVAR(flashbangPPEffectCC) ppEffectAdjust [1,1,0,[1,1,1,0],[0,0,0,1],[0,0,0,0]];
|
||||||
GVAR(flashbangPPEffectCC) ppEffectCommit (10 * _strength);
|
GVAR(flashbangPPEffectCC) ppEffectCommit (10 * _strength);
|
||||||
}, [_strength], (7 * _strength), 0] call EFUNC(common,waitAndExecute);
|
}, [_strength], 7 * _strength] call EFUNC(common,waitAndExecute);
|
||||||
|
|
||||||
//FULLRECOVERY - end effect
|
//FULLRECOVERY - end effect
|
||||||
[{
|
[{
|
||||||
GVAR(flashbangPPEffectCC) ppEffectEnable false;
|
GVAR(flashbangPPEffectCC) ppEffectEnable false;
|
||||||
}, [], (17 * _strength)] call EFUNC(common,waitAndExecute);
|
}, [], 17 * _strength] call EFUNC(common,waitAndExecute);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
params ["_projectile"];
|
params ["_projectile"];
|
||||||
|
|
||||||
if (alive _projectile) then {
|
if (alive _projectile) then {
|
||||||
@ -21,5 +22,6 @@ if (alive _projectile) then {
|
|||||||
|
|
||||||
private "_affected";
|
private "_affected";
|
||||||
_affected = _projectile nearEntities ["CAManBase", 50];
|
_affected = _projectile nearEntities ["CAManBase", 50];
|
||||||
|
|
||||||
["flashbangExplosion", _affected, [_projectile]] call EFUNC(common,targetEvent);
|
["flashbangExplosion", _affected, [_projectile]] call EFUNC(common,targetEvent);
|
||||||
};
|
};
|
||||||
|
@ -138,6 +138,7 @@
|
|||||||
<German>Aktiviere Taubheit im Gefecht?</German>
|
<German>Aktiviere Taubheit im Gefecht?</German>
|
||||||
<Czech>Povolit ztrátu sluchu?</Czech>
|
<Czech>Povolit ztrátu sluchu?</Czech>
|
||||||
<Portuguese>Ativar surdez em combate?</Portuguese>
|
<Portuguese>Ativar surdez em combate?</Portuguese>
|
||||||
|
<Russian>Уменьшает возможность игрока слышать звуки при повреждении органов слуха</Russian>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Hearing_Module_Description">
|
<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>
|
<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>
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
class ACE_Settings {
|
class ACE_Settings {
|
||||||
class GVAR(minDamageToTrigger) {
|
class GVAR(minDamageToTrigger) {
|
||||||
//Minimum mamage needed to trigger falling down while moving. Set to -1 to disable completely.
|
//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"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
params ["_unit", "_firer", "_damage"];
|
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
|
// don't fall on collision damage
|
||||||
if (_unit == _firer) exitWith {};
|
if (_unit == _firer) exitWith {};
|
||||||
|
|
||||||
//Exit if system disabled:
|
|
||||||
if (GVAR(minDamageToTrigger) == -1) exitWith {};
|
|
||||||
|
|
||||||
// camshake for player
|
// camshake for player
|
||||||
if (_unit == ACE_player) then {
|
if (_unit == ACE_player) then {
|
||||||
addCamShake [3, 5, _damage + random 10];
|
addCamShake [3, 5, _damage + random 10];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// play scream sound
|
||||||
|
if (!isNil QUOTE(EFUNC(medical,playInjuredSound))) then {
|
||||||
|
[_unit] call EFUNC(medical,playInjuredSound);
|
||||||
|
};
|
||||||
|
|
||||||
private "_vehicle";
|
private "_vehicle";
|
||||||
_vehicle = vehicle _unit;
|
_vehicle = vehicle _unit;
|
||||||
|
|
||||||
// handle static weapons
|
// handle static weapons
|
||||||
if (_vehicle isKindOf "StaticWeapon") exitwith {
|
if (_vehicle isKindOf "StaticWeapon") exitWith {
|
||||||
if (!alive _unit) then {
|
if (!alive _unit) then {
|
||||||
_unit action ["Eject", _vehicle];
|
_unit action ["Eject", _vehicle];
|
||||||
unassignVehicle _unit;
|
unassignVehicle _unit;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// don't fall after minor damage
|
// don't do animations if in a vehicle (looks weird and animations never reset):
|
||||||
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):
|
|
||||||
if (_vehicle != _unit) exitWith {};
|
if (_vehicle != _unit) exitWith {};
|
||||||
|
|
||||||
// this checks most things, so it doesn't mess with being inside vehicles or while dragging etc.
|
// 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 {};
|
if (_velocity < 2) exitWith {};
|
||||||
|
|
||||||
// get correct animation by weapon
|
// get correct animation by weapon
|
||||||
private ["_isPlayer", "_isRunning", "_anim"];
|
private "_anim";
|
||||||
|
|
||||||
_isPlayer = [_unit] call EFUNC(common,isPlayer);
|
call {
|
||||||
|
private "_weapon";
|
||||||
|
_weapon = currentWeapon _unit;
|
||||||
|
|
||||||
|
if (_weapon == "") exitWith {
|
||||||
|
_anim = "AmovPercMsprSnonWnonDf_AmovPpneMstpSnonWnonDnon"
|
||||||
|
};
|
||||||
|
|
||||||
|
if (_weapon == primaryWeapon _unit) exitWith {
|
||||||
|
if ([_unit] call EFUNC(common,isPlayer)) then {
|
||||||
|
private "_isRunning";
|
||||||
_isRunning = _velocity > 4;
|
_isRunning = _velocity > 4;
|
||||||
|
|
||||||
_anim = switch (currentWeapon _unit) do {
|
_anim = [
|
||||||
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,
|
||||||
["AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon_2", "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"] select _isRunning,
|
["AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon_2", "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"] select _isRunning,
|
||||||
"AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDleft",
|
"AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDleft",
|
||||||
"AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDright"
|
"AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDright"
|
||||||
] select floor random 4;
|
] select floor random 4;
|
||||||
|
} else {
|
||||||
|
_anim = "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
case (handgunWeapon _unit): {
|
|
||||||
if !(_isPlayer) exitWith {"AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon"};
|
|
||||||
|
|
||||||
[
|
if (_weapon == handgunWeapon _unit) exitWith {
|
||||||
|
if ([_unit] call EFUNC(common,isPlayer)) then {
|
||||||
|
_anim = [
|
||||||
"AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon",
|
"AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon",
|
||||||
"AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon",
|
"AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon",
|
||||||
"AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDleft",
|
"AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDleft",
|
||||||
"AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDright"
|
"AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDright"
|
||||||
] select floor random 4;
|
] select floor random 4;
|
||||||
|
} else {
|
||||||
|
_anim = "AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon";
|
||||||
};
|
};
|
||||||
default {""};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// exit if no animation for this weapon exists, i.E. binocular or rocket launcher
|
_anim = "";
|
||||||
|
};
|
||||||
|
|
||||||
|
// exit if no animation for this weapon exists, i.e. binocular or rocket launcher
|
||||||
if (_anim == "") exitWith {};
|
if (_anim == "") exitWith {};
|
||||||
|
|
||||||
// don't mess with transitions. don't fall then.
|
// don't mess with transitions. don't fall then.
|
||||||
if ([_unit] call EFUNC(common,inTransitionAnim)) exitWith {};
|
if !([_unit] call EFUNC(common,inTransitionAnim)) then {
|
||||||
|
|
||||||
[_unit, _anim, 2] call EFUNC(common,doAnimation);
|
[_unit, _anim, 2] call EFUNC(common,doAnimation);
|
||||||
|
};
|
||||||
|
@ -8,17 +8,19 @@ GVAR(cachedBuildingActionPairs) = [];
|
|||||||
|
|
||||||
GVAR(ParsedTextCached) = [];
|
GVAR(ParsedTextCached) = [];
|
||||||
|
|
||||||
//Setup text/shadow/size/color settings matrix
|
|
||||||
[] call FUNC(setupTextColors);
|
|
||||||
["SettingChanged", {
|
["SettingChanged", {
|
||||||
PARAMS_1(_name);
|
params ["_name"];
|
||||||
if (_name in [QGVAR(colorTextMax), QGVAR(colorTextMin), QGVAR(colorShadowMax), QGVAR(colorShadowMin), QGVAR(textSize), QGVAR(shadowSetting)]) then {
|
if (({_x == _name} count [QGVAR(colorTextMax), QGVAR(colorTextMin), QGVAR(colorShadowMax), QGVAR(colorShadowMin), QGVAR(textSize), QGVAR(shadowSetting)]) == 1) then {
|
||||||
[] call FUNC(setupTextColors);
|
[] call FUNC(setupTextColors);
|
||||||
};
|
};
|
||||||
}] call EFUNC(common,addEventhandler);
|
}] call EFUNC(common,addEventhandler);
|
||||||
|
|
||||||
|
["SettingsInitialized", {
|
||||||
|
//Setup text/shadow/size/color settings matrix
|
||||||
|
[] call FUNC(setupTextColors);
|
||||||
// Install the render EH on the main display
|
// Install the render EH on the main display
|
||||||
addMissionEventHandler ["Draw3D", DFUNC(render)];
|
addMissionEventHandler ["Draw3D", DFUNC(render)];
|
||||||
|
}] call EFUNC(common,addEventHandler);
|
||||||
|
|
||||||
//Add Actions to Houses:
|
//Add Actions to Houses:
|
||||||
["interactMenuOpened", {_this call FUNC(userActions_addHouseActions)}] call EFUNC(common,addEventHandler);
|
["interactMenuOpened", {_this call FUNC(userActions_addHouseActions)}] call EFUNC(common,addEventHandler);
|
||||||
@ -54,7 +56,7 @@ addMissionEventHandler ["Draw3D", DFUNC(render)];
|
|||||||
// If no menu is open just quit
|
// If no menu is open just quit
|
||||||
if (GVAR(openedMenuType) < 0) exitWith {};
|
if (GVAR(openedMenuType) < 0) exitWith {};
|
||||||
|
|
||||||
EXPLODE_2_PVT(_this,_unit,_isUnconscious);
|
params ["_unit", "_isUnconscious"];
|
||||||
|
|
||||||
if (_unit != ACE_player || !_isUnconscious) exitWith {};
|
if (_unit != ACE_player || !_isUnconscious) exitWith {};
|
||||||
|
|
||||||
|
@ -14,13 +14,14 @@
|
|||||||
|
|
||||||
BEGIN_COUNTER(fnc_render);
|
BEGIN_COUNTER(fnc_render);
|
||||||
|
|
||||||
private ["_cursorPos1", "_cursorPos2", "_p1", "_p2", "_forEachIndex", "_x", "_cursorScreenPos", "_closestDistance", "_closestSelection", "_sPos", "_disSq", "_closest", "_cTime", "_delta", "_foundTarget", "_misMatch", "_hoverPath", "_i", "_actionData", "_player", "_target"];
|
private ["_cursorPos2", "_p1", "_p2", "_forEachIndex", "_x", "_cursorScreenPos", "_closestDistance", "_closestSelection", "_sPos", "_disSq", "_closest", "_cTime", "_delta", "_foundTarget", "_misMatch", "_hoverPath", "_i", "_actionData", "_player", "_target"];
|
||||||
_foundTarget = false;
|
|
||||||
_cursorPos1 = positionCameraToWorld [0, 0, 0];
|
|
||||||
_cursorPos2 = positionCameraToWorld [0, 0, 2];
|
|
||||||
|
|
||||||
|
_foundTarget = false;
|
||||||
|
|
||||||
if (GVAR(openedMenuType) >= 0) then {
|
if (GVAR(openedMenuType) >= 0) then {
|
||||||
|
// _cursorPos1 = positionCameraToWorld [0, 0, 2];
|
||||||
|
_cursorPos2 = positionCameraToWorld [0, 0, 2];
|
||||||
|
|
||||||
// Render all available nearby interactions
|
// Render all available nearby interactions
|
||||||
call FUNC(renderActionPoints);
|
call FUNC(renderActionPoints);
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
class ACE_Settings {
|
class ACE_Settings {
|
||||||
class GVAR(EnableTeamManagement) {
|
class GVAR(EnableTeamManagement) {
|
||||||
value = 1;
|
value = 1;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
|
|
||||||
class ACE_ZeusActions {
|
class ACE_ZeusActions {
|
||||||
// _target = curatorLogic
|
|
||||||
// curatorSelected = [objects,groups,waypoints,markers]
|
|
||||||
class ZeusUnits {
|
class ZeusUnits {
|
||||||
displayName = "$STR_A3_RscDisplayCurator_ModeUnits_tooltip";
|
displayName = "$STR_A3_RscDisplayCurator_ModeUnits_tooltip";
|
||||||
icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeUnits_ca.paa";
|
icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeUnits_ca.paa";
|
||||||
@ -29,12 +28,14 @@ class ACE_ZeusActions {
|
|||||||
statement = "{_x setUnitPos 'AUTO';} forEach (curatorSelected select 0);";
|
statement = "{_x setUnitPos 'AUTO';} forEach (curatorSelected select 0);";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class remoteControl {
|
class remoteControl {
|
||||||
displayName = "$STR_A3_CfgVehicles_ModuleRemoteControl_F";
|
displayName = "$STR_A3_CfgVehicles_ModuleRemoteControl_F";
|
||||||
icon = "\A3\Modules_F_Curator\Data\portraitRemoteControl_ca.paa";
|
icon = "\A3\Modules_F_Curator\Data\portraitRemoteControl_ca.paa";
|
||||||
statement = "_unit = objNull; { if ((side _x in [east,west,resistance,civilian]) && !(isPlayer _x)) exitWith { _unit = _x; }; } forEach (curatorSelected select 0); bis_fnc_curatorObjectPlaced_mouseOver = ['OBJECT',_unit]; (group _target) createUnit ['ModuleRemoteControl_F',[0,0,0],[],0,''];";
|
statement = "_unit = objNull; { if ((side _x in [east,west,resistance,civilian]) && !(isPlayer _x)) exitWith { _unit = _x; }; } forEach (curatorSelected select 0); bis_fnc_curatorObjectPlaced_mouseOver = ['OBJECT',_unit]; (group _target) createUnit ['ModuleRemoteControl_F',[0,0,0],[],0,''];";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class ZeusGroups {
|
class ZeusGroups {
|
||||||
displayName = "$STR_A3_RscDisplayCurator_ModeGroups_tooltip";
|
displayName = "$STR_A3_RscDisplayCurator_ModeGroups_tooltip";
|
||||||
icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeGroups_ca.paa";
|
icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeGroups_ca.paa";
|
||||||
@ -67,6 +68,7 @@ class ACE_ZeusActions {
|
|||||||
statement = "{ _x setBehaviour 'STEALTH'; } forEach (curatorSelected select 1);";
|
statement = "{ _x setBehaviour 'STEALTH'; } forEach (curatorSelected select 1);";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class speed {
|
class speed {
|
||||||
displayName = "$STR_HC_Menu_Speed";
|
displayName = "$STR_HC_Menu_Speed";
|
||||||
|
|
||||||
@ -86,6 +88,7 @@ class ACE_ZeusActions {
|
|||||||
statement = "{_x setSpeedMode 'FULL';} forEach (curatorSelected select 1);";
|
statement = "{_x setSpeedMode 'FULL';} forEach (curatorSelected select 1);";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class formation {
|
class formation {
|
||||||
displayName = "$STR_Formation";
|
displayName = "$STR_Formation";
|
||||||
|
|
||||||
@ -136,6 +139,7 @@ class ACE_ZeusActions {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class ZeusWaypoints {
|
class ZeusWaypoints {
|
||||||
displayName = "Waypoints";
|
displayName = "Waypoints";
|
||||||
icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeRecent_ca.paa";
|
icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeRecent_ca.paa";
|
||||||
@ -168,6 +172,7 @@ class ACE_ZeusActions {
|
|||||||
statement = "{ _x setWaypointBehaviour 'STEALTH'; } forEach (curatorSelected select 2);";
|
statement = "{ _x setWaypointBehaviour 'STEALTH'; } forEach (curatorSelected select 2);";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class speed {
|
class speed {
|
||||||
displayName = "$STR_HC_Menu_Speed";
|
displayName = "$STR_HC_Menu_Speed";
|
||||||
|
|
||||||
@ -187,6 +192,7 @@ class ACE_ZeusActions {
|
|||||||
statement = "{ _x setWaypointSpeed 'FULL'; } forEach (curatorSelected select 2);";
|
statement = "{ _x setWaypointSpeed 'FULL'; } forEach (curatorSelected select 2);";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class formation {
|
class formation {
|
||||||
displayName = "$STR_Formation";
|
displayName = "$STR_Formation";
|
||||||
|
|
||||||
@ -237,6 +243,7 @@ class ACE_ZeusActions {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class ZeusMarkers {
|
class ZeusMarkers {
|
||||||
displayName = "$STR_A3_RscDisplayCurator_ModeMarkers_tooltip";
|
displayName = "$STR_A3_RscDisplayCurator_ModeMarkers_tooltip";
|
||||||
icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeMarkers_ca.paa";
|
icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeMarkers_ca.paa";
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
class Extended_PreInit_EventHandlers {
|
class Extended_PreInit_EventHandlers {
|
||||||
class ADDON {
|
class ADDON {
|
||||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||||
@ -9,3 +10,11 @@ class Extended_PostInit_EventHandlers {
|
|||||||
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Extended_Respawn_EventHandlers {
|
||||||
|
class CAManBase {
|
||||||
|
class ADDON {
|
||||||
|
respawn = QUOTE((_this select 0) setVariable [ARR_3(QUOTE(QGVAR(assignedFireTeam)),(_this select 0) getVariable [ARR_2(QUOTE(QGVAR(assignedFireTeam)),'MAIN')],true)]);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
class CfgVehicles {
|
class CfgVehicles {
|
||||||
class ACE_Module;
|
class ACE_Module;
|
||||||
class ACE_ModuleInteraction: ACE_Module {
|
class ACE_ModuleInteraction: ACE_Module {
|
||||||
@ -8,6 +9,7 @@ class CfgVehicles {
|
|||||||
scope = 2;
|
scope = 2;
|
||||||
isGlobal = 1;
|
isGlobal = 1;
|
||||||
icon = PATHTOF(UI\Icon_Module_Interaction_ca.paa);
|
icon = PATHTOF(UI\Icon_Module_Interaction_ca.paa);
|
||||||
|
|
||||||
class Arguments {
|
class Arguments {
|
||||||
class EnableTeamManagement {
|
class EnableTeamManagement {
|
||||||
displayName = CSTRING(EnableTeamManagement_DisplayName);
|
displayName = CSTRING(EnableTeamManagement_DisplayName);
|
||||||
@ -16,6 +18,7 @@ class CfgVehicles {
|
|||||||
defaultValue = 1;
|
defaultValue = 1;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class ModuleDescription {
|
class ModuleDescription {
|
||||||
description = CSTRING(Module_Description);
|
description = CSTRING(Module_Description);
|
||||||
};
|
};
|
||||||
@ -77,7 +80,6 @@ class CfgVehicles {
|
|||||||
priority = 2.1;
|
priority = 2.1;
|
||||||
hotkey = "Y";
|
hotkey = "Y";
|
||||||
};
|
};
|
||||||
|
|
||||||
class ACE_UnassignTeam {
|
class ACE_UnassignTeam {
|
||||||
displayName = CSTRING(LeaveTeam);
|
displayName = CSTRING(LeaveTeam);
|
||||||
condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {assignedTeam _target != 'MAIN'});
|
condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {assignedTeam _target != 'MAIN'});
|
||||||
@ -98,29 +100,29 @@ class CfgVehicles {
|
|||||||
icon = PATHTOF(UI\team\team_management_ca.paa);
|
icon = PATHTOF(UI\team\team_management_ca.paa);
|
||||||
hotkey = "J";
|
hotkey = "J";
|
||||||
};
|
};
|
||||||
|
|
||||||
class ACE_GetDown {
|
class ACE_GetDown {
|
||||||
displayName = CSTRING(GetDown);
|
displayName = CSTRING(GetDown);
|
||||||
condition = QUOTE([_target] call DFUNC(canInteractWithCivilian));
|
condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canInteractWithCivilian));
|
||||||
statement = QUOTE([_target] call DFUNC(getDown));
|
statement = QUOTE([ARR_2(_player,_target)] call DFUNC(getDown));
|
||||||
showDisabled = 0;
|
showDisabled = 0;
|
||||||
priority = 2.2;
|
priority = 2.2;
|
||||||
};
|
};
|
||||||
class ACE_SendAway {
|
class ACE_SendAway {
|
||||||
displayName = CSTRING(SendAway);
|
displayName = CSTRING(SendAway);
|
||||||
condition = QUOTE([_target] call DFUNC(canInteractWithCivilian));
|
condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canInteractWithCivilian));
|
||||||
statement = QUOTE([_target] call DFUNC(sendAway));
|
statement = QUOTE([ARR_2(_player,_target)] call DFUNC(sendAway));
|
||||||
showDisabled = 0;
|
showDisabled = 0;
|
||||||
priority = 2.0;
|
priority = 2.0;
|
||||||
};
|
};
|
||||||
class ACE_Pardon {
|
class ACE_Pardon {
|
||||||
displayName = CSTRING(Pardon);
|
displayName = CSTRING(Pardon);
|
||||||
condition = QUOTE(rating _target < -2000 && {alive _target} && {side group _player == side group _target});
|
condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canPardon));
|
||||||
statement = QUOTE([ARR_3(_target,'{_this addRating -rating _this}',_target)] call DEFUNC(common,execRemoteFnc));
|
statement = QUOTE([ARR_2(_player,_target)] call DFUNC(pardon));
|
||||||
showDisabled = 0;
|
showDisabled = 0;
|
||||||
priority = 2.5;
|
priority = 2.5;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class ACE_Torso {
|
class ACE_Torso {
|
||||||
displayName = CSTRING(Torso);
|
displayName = CSTRING(Torso);
|
||||||
selection = "spine3";
|
selection = "spine3";
|
||||||
@ -165,12 +167,11 @@ class CfgVehicles {
|
|||||||
};
|
};
|
||||||
class ACE_Weapon {
|
class ACE_Weapon {
|
||||||
displayName = CSTRING(Weapon);
|
displayName = CSTRING(Weapon);
|
||||||
position = QUOTE(call FUNC(getWeaponPos));
|
position = QUOTE(call DFUNC(getWeaponPos));
|
||||||
distance = 1.50;
|
distance = 1.50;
|
||||||
condition = "";
|
condition = "";
|
||||||
statement = "";
|
statement = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
class ACE_TapShoulderRight {
|
class ACE_TapShoulderRight {
|
||||||
displayName = CSTRING(TapShoulder);
|
displayName = CSTRING(TapShoulder);
|
||||||
selection = "rightshoulder";
|
selection = "rightshoulder";
|
||||||
@ -238,7 +239,6 @@ class CfgVehicles {
|
|||||||
icon = PATHTOF(UI\team\team_yellow_ca.paa);
|
icon = PATHTOF(UI\team\team_yellow_ca.paa);
|
||||||
hotkey = "Y";
|
hotkey = "Y";
|
||||||
};
|
};
|
||||||
|
|
||||||
class ACE_LeaveTeam {
|
class ACE_LeaveTeam {
|
||||||
displayName = CSTRING(LeaveTeam);
|
displayName = CSTRING(LeaveTeam);
|
||||||
condition = QUOTE(assignedTeam _player != 'MAIN');
|
condition = QUOTE(assignedTeam _player != 'MAIN');
|
||||||
@ -405,6 +405,7 @@ class CfgVehicles {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class ACE_SelfActions {
|
class ACE_SelfActions {
|
||||||
class ACE_Passengers {
|
class ACE_Passengers {
|
||||||
displayName = CSTRING(Passengers);
|
displayName = CSTRING(Passengers);
|
||||||
@ -414,6 +415,7 @@ class CfgVehicles {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class Tank: LandVehicle {
|
class Tank: LandVehicle {
|
||||||
class ACE_Actions {
|
class ACE_Actions {
|
||||||
class ACE_MainActions {
|
class ACE_MainActions {
|
||||||
@ -429,6 +431,7 @@ class CfgVehicles {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class ACE_SelfActions {
|
class ACE_SelfActions {
|
||||||
class ACE_Passengers {
|
class ACE_Passengers {
|
||||||
displayName = CSTRING(Passengers);
|
displayName = CSTRING(Passengers);
|
||||||
@ -455,6 +458,7 @@ class CfgVehicles {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class ACE_SelfActions {
|
class ACE_SelfActions {
|
||||||
class ACE_Passengers {
|
class ACE_Passengers {
|
||||||
displayName = CSTRING(Passengers);
|
displayName = CSTRING(Passengers);
|
||||||
@ -464,6 +468,7 @@ class CfgVehicles {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class Plane: Air {
|
class Plane: Air {
|
||||||
class ACE_Actions {
|
class ACE_Actions {
|
||||||
class ACE_MainActions {
|
class ACE_MainActions {
|
||||||
@ -479,6 +484,7 @@ class CfgVehicles {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class ACE_SelfActions {
|
class ACE_SelfActions {
|
||||||
class ACE_Passengers {
|
class ACE_Passengers {
|
||||||
displayName = CSTRING(Passengers);
|
displayName = CSTRING(Passengers);
|
||||||
@ -501,7 +507,7 @@ class CfgVehicles {
|
|||||||
class ACE_Push {
|
class ACE_Push {
|
||||||
displayName = CSTRING(Push);
|
displayName = CSTRING(Push);
|
||||||
distance = 6;
|
distance = 6;
|
||||||
condition = QUOTE(((getMass _target) <= 2600) && {alive _target} && {(vectorMagnitude (velocity _target)) < 3});
|
condition = QUOTE(getMass _target <= 2600 && {alive _target} && {vectorMagnitude velocity _target < 3});
|
||||||
statement = QUOTE(_this call FUNC(push));
|
statement = QUOTE(_this call FUNC(push));
|
||||||
showDisabled = 0;
|
showDisabled = 0;
|
||||||
priority = -1;
|
priority = -1;
|
||||||
@ -514,6 +520,7 @@ class CfgVehicles {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class ACE_SelfActions {
|
class ACE_SelfActions {
|
||||||
class ACE_Passengers {
|
class ACE_Passengers {
|
||||||
displayName = CSTRING(Passengers);
|
displayName = CSTRING(Passengers);
|
||||||
@ -539,6 +546,7 @@ class CfgVehicles {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class ACE_SelfActions {
|
class ACE_SelfActions {
|
||||||
class ACE_Passengers {
|
class ACE_Passengers {
|
||||||
displayName = CSTRING(Passengers);
|
displayName = CSTRING(Passengers);
|
||||||
@ -551,6 +559,7 @@ class CfgVehicles {
|
|||||||
|
|
||||||
class StaticMGWeapon: StaticWeapon {};
|
class StaticMGWeapon: StaticWeapon {};
|
||||||
class HMG_01_base_F: StaticMGWeapon {};
|
class HMG_01_base_F: StaticMGWeapon {};
|
||||||
|
|
||||||
class HMG_01_high_base_F: HMG_01_base_F {
|
class HMG_01_high_base_F: HMG_01_base_F {
|
||||||
class ACE_Actions: ACE_Actions {
|
class ACE_Actions: ACE_Actions {
|
||||||
class ACE_MainActions: ACE_MainActions {
|
class ACE_MainActions: ACE_MainActions {
|
||||||
@ -558,6 +567,7 @@ class CfgVehicles {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class AA_01_base_F: StaticMGWeapon {
|
class AA_01_base_F: StaticMGWeapon {
|
||||||
class ACE_Actions: ACE_Actions {
|
class ACE_Actions: ACE_Actions {
|
||||||
class ACE_MainActions: ACE_MainActions {
|
class ACE_MainActions: ACE_MainActions {
|
||||||
@ -565,6 +575,7 @@ class CfgVehicles {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class AT_01_base_F: StaticMGWeapon {
|
class AT_01_base_F: StaticMGWeapon {
|
||||||
class ACE_Actions: ACE_Actions {
|
class ACE_Actions: ACE_Actions {
|
||||||
class ACE_MainActions: ACE_MainActions {
|
class ACE_MainActions: ACE_MainActions {
|
||||||
@ -581,6 +592,7 @@ class CfgVehicles {
|
|||||||
selection = "";
|
selection = "";
|
||||||
distance = 2;
|
distance = 2;
|
||||||
condition = "true";
|
condition = "true";
|
||||||
|
|
||||||
class ACE_OpenBox {
|
class ACE_OpenBox {
|
||||||
displayName = CSTRING(OpenBox);
|
displayName = CSTRING(OpenBox);
|
||||||
condition = QUOTE(alive _target);
|
condition = QUOTE(alive _target);
|
||||||
@ -590,6 +602,7 @@ class CfgVehicles {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class ACE_SelfActions {};
|
class ACE_SelfActions {};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -602,6 +615,7 @@ class CfgVehicles {
|
|||||||
condition = "true";
|
condition = "true";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class ACE_SelfActions {};
|
class ACE_SelfActions {};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
#define HSPACE 0.5-2.0/16/2
|
#define HSPACE 0.5-2.0/16/2
|
||||||
#define VSPACE 0.5-0.3/9/2
|
#define VSPACE 0.5-0.3/9/2
|
||||||
|
|
||||||
@ -44,11 +45,13 @@ class ACE_Interaction_Button_Base {
|
|||||||
class RscListbox;
|
class RscListbox;
|
||||||
class IGUIBack;
|
class IGUIBack;
|
||||||
class RscText;
|
class RscText;
|
||||||
|
|
||||||
#define X_OFFSET 0.2
|
#define X_OFFSET 0.2
|
||||||
|
|
||||||
class RscACE_SelectAnItem {
|
class RscACE_SelectAnItem {
|
||||||
idd = 8854;
|
idd = 8854;
|
||||||
movingEnable = 0;
|
movingEnable = 0;
|
||||||
|
|
||||||
class controls {
|
class controls {
|
||||||
class back: IGUIBack {
|
class back: IGUIBack {
|
||||||
x = X_OFFSET;
|
x = X_OFFSET;
|
||||||
@ -139,18 +142,21 @@ class RscInteractionIcon: RscPicture {
|
|||||||
w = 2*GUI_GRID_H;
|
w = 2*GUI_GRID_H;
|
||||||
h = 2*GUI_GRID_H;
|
h = 2*GUI_GRID_H;
|
||||||
};
|
};
|
||||||
|
|
||||||
class RscInteractionHelperIcon: RscInteractionIcon {
|
class RscInteractionHelperIcon: RscInteractionIcon {
|
||||||
x = 20 * GUI_GRID_W;
|
x = 20 * GUI_GRID_W;
|
||||||
y = 16 * GUI_GRID_H;
|
y = 16 * GUI_GRID_H;
|
||||||
w = GUI_GRID_H;
|
w = GUI_GRID_H;
|
||||||
h = GUI_GRID_H;
|
h = GUI_GRID_H;
|
||||||
};
|
};
|
||||||
|
|
||||||
class RscInteractionText: RscText{
|
class RscInteractionText: RscText{
|
||||||
x = 21 * GUI_GRID_W;
|
x = 21 * GUI_GRID_W;
|
||||||
y = 16 * GUI_GRID_H;
|
y = 16 * GUI_GRID_H;
|
||||||
w = 8 * GUI_GRID_W;
|
w = 24 * GUI_GRID_W;
|
||||||
h = 1.5 * GUI_GRID_H;
|
h = 1.5 * GUI_GRID_H;
|
||||||
};
|
};
|
||||||
|
|
||||||
class RscTitles {
|
class RscTitles {
|
||||||
class GVAR(InteractionHelper) {
|
class GVAR(InteractionHelper) {
|
||||||
idd = 9930;
|
idd = 9930;
|
@ -1,37 +1,52 @@
|
|||||||
// by commy2 and esteldunedain
|
// by commy2 and esteldunedain
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
ACE_Modifier = 0;
|
ACE_Modifier = 0;
|
||||||
|
|
||||||
//SelectLeader Event Handler for BecomeLeader action:
|
["pardon", {(_this select 0) addRating -rating (_this select 0)}] call EFUNC(common,addEventHandler);
|
||||||
[QGVAR(selectLeader), {
|
|
||||||
PARAMS_2(_group,_leader);
|
["getDown", {
|
||||||
_group selectLeader _leader;
|
params ["_target"];
|
||||||
|
|
||||||
|
_target setUnitPos "DOWN";
|
||||||
}] call EFUNC(common,addEventHandler);
|
}] call EFUNC(common,addEventHandler);
|
||||||
|
|
||||||
//Pushing boats from FUNC(push)
|
["sendAway", {
|
||||||
[QGVAR(pushBoat), {
|
params ["_unit", "_position"];
|
||||||
params ["_boat", "_newVelocity"];
|
|
||||||
_boat setVelocity _newVelocity;
|
|
||||||
}] call EFUNC(common,addEventHandler);
|
|
||||||
|
|
||||||
|
_unit setUnitPos "AUTO";
|
||||||
|
_unit doMove _position;
|
||||||
|
}] call EFUNC(common,addEventHandler);
|
||||||
|
|
||||||
if (!hasInterface) exitWith {};
|
if (!hasInterface) exitWith {};
|
||||||
|
|
||||||
GVAR(isOpeningDoor) = false;
|
GVAR(isOpeningDoor) = false;
|
||||||
|
|
||||||
|
[{_this call FUNC(handleScrollWheel)}] call EFUNC(common,addScrollWheelEventHandler);
|
||||||
|
|
||||||
|
["tapShoulder", {
|
||||||
|
params ["_unit", "_shoulderNum"];
|
||||||
|
|
||||||
|
if (_unit == ACE_player) then {
|
||||||
|
addCamShake [4, 0.5, 5];
|
||||||
|
};
|
||||||
|
|
||||||
|
private "_message";
|
||||||
|
_message = parseText format ([["%1 >", localize LSTRING(YouWereTappedRight)], ["< %1", localize LSTRING(YouWereTappedLeft)]] select (_shoulderNum == 0));
|
||||||
|
|
||||||
|
["displayTextStructured", _message] call EFUNC(common,targetEvent);
|
||||||
|
}] call EFUNC(common,addEventHandler);
|
||||||
|
|
||||||
// restore global fire teams for JIP
|
// restore global fire teams for JIP
|
||||||
private ["_team"];
|
private "_team";
|
||||||
{
|
{
|
||||||
_team = _x getVariable [QGVAR(assignedFireTeam), ""];
|
_team = _x getVariable [QGVAR(assignedFireTeam), ""];
|
||||||
if (_team != "") then {_x assignTeam _team};
|
if (_team != "") then {_x assignTeam _team};
|
||||||
} forEach allUnits;
|
false
|
||||||
|
} count allUnits;
|
||||||
|
|
||||||
|
// add keybinds
|
||||||
// Add keybinds
|
["ACE3 Common", QGVAR(openDoor), localize LSTRING(OpenDoor), {
|
||||||
["ACE3 Common", QGVAR(openDoor), localize LSTRING(OpenDoor),
|
|
||||||
{
|
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||||
// Conditions: specific
|
// Conditions: specific
|
||||||
@ -40,18 +55,16 @@ private ["_team"];
|
|||||||
// Statement
|
// Statement
|
||||||
call EFUNC(interaction,openDoor);
|
call EFUNC(interaction,openDoor);
|
||||||
true
|
true
|
||||||
},
|
}, {
|
||||||
{
|
|
||||||
//Probably don't want any condidtions here, so variable never gets locked down
|
//Probably don't want any condidtions here, so variable never gets locked down
|
||||||
// Statement
|
// Statement
|
||||||
GVAR(isOpeningDoor) = false;
|
GVAR(isOpeningDoor) = false;
|
||||||
true
|
true
|
||||||
},
|
},
|
||||||
[57, [false, true, false]], false] call cba_fnc_addKeybind; //Key CTRL+Space
|
[57, [false, true, false]], false] call CBA_fnc_addKeybind; //Key CTRL+Space
|
||||||
|
|
||||||
|
|
||||||
["ACE3 Common", QGVAR(tapShoulder), localize LSTRING(TapShoulder),
|
["ACE3 Common", QGVAR(tapShoulder), localize LSTRING(TapShoulder), {
|
||||||
{
|
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||||
// Conditions: specific
|
// Conditions: specific
|
||||||
@ -62,24 +75,7 @@ private ["_team"];
|
|||||||
true
|
true
|
||||||
},
|
},
|
||||||
{false},
|
{false},
|
||||||
[20, [true, false, false]], false] call cba_fnc_addKeybind;
|
[20, [true, false, false]], false] call CBA_fnc_addKeybind;
|
||||||
|
|
||||||
["ACE3 Common", QGVAR(modifierKey), localize LSTRING(ModifierKey),
|
|
||||||
{
|
|
||||||
// Conditions: canInteract
|
|
||||||
//if !([ACE_player, objNull, ["isNotDragging"]] call EFUNC(common,canInteractWith)) exitWith {false}; // not needed
|
|
||||||
|
|
||||||
// Statement
|
|
||||||
ACE_Modifier = 1;
|
|
||||||
// Return false so it doesn't block other actions
|
|
||||||
false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
//Probably don't want any condidtions here, so variable never gets locked down
|
|
||||||
ACE_Modifier = 0;
|
|
||||||
false;
|
|
||||||
},
|
|
||||||
[29, [false, false, false]], false] call cba_fnc_addKeybind;
|
|
||||||
|
|
||||||
["isNotSwimming", {!underwater (_this select 0)}] call EFUNC(common,addCanInteractWithCondition);
|
["isNotSwimming", {!underwater (_this select 0)}] call EFUNC(common,addCanInteractWithCondition);
|
||||||
["isNotOnLadder", {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState (_this select 0) >> "ACE_isLadder") != 1}] call EFUNC(common,addCanInteractWithCondition);
|
["isNotOnLadder", {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState (_this select 0) >> "ACE_isLadder") != 1}] call EFUNC(common,addCanInteractWithCondition);
|
||||||
|
@ -2,37 +2,38 @@
|
|||||||
|
|
||||||
ADDON = false;
|
ADDON = false;
|
||||||
|
|
||||||
|
// interaction menu
|
||||||
PREP(addPassengerActions);
|
PREP(addPassengerActions);
|
||||||
PREP(addPassengersActions);
|
PREP(addPassengersActions);
|
||||||
PREP(addSelectableItem);
|
PREP(getWeaponPos);
|
||||||
PREP(applyButtons);
|
PREP(moduleInteraction);
|
||||||
PREP(canBecomeLeader);
|
PREP(removeTag);
|
||||||
|
|
||||||
|
// scroll wheel hint
|
||||||
|
PREP(showMouseHint);
|
||||||
|
PREP(hideMouseHint);
|
||||||
|
|
||||||
|
// interaction with units
|
||||||
PREP(canInteractWithCivilian);
|
PREP(canInteractWithCivilian);
|
||||||
|
PREP(getDown);
|
||||||
|
PREP(sendAway);
|
||||||
PREP(canJoinGroup);
|
PREP(canJoinGroup);
|
||||||
PREP(canJoinTeam);
|
PREP(canJoinTeam);
|
||||||
PREP(canTapShoulder);
|
PREP(joinTeam);
|
||||||
|
PREP(canBecomeLeader);
|
||||||
PREP(doBecomeLeader);
|
PREP(doBecomeLeader);
|
||||||
|
PREP(canTapShoulder);
|
||||||
|
PREP(tapShoulder);
|
||||||
|
PREP(canPardon);
|
||||||
|
PREP(pardon);
|
||||||
|
|
||||||
|
// interaction with doors
|
||||||
PREP(getDoor);
|
PREP(getDoor);
|
||||||
PREP(getDoorAnimations);
|
PREP(getDoorAnimations);
|
||||||
PREP(getDown);
|
PREP(handleScrollWheel);
|
||||||
PREP(getSelectedButton);
|
|
||||||
PREP(getWeaponPos);
|
|
||||||
PREP(hideMenu);
|
|
||||||
PREP(hideMouseHint);
|
|
||||||
PREP(isInRange);
|
|
||||||
PREP(joinTeam);
|
|
||||||
PREP(moduleInteraction);
|
|
||||||
PREP(moveDown);
|
|
||||||
PREP(onSelectMenuDblClick);
|
|
||||||
PREP(openDoor);
|
PREP(openDoor);
|
||||||
PREP(openMenuSelectUI);
|
|
||||||
PREP(openSelectMenu);
|
// interaction with boats
|
||||||
PREP(prepareSelectMenu);
|
|
||||||
PREP(push);
|
PREP(push);
|
||||||
PREP(removeTag);
|
|
||||||
PREP(sendAway);
|
|
||||||
PREP(showMouseHint);
|
|
||||||
PREP(sortOptionsByPriority);
|
|
||||||
PREP(tapShoulder);
|
|
||||||
|
|
||||||
ADDON = true;
|
ADDON = true;
|
||||||
|
@ -14,6 +14,6 @@ class CfgPatches {
|
|||||||
|
|
||||||
#include "CfgEventHandlers.hpp"
|
#include "CfgEventHandlers.hpp"
|
||||||
#include "CfgVehicles.hpp"
|
#include "CfgVehicles.hpp"
|
||||||
#include "Menu_Config.hpp"
|
#include "RscTitles.hpp"
|
||||||
#include "ACE_Settings.hpp"
|
#include "ACE_Settings.hpp"
|
||||||
#include "ACE_ZeusActions.hpp"
|
#include "ACE_ZeusActions.hpp"
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
/*
|
/*
|
||||||
* Author: esteldunedain
|
* Author: esteldunedain
|
||||||
* Mount unit actions inside passenger submenu
|
* Mount unit actions inside passenger submenu.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Vehicle <OBJECT>
|
* 0: Vehicle <OBJECT>
|
||||||
* 1: Player <OBJECT>
|
* 1: Player <OBJECT>
|
||||||
* 3: Parameters <ARRAY>
|
* 3: Parameters <ARRAY>
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return Value:
|
||||||
* Children actions <ARRAY>
|
* Children actions <ARRAY>
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
@ -17,8 +17,8 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
EXPLODE_3_PVT(_this,_vehicle,_player,_parameters);
|
params ["", "", "_parameters"];
|
||||||
EXPLODE_1_PVT(_parameters,_unit);
|
_parameters params ["_unit"];
|
||||||
|
|
||||||
private ["_varName", "_actionTrees", "_actions"];
|
private ["_varName", "_actionTrees", "_actions"];
|
||||||
|
|
||||||
@ -26,11 +26,13 @@ _varName = format [QEGVAR(interact_menu,Act_%1), typeOf _unit];
|
|||||||
_actionTrees = missionNamespace getVariable [_varName, []];
|
_actionTrees = missionNamespace getVariable [_varName, []];
|
||||||
|
|
||||||
_actions = [];
|
_actions = [];
|
||||||
// Mount unit MainActions menu
|
|
||||||
|
|
||||||
|
// Mount unit MainActions menu
|
||||||
{
|
{
|
||||||
EXPLODE_2_PVT(_x,_actionData,_children);
|
_x params ["_actionData", "_children"];
|
||||||
|
|
||||||
_actions pushBack [_actionData, _children, _unit];
|
_actions pushBack [_actionData, _children, _unit];
|
||||||
} forEach ((_actionTrees select 0) select 1);
|
false
|
||||||
|
} count (_actionTrees select 0 select 1);
|
||||||
|
|
||||||
_actions
|
_actions
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
/*
|
/*
|
||||||
* Author: esteldunedain
|
* Author: esteldunedain
|
||||||
* Create one action per passenger
|
* Create one action per passenger.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Vehicle <OBJECT>
|
* 0: Vehicle <OBJECT>
|
||||||
* 1: Player <OBJECT>
|
* 1: Player <OBJECT>
|
||||||
* 3: Parameters <ARRAY>
|
* 3: Parameters <ARRAY>
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return Value:
|
||||||
* Children actions <ARRAY>
|
* Children actions <ARRAY>
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
@ -17,39 +17,43 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
EXPLODE_3_PVT(_this,_vehicle,_player,_parameters);
|
params ["_vehicle", "_player"];
|
||||||
|
|
||||||
private ["_actions"];
|
private "_actions";
|
||||||
_actions = [];
|
_actions = [];
|
||||||
|
|
||||||
{
|
{
|
||||||
private ["_unit", "_icon"];
|
private ["_unit", "_icon"];
|
||||||
|
|
||||||
_unit = _x;
|
_unit = _x;
|
||||||
if ((_unit != _player) && {(getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "simulation")) != "UAVPilot"}) then {
|
|
||||||
_icon = switch _unit do {
|
if (_unit != _player && {getText (configFile >> "CfgVehicles" >> typeOf _unit >> "simulation") != "UAVPilot"}) then {
|
||||||
case (driver _vehicle): { QUOTE(A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_driver_ca.paa) };
|
_icon = [
|
||||||
case (gunner _vehicle): { QUOTE(A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_gunner_ca.paa) };
|
"",
|
||||||
case (commander _vehicle): { QUOTE(A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_commander_ca.paa) };
|
"A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_driver_ca.paa",
|
||||||
default { "" };
|
"A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_gunner_ca.paa",
|
||||||
};
|
"A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_commander_ca.paa"
|
||||||
|
] select (([driver _vehicle, gunner _vehicle, commander _vehicle] find _unit) + 1);
|
||||||
|
|
||||||
if (_unit getVariable [QEGVAR(captives,isHandcuffed), false]) then {
|
if (_unit getVariable [QEGVAR(captives,isHandcuffed), false]) then {
|
||||||
_icon = QUOTE(PATHTOEF(captives,UI\handcuff_ca.paa));
|
_icon = QUOTE(PATHTOEF(captives,UI\handcuff_ca.paa));
|
||||||
};
|
};
|
||||||
_actions pushBack
|
|
||||||
|
_actions pushBack [
|
||||||
[
|
[
|
||||||
[
|
format ["%1", _unit],
|
||||||
str(_unit),
|
|
||||||
[_unit, true] call EFUNC(common,getName),
|
[_unit, true] call EFUNC(common,getName),
|
||||||
_icon,
|
_icon,
|
||||||
{},
|
{},
|
||||||
{true},
|
{true},
|
||||||
{_this call FUNC(addPassengerActions);},
|
{_this call FUNC(addPassengerActions)},
|
||||||
[_unit]
|
[_unit]
|
||||||
] call EFUNC(interact_menu,createAction),
|
] call EFUNC(interact_menu,createAction),
|
||||||
[],
|
[],
|
||||||
_unit
|
_unit
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
} forEach crew _vehicle;
|
false
|
||||||
|
} count crew _vehicle;
|
||||||
|
|
||||||
_actions
|
_actions
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
/*
|
|
||||||
* Author: Garth de Wet (LH)
|
|
||||||
* Adds an item to the select menu
|
|
||||||
*
|
|
||||||
* Arguments:
|
|
||||||
* 0: List container <ARRAY/NUMBER>
|
|
||||||
* 1: Display name <STRING>
|
|
||||||
* 2: Picture <STRING>
|
|
||||||
* 3: Data <STRING/CODE>
|
|
||||||
*
|
|
||||||
* Return value:
|
|
||||||
* Container <ARRAY/NUMBER>
|
|
||||||
*
|
|
||||||
* Example:
|
|
||||||
* [actions, "Banana", "UI\dot_ca.paa", "bananaContents"] call ace_interaction_fnc_addSelectableItem
|
|
||||||
*
|
|
||||||
* Public: No
|
|
||||||
*/
|
|
||||||
#include "script_component.hpp"
|
|
||||||
|
|
||||||
PARAMS_4(_container,_displayName,_picture,_data);
|
|
||||||
|
|
||||||
if (_picture == "" || _picture == "PictureThing") then {
|
|
||||||
_picture = QUOTE(PATHTOF(UI\dot_ca.paa));
|
|
||||||
};
|
|
||||||
|
|
||||||
private ["_index"];
|
|
||||||
_index = lbAdd [_container, _displayName];
|
|
||||||
lbSetData [_container, _index, str _data];
|
|
||||||
lbSetPicture [_container, _index, _picture];
|
|
||||||
|
|
||||||
_container
|
|
@ -1,66 +0,0 @@
|
|||||||
/*
|
|
||||||
* Author: commy2
|
|
||||||
* Applies buttons
|
|
||||||
*
|
|
||||||
* Arguments:
|
|
||||||
* None
|
|
||||||
*
|
|
||||||
* Return value:
|
|
||||||
* None
|
|
||||||
*
|
|
||||||
* Example:
|
|
||||||
* call ace_interaction_fnc_applyButtons
|
|
||||||
*
|
|
||||||
* Public: No
|
|
||||||
*/
|
|
||||||
#include "script_component.hpp"
|
|
||||||
|
|
||||||
private ["_object", "_actions", "_dlgInteractionDialog", "_ctrlInteractionDialog", "_index", "_ctrlInteractionDialogIcon", "_a", "_action", "_count"];
|
|
||||||
|
|
||||||
_object = GVAR(Target);
|
|
||||||
_actions = GVAR(Buttons);
|
|
||||||
|
|
||||||
|
|
||||||
disableSerialization;
|
|
||||||
_dlgInteractionDialog = uiNamespace getVariable QGVAR(Dialog);
|
|
||||||
|
|
||||||
/*
|
|
||||||
for "_a" from 0 to (_count - 1) do {
|
|
||||||
_action = GVAR(Buttons) select _a;
|
|
||||||
|
|
||||||
_ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _a);
|
|
||||||
_ctrlInteractionDialog ctrlShow true;
|
|
||||||
_ctrlInteractionDialog ctrlSetText (_action select 0);
|
|
||||||
_ctrlInteractionDialog ctrlEnable (call (_action select 2));
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
|
|
||||||
_ctrlInteractionDialog = _dlgInteractionDialog displayCtrl 3;
|
|
||||||
|
|
||||||
GVAR(MainButton) = "(findDisplay 1713999) closeDisplay 1;";
|
|
||||||
|
|
||||||
if (_object isKindOf "Man") then {
|
|
||||||
_ctrlInteractionDialog ctrlSetText (if (alive _object) then {name _object} else {_object getVariable ["ACE_Name", "Unknown"]});
|
|
||||||
} else {
|
|
||||||
_ctrlInteractionDialog ctrlSetText (getText (configFile >> "CfgVehicles" >> typeOf _object >> "displayName"));
|
|
||||||
};
|
|
||||||
|
|
||||||
for "_index" from 0 to 9 do {
|
|
||||||
_ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _index);
|
|
||||||
_ctrlInteractionDialog ctrlShow true;
|
|
||||||
|
|
||||||
_ctrlInteractionDialogIcon = _dlgInteractionDialog displayCtrl (20 + _index);
|
|
||||||
|
|
||||||
if (_index < _count) then {
|
|
||||||
_action = GVAR(Buttons) select _index;
|
|
||||||
_ctrlInteractionDialog ctrlSetText (_action select 0);
|
|
||||||
_ctrlInteractionDialog ctrlEnable (call (_action select 2));
|
|
||||||
|
|
||||||
_ctrlInteractionDialogIcon ctrlSetText (_action select 5);
|
|
||||||
} else {
|
|
||||||
_ctrlInteractionDialog ctrlSetText "";
|
|
||||||
_ctrlInteractionDialog ctrlEnable false;
|
|
||||||
|
|
||||||
_ctrlInteractionDialogIcon ctrlSetText "";
|
|
||||||
};
|
|
||||||
};
|
|
@ -1,21 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* Author: PabstMirror
|
* Author: PabstMirror
|
||||||
* Test if can Become Leader of group
|
* Test if can Become Leader of group.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Target <OBJECT>
|
* 1: Unit <OBJECT>
|
||||||
* 1: Player <OBJECT>
|
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Able to become leader of group <BOOL>
|
* Able to become leader of group <BOOL>
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [player, player] call ace_interaction_fnc_canBecomeLeader
|
* [player] call ace_interaction_fnc_canBecomeLeader
|
||||||
*
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
PARAMS_2(_target,_player);
|
params ["_unit"];
|
||||||
|
|
||||||
(count (units group _player) > 1) && {leader group _player != _player}
|
count units group _unit > 1 && {leader group _unit != _unit}
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
/*
|
/*
|
||||||
* Author: commy2
|
* Author: commy2
|
||||||
* Checks if the player can interact with civilian
|
* Checks if the unit can interact with civilian
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Target <OBJECT>
|
* 0: Unit <OBJECT>
|
||||||
|
* 1: Target <OBJECT>
|
||||||
|
* 2: Target has to be on the civilian side (default: true) <BOOL>
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return Value:
|
||||||
* Able to interact with civilian <BOOL>
|
* Able to interact with civilian <BOOL>
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
@ -15,10 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
EXPLODE_2_PVT(_this,_unit,_isCivilian);
|
params ["_unit", "_target", ["_isCivilian", true]];
|
||||||
|
|
||||||
if (isNil "_isCivilian") then {_isCivilian = true};
|
alive _target && [side _target != side _unit, side group _target == civilian] select _isCivilian // return
|
||||||
|
|
||||||
alive _unit
|
|
||||||
&& [side _unit != side ACE_player, side group _unit == civilian] select _isCivilian
|
|
||||||
//&& {count (weapons _unit) == 0}
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
* Author: commy2
|
* Author: commy2
|
||||||
* Checks if the player can join a group
|
* Checks if the unit can join a group
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Player <OBJECT>
|
* 0: Unit <OBJECT>
|
||||||
* 1: Target <OBJECT>
|
* 1: Target <OBJECT>
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return Value:
|
||||||
* Able to join a group <BOOL>
|
* Able to join a group <BOOL>
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
@ -16,9 +16,9 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
PARAMS_2(_unit,_target);
|
params ["_unit", "_target"];
|
||||||
|
|
||||||
alive _target
|
alive _target
|
||||||
&& {!(_target getVariable ["ACE_isUnconscious", false])}
|
&& {!(_target getVariable ["ACE_isUnconscious", false])}
|
||||||
&& {side group _unit == side group _target}
|
&& {side group _unit == side group _target}
|
||||||
&& {group _unit != group _target}
|
&& {group _unit != group _target} // return
|
||||||
|
20
addons/interaction/functions/fnc_canPardon.sqf
Normal file
20
addons/interaction/functions/fnc_canPardon.sqf
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* Author: commy2
|
||||||
|
* Checks if the unit can pardon the target.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: Unit <OBJECT>
|
||||||
|
* 1: Target <OBJECT>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* Unit can pardon target <BOOL>
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
params ["_unit", "_target"];
|
||||||
|
|
||||||
|
alive _target
|
||||||
|
&& {rating _target < -2000}
|
||||||
|
&& {side group _unit == side group _target}
|
@ -1,12 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
* Author: commy2
|
* Author: commy2
|
||||||
* Checks if the player can tap a shoulder
|
* Checks if the player can tap a shoulder.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Player <OBJECT>
|
* 0: Player <OBJECT>
|
||||||
* 1: Target <OBJECT>
|
* 1: Target <OBJECT>
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return Value:
|
||||||
* Able to tap a shoulder <BOOL>
|
* Able to tap a shoulder <BOOL>
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
@ -16,9 +16,9 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
PARAMS_2(_unit,_target);
|
params ["_unit", "_target"];
|
||||||
|
|
||||||
_target isKindOf "CAManBase" &&
|
_target isKindOf "CAManBase" &&
|
||||||
{alive _target} &&
|
{alive _target} &&
|
||||||
{_unit distance _target < 4} &&
|
{_unit distance _target < 4} &&
|
||||||
{!(_target getVariable ["ACE_isUnconscious", false])}
|
{!(_target getVariable ["ACE_isUnconscious", false])} // return
|
||||||
|
@ -1,21 +1,20 @@
|
|||||||
/*
|
/*
|
||||||
* Author: PabstMirror
|
* Author: PabstMirror
|
||||||
* Become Leader of group
|
* Become Leader of group.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Target <OBJECT>
|
* 0: Unit <OBJECT>
|
||||||
* 1: Player <OBJECT>
|
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [player, player] call ace_interaction_fnc_doBecomeLeader
|
* [player] call ace_interaction_fnc_doBecomeLeader
|
||||||
*
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
PARAMS_2(_target,_player);
|
params ["_unit"];
|
||||||
|
|
||||||
[QGVAR(selectLeader), (units group _player), [(group _player), _player]] call EFUNC(common,targetEvent);
|
["selectLeader", units group _unit, [group _unit, _unit]] call EFUNC(common,targetEvent);
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
* Author: commy2
|
* Author: commy2
|
||||||
* Get door
|
* Find door.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Distance <NUMBER>
|
* 0: Distance <NUMBER>
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return Value:
|
||||||
* House objects and door <ARRAY>
|
* House objects and door <ARRAY>
|
||||||
* 0: House <OBJECT>
|
* 0: House <OBJECT>
|
||||||
* 1: Door Name <STRING>
|
* 1: Door Name <STRING>
|
||||||
@ -17,19 +17,18 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
PARAMS_1(_distance);
|
params ["_distance"];
|
||||||
|
|
||||||
private ["_position0", "_position1", "_intersections", "_count", "_house", "_door"];
|
private ["_position0", "_position1", "_intersections", "_house", "_door"];
|
||||||
|
|
||||||
_position0 = positionCameraToWorld [0, 0, 0];
|
_position0 = positionCameraToWorld [0, 0, 0];
|
||||||
_position1 = positionCameraToWorld [0, 0, _distance];
|
_position1 = positionCameraToWorld [0, 0, _distance];
|
||||||
|
|
||||||
_intersections = lineIntersectsWith [ATLToASL _position0, ATLToASL _position1, objNull, objNull, true];
|
_intersections = lineIntersectsSurfaces [AGLToASL _position0, AGLToASL _position1, cameraOn, objNull, true, 1, "GEOM"];
|
||||||
|
|
||||||
_count = count _intersections;
|
if (_intersections isEqualTo []) exitWith {[objNull, ""]};
|
||||||
if (_count == 0) exitWith {[objNull, ""]};
|
|
||||||
|
|
||||||
_house = _intersections select (_count - 1);
|
_house = _intersections select 0 select 2;
|
||||||
|
|
||||||
// shithouse is bugged
|
// shithouse is bugged
|
||||||
if (typeOf _house == "") exitWith {[objNull, ""]};
|
if (typeOf _house == "") exitWith {[objNull, ""]};
|
||||||
@ -37,6 +36,7 @@ if (typeOf _house == "") exitWith {[objNull, ""]};
|
|||||||
_intersections = [_house, "GEOM"] intersect [_position0, _position1];
|
_intersections = [_house, "GEOM"] intersect [_position0, _position1];
|
||||||
|
|
||||||
_door = _intersections select 0 select 0;
|
_door = _intersections select 0 select 0;
|
||||||
|
|
||||||
if (isNil "_door") exitWith {[_house, ""]};
|
if (isNil "_door") exitWith {[_house, ""]};
|
||||||
|
|
||||||
[_house, _door]
|
[_house, _door]
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user