mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
manual merge
This commit is contained in:
commit
31db62a85d
13
.editorconfig
Normal file
13
.editorconfig
Normal file
@ -0,0 +1,13 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = crlf
|
||||
insert_final_newline = true
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
14
README.md
14
README.md
@ -1,21 +1,23 @@
|
||||
<p align="center">
|
||||
<img src="https://raw.githubusercontent.com/KoffeinFlummi/ACE3/new-readme/extras/logo.png?token=ACU2mWeJUeshQIVc52XPoNiPpc3PzTauks5Uv24rwA%3D%3D" height="150px" /><br />
|
||||
<img src="https://github.com/KoffeinFlummi/ACE3/blob/master/extras/assets/logo/black/ACE3-Logo.jpg" height="80" />
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://github.com/KoffeinFlummi/ACE3/releases">
|
||||
<img src="http://img.shields.io/badge/release-3.0-green.svg?style=flat" alt="ACE version">
|
||||
</a>
|
||||
<a href="#">
|
||||
<a href="#">
|
||||
<img src="http://img.shields.io/badge/download-22_MB-blue.svg?style=flat" alt="ACE download">
|
||||
</a>
|
||||
<a href="https://github.com/KoffeinFlummi/ACE3/issues">
|
||||
<a href="https://github.com/KoffeinFlummi/ACE3/issues">
|
||||
<img src="http://img.shields.io/github/issues/KoffeinFlummi/ACE3.svg?style=flat" alt="ACE issues">
|
||||
</a>
|
||||
<a href="https://github.com/KoffeinFlummi/ACE3/blob/master/LICENSE">
|
||||
<a href="https://github.com/KoffeinFlummi/ACE3/blob/master/LICENSE">
|
||||
<img src="http://img.shields.io/badge/license-GPLv2-red.svg?style=flat" alt="ACE license">
|
||||
</a>
|
||||
</p>
|
||||
<p align="center"><sup><strong>Requires the latest version of <a href="http://www.armaholic.com/page.php?id=18767">CBA A3</a> | <a href="#">BIF thread</a></strong></sup></p>
|
||||
|
||||
**ACE 3** is a join effort by the teams behind **ACE 2**, **AGM**, **CSE** and **RHS** to improve the realism and authenticity of Arma 3.
|
||||
**ACE 3** is a joint effort by the teams behind **ACE2**, **AGM** and **CSE** to improve the realism and authenticity of Arma 3.
|
||||
|
||||
This mod is entirely **open-source**, and everyone is free to propose changes or maintain their own, customized version as long as they make their changes open to the public in accordance with the GNU General Public License (for more information check the license file attached to this project).
|
||||
|
||||
@ -32,7 +34,7 @@ More information on the purpose of the different components of ACE and which one
|
||||
* Realistic ballistics including wind and humidity
|
||||
* Backblast simulation
|
||||
* Weapon resting and bipod deployment
|
||||
* A fire control system for armored vehicles and helicopters
|
||||
* A fire control system for armored vehicles and helicopters
|
||||
***and more...***
|
||||
|
||||
For a full list of current features, check [the official wiki](https://github.com/KoffeinFlummi/ACE3/wiki).
|
||||
|
@ -1,98 +0,0 @@
|
||||
/**
|
||||
* fn_moduleAmbianceSoundLoop.sqf
|
||||
* @Descr: N/A
|
||||
* @Author: Glowbal
|
||||
*
|
||||
* @Arguments: []
|
||||
* @Return:
|
||||
* @PublicAPI: false
|
||||
*/
|
||||
|
||||
private ["_logic", "_units", "_activated","_ambianceSounds", "_soundFiles", "_minimalDistance","_maximalDistance", "_minimalDistance", "_maxDelayBetweenSounds", "_allUnits", "_newPos", "_targetUnit", "_soundToPlay", "_soundPath", "_unparsedSounds", "_list", "_splittedList", "_nilCheckPassedList"];
|
||||
_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param;
|
||||
_units = [_this,1,[],[[]]] call BIS_fnc_param;
|
||||
_activated = [_this,2,true,[true]] call BIS_fnc_param;
|
||||
|
||||
if (_activated && isServer) then {
|
||||
_ambianceSounds = [];
|
||||
_unparsedSounds = _logic getvariable ["soundFiles", ""];
|
||||
_minimalDistance = (_logic getvariable ["minimalDistance", 400]) max 1;
|
||||
_maximalDistance = (_logic getvariable ["maximalDistance", 10]) max _minimalDistance;
|
||||
_minDelayBetweensounds = (_logic getvariable ["minimalDelay", 10]) max 1;
|
||||
_maxDelayBetweenSounds = (_logic getvariable ["maximalDelay", 170]) max _minDelayBetweensounds;
|
||||
_volume = (_logic getvariable ["soundVolume", 30]) max 1;
|
||||
_followPlayers = _logic getvariable ["followPlayers", false];
|
||||
|
||||
_splittedList = [_unparsedSounds, ","] call BIS_fnc_splitString;
|
||||
|
||||
_nilCheckPassedList = "";
|
||||
{
|
||||
_x = [_x] call cse_fnc_string_removeWhiteSpace;
|
||||
_splittedList set [_foreachIndex, _x];
|
||||
}foreach _splittedList;
|
||||
|
||||
_soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString;
|
||||
{
|
||||
if (isclass (missionConfigFile >> "CfgSounds" >> _x)) then {
|
||||
_ambianceSounds pushback (_soundPath + (getArray(missionConfigFile >> "CfgSounds" >> _x >> "sound") select 0));
|
||||
} else {
|
||||
if (isclass (configFile >> "CfgSounds" >> _x)) then {
|
||||
_ambianceSounds pushback ((getArray(configFile >> "CfgSounds" >> _x >> "sound") select 0));
|
||||
};
|
||||
};
|
||||
}foreach _splittedList;
|
||||
|
||||
if (count _ambianceSounds == 0) exitwith {
|
||||
[format["No Ambiance sounds available"]] call cse_fnc_debug;
|
||||
};
|
||||
{
|
||||
if !([".", _x, true] call BIS_fnc_inString) then {
|
||||
[format["Ambiance soundfile does not contain a file extension %1", _x]] call cse_fnc_debug;
|
||||
_ambianceSounds set [_foreachIndex, _x + ".wss"];
|
||||
};
|
||||
}foreach _ambianceSounds;
|
||||
[format["Ambiance sounds %1", _ambianceSounds]] call cse_fnc_debug;
|
||||
|
||||
while {alive _logic} do {
|
||||
_allUnits = switch (true) do {
|
||||
case isMultiplayer: {playableUnits};
|
||||
case isDedicated: {[_logic]};
|
||||
default {[player]};
|
||||
};
|
||||
|
||||
if (count _allUnits > 0) then {
|
||||
_targetUnit = _allUnits select (round(random((count _allUnits)-1)));
|
||||
|
||||
_newPos = (getPos _targetUnit);
|
||||
if (!_followPlayers) then {
|
||||
_newPos = getPos _logic;
|
||||
};
|
||||
|
||||
if (random(1) >= 0.5) then {
|
||||
if (random(1) >= 0.5) then {
|
||||
_newPos set [0, (_newPos select 0) + (_minimalDistance + random(_maximalDistance))];
|
||||
} else {
|
||||
_newPos set [0, (_newPos select 0) - (_minimalDistance + random(_maximalDistance))];
|
||||
};
|
||||
} else {
|
||||
if (random(1) >= 0.5) then {
|
||||
_newPos set [1, (_newPos select 1) + (_minimalDistance + random(_maximalDistance))];
|
||||
} else {
|
||||
_newPos set [1, (_newPos select 1) - (_minimalDistance + random(_maximalDistance))];
|
||||
};
|
||||
};
|
||||
|
||||
if ({(_newPos distance _x < (_minimalDistance / 2))}count _allUnits == 0) then {
|
||||
|
||||
_soundToPlay = _ambianceSounds select (round(random((count _ambianceSounds)-1)));
|
||||
playSound3D [_soundToPlay, _targetUnit, false, _newPos, _volume, 1, 1000];
|
||||
|
||||
[format["Played a sound %1", _soundToPlay]] call cse_fnc_debug;
|
||||
|
||||
sleep (_minDelayBetweensounds + random(_maxDelayBetweenSounds)) min _maxDelayBetweenSounds;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
true;
|
BIN
ace_fcs.dll
BIN
ace_fcs.dll
Binary file not shown.
@ -217,9 +217,8 @@ class CfgVehicles {
|
||||
};*/
|
||||
};
|
||||
|
||||
class I_Heli_Transport_02_F: Heli_Transport_02_base_F {};
|
||||
|
||||
class I_Heli_light_03_base_F: Helicopter_Base_F {
|
||||
class Heli_light_03_base_F: Helicopter_Base_F {};
|
||||
class I_Heli_light_03_base_F: Heli_light_03_base_F {
|
||||
lockDetectionSystem = 0;
|
||||
incomingMissileDetectionSystem = 16;
|
||||
driverCanEject = 1;
|
||||
@ -242,15 +241,15 @@ class CfgVehicles {
|
||||
};
|
||||
};
|
||||
|
||||
class I_Heli_light_03_F: I_Heli_light_03_base_F {
|
||||
class I_Heli_light_03_F: Heli_light_03_base_F {
|
||||
class Turrets: Turrets {
|
||||
class MainTurret: MainTurret {};
|
||||
};
|
||||
};
|
||||
|
||||
class I_Heli_light_03_unarmed_base_F: I_Heli_light_03_base_F {};
|
||||
class Heli_light_03_unarmed_base_F: Heli_light_03_base_F {};
|
||||
|
||||
class I_Heli_light_03_unarmed_F: I_Heli_light_03_unarmed_base_F {};
|
||||
class I_Heli_light_03_unarmed_F: Heli_light_03_unarmed_base_F {};
|
||||
|
||||
class Plane_CAS_01_base_F: Plane_Base_F {
|
||||
lockDetectionSystem = 12;
|
||||
@ -303,7 +302,8 @@ class CfgVehicles {
|
||||
};*/
|
||||
};
|
||||
|
||||
class B_Heli_Transport_03_base_F: Helicopter_Base_H {
|
||||
class Heli_Transport_03_base_F: Helicopter_Base_H {};
|
||||
class B_Heli_Transport_03_base_F: Heli_Transport_03_base_F {
|
||||
lockDetectionSystem = 12;
|
||||
incomingMissileDetectionSystem = 16;
|
||||
driverCanEject = 1;
|
||||
@ -317,7 +317,7 @@ class CfgVehicles {
|
||||
};
|
||||
};
|
||||
|
||||
class B_Heli_Transport_03_unarmed_base_F: B_Heli_Transport_03_base_F {
|
||||
class B_Heli_Transport_03_unarmed_base_F: Heli_Transport_03_base_F {
|
||||
class Turrets: Turrets {
|
||||
class CopilotTurret: CopilotTurret {
|
||||
canEject = 1;
|
||||
|
@ -1,25 +1,27 @@
|
||||
|
||||
#define MACRO_ATTACHTOVEHICLE \
|
||||
class ACE_Actions { \
|
||||
class GVAR(AttachVehicle) { \
|
||||
displayName = "$STR_ACE_Attach_AttachDetach"; \
|
||||
condition = QUOTE(([ARR_3(_player, _target, '')] call FUNC(canAttach))); \
|
||||
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(openAttachUI);); \
|
||||
exceptions[] = {"ACE_Drag_isNotDragging"}; \
|
||||
showDisabled = 0; \
|
||||
priority = 0; \
|
||||
icon = PATHTOF(UI\attach_ca.paa); \
|
||||
distance = 4; \
|
||||
}; \
|
||||
class GVAR(DetachVehicle) { \
|
||||
displayName = "$STR_ACE_Attach_Detach"; \
|
||||
condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canDetach))); \
|
||||
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(detach) ); \
|
||||
exceptions[] = {"ACE_Drag_isNotDragging"}; \
|
||||
showDisabled = 0; \
|
||||
priority = 0; \
|
||||
icon = PATHTOF(UI\detach_ca.paa); \
|
||||
distance = 4; \
|
||||
class ACE_MainActions { \
|
||||
class GVAR(AttachVehicle) { \
|
||||
displayName = "$STR_ACE_Attach_AttachDetach"; \
|
||||
condition = QUOTE(([ARR_3(_player, _target, '')] call FUNC(canAttach))); \
|
||||
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(openAttachUI);); \
|
||||
exceptions[] = {"ACE_Drag_isNotDragging"}; \
|
||||
showDisabled = 0; \
|
||||
priority = 0; \
|
||||
icon = PATHTOF(UI\attach_ca.paa); \
|
||||
distance = 4; \
|
||||
}; \
|
||||
class GVAR(DetachVehicle) { \
|
||||
displayName = "$STR_ACE_Attach_Detach"; \
|
||||
condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canDetach))); \
|
||||
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(detach) ); \
|
||||
exceptions[] = {"ACE_Drag_isNotDragging"}; \
|
||||
showDisabled = 0; \
|
||||
priority = 0; \
|
||||
icon = PATHTOF(UI\detach_ca.paa); \
|
||||
distance = 4; \
|
||||
}; \
|
||||
}; \
|
||||
};
|
||||
|
||||
|
@ -62,6 +62,5 @@ _attachables = items _unit;
|
||||
},
|
||||
{
|
||||
call EFUNC(interaction,hideMenu);
|
||||
if !(profileNamespace getVariable [QEGVAR(interaction,AutoCloseMenu), false]) then {"Default" call EFUNC(interaction,openMenuSelf)};
|
||||
}
|
||||
] call EFUNC(interaction,openSelectMenu);
|
||||
|
1
addons/backpacks/$PBOPREFIX$
Normal file
1
addons/backpacks/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\backpacks
|
@ -5,6 +5,12 @@ class Extended_PreInit_EventHandlers {
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_InventoryOpened_EventHandlers {
|
||||
class CAManBase {
|
||||
class GVAR(onOpenInventory) {
|
3
addons/backpacks/XEH_postInit.sqf
Normal file
3
addons/backpacks/XEH_postInit.sqf
Normal file
@ -0,0 +1,3 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
["backpackOpened", {_this call FUNC(backpackOpened)}] call EFUNC(common,addEventHandler);
|
@ -2,6 +2,7 @@
|
||||
|
||||
ADDON = false;
|
||||
|
||||
PREP(backpackOpened);
|
||||
PREP(getBackpackAssignedUnit);
|
||||
PREP(isBackpack);
|
||||
PREP(onOpenInventory);
|
@ -5,7 +5,7 @@ class CfgPatches {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common","ace_interaction"};
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author[] = {"bux","commy2"};
|
||||
authorUrl = "https://github.com/commy2/";
|
||||
VERSION_CONFIG;
|
||||
@ -13,4 +13,3 @@ class CfgPatches {
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgVehicles.hpp"
|
51
addons/backpacks/functions/fnc_backpackOpened.sqf
Normal file
51
addons/backpacks/functions/fnc_backpackOpened.sqf
Normal file
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Someone opened your backpack. Execute locally.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Who accessed your inventory? (Object)
|
||||
* 1: Unit that wields the backpack (Object)
|
||||
* 2: The backpack object (Object)
|
||||
*
|
||||
* Return value:
|
||||
* None.
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_target"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_target = _this select 1;
|
||||
_backpack = _this select 2;
|
||||
|
||||
// do cam shake if the target is the player
|
||||
if ([_target] call EFUNC(common,isPlayer)) then {
|
||||
addCamShake [4, 0.5, 5];
|
||||
};
|
||||
|
||||
// play a rustling sound
|
||||
private ["_sounds", "_position"];
|
||||
|
||||
_sounds = [
|
||||
/*"a3\sounds_f\characters\ingame\AinvPknlMstpSlayWpstDnon_medic.wss",
|
||||
"a3\sounds_f\characters\ingame\AinvPknlMstpSlayWrflDnon_medic.wss",
|
||||
"a3\sounds_f\characters\ingame\AinvPpneMstpSlayWpstDnon_medic.wss",
|
||||
"a3\sounds_f\characters\ingame\AinvPpneMstpSlayWrflDnon_medic.wss"*/
|
||||
|
||||
QUOTE(PATHTO_R(sounds\zip_in.wav)),
|
||||
QUOTE(PATHTO_R(sounds\zip_out.wav))
|
||||
];
|
||||
|
||||
_position = _target modelToWorld (_target selectionPosition "Spine3");
|
||||
_position = _position call EFUNC(common,positionToASL);
|
||||
|
||||
playSound3D [
|
||||
_sounds select floor random count _sounds,
|
||||
objNull,
|
||||
false,
|
||||
_position,
|
||||
1,
|
||||
1,
|
||||
50
|
||||
];
|
30
addons/backpacks/functions/fnc_onOpenInventory.sqf
Normal file
30
addons/backpacks/functions/fnc_onOpenInventory.sqf
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Handle the open inventory event. Display message on traget client.
|
||||
*
|
||||
* Argument:
|
||||
* Input from "InventoryOpened" eventhandler
|
||||
*
|
||||
* Return value:
|
||||
* false. Always open the inventory dialog. (Bool)
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_backpack"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_backpack = _this select 1;
|
||||
|
||||
// exit if the target is not a backpack
|
||||
if !([_backpack] call FUNC(isBackpack)) exitWith {};
|
||||
|
||||
// get the unit that wears the backpack object
|
||||
private "_target";
|
||||
_target = [_backpack] call FUNC(getBackpackAssignedUnit);
|
||||
|
||||
// raise event on target unit
|
||||
["backpackOpened", _target, [_unit, _target, _backpack]] call EFUNC(common,targetEvent);
|
||||
|
||||
// return false to open inventory as usual
|
||||
false
|
1
addons/backpacks/functions/script_component.hpp
Normal file
1
addons/backpacks/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
||||
#include "\z\ace\addons\backpacks\script_component.hpp"
|
12
addons/backpacks/script_component.hpp
Normal file
12
addons/backpacks/script_component.hpp
Normal file
@ -0,0 +1,12 @@
|
||||
#define COMPONENT backpacks
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
#ifdef DEBUG_ENABLED_BACKPACKS
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_ENABLED_BACKPACKS
|
||||
#define DEBUG_SETTINGS DEBUG_ENABLED_BACKPACKS
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
BIN
addons/backpacks/sounds/zip_in.wav
Normal file
BIN
addons/backpacks/sounds/zip_in.wav
Normal file
Binary file not shown.
BIN
addons/backpacks/sounds/zip_out.wav
Normal file
BIN
addons/backpacks/sounds/zip_out.wav
Normal file
Binary file not shown.
@ -9,7 +9,6 @@ class Extended_PostInit_EventHandlers {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||
};
|
||||
};
|
||||
|
||||
//release escorted captive when entering a vehicle
|
||||
class Extended_GetIn_EventHandlers {
|
||||
class All {
|
||||
@ -18,7 +17,6 @@ class Extended_GetIn_EventHandlers {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
//reset captive animation after leaving vehicle
|
||||
class Extended_GetOut_EventHandlers {
|
||||
class All {
|
||||
@ -27,7 +25,6 @@ class Extended_GetOut_EventHandlers {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
//reset captivity and escorting status when getting killed
|
||||
class Extended_Killed_EventHandlers {
|
||||
class CAManBase {
|
||||
@ -36,7 +33,6 @@ class Extended_Killed_EventHandlers {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
//mission start
|
||||
class Extended_InitPost_EventHandlers {
|
||||
class CAManBase {
|
||||
@ -45,4 +41,3 @@ class Extended_InitPost_EventHandlers {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -72,7 +72,7 @@ class CfgMovesMaleSdr: CfgMovesBasic {
|
||||
InterpolateTo[] = {"Unconscious",0.01};
|
||||
};
|
||||
class ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon {
|
||||
speed = 0.333; //for gameplay reasons, slow this down
|
||||
speed = 0.5; //for gameplay reasons, slow this down
|
||||
actions = "CivilStandActions";
|
||||
file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\sur\non\AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon";
|
||||
ConnectTo[] = {"AmovPercMstpSnonWnonDnon",0.1};
|
||||
|
@ -2,70 +2,70 @@ class CfgVehicles {
|
||||
class Man;
|
||||
class CAManBase: Man {
|
||||
class ACE_Actions {
|
||||
|
||||
class ACE_ApplyHandcuffs {
|
||||
displayName = "$STR_ACE_Captives_SetCaptive";
|
||||
distance = 4;
|
||||
selection = "righthand";
|
||||
distance = 2;
|
||||
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canApplyHandcuffs));
|
||||
statement = QUOTE([ARR_2(_player, _target)] call FUNC(doApplyHandcuffs));
|
||||
exceptions[] = {};
|
||||
showDisabled = 0;
|
||||
priority = 2.4;
|
||||
icon = QUOTE(PATHTOF(UI\handcuff_ca.paa));
|
||||
hotkey = "C";
|
||||
};
|
||||
class ACE_RemoveHandcuffs {
|
||||
displayName = "$STR_ACE_Captives_ReleaseCaptive";
|
||||
distance = 4;
|
||||
selection = "righthand";
|
||||
distance = 2;
|
||||
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs));
|
||||
statement = QUOTE([ARR_2(_player, _target)] call FUNC(doRemoveHandcuffs));
|
||||
exceptions[] = {};
|
||||
showDisabled = 0;
|
||||
priority = 2.4;
|
||||
icon = QUOTE(PATHTOF(UI\handcuff_ca.paa));
|
||||
hotkey = "R";
|
||||
};
|
||||
class ACE_EscortCaptive {
|
||||
displayName = "$STR_ACE_Captives_EscortCaptive";
|
||||
distance = 4;
|
||||
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canEscortCaptive));
|
||||
statement = QUOTE([ARR_3(_player, _target, true)] call FUNC(doEscortCaptive));
|
||||
exceptions[] = {};
|
||||
showDisabled = 0;
|
||||
icon = QUOTE(PATHTOF(UI\captive_ca.paa));
|
||||
priority = 2.3;
|
||||
hotkey = "E";
|
||||
};
|
||||
class ACE_StopEscorting {
|
||||
displayName = "$STR_ACE_Captives_StopEscorting";
|
||||
distance = 4;
|
||||
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canStopEscorting));
|
||||
statement = QUOTE([ARR_3(_player,_target, false)] call FUNC(doEscortCaptive));
|
||||
exceptions[] = {QGVAR(isNotEscorting)};
|
||||
showDisabled = 0;
|
||||
icon = QUOTE(PATHTOF(UI\captive_ca.paa));
|
||||
priority = 2.3;
|
||||
hotkey = "E";
|
||||
};
|
||||
class ACE_LoadCaptive {
|
||||
displayName = "$STR_ACE_Captives_LoadCaptive";
|
||||
distance = 4;
|
||||
condition = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(canLoadCaptive));
|
||||
statement = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(doLoadCaptive));
|
||||
exceptions[] = {QGVAR(isNotEscorting)};
|
||||
showDisabled = 0;
|
||||
icon = QUOTE(PATHTOF(UI\captive_ca.paa));
|
||||
priority = 2.2;
|
||||
hotkey = "L";
|
||||
};
|
||||
class ACE_FriskPerson {
|
||||
displayName = "$STR_ACE_Captives_FriskPerson";
|
||||
distance = 2;
|
||||
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canFriskPerson));
|
||||
statement = QUOTE([ARR_2(_player, _target)] call FUNC(doFriskPerson));
|
||||
showDisabled = 0;
|
||||
//icon = ""; //@todo
|
||||
priority = 3;
|
||||
hotkey = "F";
|
||||
|
||||
class ACE_MainActions {
|
||||
class ACE_EscortCaptive {
|
||||
displayName = "$STR_ACE_Captives_EscortCaptive";
|
||||
distance = 4;
|
||||
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canEscortCaptive));
|
||||
statement = QUOTE([ARR_3(_player, _target, true)] call FUNC(doEscortCaptive));
|
||||
exceptions[] = {};
|
||||
showDisabled = 0;
|
||||
icon = QUOTE(PATHTOF(UI\captive_ca.paa));
|
||||
priority = 2.3;
|
||||
hotkey = "E";
|
||||
};
|
||||
class ACE_StopEscorting {
|
||||
displayName = "$STR_ACE_Captives_StopEscorting";
|
||||
distance = 4;
|
||||
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canStopEscorting));
|
||||
statement = QUOTE([ARR_3(_player,_target, false)] call FUNC(doEscortCaptive));
|
||||
exceptions[] = {QGVAR(isNotEscorting)};
|
||||
showDisabled = 0;
|
||||
icon = QUOTE(PATHTOF(UI\captive_ca.paa));
|
||||
priority = 2.3;
|
||||
hotkey = "E";
|
||||
};
|
||||
class ACE_LoadCaptive {
|
||||
displayName = "$STR_ACE_Captives_LoadCaptive";
|
||||
distance = 4;
|
||||
condition = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(canLoadCaptive));
|
||||
statement = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(doLoadCaptive));
|
||||
exceptions[] = {QGVAR(isNotEscorting)};
|
||||
showDisabled = 0;
|
||||
icon = QUOTE(PATHTOF(UI\captive_ca.paa));
|
||||
priority = 2.2;
|
||||
hotkey = "L";
|
||||
};
|
||||
class ACE_FriskPerson {
|
||||
displayName = "$STR_ACE_Captives_FriskPerson";
|
||||
distance = 2;
|
||||
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canFriskPerson));
|
||||
statement = QUOTE([ARR_2(_player, _target)] call FUNC(doFriskPerson));
|
||||
showDisabled = 0;
|
||||
//icon = ""; //@todo
|
||||
priority = 3;
|
||||
hotkey = "F";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -82,7 +82,7 @@ class CfgVehicles {
|
||||
class ACE_StartSurrenderingSelf {
|
||||
displayName = "$STR_ACE_Captives_StartSurrendering";
|
||||
condition = QUOTE([ARR_2(_player, true)] call FUNC(canSurrender));
|
||||
statement = QUOTE([ARR_2(_player, true)] call FUNC(surrender));
|
||||
statement = QUOTE([ARR_2(_player, true)] call FUNC(setSurrendered));
|
||||
exceptions[] = {};
|
||||
showDisabled = 0;
|
||||
priority = 0;
|
||||
@ -90,7 +90,7 @@ class CfgVehicles {
|
||||
class ACE_StopSurrenderingSelf {
|
||||
displayName = "$STR_ACE_Captives_StopSurrendering";
|
||||
condition = QUOTE([ARR_2(_player, false)] call FUNC(canSurrender));
|
||||
statement = QUOTE([ARR_2(_player, false)] call FUNC(surrender));
|
||||
statement = QUOTE([ARR_2(_player, false)] call FUNC(setSurrendered));
|
||||
exceptions[] = {QGVAR(isNotSurrendering)};
|
||||
showDisabled = 0;
|
||||
priority = 0;
|
||||
@ -100,24 +100,27 @@ class CfgVehicles {
|
||||
|
||||
#define MACRO_LOADUNLOADCAPTIVE \
|
||||
class ACE_Actions { \
|
||||
class ACE_LoadCaptive { \
|
||||
displayName = "$STR_ACE_Captives_LoadCaptive"; \
|
||||
distance = 4; \
|
||||
condition = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(canLoadCaptive)); \
|
||||
statement = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(doLoadCaptive)); \
|
||||
exceptions[] = {QGVAR(isNotEscorting)}; \
|
||||
showDisabled = 0; \
|
||||
priority = 1.2; \
|
||||
hotkey = "L"; \
|
||||
}; \
|
||||
class ACE_UnloadCaptive { \
|
||||
displayName = "$STR_ACE_Captives_UnloadCaptive"; \
|
||||
distance = 4; \
|
||||
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canUnloadCaptive)); \
|
||||
statement = QUOTE([ARR_2(_player, _target)] call FUNC(doUnloadCaptive)); \
|
||||
showDisabled = 0; \
|
||||
priority = 1.2; \
|
||||
hotkey = "C"; \
|
||||
class ACE_MainActions { \
|
||||
selection = ""; \
|
||||
class ACE_LoadCaptive { \
|
||||
displayName = "$STR_ACE_Captives_LoadCaptive"; \
|
||||
distance = 4; \
|
||||
condition = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(canLoadCaptive)); \
|
||||
statement = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(doLoadCaptive)); \
|
||||
exceptions[] = {QGVAR(isNotEscorting)}; \
|
||||
showDisabled = 0; \
|
||||
priority = 1.2; \
|
||||
hotkey = "L"; \
|
||||
}; \
|
||||
class ACE_UnloadCaptive { \
|
||||
displayName = "$STR_ACE_Captives_UnloadCaptive"; \
|
||||
distance = 4; \
|
||||
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canUnloadCaptive)); \
|
||||
statement = QUOTE([ARR_2(_player, _target)] call FUNC(doUnloadCaptive)); \
|
||||
showDisabled = 0; \
|
||||
priority = 1.2; \
|
||||
hotkey = "C"; \
|
||||
}; \
|
||||
}; \
|
||||
};
|
||||
|
||||
@ -151,15 +154,10 @@ class CfgVehicles {
|
||||
MACRO_LOADUNLOADCAPTIVE
|
||||
};
|
||||
|
||||
#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
|
||||
name = #ITEM; \
|
||||
count = COUNT; \
|
||||
};
|
||||
|
||||
class Box_NATO_Support_F;
|
||||
class ACE_Box_Misc: Box_NATO_Support_F {
|
||||
class TransportItems {
|
||||
MACRO_ADDITEM(ACE_CableTie,12)
|
||||
MACRO_ADDITEM(ACE_CableTie,12);
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -1,12 +1,9 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
|
||||
["MoveInCaptive", {_this call FUNC(vehicleCaptiveMoveIn)}] call EFUNC(common,addEventHandler);
|
||||
["MoveOutCaptive", {_this call FUNC(vehicleCaptiveMoveOut)}] call EFUNC(common,addEventHandler);
|
||||
["SetHandcuffed", {_this call FUNC(setHandcuffed)}] call EFUNC(common,addEventHandler);
|
||||
|
||||
//Handles when someone starts escorting and then disconnects, leaving the captive attached
|
||||
//This is normaly handled by the PFEH in doEscortCaptive, but that won't be running if they DC
|
||||
|
||||
if (isServer) then {
|
||||
addMissionEventHandler ["HandleDisconnect", {
|
||||
PARAMS_1(_disconnectedPlayer);
|
||||
@ -21,12 +18,20 @@ if (isServer) then {
|
||||
}];
|
||||
};
|
||||
|
||||
//TODO: Medical Integration Events???
|
||||
["playerVehicleChanged", {_this call FUNC(handleVehicleChanged)}] call EFUNC(common,addEventHandler);
|
||||
["zeusDisplayChanged", {_this call FUNC(handleZeusDisplayChanged)}] call EFUNC(common,addEventHandler);
|
||||
["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
|
||||
["MoveInCaptive", {_this call FUNC(vehicleCaptiveMoveIn)}] call EFUNC(common,addEventHandler);
|
||||
["MoveOutCaptive", {_this call FUNC(vehicleCaptiveMoveOut)}] call EFUNC(common,addEventHandler);
|
||||
|
||||
// [_unit, "knockedOut", {
|
||||
// if (local (_this select 0)) then {_this call ACE_Captives_fnc_handleKnockedOut};
|
||||
// }] call ACE_Core_fnc_addCustomEventhandler;
|
||||
["SetHandcuffed", {_this call FUNC(setHandcuffed)}] call EFUNC(common,addEventHandler);
|
||||
["SetSurrendered", {_this call FUNC(setSurrendered)}] call EFUNC(common,addEventHandler);
|
||||
|
||||
// [_unit, "wokeUp", {
|
||||
// if (local (_this select 0)) then {_this call ACE_Captives_fnc_handleWokeUp};
|
||||
// }] call ACE_Core_fnc_addCustomEventhandler;
|
||||
//Medical Integration Events???
|
||||
["medical_onUnconscious", {_this call ACE_Captives_fnc_handleOnUnconscious}] call EFUNC(common,addEventHandler);
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
["isNotEscorting", {!(GETVAR(_this select 0,GVAR(isEscorting),false))}] call EFUNC(common,addCanInteractWithCondition);
|
||||
["isNotHandcuffed", {!(GETVAR(_this select 0,GVAR(isHandcuffed),false))}] call EFUNC(common,addCanInteractWithCondition);
|
||||
["isNotSurrendering", {!(GETVAR(_this select 0,GVAR(isSurrendering),false))}] call EFUNC(common,addCanInteractWithCondition);
|
||||
|
@ -19,13 +19,13 @@ PREP(doUnloadCaptive);
|
||||
PREP(handleGetIn);
|
||||
PREP(handleGetOut);
|
||||
PREP(handleKilled);
|
||||
PREP(handleKnockedOut);
|
||||
PREP(handleOnUnconscious);
|
||||
PREP(handlePlayerChanged);
|
||||
PREP(handleUnitInitPost);
|
||||
PREP(handleWokeUp);
|
||||
PREP(handleZeusDisplayChanged);
|
||||
PREP(moduleSurrender);
|
||||
PREP(setHandcuffed);
|
||||
PREP(surrender);
|
||||
PREP(setSurrendered);
|
||||
PREP(vehicleCaptiveMoveIn);
|
||||
PREP(vehicleCaptiveMoveOut);
|
||||
|
||||
|
@ -16,16 +16,3 @@ class CfgPatches {
|
||||
#include "CfgMoves.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
#include "CfgWeapons.hpp"
|
||||
|
||||
|
||||
class ACE_canInteractConditions {
|
||||
class GVAR(isNotEscorting) {
|
||||
condition = QUOTE(!(GETVAR(player,QGVAR(isEscorting),false)));
|
||||
};
|
||||
class GVAR(isNotHandcuffed) {
|
||||
condition = QUOTE(!(GETVAR(player,QGVAR(isHandcuffed),false)));
|
||||
};
|
||||
class GVAR(isNotSurrendering) {
|
||||
condition = QUOTE(!(GETVAR(player,QGVAR(isSurrendering),false)));
|
||||
};
|
||||
};
|
||||
|
@ -19,22 +19,10 @@
|
||||
PARAMS_1(_unit);
|
||||
DEFAULT_PARAM(1,_target,objNull);
|
||||
|
||||
private ["_isAttached"];
|
||||
|
||||
if (isNull _target) then {
|
||||
_target = _unit getVariable [QGVAR(escortedUnit), objNull];
|
||||
};
|
||||
|
||||
if (isNull _target) exitWith {
|
||||
ERROR("Null Target (no ACE_escortedUnit)");
|
||||
false
|
||||
};
|
||||
if (isNull _target) exitWith {false};
|
||||
|
||||
_isAttached = _target in (attachedObjects _unit);
|
||||
|
||||
if (_isAttached && (!(_target getVariable [QGVAR(isHandcuffed), false]))) exitWith {
|
||||
ERROR("Attached But Not Captive");
|
||||
false
|
||||
};
|
||||
|
||||
_isAttached
|
||||
(_target in (attachedObjects _unit)) && {_target getVariable [QGVAR(isHandcuffed), false]}
|
||||
|
@ -18,5 +18,12 @@
|
||||
|
||||
PARAMS_2(_unit,_newSurrenderState);
|
||||
|
||||
//TODO: any other conditions??
|
||||
(!((_unit getVariable [QGVAR(isSurrendering), false]) isEqualTo _newSurrenderState))
|
||||
private "_returnValue";
|
||||
|
||||
_returnValue = if (_newSurrenderState) then {
|
||||
!(_unit getVariable [QGVAR(isSurrendering), false]); //Not currently surrendering
|
||||
} else {
|
||||
(_unit getVariable [QGVAR(isSurrendering), false]); //is Surrendering
|
||||
};
|
||||
|
||||
_returnValue
|
||||
|
@ -51,7 +51,7 @@ if (_state) then {
|
||||
_unit setVariable [QGVAR(escortedUnit), objNull, true];
|
||||
};
|
||||
};
|
||||
[_escortFnc, 0.2, [_unit, _target, _actionID]] call CBA_fnc_addPerFrameHandler;
|
||||
[_escortFnc, 0, [_unit, _target, _actionID]] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
} else {
|
||||
_unit setVariable [QGVAR(isEscorting), false, true];
|
||||
|
@ -19,6 +19,12 @@
|
||||
|
||||
PARAMS_3(_vehicle,_dontcare,_unit);
|
||||
|
||||
if ((local _unit) && (_unit getVariable [QGVAR(isEscorting), false])) then {
|
||||
_unit setVariable [QGVAR(isEscorting), false, true];
|
||||
if (local _unit) then {
|
||||
if (_unit getVariable [QGVAR(isEscorting), false]) then {
|
||||
_unit setVariable [QGVAR(isEscorting), false, true];
|
||||
};
|
||||
|
||||
if (_unit getVariable [QGVAR(isSurrendering), false]) then {
|
||||
[_unit, false] call FUNC(setSurrender);
|
||||
};
|
||||
};
|
||||
|
@ -1,2 +0,0 @@
|
||||
// by commy2
|
||||
|
36
addons/captives/functions/fnc_handleOnUnconscious.sqf
Normal file
36
addons/captives/functions/fnc_handleOnUnconscious.sqf
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Author: commy2, PabstMirror
|
||||
* Handles the "medical_onUnconscious" event
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
* 0: Is Unconsisisiouses <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* [bob, true] call ACE_captives_fnc_handleOnUnconscious
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_unit,_isUnconc);
|
||||
|
||||
if (!local _unit) exitWith {};
|
||||
|
||||
systemChat format ["med: %1", _this];
|
||||
|
||||
if (_isUnconc) then {
|
||||
//Knocked out: If surrendering, stop
|
||||
if (_unit getVariable [QGVAR(isSurrendering), false]) then {
|
||||
[_unit, false] call FUNC(setSurrendered);
|
||||
};
|
||||
} else {
|
||||
//Woke up: if handcuffed, goto animation
|
||||
if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then {
|
||||
[_unit] call EFUNC(common,fixLoweredRifleAnimation);
|
||||
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
|
||||
};
|
||||
};
|
@ -18,10 +18,16 @@
|
||||
|
||||
PARAMS_2(_newUnit,_oldUnit);
|
||||
|
||||
//set showHUD based on new unit status:
|
||||
if ((_newUnit getVariable [QGVAR(isHandcuffed), false]) || {_newUnit getVariable [QGVAR(isSurrendering), false]}) then {
|
||||
TRACE_1("Player Change (showHUD false)",_newUnit);
|
||||
showHUD false;
|
||||
showHUD false;
|
||||
} else {
|
||||
TRACE_1("Player Change (showHUD true)",_newUnit);
|
||||
showHUD true;
|
||||
};
|
||||
|
||||
//If old player was escorting, stop
|
||||
if (_oldUnit getVariable [QGVAR(isEscorting), false]) then {
|
||||
_oldUnit setVariable [QGVAR(isEscorting), false, true];
|
||||
};
|
||||
|
@ -29,6 +29,6 @@ if (local _unit) then {
|
||||
|
||||
if (_unit getVariable [QGVAR(isSurrendering), false]) then {
|
||||
_unit setVariable [QGVAR(isSurrendering), false];
|
||||
[_unit, true] call FUNC(surrender);
|
||||
[_unit, true] call FUNC(setSurrendered);
|
||||
};
|
||||
};
|
||||
|
@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* TODO
|
||||
*
|
||||
* Arguments:
|
||||
* 0: _unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* The return value <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [bob] call ACE_captives_fnc_handleWokeUp
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_1(_unit);
|
||||
|
||||
if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then {
|
||||
[_unit] call EFUNC(common,fixLoweredRifleAnimation);
|
||||
[_unit, "ACE_AmovPercMstpScapWnonDnon", 0] call EFUNC(common,doAnimation);
|
||||
};
|
31
addons/captives/functions/fnc_handleZeusDisplayChanged.sqf
Normal file
31
addons/captives/functions/fnc_handleZeusDisplayChanged.sqf
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
* Handles ZeusDisplayChanged event
|
||||
* Need to reset showHUD after closing zeus
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
* 1: Display is now open <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* [bob1, false] call ACE_captives_fnc_handleZeusDisplayChanged
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_unit,_zeusIsOpen);
|
||||
|
||||
//set showHUD based on unit status:
|
||||
if (!_zeusIsOpen) then {
|
||||
if ((_unit getVariable [QGVAR(isHandcuffed), false]) || {_unit getVariable [QGVAR(isSurrendering), false]}) then {
|
||||
TRACE_1("Player Change (showHUD false)",_unit);
|
||||
showHUD false;
|
||||
} else {
|
||||
TRACE_1("Player Change (showHUD true)",_unit);
|
||||
showHUD true;
|
||||
};
|
||||
};
|
@ -27,19 +27,31 @@ if (local _logic) then {
|
||||
if ((count _bisMouseOver) == 2) then {//check what mouse was over before the module was placed
|
||||
_mouseOverObject = _bisMouseOver select 1;
|
||||
if ((_mouseOverObject isKindOf "CAManBase") && {(vehicle _mouseOverObject) == _mouseOverObject}) then {
|
||||
systemChat format ["Debug - module surrendering %1", (name _mouseOverObject)];
|
||||
[_mouseOverObject, true] call FUNC(surrender);
|
||||
TRACE_2("Debug - module surrendering %1",_mouseOverObject,(name _mouseOverObject));
|
||||
if (alive _mouseOverObject) then {
|
||||
if (!(_mouseOverObject getVariable [QGVAR(isSurrendering), false])) then {
|
||||
["SetSurrendered", [_mouseOverObject], [_mouseOverObject, true]] call EFUNC(common,targetEvent);
|
||||
} else {
|
||||
["SetSurrendered", [_mouseOverObject], [_mouseOverObject, false]] call EFUNC(common,targetEvent);
|
||||
};
|
||||
} else {
|
||||
["STR_ACE_Captives_Zeus_OnlyAlive"] call EFUNC(common,displayTextStructured);
|
||||
};
|
||||
} else {
|
||||
systemChat format ["Only use on dismounted inf"];
|
||||
["STR_ACE_Captives_Zeus_OnlyInfentry"] call EFUNC(common,displayTextStructured);
|
||||
};
|
||||
} else {
|
||||
systemChat format ["Nothing under mouse"];
|
||||
["STR_ACE_Captives_Zeus_NothingSelected"] call EFUNC(common,displayTextStructured);
|
||||
};
|
||||
} else {//an editor module
|
||||
{
|
||||
systemChat format ["Debug - module surrendering %1", (name _x)];
|
||||
[_x, true] call FUNC(surrender);
|
||||
} forEach _units;
|
||||
} else {
|
||||
//an editor module
|
||||
//Modules run before postInit can instal the event handler, so we need to wait a little bit
|
||||
[{
|
||||
PARAMS_1(_units);
|
||||
{
|
||||
["SetSurrendered", [_x], [_x, true]] call EFUNC(common,targetEvent);
|
||||
} forEach _units;
|
||||
}, [_units], 0.05, 0.05]call EFUNC(common,waitAndExecute);
|
||||
};
|
||||
|
||||
deleteVehicle _logic;
|
||||
|
@ -18,19 +18,23 @@
|
||||
|
||||
PARAMS_2(_unit,_state);
|
||||
|
||||
// We only want this function to work on local machines
|
||||
if (!local _unit) exitwith {
|
||||
[_this, QUOTE(FUNC(setHandcuffed)), _unit] call EFUNC(common,execRemoteFnc);
|
||||
TRACE_2("running setHandcuffed on remote unit",_unit,_state);
|
||||
};
|
||||
|
||||
if (_state isEqualTo (_unit getVariable [QGVAR(isHandcuffed), false])) then {
|
||||
LOG("setHandcuffed: current state same as new");
|
||||
if (!local _unit) exitwith {
|
||||
ERROR("running setHandcuffed on remote unit");
|
||||
};
|
||||
if ((_unit getVariable [QGVAR(isHandcuffed), false]) isEqualTo _state) exitWith {
|
||||
ERROR("setHandcuffed: current state same as new");
|
||||
};
|
||||
|
||||
if (_state) then {
|
||||
_unit setVariable [QGVAR(isHandcuffed), true, true];
|
||||
[_unit, QGVAR(Handcuffed), true] call EFUNC(common,setCaptivityStatus);
|
||||
|
||||
if (_unit getVariable [QGVAR(isSurrendering), false]) then { //If surrendering, stop
|
||||
[_unit, false] call FUNC(setSurrendered);
|
||||
};
|
||||
|
||||
//Set unit cargoIndex (will be -1 if dismounted)
|
||||
_unit setVariable [QGVAR(CargoIndex), ((vehicle _unit) getCargoIndex _unit), true];
|
||||
|
||||
if (_unit == ACE_player) then {
|
||||
@ -43,13 +47,32 @@ if (_state) then {
|
||||
if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then {
|
||||
[_unit] call EFUNC(common,fixLoweredRifleAnimation);
|
||||
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
|
||||
|
||||
//Adds an animation changed eh
|
||||
//If we get a change in animation then redo the animation (handles people vaulting to break the animation chain)
|
||||
_animChangedEHID = _unit addEventHandler ["AnimChanged", {
|
||||
PARAMS_2(_unit,_newAnimation);
|
||||
if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then {
|
||||
ERROR("Handcuff animation interrupted");
|
||||
systemChat format ["debug %2: new %1", _newAnimation, time];
|
||||
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
|
||||
};
|
||||
}];
|
||||
_unit setVariable [QGVAR(handcuffAnimEHID), _animChangedEHID];
|
||||
|
||||
};
|
||||
}, [_unit], 0.01, 0] call EFUNC(common,waitAndExecute);
|
||||
} else {
|
||||
_unit setVariable [QGVAR(isHandcuffed), false, true];
|
||||
[_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus);
|
||||
if ((vehicle _unit) == _unit) then {
|
||||
//Break out of hands up animation loop (doAnimation handles Unconscious prioity)
|
||||
|
||||
//remove AnimChanged EH
|
||||
_animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1];
|
||||
_unit removeEventHandler ["AnimChanged", _animChangedEHID];
|
||||
_unit setVariable [QGVAR(handcuffAnimEHID), -1];
|
||||
|
||||
if (((vehicle _unit) == _unit) && {!(_unit getVariable ["ACE_isUnconscious", false])}) then {
|
||||
//Break out of hands up animation loop
|
||||
[_unit, "ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation);
|
||||
};
|
||||
|
||||
|
101
addons/captives/functions/fnc_setSurrendered.sqf
Normal file
101
addons/captives/functions/fnc_setSurrendered.sqf
Normal file
@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Author: commy2 PabstMirror
|
||||
* Lets a unit surrender
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
* 1: True to surrender, false to un-surrender <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* [Pierre, true] call ACE_captives_fnc_setSurrendered;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_unit,_state);
|
||||
|
||||
|
||||
if (!local _unit) exitwith {
|
||||
ERROR("running surrender on remote unit");
|
||||
};
|
||||
|
||||
if ((_unit getVariable [QGVAR(isSurrendering), false]) isEqualTo _state) exitWith {
|
||||
ERROR("Surrender: current state same as new");
|
||||
};
|
||||
|
||||
if (_state) then {
|
||||
if ((vehicle _unit) != _unit) exitWith {ERROR("Cannot surrender while mounted");};
|
||||
if (_unit getVariable [QGVAR(isHandcuffed), false]) exitWith {ERROR("Cannot surrender while handcuffed");};
|
||||
|
||||
_unit setVariable [QGVAR(isSurrendering), true, true];
|
||||
|
||||
[_unit, QGVAR(Surrendered), true] call EFUNC(common,setCaptivityStatus);
|
||||
|
||||
if (_unit == ACE_player) then {
|
||||
showHUD false;
|
||||
};
|
||||
|
||||
[_unit] call EFUNC(common,fixLoweredRifleAnimation);
|
||||
[_unit, "ACE_AmovPercMstpSsurWnonDnon", 1] call EFUNC(common,doAnimation);
|
||||
|
||||
// fix anim on mission start (should work on dedicated servers)
|
||||
[{
|
||||
PARAMS_1(_unit);
|
||||
if (_unit getVariable [QGVAR(isSurrendering), false] && {(vehicle _unit) == _unit}) then {
|
||||
//Adds an animation changed eh
|
||||
//If we get a change in animation then redo the animation (handles people vaulting to break the animation chain)
|
||||
_animChangedEHID = _unit addEventHandler ["AnimChanged", {
|
||||
PARAMS_2(_unit,_newAnimation);
|
||||
if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then {
|
||||
ERROR("Surrender animation interrupted");
|
||||
systemChat format ["debug %2: new %1", _newAnimation, time];
|
||||
[_unit, "ACE_AmovPercMstpSsurWnonDnon", 1] call EFUNC(common,doAnimation);
|
||||
};
|
||||
}];
|
||||
_unit setVariable [QGVAR(surrenderAnimEHID), _animChangedEHID];
|
||||
};
|
||||
}, [_unit], 0.01, 0] call EFUNC(common,waitAndExecute);
|
||||
} else {
|
||||
_unit setVariable [QGVAR(isSurrendering), false, true];
|
||||
[_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus);
|
||||
|
||||
//remove AnimChanged EH
|
||||
_animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1];
|
||||
_unit removeEventHandler ["AnimChanged", _animChangedEHID];
|
||||
_unit setVariable [QGVAR(surrenderAnimEHID), -1];
|
||||
|
||||
if (_unit == ACE_player) then {
|
||||
//only re-enable HUD if not handcuffed
|
||||
if (!(_unit getVariable [QGVAR(isHandcuffed), false])) then {
|
||||
showHUD true;
|
||||
};
|
||||
};
|
||||
|
||||
if (_unit getVariable ["ACE_isUnconscious", false]) exitWith {}; //don't touch animations if unconscious
|
||||
|
||||
//if we are in "hands up" animationState, crack it now
|
||||
if (((vehicle _unit) == _unit) && {(animationState _unit) == "ACE_AmovPercMstpSsurWnonDnon"}) then {
|
||||
[_unit, "ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation);
|
||||
} else {
|
||||
//spin up a PFEH, to watching animationState for the next 20 seconds to make sure we don't enter "hands up"
|
||||
//Handles long animation chains
|
||||
[{
|
||||
PARAMS_2(_args,_pfID);
|
||||
EXPLODE_2_PVT(_args,_unit,_maxTime);
|
||||
//If waited long enough or they re-surrendered or they are unconscious, exit loop
|
||||
if ((time > _maxTime) || {_unit getVariable [QGVAR(isSurrendering), false]} || {_unit getVariable ["ACE_isUnconscious", false]}) exitWith {
|
||||
[_pfID] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
//Only break animation if they are actualy the "hands up" animation (because we are using switchmove there won't be an transition)
|
||||
if (((vehicle _unit) == _unit) && {(animationState _unit) == "ACE_AmovPercMstpSsurWnonDnon"}) exitWith {
|
||||
[_pfID] call CBA_fnc_removePerFrameHandler;
|
||||
//Break out of hands up animation loop
|
||||
[_unit, "ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation);
|
||||
};
|
||||
}, 0, [_unit, (time + 20)]] call CBA_fnc_addPerFrameHandler;
|
||||
};
|
||||
};
|
@ -1,76 +0,0 @@
|
||||
/*
|
||||
* Author: commy2 PabstMirror
|
||||
* Lets a unit surrender
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
* 1: State <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* [Pierre, true] call ACE_captives_fnc_surrender;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_unit,_state);
|
||||
|
||||
// We only want this function to work on local machines
|
||||
if (!local _unit) exitwith {
|
||||
[_this, QUOTE(FUNC(surrender)), _unit] call EFUNC(common,execRemoteFnc);
|
||||
TRACE_2("running surrender on remote unit",_unit,_state);
|
||||
};
|
||||
|
||||
if ((_unit getVariable [QGVAR(isSurrendering), false]) isEqualTo _state) then {
|
||||
LOG("Surrender: current state same as new");
|
||||
};
|
||||
|
||||
if (_state) then {
|
||||
_unit setVariable [QGVAR(isSurrendering), true, true];
|
||||
[_unit, QGVAR(Surrendered), true] call EFUNC(common,setCaptivityStatus);
|
||||
|
||||
if (_unit == ACE_player) then {
|
||||
showHUD false;
|
||||
};
|
||||
|
||||
// fix anim on mission start (should work on dedicated servers)
|
||||
[{
|
||||
PARAMS_1(_unit);
|
||||
if (_unit getVariable [QGVAR(isSurrendering), false] && {vehicle _unit == _unit}) then {
|
||||
[_unit] call EFUNC(common,fixLoweredRifleAnimation);
|
||||
[_unit, "ACE_AmovPercMstpSsurWnonDnon", 1] call EFUNC(common,doAnimation);
|
||||
};
|
||||
}, [_unit], 0.01, 0] call EFUNC(common,waitAndExecute);
|
||||
|
||||
//PFEH - (TODO: move to event system?)
|
||||
[{
|
||||
EXPLODE_1_PVT((_this select 0),_unit);
|
||||
if (_unit getVariable [QGVAR(isSurrendering), false]) then {
|
||||
//If unit dies, gets knocked out, or is handcuffed then end surrender
|
||||
if ((!alive _unit) || {_unit getVariable ["ACE_isUnconscious", false]} || {_unit getVariable [QGVAR(isHandcuffed), false]}) then {
|
||||
[_unit, false] call FUNC(surrender);
|
||||
[(_this select 1)] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
} else {
|
||||
[(_this select 1)] call cba_fnc_removePerFrameHandler;
|
||||
};
|
||||
}, 0.0, [_unit]] call CBA_fnc_addPerFrameHandler;
|
||||
} else {
|
||||
_unit setVariable [QGVAR(isSurrendering), false, true];
|
||||
[_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus);
|
||||
|
||||
if ((vehicle _unit) == _unit) then {
|
||||
//Break out of hands up animation loop (doAnimation handles Unconscious prioity)
|
||||
[_unit, "ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation);
|
||||
};
|
||||
|
||||
if (_unit == ACE_player) then {
|
||||
//only re-enable HUD if not handcuffed
|
||||
if (!(_unit getVariable [QGVAR(isHandcuffed), false])) then {
|
||||
showHUD true;
|
||||
};
|
||||
};
|
||||
};
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Edited with tabler - 2015-02-06 -->
|
||||
<!-- Edited with tabler - 2015-02-24 -->
|
||||
<Project name="ACE">
|
||||
<Package name="Captives">
|
||||
<Key ID="STR_ACE_Captives_SetCaptive">
|
||||
@ -136,5 +136,14 @@
|
||||
<Key ID="STR_ACE_Captives_StopSurrendering">
|
||||
<English>Stop Surrendering</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Captives_Zeus_OnlyAlive">
|
||||
<English>Only use on alive units</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Captives_Zeus_OnlyInfentry">
|
||||
<English>Only use on dismounted inf</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Captives_Zeus_NothingSelected">
|
||||
<English>Nothing under mouse</English>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
@ -38,7 +38,7 @@ class Extended_Respawn_EventHandlers {
|
||||
respawn = QUOTE(_this call FUNC(setName));
|
||||
};
|
||||
class GVAR(RESETDefaults) {
|
||||
respawn = QUOTE(_this call FUNC(resetAllDefaults_F));
|
||||
respawn = QUOTE(_this call FUNC(resetAllDefaults));
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -7,14 +7,22 @@ class CfgWeapons {
|
||||
simulation = "ItemMineDetector";
|
||||
};
|
||||
|
||||
class Rifle_Base_F;
|
||||
class Rifle;
|
||||
class Rifle_Base_F: Rifle {
|
||||
class WeaponSlotsInfo;
|
||||
};
|
||||
|
||||
class ACE_FakePrimaryWeapon: Rifle_Base_F {
|
||||
scope = 2;
|
||||
displayName = "";
|
||||
model = "";
|
||||
picture = "";
|
||||
magazines[] = {"ACE_FakeMagazine"};
|
||||
discreteDistance[] = {};
|
||||
discreteDistanceInitIndex = 0;
|
||||
displayName = "";
|
||||
picture = "";
|
||||
model = "";
|
||||
magazines[] = {"ACE_FakeMagazine"};
|
||||
scope = 2;
|
||||
|
||||
class WeaponSlotsInfo: WeaponSlotsInfo {
|
||||
mass = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -17,14 +17,15 @@ class RscTitles {
|
||||
class HintBox: RscStructuredText {
|
||||
idc = 1;
|
||||
text = "";
|
||||
size = "1 / 40 / (getResolution select 5)";
|
||||
sizeEx = 1;
|
||||
//size = "1 / 40 / (getResolution select 5)";
|
||||
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
|
||||
colorText[] = {1, 1, 1, 1};
|
||||
colorBackground[] = {0, 0, 0, 0.5};
|
||||
x = safeZoneW + safeZoneX - 0 * safezoneW; //safeZoneW + safeZoneX - 0.2 * safezoneW;
|
||||
y = safeZoneY + 0.2 * safezoneH;
|
||||
w = 0.2 * safeZoneW;
|
||||
h = 0.1 * SafeZoneH;
|
||||
font = "PuristaMedium";
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -36,13 +37,12 @@ class RscTitles {
|
||||
fadeIn = 0.2;
|
||||
fadeOut = 0.2;
|
||||
name = "ACE_RscErrorHint";
|
||||
|
||||
class controls {
|
||||
class HintBox: RscStructuredText {
|
||||
idc = 1;
|
||||
text = "";
|
||||
size = "1 / 40 / (getResolution select 5)";
|
||||
sizeEx = 1;
|
||||
//size = "1 / 40 / (getResolution select 5)";
|
||||
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
|
||||
colorText[] = {1, 1, 1, 1};
|
||||
colorBackground[] = {0.8, 0, 0, 0.5};
|
||||
x = 0.3 * safeZoneW + safeZoneX;
|
||||
@ -52,6 +52,7 @@ class RscTitles {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class ACE_EventHandlerHelper: ACE_Rsc_Display_Base {
|
||||
idd = -1;
|
||||
class controls {
|
||||
|
@ -1,6 +1,3 @@
|
||||
class ACE_gui_RscProgress;
|
||||
class ACE_gui_staticBase;
|
||||
|
||||
|
||||
class GVAR(ProgressBar_Dialog) {
|
||||
idd = -1;
|
||||
@ -20,7 +17,7 @@ class GVAR(ProgressBar_Dialog) {
|
||||
type = 0;
|
||||
style = 0;
|
||||
size = 1;
|
||||
colorBackground[] = {0, 0, 0, 0.1};
|
||||
colorBackground[] = {0, 0, 0, 0.0};
|
||||
colorText[] = {0, 0, 0, 0};
|
||||
x = "safezoneX";
|
||||
y = "safezoneY";
|
||||
@ -34,7 +31,7 @@ class GVAR(ProgressBar_Dialog) {
|
||||
y = "0.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
|
||||
w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = ".8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
colorFrame[] = {0,0,0,0.025};
|
||||
colorFrame[] = {0,0,0,0.0};
|
||||
colorBar[] = {0.27,0.5,0.31,0.8};
|
||||
texture = "#(argb,8,8,3)color(1,1,1,0.7)";
|
||||
};
|
||||
|
@ -26,5 +26,5 @@ class RscDisplayInventory {
|
||||
};
|
||||
|
||||
class RscDisplayChannel {
|
||||
onLoad = QUOTE(_this call GVAR(onLoadRscDisplayChannel));
|
||||
onLoad = QUOTE(_this call FUNC(onLoadRscDisplayChannel));
|
||||
};
|
||||
|
@ -20,6 +20,19 @@ if (hasInterface) then {
|
||||
};
|
||||
}] call FUNC(addEventhandler);
|
||||
|
||||
["fixCollision", DFUNC(fixCollision)] call FUNC(addEventhandler);
|
||||
["fixFloating", DFUNC(fixFloating)] call FUNC(addEventhandler);
|
||||
["fixPosition", DFUNC(fixPosition)] call FUNC(addEventhandler);
|
||||
|
||||
["lockVehicle", {
|
||||
_this setVariable [QGVAR(lockStatus), locked _this];
|
||||
_this lock 2;
|
||||
}] call FUNC(addEventhandler);
|
||||
|
||||
["unlockVehicle", {
|
||||
_this lock (_this getVariable [QGVAR(lockStatus), locked _this]);
|
||||
}] call FUNC(addEventhandler);
|
||||
|
||||
// hack to get PFH to work in briefing
|
||||
[QGVAR(onBriefingPFH), "onEachFrame", {
|
||||
if (time > 0) exitWith {
|
||||
@ -55,8 +68,6 @@ if (_currentVersion != _previousVersion) then {
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
call COMPILE_FILE(scripts\assignedItemFix);
|
||||
|
||||
call COMPILE_FILE(scripts\initCanInteractFunction);
|
||||
call COMPILE_FILE(scripts\initScrollWheel);
|
||||
|
||||
0 spawn {
|
||||
@ -88,6 +99,7 @@ GVAR(OldZeusDisplayIsOpen) = !(isNull findDisplay 312);
|
||||
GVAR(OldCameraView) = cameraView;
|
||||
GVAR(OldPlayerVehicle) = vehicle ACE_player;
|
||||
GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex);
|
||||
GVAR(OldPlayerWeapon) = currentWeapon ACE_player;
|
||||
|
||||
// PFH to raise varios events
|
||||
[{
|
||||
@ -148,6 +160,14 @@ GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex);
|
||||
["playerTurretChanged", [ACE_player, _newPlayerTurret]] call FUNC(localEvent);
|
||||
};
|
||||
|
||||
// "playerWeaponChanged" event
|
||||
_newPlayerWeapon = currentWeapon ACE_player;
|
||||
if (_newPlayerWeapon != GVAR(OldPlayerWeapon)) then {
|
||||
// Raise ACE event locally
|
||||
GVAR(OldPlayerWeapon) = _newPlayerWeapon;
|
||||
["playerWeaponChanged", [ACE_player, _newPlayerWeapon]] call FUNC(localEvent);
|
||||
};
|
||||
|
||||
}, 0, []] call cba_fnc_addPerFrameHandler;
|
||||
|
||||
[QGVAR(StateArrested),false,true,QUOTE(ADDON)] call FUNC(defineVariable);
|
||||
@ -158,3 +178,8 @@ GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex);
|
||||
PARAMS_2(_vehicle,_fuelLevel);
|
||||
_vehicle setFuel _fuelLevel;
|
||||
}] call FUNC(addEventhandler);
|
||||
|
||||
["displayTextStructured", FUNC(displayTextStructured)] call FUNC(addEventhandler);
|
||||
["displayTextPicture", FUNC(displayTextPicture)] call FUNC(addEventhandler);
|
||||
|
||||
["notOnMap", {!visibleMap}] call FUNC(addCanInteractWithCondition);
|
||||
|
@ -7,6 +7,7 @@ ADDON = false;
|
||||
PREP(addActionEventHandler);
|
||||
PREP(addActionMenuEventHandler);
|
||||
PREP(addCameraEventHandler);
|
||||
PREP(addCanInteractWithCondition);
|
||||
PREP(addCustomEventHandler);
|
||||
PREP(addLineToDebugDraw);
|
||||
PREP(addMapMarkerCreatedEventHandler);
|
||||
@ -15,12 +16,19 @@ PREP(addSetting);
|
||||
PREP(adminKick);
|
||||
PREP(ambientBrightness);
|
||||
PREP(applyForceWalkStatus);
|
||||
PREP(ASLToPosition);
|
||||
PREP(beingCarried);
|
||||
PREP(binarizeNumber);
|
||||
PREP(blurScreen);
|
||||
PREP(cachedCall);
|
||||
PREP(callCustomEventHandlers);
|
||||
PREP(callCustomEventHandlersGlobal);
|
||||
PREP(canGetInPosition);
|
||||
PREP(canInteract);
|
||||
PREP(canInteractWith);
|
||||
PREP(canUseWeapon);
|
||||
PREP(carriedByObj);
|
||||
PREP(carryObj);
|
||||
PREP(changeProjectileDirection);
|
||||
PREP(checkPBOs);
|
||||
PREP(claim);
|
||||
@ -30,24 +38,42 @@ PREP(codeToString);
|
||||
PREP(convertKeyCode);
|
||||
PREP(createOrthonormalReference);
|
||||
PREP(currentChannel);
|
||||
PREP(debug);
|
||||
PREP(debugModule);
|
||||
PREP(defineVariable);
|
||||
PREP(disableAI);
|
||||
PREP(disableUserInput);
|
||||
PREP(displayIcon);
|
||||
PREP(displayText);
|
||||
PREP(displayTextPicture);
|
||||
PREP(displayTextStructured);
|
||||
PREP(doAnimation);
|
||||
PREP(endRadioTransmission);
|
||||
PREP(eraseCache);
|
||||
PREP(execNextFrame);
|
||||
PREP(execPersistentFnc);
|
||||
PREP(execRemoteFnc);
|
||||
PREP(executePersistent);
|
||||
PREP(filter);
|
||||
PREP(fixCollision);
|
||||
PREP(fixFloating);
|
||||
PREP(fixLoweredRifleAnimation);
|
||||
PREP(fixPosition);
|
||||
PREP(getAllDefinedSetVariables);
|
||||
PREP(getAllGear);
|
||||
PREP(getCaptivityStatus);
|
||||
PREP(getCarriedBy);
|
||||
PREP(getCarriedObj);
|
||||
PREP(getConfigCommander);
|
||||
PREP(getConfigGunner);
|
||||
PREP(getDeathAnim);
|
||||
PREP(getDefaultAnim);
|
||||
PREP(getDefinedVariable);
|
||||
PREP(getDefinedVariableDefault);
|
||||
PREP(getDefinedVariableInfo);
|
||||
PREP(getDoorTurrets);
|
||||
PREP(getFirstObjectIntersection);
|
||||
PREP(getFirstTerrainIntersection);
|
||||
PREP(getForceWalkStatus);
|
||||
PREP(getGunner);
|
||||
PREP(getHitPoints);
|
||||
@ -56,6 +82,7 @@ PREP(getInPosition);
|
||||
PREP(getMarkerType);
|
||||
PREP(getName);
|
||||
PREP(getNumberFromMissionSQM);
|
||||
PREP(getNumberMagazinesIn);
|
||||
PREP(getPitchBankYaw);
|
||||
PREP(getSettingData);
|
||||
PREP(getStringFromMissionSQM);
|
||||
@ -74,63 +101,101 @@ PREP(getUavControlPosition);
|
||||
PREP(getVehicleCargo);
|
||||
PREP(getVehicleCodriver);
|
||||
PREP(getVehicleCrew);
|
||||
PREP(getVersion);
|
||||
PREP(getWeaponAzimuthAndInclination);
|
||||
PREP(getWeaponIndex);
|
||||
PREP(getWeaponType);
|
||||
PREP(getWindDirection);
|
||||
PREP(goKneeling);
|
||||
PREP(hadamardProduct);
|
||||
PREP(hasItem);
|
||||
PREP(hasMagazine);
|
||||
PREP(inheritsFrom);
|
||||
PREP(insertionSort);
|
||||
PREP(interpolateFromArray);
|
||||
PREP(inTransitionAnim);
|
||||
PREP(inWater);
|
||||
PREP(isAlive);
|
||||
PREP(isArrested);
|
||||
PREP(isAutoWind);
|
||||
PREP(isAwake);
|
||||
PREP(isEngineer);
|
||||
PREP(isEOD);
|
||||
PREP(isInBuilding);
|
||||
PREP(isModLoaded);
|
||||
PREP(isPlayer);
|
||||
PREP(isTurnedOut);
|
||||
PREP(letterToCode);
|
||||
PREP(limitMovementSpeed);
|
||||
PREP(loadPerson);
|
||||
PREP(loadPersonLocal);
|
||||
PREP(loadSettingsFromProfile);
|
||||
PREP(loadSettingsOnServer);
|
||||
PREP(map);
|
||||
PREP(moduleCheckPBOs);
|
||||
PREP(moduleLSDVehicles);
|
||||
PREP(moveToTempGroup);
|
||||
PREP(muteUnit);
|
||||
PREP(numberToDigits);
|
||||
PREP(numberToDigitsString);
|
||||
PREP(onAnswerRequest);
|
||||
PREP(onLoadRscDisplayChannel);
|
||||
PREP(owned);
|
||||
PREP(player);
|
||||
PREP(playerSide);
|
||||
PREP(positionToASL);
|
||||
PREP(progressBar);
|
||||
PREP(queueAnimation);
|
||||
PREP(readSettingFromModule);
|
||||
PREP(receiveRequest);
|
||||
PREP(removeActionEventHandler);
|
||||
PREP(removeActionMenuEventHandler);
|
||||
PREP(removeCameraEventHandler);
|
||||
PREP(removeCanInteractWithCondition);
|
||||
PREP(removeCustomEventHandler);
|
||||
PREP(removeMapMarkerCreatedEventHandler);
|
||||
PREP(removeScrollWheelEventHandler);
|
||||
PREP(removeSpecificMagazine);
|
||||
PREP(requestCallback);
|
||||
PREP(resetAllDefaults);
|
||||
PREP(restoreVariablesJIP);
|
||||
PREP(revertKeyCodeLocalized);
|
||||
PREP(sanitizeString);
|
||||
PREP(sendRequest);
|
||||
PREP(serverLog);
|
||||
PREP(setArrestState);
|
||||
PREP(setCanInteract);
|
||||
PREP(setCaptivityStatus);
|
||||
PREP(setCarriedBy);
|
||||
PREP(setDefinedVariable);
|
||||
PREP(setDisableUserInputStatus);
|
||||
PREP(setForceWalkStatus);
|
||||
PREP(setHearingCapability);
|
||||
PREP(setName);
|
||||
PREP(setParameter);
|
||||
PREP(setPitchBankYaw);
|
||||
PREP(setVariableJIP);
|
||||
PREP(setVariablePublic);
|
||||
PREP(setProne);
|
||||
PREP(setSetting);
|
||||
PREP(setSettingFromConfig);
|
||||
PREP(setVariableJIP);
|
||||
PREP(setVariablePublic);
|
||||
PREP(setVolume);
|
||||
PREP(sortAlphabeticallyBy);
|
||||
PREP(stringCompare);
|
||||
PREP(stringToColoredText);
|
||||
PREP(stringRemoveWhiteSpace);
|
||||
PREP(subString);
|
||||
PREP(switchToGroupSide);
|
||||
PREP(throttledPublicVariable);
|
||||
PREP(toBin);
|
||||
PREP(toBitmask);
|
||||
PREP(toHex);
|
||||
PREP(toNumber);
|
||||
PREP(throttledPublicVariable);
|
||||
PREP(uniqueElementsOnly);
|
||||
PREP(unloadPerson);
|
||||
PREP(unmuteUnit);
|
||||
PREP(useItem);
|
||||
PREP(useMagazine);
|
||||
PREP(waitAndExecute);
|
||||
|
||||
// ACE_Debug
|
||||
@ -143,6 +208,9 @@ PREP(logDisplays);
|
||||
PREP(monitor);
|
||||
PREP(showUser);
|
||||
|
||||
PREP(dumpPerformanceCounters);
|
||||
PREP(dumpArray);
|
||||
|
||||
// ACE_CuratorFix
|
||||
PREP(addCuratorUnloadEventhandler);
|
||||
PREP(fixCrateContent);
|
||||
@ -171,6 +239,9 @@ PREP(hashListSelect);
|
||||
PREP(hashListSet);
|
||||
PREP(hashListPush);
|
||||
|
||||
//Debug
|
||||
ACE_COUNTERS = [];
|
||||
|
||||
// Load settings
|
||||
if (isServer) then {
|
||||
call FUNC(loadSettingsOnServer);
|
||||
@ -195,74 +266,6 @@ if (hasInterface) then {
|
||||
}, 0, []] call cba_fnc_addPerFrameHandler;
|
||||
};
|
||||
|
||||
PREP(stringCompare);
|
||||
PREP(string_removeWhiteSpace);
|
||||
PREP(isHC);
|
||||
PREP(sendRequest_f);
|
||||
PREP(requestCallback);
|
||||
PREP(receiveRequest);
|
||||
PREP(onAnswerRequest);
|
||||
PREP(debug);
|
||||
PREP(debugModule);
|
||||
PREP(defineVariable);
|
||||
PREP(setDefinedVariable);
|
||||
PREP(getDefinedVariable);
|
||||
PREP(getAllDefinedSetVariables);
|
||||
PREP(getDefinedVariableInfo);
|
||||
PREP(getDefinedVariableDefault);
|
||||
PREP(getDeathAnim);
|
||||
PREP(insertionSort);
|
||||
PREP(uniqueElementsOnly);
|
||||
PREP(sortAlphabeticallyBy);
|
||||
PREP(hasMagazine);
|
||||
PREP(useMagazine);
|
||||
PREP(findMagazine);
|
||||
PREP(hasItem);
|
||||
PREP(useItem);
|
||||
PREP(findItem);
|
||||
PREP(getNumberMagazinesIn);
|
||||
PREP(setCanInteract);
|
||||
PREP(getCanInteract);
|
||||
PREP(canInteract);
|
||||
PREP(resetAllDefaults_f);
|
||||
PREP(broadcastSound3D_f);
|
||||
|
||||
PREP(isAwake);
|
||||
PREP(setProne);
|
||||
|
||||
PREP(setDisableUserInputStatus);
|
||||
|
||||
PREP(dropWeapon_f);
|
||||
PREP(inWater_f);
|
||||
PREP(setVolume_f);
|
||||
PREP(closeAllDialogs_f);
|
||||
PREP(disableAI_f);
|
||||
PREP(switchToGroupSide_f);
|
||||
PREP(getFirstObjectIntersection);
|
||||
PREP(getFirstTerrainIntersection);
|
||||
PREP(setHearingCapability);
|
||||
PREP(revealObject_f);
|
||||
PREP(getWeaponItems_f);
|
||||
PREP(isModLoaded_f);
|
||||
PREP(inheritsFrom);
|
||||
PREP(getVersion);
|
||||
PREP(carryObj);
|
||||
PREP(carriedByObj);
|
||||
PREP(getCarriedObj);
|
||||
PREP(getCarriedBy);
|
||||
PREP(beingCarried);
|
||||
PREP(setCarriedBy);
|
||||
|
||||
|
||||
PREP(moveToTempGroup);
|
||||
|
||||
|
||||
PREP(limitMovementSpeed);
|
||||
PREP(setArrestState);
|
||||
PREP(isArrested);
|
||||
PREP(loadPerson_F);
|
||||
PREP(loadPersonLocal_F);
|
||||
PREP(unloadPerson_F);
|
||||
|
||||
|
||||
ADDON = true;
|
||||
|
||||
isHC = !(hasInterface || isDedicated);
|
||||
|
@ -51,12 +51,6 @@ class ACE_Rsc_Control_Base {
|
||||
h = 0;
|
||||
};
|
||||
|
||||
class ACE_canInteractConditions {
|
||||
class GVAR(notOnMap) {
|
||||
condition = "!visibleMap";
|
||||
};
|
||||
};
|
||||
|
||||
class ACE_Settings {
|
||||
/*
|
||||
*class GVAR(sampleSetting) {
|
||||
@ -94,8 +88,41 @@ class ACE_Settings {
|
||||
isClientSetable = 1;
|
||||
displayName = "$STR_ACE_Common_EnableNumberHotkeys";
|
||||
};
|
||||
class GVAR(settingFeedbackIcons) {
|
||||
value = 1;
|
||||
typeName = "SCALAR";
|
||||
force = 0;
|
||||
isClientSetable = 1;
|
||||
displayName = "$STR_ACE_Common_SettingFeedbackIconsName";
|
||||
description = "$STR_ACE_Common_SettingFeedbackIconsDesc";
|
||||
values[] = {"Hide", "Top right, downwards", "Top right, to the left", "Top left, downwards", "Top left, to the right"};
|
||||
};
|
||||
class GVAR(SettingProgressBarLocation) {
|
||||
value = 0;
|
||||
typeName = "SCALAR";
|
||||
force = 0;
|
||||
isClientSetable = 1;
|
||||
displayName = "$STR_ACE_Common_SettingProgressbarLocationName";
|
||||
description = "$STR_ACE_Common_SettingProgressbarLocationDesc";
|
||||
values[] = {"Top", "Bottom"};
|
||||
};
|
||||
class GVAR(displayTextColor) {
|
||||
value[] = {0,0,0,0.1};
|
||||
typeName = "COLOR";
|
||||
isClientSetable = 1;
|
||||
displayName = "$STR_ACE_Common_SettingDisplayTextColorName";
|
||||
description = "$STR_ACE_Common_SettingDisplayTextColorDesc";
|
||||
};
|
||||
class GVAR(displayTextFontColor) {
|
||||
value[] = {1,1,1,1};
|
||||
typeName = "COLOR";
|
||||
isClientSetable = 1;
|
||||
displayName = "$STR_ACE_Common_SettingDisplayTextFontColorName";
|
||||
description = "$STR_ACE_Common_SettingDisplayTextFontColorDesc";
|
||||
};
|
||||
};
|
||||
|
||||
#include "define.hpp"
|
||||
#include <ProgressScreen.hpp>
|
||||
#include <HintConfig.hpp>
|
||||
#include <RscInfoType.hpp>
|
||||
@ -103,3 +130,23 @@ class ACE_Settings {
|
||||
#include <FixAnimations.hpp>
|
||||
#include <NoVoice.hpp>
|
||||
|
||||
class CfgUIGrids {
|
||||
class IGUI {
|
||||
class Presets {
|
||||
class Arma3 {
|
||||
class Variables {
|
||||
grid_ACE_displayText[] = {{((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40)),safeZoneY + 0.175 * safezoneH, (10 *(((safezoneW / safezoneH) min 1.2) / 40)), (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))}, "(((safezoneW / safezoneH) min 1.2) / 40)","((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Variables {
|
||||
class grid_ACE_displayText {
|
||||
displayName = "ACE Hint";
|
||||
description = "Textual in game feedback to the player.";
|
||||
preview = "\a3\Ui_f\data\GUI\Cfg\UIGrids\grid_hint_ca.paa";
|
||||
saveToProfile[] = {0,1};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -182,12 +182,12 @@ class ACE_gui_buttonBase {
|
||||
bottom = 0.00;
|
||||
};
|
||||
textureNoShortcut = "";
|
||||
animTextureNormal = QUOTE( PATHTOF(data\buttonNormal_gradient_top.paa) );
|
||||
animTextureDisabled = QUOTE( PATHTOF(data\buttonDisabled_gradient.paa));
|
||||
animTextureOver = QUOTE( PATHTOF(data\buttonNormal_gradient_top.paa));
|
||||
animTextureFocused = QUOTE( PATHTOF(data\buttonNormal_gradient_top.paa));
|
||||
animTexturePressed = QUOTE( PATHTOF(data\buttonNormal_gradient_top.paa));
|
||||
animTextureDefault = QUOTE( PATHTOF(data\buttonNormal_gradient_top.paa));
|
||||
animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)";
|
||||
animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.8)";
|
||||
animTextureOver = "#(argb,8,8,3)color(1,1,1,1)";
|
||||
animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)";
|
||||
animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)";
|
||||
animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)";
|
||||
period = 0.5;
|
||||
font = FontCSE;
|
||||
soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1};
|
21
addons/common/functions/fnc_ASLToPosition.sqf
Normal file
21
addons/common/functions/fnc_ASLToPosition.sqf
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Author: CAA-Picard
|
||||
* Converts ASL to Arma "Position"
|
||||
*
|
||||
* Arguments:
|
||||
* 0: position x <Number>
|
||||
* 1: position y <Number>
|
||||
* 2: position z <Number>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (surfaceIsWater _this) then {
|
||||
_this
|
||||
} else {
|
||||
ASLtoATL _this
|
||||
};
|
38
addons/common/functions/fnc_addCanInteractWithCondition.sqf
Normal file
38
addons/common/functions/fnc_addCanInteractWithCondition.sqf
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Add a condition that gets checked by ace_common_fnc_canInteractWith.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The conditions id. Used to remove later or as exception name. An already existing name overwrites. (String)
|
||||
* 1: The condition to check. format of "_this" is "[_player, _target]". (Code)
|
||||
*
|
||||
* Return Value:
|
||||
* Unit can interact?
|
||||
*
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_conditionName", "_conditionFunc"];
|
||||
|
||||
_conditionName = toLower (_this select 0);
|
||||
_conditionFunc = _this select 1;
|
||||
|
||||
private ["_conditions", "_conditionNames", "_conditionFuncs"];
|
||||
|
||||
_conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]];
|
||||
|
||||
_conditionNames = _conditions select 0;
|
||||
_conditionFuncs = _conditions select 1;
|
||||
|
||||
private "_index";
|
||||
_index = _conditionNames find _conditionName;
|
||||
|
||||
if (_index == -1) then {
|
||||
_index = count _conditionNames;
|
||||
};
|
||||
|
||||
_conditionNames set [_index, _conditionName];
|
||||
_conditionFuncs set [_index, _conditionFunc];
|
||||
|
||||
GVAR(InteractionConditions) = [_conditionNames, _conditionFuncs];
|
@ -11,4 +11,4 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
sunOrMoon * sunOrMoon + moonIntensity/5 min 1
|
||||
sunOrMoon * sunOrMoon * (1 - overcast * 0.25) + (moonIntensity/5 min 1) * (1 - overcast)
|
||||
|
@ -39,4 +39,4 @@ if (_show) then {
|
||||
GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = nil;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
@ -1,16 +0,0 @@
|
||||
/**
|
||||
* fn_broadcastSound3D_f.sqf
|
||||
* @Descr: Plays a sound in 3D
|
||||
* @Author: Glowbal
|
||||
*
|
||||
* @Arguments: [unit OBJECT, sound STRING]
|
||||
* @Return: void
|
||||
* @PublicAPI: true
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (isDedicated) exitwith{};
|
||||
_unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param;
|
||||
_sound = [_this, 1, "",[""]] call BIS_fnc_Param;
|
||||
_unit say3D _sound;
|
30
addons/common/functions/fnc_cachedCall.sqf
Normal file
30
addons/common/functions/fnc_cachedCall.sqf
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Author: CAA-Picard and Jaynus
|
||||
* Returns the result of the function and caches it up to a given time
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Parameters <ARRAY>
|
||||
* 1: Function <CODE>
|
||||
* 2: Namespace to store the cache on <NAMESPACE>
|
||||
* 3: Cache uid <STRING>
|
||||
* 4: Max duration of the cache <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* Result of the function <ANY>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_5_PVT(_this,_params,_function,_namespace,_uid,_duration);
|
||||
|
||||
if (((_namespace getVariable [_uid, [-99999]]) select 0) < diag_tickTime) then {
|
||||
_namespace setVariable [_uid, [diag_tickTime + _duration, _params call _function]];
|
||||
#ifdef DEBUG_MODE_FULL
|
||||
diag_log format ["Calculated result: %1 %2", _namespace, _uid];
|
||||
} else {
|
||||
diag_log format ["Cached result : %1 %2", _namespace, _uid];
|
||||
#endif
|
||||
};
|
||||
|
||||
(_namespace getVariable _uid) select 1
|
@ -1,11 +1,49 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Check if the unit can interact.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The player. (Object)
|
||||
* 1: The interaction target. objNull to ignore. (Object)
|
||||
* 2: Exceptions. What general conditions are to skip? (Array)
|
||||
*
|
||||
* Return Value:
|
||||
* Unit can interact?
|
||||
*
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_target", "_owner"];
|
||||
private ["_unit", "_target", "_exceptions"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_target = _this select 1;
|
||||
_exceptions = _this select 2;
|
||||
|
||||
_owner = _target getVariable ["ACE_isUsedBy", objNull];
|
||||
_exceptions = [_exceptions, {toLower _this}] call FUNC(map);
|
||||
|
||||
isNull _owner || {_unit == _owner} || {!isPlayer _owner}
|
||||
// exit if the target is not free to interact
|
||||
private "_owner";
|
||||
_owner = _target getVariable [QGVAR(owner), objNull];
|
||||
|
||||
if (!isNull _owner && {_unit != _owner}) exitWith {false};
|
||||
|
||||
// check general conditions
|
||||
|
||||
private ["_conditions", "_conditionNames", "_conditionFuncs"];
|
||||
|
||||
_conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]];
|
||||
|
||||
_conditionNames = _conditions select 0;
|
||||
_conditionFuncs = _conditions select 1;
|
||||
|
||||
private "_canInteract";
|
||||
_canInteract = true;
|
||||
|
||||
{
|
||||
if (!(_x in _exceptions) && {!([_unit, _target] call (_conditionFuncs select _forEachIndex))}) exitWith {
|
||||
_canInteract = false;
|
||||
};
|
||||
} forEach _conditionNames;
|
||||
|
||||
_canInteract
|
||||
|
@ -1,7 +1,20 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Unit claims the ownership over an object. This is used to prevent multiple players from draging the same ammo box or using up the same wheel when repairing etc.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit that claims another object. ObjNull to remove claim. (Object)
|
||||
* 1: The object that gets claimed. (Object)
|
||||
* 2: Lock the claimed object aswell? (Bool)
|
||||
*
|
||||
* Return Value:
|
||||
* NONE
|
||||
*
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_target", "_lockTarget", "_owner"];
|
||||
private ["_unit", "_target", "_lockTarget"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_target = _this select 1;
|
||||
@ -9,20 +22,26 @@ _lockTarget = _this select 2;
|
||||
|
||||
if (isNil "_lockTarget") then {_lockTarget = false};
|
||||
|
||||
_owner = _target getVariable ["ACE_isUsedBy", objNull];
|
||||
private "_owner";
|
||||
_owner = _target getVariable [QGVAR(owner), objNull];
|
||||
|
||||
if (!isNull _owner && {!isNull _unit} && {_unit != _owner}) then {
|
||||
diag_log text "[ACE] ERROR: Claiming already owned object.";
|
||||
};
|
||||
|
||||
_target setVariable ["ACE_isUsedBy", _unit, true];
|
||||
// transfer this immediately
|
||||
_target setVariable [QGVAR(owner), _unit, true];
|
||||
|
||||
// lock target object
|
||||
if (_lockTarget) then {
|
||||
if (!isNull _unit) then {
|
||||
[_target, "{_locked = locked _this; _this setVariable ['ACE_lockStatus', _locked]; _this lock 2}", _target] call FUNC(execRemoteFnc);
|
||||
} else {
|
||||
[_target, "{_this lock (_this getVariable ['ACE_lockStatus', locked _this])}", _target] call FUNC(execRemoteFnc);
|
||||
};
|
||||
if (!isNull _unit) then {
|
||||
["lockVehicle", _target, _target] call FUNC(targetEvent);
|
||||
} else {
|
||||
["unlockVehicle", _target, _target] call FUNC(targetEvent);
|
||||
};
|
||||
};
|
||||
|
||||
//systemChat str locked _target; systemChat str (_target getVariable ['ACE_lockStatus', locked _target]);
|
||||
/*
|
||||
systemChat str locked _target;
|
||||
systemChat str (_target getVariable [QGVAR(lockStatus), locked _target]);
|
||||
*/
|
||||
|
@ -1,14 +0,0 @@
|
||||
/**
|
||||
* fn_closeAllDialogs_f.sqf
|
||||
* @Descr: Close all dialogs
|
||||
* @Author: Glowbal
|
||||
*
|
||||
* @Arguments: []
|
||||
* @Return: void
|
||||
* @PublicAPI: true
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
while {dialog} do {
|
||||
closeDialog 0;
|
||||
};
|
@ -14,4 +14,4 @@
|
||||
#define CHANNELS ["group", "side", "global", "command", "vehicle", "direct"]
|
||||
#define CHANNELS_LOCALIZED [localize "str_channel_group", localize "str_channel_side", localize "str_channel_global", localize "str_channel_command", localize "str_channel_vehicle", localize "str_channel_direct"]
|
||||
|
||||
CHANNELS select (CHANNELS_LOCALIZED find (uiNamespace getVariable ["ACE_currentChannel", ""])) max 0
|
||||
CHANNELS select (CHANNELS_LOCALIZED find (uiNamespace getVariable [QGVAR(currentChannel), ""])) max 0
|
||||
|
120
addons/common/functions/fnc_displayIcon.sqf
Normal file
120
addons/common/functions/fnc_displayIcon.sqf
Normal file
@ -0,0 +1,120 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
*
|
||||
* Draw progress bar and execute given function if succesful.
|
||||
* Finish/Failure/Conditional are all passed [_args, _elapsedTime, _totalTime, _errorCode]
|
||||
*
|
||||
* Argument:
|
||||
* 0: icon ID <STRING>
|
||||
* 1: show <BOOL>
|
||||
* 2: Icon Path <STRING>
|
||||
* 3: Icon color <ARRAY>
|
||||
* 4: timeAlive. -1 = forever <NUMBER> <OPTIONAL>
|
||||
*
|
||||
* Return value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* ["myID", true, QUOTE(PATHTOF(data\icon_group.paa)), [1,1,1,1], 0] call ace_gui_fnc_displayIcon;
|
||||
*/
|
||||
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
// positions for the icon UI
|
||||
#define RIGHT_SIDE (safezoneW + safezoneX)
|
||||
#define LEFT_SIDE safezoneX
|
||||
#define TOP_SIDE safeZoneY
|
||||
#define BOTTOM_SIDE (safeZoneH + safezoneY)
|
||||
#define ICON_WIDTH (2 * (((safezoneW / safezoneH) min 1.2) / 40))
|
||||
#define X_POS_ICONS (RIGHT_SIDE - (1.5 * ICON_WIDTH))
|
||||
#define Y_POS_ICONS (TOP_SIDE + (2.5 * ICON_WIDTH))
|
||||
#define DIFFERENCE_ICONS (1.1 * ICON_WIDTH)
|
||||
#define X_POS_ICONS_SECOND (RIGHT_SIDE - (4.4 * ICON_WIDTH))
|
||||
#define Y_POS_ICONS_SECOND (TOP_SIDE + (1.1 * ICON_WIDTH))
|
||||
|
||||
// setting values
|
||||
#define TOP_RIGHT_DOWN 1
|
||||
#define TOP_RIGHT_LEFT 2
|
||||
#define TOP_LEFT_DOWN 3
|
||||
#define TOP_LEFT_RIGHT 4
|
||||
|
||||
// other constants
|
||||
#define DEFAULT_TIME 6
|
||||
|
||||
private ["_iconId", "_show", "_icon", "_allControls", "_refresh", "_timeAlive", "_list", "_color"];
|
||||
_iconId = _this select 0;
|
||||
_show = _this select 1;
|
||||
_icon = _this select 2;
|
||||
_color = _this select 3;
|
||||
_timeAlive = if (count _this > 4) then {_this select 4} else {DEFAULT_TIME};
|
||||
|
||||
disableSerialization;
|
||||
_list = missionNamespace getvariable [QGVAR(displayIconList),[]];
|
||||
|
||||
_refresh = {
|
||||
private ["_allControls"];
|
||||
// Refreshing of all icons..
|
||||
_allControls = missionNamespace getvariable [QGVAR(displayIconListControls), []];
|
||||
{
|
||||
ctrlDelete _x;
|
||||
}foreach _allControls;
|
||||
|
||||
_allControls = [];
|
||||
|
||||
private ["_ctrl", "_setting"];
|
||||
_setting = missionNamespace getvariable[QGVAR(settingFeedbackIcons), 0];
|
||||
if (_setting > 0) then {
|
||||
{
|
||||
// +19000 because we want to make certain we are using free IDCs..
|
||||
_ctrl = ((findDisplay 46) ctrlCreate ["RscPicture", _foreachIndex + 19000]);
|
||||
_position = switch (_setting) do {
|
||||
case TOP_RIGHT_DOWN: {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]};
|
||||
case TOP_RIGHT_LEFT: {[X_POS_ICONS_SECOND - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND - (ICON_WIDTH / 2), ICON_WIDTH, ICON_WIDTH]};
|
||||
case TOP_LEFT_DOWN: {[LEFT_SIDE + (0.5 * ICON_WIDTH), Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]};
|
||||
case TOP_LEFT_RIGHT: {[LEFT_SIDE + (0.5 * ICON_WIDTH) - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND, ICON_WIDTH, ICON_WIDTH]};
|
||||
default {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]};
|
||||
};
|
||||
_ctrl ctrlSetPosition _position;
|
||||
_ctrl ctrlsetText (_x select 1);
|
||||
_ctrl ctrlSetTextColor (_x select 2);
|
||||
_ctrl ctrlCommit 0;
|
||||
_allControls pushback _ctrl;
|
||||
}foreach (missionNamespace getvariable [QGVAR(displayIconList),[]]);
|
||||
};
|
||||
missionNamespace setvariable [QGVAR(displayIconListControls), _allControls];
|
||||
};
|
||||
|
||||
if (_show) then {
|
||||
if ({(_x select 0 == _iconId)} count _list == 0) then {
|
||||
_list pushback [_iconId, _icon, _color, time];
|
||||
} else {
|
||||
{
|
||||
if (_x select 0 == _iconId) exitwith {
|
||||
_list set [_foreachIndex, [_iconId, _icon, _color, time]];
|
||||
};
|
||||
}foreach _list;
|
||||
};
|
||||
missionNamespace setvariable [QGVAR(displayIconList), _list];
|
||||
call _refresh;
|
||||
|
||||
if (_timeAlive >= 0) then {
|
||||
[{
|
||||
[_this select 0, false, "", [0,0,0], 0] call FUNC(displayIcon);
|
||||
}, [_iconId], _timeAlive, _timeAlive] call EFUNC(common,waitAndExecute);
|
||||
};
|
||||
|
||||
} else {
|
||||
if ({(_x select 0 == _iconId)} count _list == 1) then {
|
||||
private "_newList";
|
||||
_newList = [];
|
||||
{
|
||||
if (_x select 0 != _iconId) then {
|
||||
_newList pushback _x;
|
||||
};
|
||||
}foreach _list;
|
||||
|
||||
missionNamespace setvariable [QGVAR(displayIconList), _newList];
|
||||
call _refresh;
|
||||
};
|
||||
};
|
@ -18,36 +18,32 @@
|
||||
#define DEFAULT_DELAY 2
|
||||
#define DEFAULT_PRIORITY 0
|
||||
|
||||
if (isNil QGVAR(lastHint)) then {
|
||||
GVAR(lastHint) = [0, 0];
|
||||
};
|
||||
|
||||
_this resize 4;
|
||||
|
||||
_this spawn {
|
||||
private ["_text", "_sound", "_delay", "_priority", "_lastHintTime", "_lastHintPriority", "_time"];
|
||||
private ["_text", "_sound", "_delay", "_priority", "_lastHintTime", "_lastHintPriority", "_time"];
|
||||
_text = _this select 0;
|
||||
_sound = _this select 1;
|
||||
_delay = _this select 2;
|
||||
_priority = _this select 3;
|
||||
|
||||
_text = _this select 0;
|
||||
_sound = _this select 1;
|
||||
_delay = _this select 2;
|
||||
_priority = _this select 3;
|
||||
if (isNil QGVAR(lastHint)) then {
|
||||
GVAR(lastHint) = [0, 0];
|
||||
};
|
||||
|
||||
_lastHintTime = GVAR(lastHint) select 0;
|
||||
_lastHintPriority = GVAR(lastHint) select 1;
|
||||
_lastHintTime = GVAR(lastHint) select 0;
|
||||
_lastHintPriority = GVAR(lastHint) select 1;
|
||||
|
||||
if !(typeName _text in ["STRING", "TEXT"]) then {_text = str _text};
|
||||
if (isNil "_sound") then {_sound = DEFAULT_PLAY_SOUND};
|
||||
if (isNil "_delay") then {_delay = DEFAULT_DELAY};
|
||||
if (isNil "_priority") then {_priority = DEFAULT_PRIORITY};
|
||||
if !(typeName _text in ["STRING", "TEXT"]) then {_text = str _text};
|
||||
if (isNil "_sound") then {_sound = DEFAULT_PLAY_SOUND};
|
||||
if (isNil "_delay") then {_delay = DEFAULT_DELAY};
|
||||
if (isNil "_priority") then {_priority = DEFAULT_PRIORITY};
|
||||
|
||||
_time = time;
|
||||
if (_time > _lastHintTime + _delay || {_priority >= _lastHintPriority}) then {
|
||||
_time = time;
|
||||
if (_time > _lastHintTime + _delay || {_priority >= _lastHintPriority}) then {
|
||||
hintSilent _text;
|
||||
if (_sound) then {playSound "ACE_Sound_Click"};
|
||||
GVAR(lastHint) set [0, _time];
|
||||
GVAR(lastHint) set [1, _priority];
|
||||
|
||||
sleep _delay;
|
||||
if (_time == GVAR(lastHint) select 0) then {hintSilent ""};
|
||||
};
|
||||
[{if ((_this select 0) == GVAR(lastHint) select 0) then {hintSilent ""};}, [_time], _delay, 0] call FUNC(waitAndExecute);
|
||||
};
|
||||
|
@ -1,30 +1,44 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Author: commy2, Glowbal
|
||||
*
|
||||
* Display a structured text with image.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Text (Anything)
|
||||
* 1: Image (String)
|
||||
* 0: Text <ANY>
|
||||
* 1: Image <STRING>
|
||||
* 2: Image color <ARRAY> <OPTIONAL>
|
||||
* 3: Target Unit. Will only display if target is the player controlled object <OBJECT> <OPTIONAL>
|
||||
*
|
||||
* Return value:
|
||||
* Nothing
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_text", "_image"];
|
||||
|
||||
private ["_text", "_image", "_imageColor", "_target"];
|
||||
_text = _this select 0;
|
||||
_image = _this select 1;
|
||||
_imageColor = if (count _this > 2) then {_this select 2} else {[1,1,1]};
|
||||
_imageColor resize 3;
|
||||
_target = if (count _this > 3) then {_this select 3} else {ACE_player};
|
||||
|
||||
if (_target != ACE_player) exitWith {};
|
||||
|
||||
if (typeName _text != "TEXT") then {
|
||||
_text = parseText format ["<t align='center'>%1</t>", _text];
|
||||
if (typeName _text == "ARRAY") then {
|
||||
if (count _text > 0) then {
|
||||
{
|
||||
if (typeName _x == "STRING" && {isLocalized _x}) then {
|
||||
_text set [_foreachIndex, localize _x];
|
||||
};
|
||||
}foreach _text;
|
||||
_text = format _text;
|
||||
};
|
||||
};
|
||||
if (typeName _text == "STRING" && {isLocalized _text}) then {
|
||||
_text = localize _text;
|
||||
};
|
||||
_text = parseText format ["<t align='center'>%1</t>", _text];
|
||||
};
|
||||
|
||||
_text = composeText [
|
||||
parseText format ["<img size='2.5' align='center' color='#ffffff' image='%1'/>", _image],
|
||||
lineBreak,
|
||||
_text
|
||||
];
|
||||
|
||||
[_text] call FUNC(displayTextStructured);
|
||||
_text = composeText [parseText format ["<img size='2' align='center' color='%2' image='%1'/>", _image, _imageColor call BIS_fnc_colorRGBtoHTML], lineBreak, _text];
|
||||
[_text, 2] call FUNC(displayTextStructured);
|
||||
|
@ -1,26 +1,41 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Author: commy2, Glowbal
|
||||
*
|
||||
* Display a structured text.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Text (Anything)
|
||||
* 1: Size of the textbox (Number, optional default: 1)
|
||||
* 0: Text <ANY>
|
||||
* 1: Size of the textbox <NUMBER> <OPTIONAL>
|
||||
* 2: Target Unit. Will only display if target is the player controlled object <OBJECT> <OPTIONAL>
|
||||
*
|
||||
* Return value:
|
||||
* Nothing
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_text", "_size", "_isShown", "_ctrlHint"];
|
||||
|
||||
private ["_text", "_size", "_isShown", "_ctrlHint", "_yPos", "_xPos", "_wPos", "_hPos", "_position", "_target"];
|
||||
_text = _this select 0;
|
||||
_size = _this select 1;
|
||||
_size = if (count _this > 1) then {_this select 1} else {1.5;};
|
||||
_target = if (count _this > 2) then {_this select 2} else {ACE_player};
|
||||
|
||||
if (isNil "_size") then {_size = 1};
|
||||
if (_target != ACE_player) exitWith {};
|
||||
|
||||
if (typeName _text != "TEXT") then {
|
||||
_text = composeText [lineBreak, parseText format ["<t align='center'>%1</t>", _text]];
|
||||
if (typeName _text == "ARRAY") then {
|
||||
if (count _text > 0) then {
|
||||
{
|
||||
if (typeName _x == "STRING" && {isLocalized _x}) then {
|
||||
_text set [_foreachIndex, localize _x];
|
||||
};
|
||||
}foreach _text;
|
||||
_text = format _text;
|
||||
};
|
||||
};
|
||||
if (typeName _text == "STRING" && {isLocalized _text}) then {
|
||||
_text = localize _text;
|
||||
};
|
||||
_text = composeText [lineBreak, parseText format ["<t align='center'>%1</t>", _text]];
|
||||
};
|
||||
|
||||
_isShown = ctrlShown (uiNamespace getVariable ["ACE_ctrlHint", controlNull]);
|
||||
@ -30,19 +45,31 @@ _isShown = ctrlShown (uiNamespace getVariable ["ACE_ctrlHint", controlNull]);
|
||||
disableSerialization;
|
||||
_ctrlHint = uiNamespace getVariable "ACE_ctrlHint";
|
||||
|
||||
_ctrlHint ctrlSetPosition [
|
||||
safeZoneW + safeZoneX - 0 * safezoneW,
|
||||
safeZoneY + 0.2 * safezoneH,
|
||||
0.2 * safeZoneW,
|
||||
_size * 0.1 * SafeZoneH
|
||||
];
|
||||
_ctrlHint ctrlSetBackgroundColor GVAR(displayTextColor);
|
||||
_ctrlHint ctrlSetTextColor GVAR(displayTextFontColor);
|
||||
/*
|
||||
// This does not function at the moment. Has been disabled until it fixed.
|
||||
_xPos = profilenamespace getvariable ["IGUI_GRID_ACE_displayText_X", ((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40))];
|
||||
_yPos = profilenamespace getvariable ["IGUI_GRID_ACE_displayText_Y", safeZoneY + 0.175 * safezoneH];
|
||||
_wPos = profilenamespace getvariable ["IGUI_GRID_ACE_displayText_W", (10 *(((safezoneW / safezoneH) min 1.2) / 40))];
|
||||
_hPos = profilenamespace getvariable ["IGUI_GRID_ACE_displayText_H", (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))];
|
||||
*/
|
||||
|
||||
_xPos = ((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40));
|
||||
_yPos = safeZoneY + 0.175 * safezoneH;
|
||||
_wPos = (10 *(((safezoneW / safezoneH) min 1.2) / 40));
|
||||
_hPos = (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25));
|
||||
|
||||
//Zeus Interface Open and Display would be under the "CREATE" list
|
||||
if (!isnull curatorCamera) then {
|
||||
_xPos = _xPos min ((safezoneX + safezoneW - 12.5 * (((safezoneW / safezoneH) min 1.2) / 40)) - _wPos);
|
||||
};
|
||||
|
||||
_position = [_xPos, _yPos, _wPos, _size * _hPos];
|
||||
|
||||
_ctrlHint ctrlSetPosition _position;
|
||||
_ctrlHint ctrlCommit 0;
|
||||
|
||||
_ctrlHint ctrlSetStructuredText _text;
|
||||
_ctrlHint ctrlSetPosition [
|
||||
safeZoneW + safeZoneX - 0.2 * safezoneW,
|
||||
safeZoneY + 0.2 * safezoneH,
|
||||
0.2 * safeZoneW,
|
||||
_size * 0.1 * SafeZoneH
|
||||
];
|
||||
_ctrlHint ctrlCommit ([0.2, 0] select _isShown);
|
||||
_ctrlHint ctrlSetPosition _position;
|
||||
_ctrlHint ctrlCommit ([0.5, 0] select _isShown);
|
||||
|
@ -1,39 +0,0 @@
|
||||
/**
|
||||
* fn_dropWeapon_f.sqf
|
||||
* @Descr: N/A
|
||||
* @Author: Glowbal
|
||||
*
|
||||
* @Arguments: []
|
||||
* @Return:
|
||||
* @PublicAPI: false
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private ["_unit","_currentWeapon","_currentAnimation", "_WeaponHolder"];
|
||||
_unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param;
|
||||
|
||||
_currentWeapon = currentWeapon _unit;
|
||||
_currentAnimation = animationState _unit;
|
||||
_WeaponHolder = "GroundWeaponHolder" createVehicle position _unit;
|
||||
|
||||
_unit removeWeapon _currentWeapon;
|
||||
_weaponHolder addWeaponCargoGlobal [_currentWeapon, 1];
|
||||
//_unit action [ "DropWeapon", _WeaponHolder, _currentWeapon ];
|
||||
_WeaponHolder setPos (getPos _unit);
|
||||
//_unit switchMove _currentAnimation;
|
||||
|
||||
_primairyWeapon = primaryWeapon _unit;
|
||||
_secondairyWeapon = secondaryWeapon _unit;
|
||||
_handGunWeapon = handgunWeapon _unit;
|
||||
|
||||
switch (_currentWeapon) do {
|
||||
case _primairyWeapon: {
|
||||
|
||||
};
|
||||
case _secondairyWeapon: {
|
||||
|
||||
};
|
||||
case _handGunWeapon: {
|
||||
|
||||
};
|
||||
default {};
|
||||
};
|
25
addons/common/functions/fnc_dumpArray.sqf
Normal file
25
addons/common/functions/fnc_dumpArray.sqf
Normal file
@ -0,0 +1,25 @@
|
||||
//fnc_dumpArray.sqf
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_var", "_depth", "_pad", "_i", "_x"];
|
||||
|
||||
_var = _this select 0;
|
||||
_depth = _this select 1;
|
||||
_pad = "";
|
||||
for "_i" from 0 to _depth do {
|
||||
_pad = _pad + toString [9];
|
||||
};
|
||||
_depth = _depth + 1;
|
||||
if(IS_ARRAY(_var)) then {
|
||||
if((count _var) > 0) then {
|
||||
diag_log text format["%1[", _pad];
|
||||
{
|
||||
[_x, _depth] call FUNC(dumpArray);
|
||||
} forEach _var;
|
||||
diag_log text format["%1],", _pad];
|
||||
} else {
|
||||
diag_log text format["%1[],", _pad];
|
||||
};
|
||||
} else {
|
||||
diag_log text format["%1%2", _pad, [_var] call FUNC(formatVar)];
|
||||
};
|
73
addons/common/functions/fnc_dumpPerformanceCounters.sqf
Normal file
73
addons/common/functions/fnc_dumpPerformanceCounters.sqf
Normal file
@ -0,0 +1,73 @@
|
||||
//fnc_dumpPerformanceCounters.sqf
|
||||
#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
diag_log text format["REGISTERED ACE PFH HANDLERS"];
|
||||
diag_log text format["-------------------------------------------"];
|
||||
if(!isNil "ACE_PFH") then {
|
||||
{
|
||||
private["_pfh"];
|
||||
_pfh = _x select 0;
|
||||
diag_log text format["Registered PFH: id=%1, %1:%2", (_pfh select 0), (_pfh select 1), (_pfh select 2) ];
|
||||
} forEach ACE_PFH;
|
||||
};*/
|
||||
|
||||
diag_log text format["ACE COUNTER RESULTS"];
|
||||
diag_log text format["-------------------------------------------"];
|
||||
{
|
||||
private["_counterEntry", "_iter", "_total", "_count", "_delta", "_averageResult"];
|
||||
_counterEntry = _x;
|
||||
_iter = 0;
|
||||
_total = 0;
|
||||
_count = 0;
|
||||
_averageResult = 0;
|
||||
if( (count _counterEntry) > 3) then {
|
||||
// calc
|
||||
{
|
||||
if(_iter > 2) then {
|
||||
_count = _count + 1;
|
||||
_delta = (_x select 1) - (_x select 0);
|
||||
|
||||
_total = _total + _delta;
|
||||
};
|
||||
_iter = _iter + 1;
|
||||
} forEach _counterEntry;
|
||||
|
||||
// results
|
||||
_averageResult = (_total / _count) * 1000;
|
||||
|
||||
// dump results
|
||||
diag_log text format["%1: Average: %2s / %3 = %4ms", (_counterEntry select 0), _total, _count, _averageResult];
|
||||
} else {
|
||||
diag_log text format["%1: No results", (_counterEntry select 0) ];
|
||||
};
|
||||
} forEach ACE_COUNTERS;
|
||||
|
||||
/*
|
||||
// Dump PFH Trackers
|
||||
diag_log text format["ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER"];
|
||||
diag_log text format["-------------------------------------------"];
|
||||
{
|
||||
private["_delay"];
|
||||
_delay = _x select 2;
|
||||
//if(_delay > 0) then { _delay = _delay / 1000; };
|
||||
|
||||
diag_log text format["%1: %2s, delay=%3, handle=%4",(_x select 0), _delay, (_x select 3), (_x select 4)];
|
||||
} forEach ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER;
|
||||
|
||||
// Dump PFH Trackers
|
||||
diag_log text format["ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER"];
|
||||
diag_log text format["-------------------------------------------"];
|
||||
{
|
||||
private["_delta"];
|
||||
_delta = _x select 1;
|
||||
//if(_delta > 0) then { _delta = _delta / 1000; };
|
||||
diag_log text format[" DELTA: %1s", _delta];
|
||||
} forEach ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER;
|
||||
|
||||
//{
|
||||
//
|
||||
//} forEach ACRE_EXCESSIVE_FRAME_TRACKER;
|
||||
|
||||
*/
|
@ -14,17 +14,17 @@
|
||||
|
||||
// ACRE
|
||||
if (isClass (configFile >> "CfgPatches" >> "acre_main")) then {
|
||||
[-1] call acre_core_fnc_handleMultiPttKeyPressUp;
|
||||
[0] call acre_core_fnc_handleMultiPttKeyPressUp;
|
||||
[1] call acre_core_fnc_handleMultiPttKeyPressUp;
|
||||
[2] call acre_core_fnc_handleMultiPttKeyPressUp;
|
||||
[-1] call acre_core_fnc_handleMultiPttKeyPressUp;
|
||||
[0] call acre_core_fnc_handleMultiPttKeyPressUp;
|
||||
[1] call acre_core_fnc_handleMultiPttKeyPressUp;
|
||||
[2] call acre_core_fnc_handleMultiPttKeyPressUp;
|
||||
};
|
||||
|
||||
// TFAR
|
||||
if (isClass (configFile >> "CfgPatches" >> "task_force_radio")) then {
|
||||
call TFAR_fnc_onSwTangentReleased;
|
||||
call TFAR_fnc_onAdditionalSwTangentReleased;
|
||||
call TFAR_fnc_onLRTangentReleased;
|
||||
call TFAR_fnc_onAdditionalLRTangentReleased;
|
||||
call TFAR_fnc_onDDTangentReleased;
|
||||
call TFAR_fnc_onSwTangentReleased;
|
||||
call TFAR_fnc_onAdditionalSwTangentReleased;
|
||||
call TFAR_fnc_onLRTangentReleased;
|
||||
call TFAR_fnc_onAdditionalLRTangentReleased;
|
||||
call TFAR_fnc_onDDTangentReleased;
|
||||
};
|
||||
|
18
addons/common/functions/fnc_eraseCache.sqf
Normal file
18
addons/common/functions/fnc_eraseCache.sqf
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Author: CAA-Picard
|
||||
* Deletes a cached result
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Namespace to store the cache on <NAMESPACE>
|
||||
* 1: Cache uid <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_2_PVT(_this,_namespace,_uid);
|
||||
|
||||
_namespace setVariable [_uid, nil];
|
@ -1,8 +1,8 @@
|
||||
// by commy2
|
||||
/*
|
||||
usage:
|
||||
usage:
|
||||
|
||||
(configFile >> "CfgAmmo") call FUNC(exportConfig);
|
||||
(configFile >> "CfgAmmo") call FUNC(exportConfig);
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
|
@ -1,25 +0,0 @@
|
||||
/**
|
||||
* fn_findItem.sqf
|
||||
* @Descr:
|
||||
* @Author: Glowbal
|
||||
*
|
||||
* @Arguments: []
|
||||
* @Return:
|
||||
* @PublicAPI: true
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private ["_unit","_magazine","_return"];
|
||||
_unit = _this select 0;
|
||||
_item = _this select 1;
|
||||
|
||||
if (_item in (uniformItems _unit)) exitwith {1};
|
||||
if (_item in (vestItems _unit)) exitwith {2};
|
||||
if (_item in (backpackItems _unit)) exitwith {3};
|
||||
if (_item in (assignedItems _unit)) exitwith {4};
|
||||
if (_item in (primaryWeaponItems _unit)) exitwith {5};
|
||||
if (_item in (secondaryWeaponItems _unit)) exitwith {6};
|
||||
if (_item in (handgunItems _unit)) exitwith {7};
|
||||
if (_item in (items _unit)) exitwith {8}; // in case it is in items but cannot be found in any other container (should never reach this)
|
||||
|
||||
// If we cannot find the item, return 0.
|
||||
0;
|
@ -1,21 +0,0 @@
|
||||
/**
|
||||
* fn_findMagazine.sqf
|
||||
* @Descr: Find where the current magazines are. Order: uniform, vest, backpack, any.
|
||||
* @Author: Glowbal
|
||||
*
|
||||
* @Arguments: [unit OBJECT, magazine STRING (Classname of magazine)]
|
||||
* @Return: NUMBER 0 = none, 1 = in uniform, 2 = in vest, 3 = in backpack, 4 = found outside container
|
||||
* @PublicAPI: true
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private ["_unit","_magazine"];
|
||||
_unit = _this select 0;
|
||||
_magazine = _this select 1;
|
||||
|
||||
if (_magazine in (getMagazineCargo uniformContainer _unit)) exitwith {1};
|
||||
if (_magazine in (getMagazineCargo vestContainer _unit)) exitwith {2};
|
||||
if (_magazine in (getMagazineCargo backpackContainer _unit)) exitwith {3};
|
||||
if (_magazine in (magazines _unit)) exitwith {4}; // in case it cannot be found in any other container. Most likely loaded in a weapon.
|
||||
|
||||
// If we cannot find the item, return 0.
|
||||
0;
|
21
addons/common/functions/fnc_fixCollision.sqf
Normal file
21
addons/common/functions/fnc_fixCollision.sqf
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Attempt to fix physx collisions causing unreasonable impact forces and damage.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Object <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
// allowDamage requires local object
|
||||
if (!local _this) exitWith {};
|
||||
|
||||
// prevent collision damage, @todo allowDamage API
|
||||
_this allowDamage false;
|
||||
|
||||
// re-allow damage after 2 seconds
|
||||
[{_this allowDamage true}, _this, 2, 0] call EFUNC(common,waitAndExecute);
|
32
addons/common/functions/fnc_fixFloating.sqf
Normal file
32
addons/common/functions/fnc_fixFloating.sqf
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Attempt to fix floating physx with disabled damage after setPosXXX commands.
|
||||
*
|
||||
* Arguments:
|
||||
* Physx object (Object)
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private "_object";
|
||||
|
||||
_object = _this;
|
||||
|
||||
// setHitPointDamage requires local object
|
||||
if (!local _object) exitWith {};
|
||||
|
||||
// save and restore hitpoints, see below why
|
||||
private ["_hitPoints", "_hitPointDamages"];
|
||||
|
||||
_hitPoints = [_object] call FUNC(getHitpoints);
|
||||
_hitPointDamages = [_hitPoints, {_object getHitPointDamage _this}] call FUNC(map);
|
||||
|
||||
// this prevents physx objects from floating when near other physx objects with allowDamage false
|
||||
_object setDamage damage _object;
|
||||
|
||||
{
|
||||
_object setHitPointDamage [_x, _hitPointDamages select _forEachIndex];
|
||||
} forEach _hitPoints;
|
29
addons/common/functions/fnc_fixPosition.sqf
Normal file
29
addons/common/functions/fnc_fixPosition.sqf
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Fixes position of an object. E.g. moves object above ground and adjusts to terrain slope. Requires local object.
|
||||
*
|
||||
* Argument:
|
||||
* Object (Object)
|
||||
*
|
||||
* Return value:
|
||||
* NONE
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
// setVectorUp requires local object
|
||||
if (!local _this) exitWith {};
|
||||
|
||||
private "_position";
|
||||
_position = getPos _this;
|
||||
|
||||
// don't place the object below the ground
|
||||
if (_position select 2 < -0.1) then {
|
||||
_position set [2, -0.1];
|
||||
_this setPos _position;
|
||||
};
|
||||
|
||||
// adjust position to sloped terrain, if placed on ground
|
||||
if (getPosATL _this select 2 == _position select 2) then {
|
||||
_this setVectorUp surfaceNormal _position;
|
||||
};
|
@ -1,12 +0,0 @@
|
||||
/**
|
||||
* fn_getCanInteract.sqf
|
||||
* @Descr: N/A
|
||||
* @Author: Glowbal
|
||||
*
|
||||
* @Arguments: []
|
||||
* @Return:
|
||||
* @PublicAPI: false
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
((_this select 0) getvariable [QGVAR(canInteract),0])
|
@ -1,45 +0,0 @@
|
||||
/**
|
||||
* fn_getCustomResults_f.sqf
|
||||
* @Descr: Executes custom results eventhandlers, collects their output and returns this.
|
||||
* @Author: Glowbal
|
||||
*
|
||||
* @Arguments: [arguments ANY, handle STRING]
|
||||
* @Return: ARRAY Collection of all return values of all executed CustomResult handlers
|
||||
* @PublicAPI: true
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_arguments","_handle","_ehCfg","_eventHandlerCollection","_eventHandlerName","_cfg","_code","_classType", "_return"];
|
||||
_arguments = _this select 0;
|
||||
_handle = _this select 1;
|
||||
|
||||
_eventHandlerName = ("ace_f_custom_results_eventhandler_" + _handle);
|
||||
_eventHandlerCollection = missionNamespace getvariable _eventHandlerName;
|
||||
if (isnil "_eventHandlerCollection") then {
|
||||
_eventHandlerCollection = [];
|
||||
|
||||
// TODO Get a replacement for this
|
||||
_cfg = (ConfigFile >> "Advanced_Combat_Environment" >> "CustomResults" >> _handle);
|
||||
if (isClass _cfg) then {
|
||||
_numberOfEH = count _cfg;
|
||||
for [{_EHiterator=0}, {(_EHiterator< _numberOfEH)}, {_EHiterator=_EHiterator+1}] do {
|
||||
_ehCfg = _cfg select _EHiterator;
|
||||
if (isClass _ehCfg) then {
|
||||
_classType = (ConfigName _ehCfg);
|
||||
_code = (compile getText(_ehCfg >> "onCall"));
|
||||
_eventHandlerCollection pushback [_classType, _code];
|
||||
true;
|
||||
};
|
||||
};
|
||||
};
|
||||
missionNamespace setvariable [_eventHandlerName, _eventHandlerCollection];
|
||||
};
|
||||
|
||||
_return = [];
|
||||
{
|
||||
_return pushback (_arguments call (_x select 1));
|
||||
false;
|
||||
}count _eventHandlerCollection;
|
||||
|
||||
_return
|
@ -20,9 +20,9 @@ private "_gunner";
|
||||
_gunner = objNull;
|
||||
|
||||
{
|
||||
if (_weapon in (_vehicle weaponsTurret _x)) exitWith {
|
||||
_gunner = _vehicle turretUnit _x;
|
||||
};
|
||||
if (_weapon in (_vehicle weaponsTurret _x)) exitWith {
|
||||
_gunner = _vehicle turretUnit _x;
|
||||
};
|
||||
} forEach allTurrets _vehicle;
|
||||
|
||||
_gunner
|
||||
|
@ -23,33 +23,33 @@ _hitpoints = [];
|
||||
private "_hitpointClasses";
|
||||
_hitpointClasses = [_config >> "HitPoints"];
|
||||
{
|
||||
private "_class";
|
||||
_class = ([_config, _x] call FUNC(getTurretConfigPath)) >> "HitPoints";
|
||||
private "_class";
|
||||
_class = ([_config, _x] call FUNC(getTurretConfigPath)) >> "HitPoints";
|
||||
|
||||
if (isClass _class) then {
|
||||
_hitpointClasses pushBack _class;
|
||||
};
|
||||
if (isClass _class) then {
|
||||
_hitpointClasses pushBack _class;
|
||||
};
|
||||
|
||||
} forEach allTurrets _vehicle;
|
||||
|
||||
// iterate through all classes with hitpoints and their parents
|
||||
{
|
||||
private "_class";
|
||||
_class = _x;
|
||||
private "_class";
|
||||
_class = _x;
|
||||
|
||||
while {isClass _class} do {
|
||||
while {isClass _class} do {
|
||||
|
||||
for "_i" from 0 to (count _class - 1) do {
|
||||
private "_entry";
|
||||
_entry = configName (_class select _i);
|
||||
for "_i" from 0 to (count _class - 1) do {
|
||||
private "_entry";
|
||||
_entry = configName (_class select _i);
|
||||
|
||||
if (!(_entry in _hitpoints) && {!isNil {_vehicle getHitPointDamage _entry}}) then {
|
||||
_hitpoints pushBack _entry;
|
||||
};
|
||||
};
|
||||
if (!(_entry in _hitpoints) && {!isNil {_vehicle getHitPointDamage _entry}}) then {
|
||||
_hitpoints pushBack _entry;
|
||||
};
|
||||
};
|
||||
|
||||
_class = inheritsFrom _class;
|
||||
};
|
||||
_class = inheritsFrom _class;
|
||||
};
|
||||
|
||||
} forEach _hitpointClasses;
|
||||
|
||||
|
@ -24,36 +24,36 @@ _selections = [];
|
||||
private "_hitpointClasses";
|
||||
_hitpointClasses = [_config >> "HitPoints"];
|
||||
{
|
||||
private "_class";
|
||||
_class = ([_config, _x] call FUNC(getTurretConfigPath)) >> "HitPoints";
|
||||
private "_class";
|
||||
_class = ([_config, _x] call FUNC(getTurretConfigPath)) >> "HitPoints";
|
||||
|
||||
if (isClass _class) then {
|
||||
_hitpointClasses pushBack _class;
|
||||
};
|
||||
if (isClass _class) then {
|
||||
_hitpointClasses pushBack _class;
|
||||
};
|
||||
|
||||
} forEach allTurrets _vehicle;
|
||||
|
||||
// iterate through all classes with hitpoints and their parents
|
||||
{
|
||||
private "_class";
|
||||
_class = _x;
|
||||
private "_class";
|
||||
_class = _x;
|
||||
|
||||
while {isClass _class} do {
|
||||
while {isClass _class} do {
|
||||
|
||||
for "_i" from 0 to (count _class - 1) do {
|
||||
private ["_entry", "_selection"];
|
||||
for "_i" from 0 to (count _class - 1) do {
|
||||
private ["_entry", "_selection"];
|
||||
|
||||
_entry = configName (_class select _i);
|
||||
_selection = getText (_class select _i >> "name");
|
||||
_entry = configName (_class select _i);
|
||||
_selection = getText (_class select _i >> "name");
|
||||
|
||||
if (!(_selection in _selections) && {!isNil {_vehicle getHit _selection}}) then {
|
||||
_hitpoints pushBack _entry;
|
||||
_selections pushBack _selection;
|
||||
};
|
||||
};
|
||||
if (!(_selection in _selections) && {!isNil {_vehicle getHit _selection}}) then {
|
||||
_hitpoints pushBack _entry;
|
||||
_selections pushBack _selection;
|
||||
};
|
||||
};
|
||||
|
||||
_class = inheritsFrom _class;
|
||||
};
|
||||
_class = inheritsFrom _class;
|
||||
};
|
||||
|
||||
} forEach _hitpointClasses;
|
||||
|
||||
|
@ -1,14 +0,0 @@
|
||||
/**
|
||||
* fn_getWeaponItems_f.sqf
|
||||
* @Descr: Get the weapon items from the unit.
|
||||
* @Author: Glowbal
|
||||
*
|
||||
* @Arguments: [unit OBJECT]
|
||||
* @Return:
|
||||
* @PublicAPI: false
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
private "_unit";
|
||||
_unit = _this select 0;
|
||||
|
||||
[primaryWeaponItems _unit, secondaryWeaponItems _unit, handgunItems _unit];
|
@ -9,18 +9,18 @@ _key = _this select 1;
|
||||
ERRORDATA(2);
|
||||
_val = nil;
|
||||
try {
|
||||
if(VALIDHASH(_hash)) then {
|
||||
_index = (_hash select 0) find _key;
|
||||
if(_index != -1) then {
|
||||
_val = (_hash select 1) select _index;
|
||||
if(IS_STRING(_val) && {_val == "ACREHASHREMOVEDONOTUSETHISVAL"}) then {
|
||||
_val = nil;
|
||||
};
|
||||
};
|
||||
} else {
|
||||
ERROR("Input hash is not valid");
|
||||
};
|
||||
if(VALIDHASH(_hash)) then {
|
||||
_index = (_hash select 0) find _key;
|
||||
if(_index != -1) then {
|
||||
_val = (_hash select 1) select _index;
|
||||
if(IS_STRING(_val) && {_val == "ACREHASHREMOVEDONOTUSETHISVAL"}) then {
|
||||
_val = nil;
|
||||
};
|
||||
};
|
||||
} else {
|
||||
ERROR("Input hash is not valid");
|
||||
};
|
||||
} catch {
|
||||
HANDLECATCH;
|
||||
HANDLECATCH;
|
||||
};
|
||||
_val
|
||||
|
@ -9,15 +9,15 @@ _key = _this select 1;
|
||||
ERRORDATA(2);
|
||||
_val = false;
|
||||
try {
|
||||
if(VALIDHASH(_hash)) then {
|
||||
_index = (_hash select 0) find _key;
|
||||
if(_index != -1) then {
|
||||
_val = true;
|
||||
};
|
||||
} else {
|
||||
ERROR("Input hash is not valid");
|
||||
};
|
||||
if(VALIDHASH(_hash)) then {
|
||||
_index = (_hash select 0) find _key;
|
||||
if(_index != -1) then {
|
||||
_val = true;
|
||||
};
|
||||
} else {
|
||||
ERROR("Input hash is not valid");
|
||||
};
|
||||
} catch {
|
||||
HANDLECATCH;
|
||||
HANDLECATCH;
|
||||
};
|
||||
_val
|
||||
|
@ -7,12 +7,12 @@ _hashList = _this select 0;
|
||||
ERRORDATA(1);
|
||||
_hashKeys = [];
|
||||
try {
|
||||
if(VALIDHASH(_hashList)) then {
|
||||
_hashKeys = (_hashList select 0);
|
||||
} else {
|
||||
ERROR("Input hashlist is not valid");
|
||||
};
|
||||
if(VALIDHASH(_hashList)) then {
|
||||
_hashKeys = (_hashList select 0);
|
||||
} else {
|
||||
ERROR("Input hashlist is not valid");
|
||||
};
|
||||
} catch {
|
||||
HANDLECATCH;
|
||||
HANDLECATCH;
|
||||
};
|
||||
[_hashKeys, []];
|
||||
|
@ -7,11 +7,11 @@ _hashList = _this select 0;
|
||||
_value = _this select 1;
|
||||
ERRORDATA(2);
|
||||
try {
|
||||
if(VALIDHASH(_hashList)) then {
|
||||
[_hashList, (count (_hashList select 1)), _value] call FUNC(hashListSet);
|
||||
} else {
|
||||
ERROR("Input hashlist in push not valid");
|
||||
};
|
||||
if(VALIDHASH(_hashList)) then {
|
||||
[_hashList, (count (_hashList select 1)), _value] call FUNC(hashListSet);
|
||||
} else {
|
||||
ERROR("Input hashlist in push not valid");
|
||||
};
|
||||
} catch {
|
||||
HANDLECATCH;
|
||||
HANDLECATCH;
|
||||
};
|
||||
|
@ -8,20 +8,20 @@ _index = _this select 1;
|
||||
ERRORDATA(2);
|
||||
_hash = nil;
|
||||
try {
|
||||
if(VALIDHASH(_hashList)) then {
|
||||
_keys = _hashList select 0;
|
||||
_hashes = _hashList select 1;
|
||||
if(_index < (count _hashes)) then {
|
||||
_values = _hashes select _index;
|
||||
if(VALIDHASH(_hashList)) then {
|
||||
_keys = _hashList select 0;
|
||||
_hashes = _hashList select 1;
|
||||
if(_index < (count _hashes)) then {
|
||||
_values = _hashes select _index;
|
||||
|
||||
_hash = [_keys, _values, 1];
|
||||
} else {
|
||||
ERROR("Index of hashlist is out of range");
|
||||
};
|
||||
} else {
|
||||
ERROR("Input hashlist is not valid");
|
||||
};
|
||||
_hash = [_keys, _values, 1];
|
||||
} else {
|
||||
ERROR("Index of hashlist is out of range");
|
||||
};
|
||||
} else {
|
||||
ERROR("Input hashlist is not valid");
|
||||
};
|
||||
} catch {
|
||||
HANDLECATCH;
|
||||
HANDLECATCH;
|
||||
};
|
||||
_hash;
|
||||
|
@ -8,17 +8,17 @@ _index = _this select 1;
|
||||
_value = _this select 2;
|
||||
ERRORDATA(3);
|
||||
try {
|
||||
if(VALIDHASH(_hashList)) then {
|
||||
if(VALIDHASH(_value)) then {
|
||||
_vals = _value select 1;
|
||||
|
||||
(_hashList select 1) set[_index, _vals];
|
||||
} else {
|
||||
ERROR("Set hash in hashlist is not valid");
|
||||
};
|
||||
} else {
|
||||
ERROR("Input hashlist is not valid");
|
||||
};
|
||||
if(VALIDHASH(_hashList)) then {
|
||||
if(VALIDHASH(_value)) then {
|
||||
_vals = _value select 1;
|
||||
|
||||
(_hashList select 1) set[_index, _vals];
|
||||
} else {
|
||||
ERROR("Set hash in hashlist is not valid");
|
||||
};
|
||||
} else {
|
||||
ERROR("Input hashlist is not valid");
|
||||
};
|
||||
} catch {
|
||||
HANDLECATCH;
|
||||
HANDLECATCH;
|
||||
};
|
||||
|
@ -8,23 +8,23 @@ _key = _this select 1;
|
||||
ERRORDATA(2);
|
||||
_val = nil;
|
||||
try {
|
||||
if(VALIDHASH(_hash)) then {
|
||||
_index = (_hash select 0) find _key;
|
||||
if(_index != -1) then {
|
||||
(_hash select 1) set[_index, "ACREHASHREMOVEDONOTUSETHISVAL"];
|
||||
// is this hash is not part of a hash list?
|
||||
// if it is we need to leave the keys intact.
|
||||
if((count _hash) == 2) then {
|
||||
// if this is a standalone hash then we can clean it up
|
||||
(_hash select 0) set[_index, "ACREHASHREMOVEDONOTUSETHISVAL"];
|
||||
_hash set[0, ((_hash select 0) - ["ACREHASHREMOVEDONOTUSETHISVAL"])];
|
||||
_hash set[1, ((_hash select 1) - ["ACREHASHREMOVEDONOTUSETHISVAL"])];
|
||||
};
|
||||
};
|
||||
} else {
|
||||
ERROR("Input hash is not valid");
|
||||
};
|
||||
if(VALIDHASH(_hash)) then {
|
||||
_index = (_hash select 0) find _key;
|
||||
if(_index != -1) then {
|
||||
(_hash select 1) set[_index, "ACREHASHREMOVEDONOTUSETHISVAL"];
|
||||
// is this hash is not part of a hash list?
|
||||
// if it is we need to leave the keys intact.
|
||||
if((count _hash) == 2) then {
|
||||
// if this is a standalone hash then we can clean it up
|
||||
(_hash select 0) set[_index, "ACREHASHREMOVEDONOTUSETHISVAL"];
|
||||
_hash set[0, ((_hash select 0) - ["ACREHASHREMOVEDONOTUSETHISVAL"])];
|
||||
_hash set[1, ((_hash select 1) - ["ACREHASHREMOVEDONOTUSETHISVAL"])];
|
||||
};
|
||||
};
|
||||
} else {
|
||||
ERROR("Input hash is not valid");
|
||||
};
|
||||
} catch {
|
||||
HANDLECATCH;
|
||||
HANDLECATCH;
|
||||
};
|
||||
true
|
||||
|
@ -9,19 +9,19 @@ _key = _this select 1;
|
||||
_val = _this select 2;
|
||||
ERRORDATA(3);
|
||||
try {
|
||||
if(VALIDHASH(_hash)) then {
|
||||
_index = (_hash select 0) find _key;
|
||||
if(_index == -1) then {
|
||||
_index = (_hash select 0) find "ACREHASHREMOVEDONOTUSETHISVAL";
|
||||
if(_index == -1) then {
|
||||
_index = (count (_hash select 0));
|
||||
};
|
||||
(_hash select 0) set[_index, _key];
|
||||
};
|
||||
(_hash select 1) set[_index, _val];
|
||||
} else {
|
||||
ERROR("Input hash is not valid");
|
||||
};
|
||||
if(VALIDHASH(_hash)) then {
|
||||
_index = (_hash select 0) find _key;
|
||||
if(_index == -1) then {
|
||||
_index = (_hash select 0) find "ACREHASHREMOVEDONOTUSETHISVAL";
|
||||
if(_index == -1) then {
|
||||
_index = (count (_hash select 0));
|
||||
};
|
||||
(_hash select 0) set[_index, _key];
|
||||
};
|
||||
(_hash select 1) set[_index, _val];
|
||||
} else {
|
||||
ERROR("Input hash is not valid");
|
||||
};
|
||||
} catch {
|
||||
HANDLECATCH;
|
||||
HANDLECATCH;
|
||||
};
|
||||
|
14
addons/common/functions/fnc_isAlive.sqf
Normal file
14
addons/common/functions/fnc_isAlive.sqf
Normal file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Check if the object still exists and is alive. This function exists because 'alive objNull' actually returns true.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Any object (Object)
|
||||
*
|
||||
* Return value:
|
||||
* The object exists and is alive (Bool).
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
!isNull (_this select 0) && {alive (_this select 0)}
|
@ -1,24 +0,0 @@
|
||||
/**
|
||||
* fn_isHC.sqf
|
||||
* @Descr: Check if current locality is a headless client
|
||||
* @Author: Glowbal
|
||||
*
|
||||
* @Arguments: []
|
||||
* @Return: BOOL True if locality is headless client OR is not in multiplayer
|
||||
* @PublicAPI: true
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_return"];
|
||||
|
||||
if (!isMultiplayer) then {
|
||||
_return = true;
|
||||
} else {
|
||||
if (isServer && !isDedicated) then {
|
||||
_return = true;
|
||||
} else {
|
||||
_return = !(hasInterface || isDedicated);
|
||||
};
|
||||
};
|
||||
_return
|
@ -10,7 +10,7 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
#define GROUP_SWITCH_ID QUOTE(FUNC(loadPerson_F))
|
||||
#define GROUP_SWITCH_ID QUOTE(FUNC(loadPerson))
|
||||
|
||||
private ["_caller", "_unit","_vehicle", "_loadcar", "_loadhelicopter", "_loadtank"];
|
||||
_caller = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param;
|
||||
@ -34,9 +34,9 @@ if (_unit distance _loadcar <= 10) then {
|
||||
};
|
||||
};
|
||||
if (!isNull _vehicle) then {
|
||||
[_unit, true, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide_f);
|
||||
[_unit, true, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide);
|
||||
[_caller,objNull] call FUNC(carryObj);
|
||||
[_unit,objNull] call FUNC(carryObj);
|
||||
[[_unit, _vehicle,_caller], QUOTE(FUNC(loadPersonLocal_F)), _unit, false] call EFUNC(common,execRemoteFnc);
|
||||
[[_unit, _vehicle,_caller], QUOTE(FUNC(loadPersonLocal)), _unit, false] call EFUNC(common,execRemoteFnc);
|
||||
};
|
||||
_vehicle
|
@ -16,13 +16,13 @@ _vehicle = [_this, 1, ObjNull,[ObjNull]] call BIS_fnc_Param;
|
||||
_caller = [_this, 2, ObjNull,[ObjNull]] call BIS_fnc_Param;
|
||||
|
||||
if (!alive _unit) then {
|
||||
_unit = [_unit,_caller] call FUNC(makeCopyOfBody_F);
|
||||
_unit = [_unit,_caller] call FUNC(makeCopyOfBody);
|
||||
};
|
||||
|
||||
_unit moveInCargo _vehicle;
|
||||
_loaded = _vehicle getvariable [QGVAR(loaded_persons_F),[]];
|
||||
_loaded = _vehicle getvariable [QGVAR(loaded_persons),[]];
|
||||
_loaded pushback _unit;
|
||||
_vehicle setvariable [QGVAR(loaded_persons_F),_loaded,true];
|
||||
_vehicle setvariable [QGVAR(loaded_persons),_loaded,true];
|
||||
if (!([_unit] call FUNC(isAwake))) then {
|
||||
_handle = [_unit,_vehicle] spawn {
|
||||
private ["_unit","_vehicle"];
|
@ -18,12 +18,12 @@ if (_moveTo) then {
|
||||
_previousGroup = group _unit;
|
||||
_newGroup = createGroup (side _previousGroup);
|
||||
[_unit] joinSilent _newGroup;
|
||||
_unit setvariable [QGVAR(previousGroup_F),_previousGroup];
|
||||
_unit setvariable [QGVAR(previousGroup),_previousGroup];
|
||||
} else {
|
||||
_previousGroup = _unit getvariable QGVAR(previousGroup_F);
|
||||
_previousGroup = _unit getvariable QGVAR(previousGroup);
|
||||
if (!isnil "_previousGroup") then {
|
||||
_currentGroup = group _unit;
|
||||
_unit setvariable [QGVAR(previousGroup_F),nil];
|
||||
_unit setvariable [QGVAR(previousGroup),nil];
|
||||
[_unit] joinSilent _previousGroup;
|
||||
if (count units _currentGroup == 0) then {
|
||||
deleteGroup _currentGroup;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user