Merge branch 'master' into cookoff-refactor

This commit is contained in:
johnb432 2024-01-27 09:39:54 +01:00
commit a999c81fec
55 changed files with 641 additions and 324 deletions

View File

@ -5,7 +5,7 @@
<p align="center">
<a href="https://github.com/acemod/ACE3/releases/latest">
<img src="https://img.shields.io/badge/Version-3.16.1-blue.svg?style=flat-square" alt="ACE3 Version">
<img src="https://img.shields.io/badge/Version-3.16.3-blue.svg?style=flat-square" alt="ACE3 Version">
</a>
<a href="https://github.com/acemod/ACE3/issues">
<img src="https://img.shields.io/github/issues-raw/acemod/ACE3.svg?style=flat-square&label=Issues" alt="ACE3 Issues">

View File

@ -7,8 +7,8 @@
* 0: The building(s) nearest this position are used <POSITION>
* 1: Limit the building search to those type of building <ARRAY>
* 2: Units that will be garrisoned <ARRAY>
* 3: Radius to fill building(s) <SCALAR> (default: 50)
* 4: 0: even filling, 1: building by building, 2: random filling <SCALAR> (default: 0)
* 3: Radius to fill building(s) <NUMBER> (default: 50)
* 4: 0: even filling, 1: building by building, 2: random filling <NUMBER> (default: 0)
* 5: True to fill building(s) from top to bottom <BOOL> (default: false) (note: only works with filling mode 0 and 1)
* 6: Teleport units <BOOL> (default: false)

View File

@ -12,57 +12,10 @@ PREP_RECOMPILE_END;
#include "initSettings.inc.sqf"
// Arsenal events
[QGVAR(statsToggle), {
params ["_display", "_showStats"];
private _statsCtrlGroupCtrl = _display displayCtrl IDC_statsBox;
private _statsPreviousPageCtrl = _display displayCtrl IDC_statsPreviousPage;
private _statsNextPageCtrl = _display displayCtrl IDC_statsNextPage;
private _statsCurrentPageCtrl = _display displayCtrl IDC_statsCurrentPage;
{
_x ctrlShow (GVAR(showStats) && {_showStats});
} forEach [
_statsCtrlGroupCtrl,
_statsPreviousPageCtrl,
_statsNextPageCtrl,
_statsCurrentPageCtrl
];
}] call CBA_fnc_addEventHandler;
[QGVAR(statsChangePage), {
_this call FUNC(buttonStatsPage);
}] call CBA_fnc_addEventHandler;
[QGVAR(displayStats), {
_this call FUNC(handleStats);
}] call CBA_fnc_addEventHandler;
[QGVAR(actionsChangePage), {
_this call FUNC(buttonActionsPage);
}] call CBA_fnc_addEventHandler;
[QGVAR(displayActions), {
_this call FUNC(handleActions);
}] call CBA_fnc_addEventHandler;
[QGVAR(actionsToggle), {
params ["_display", "_showActions"];
private _actionsCtrlGroupCtrl = _display displayCtrl IDC_actionsBox;
private _actionsPreviousPageCtrl = _display displayCtrl IDC_actionsPreviousPage;
private _actionsNextPageCtrl = _display displayCtrl IDC_actionsNextPage;
private _actionsCurrentPageCtrl = _display displayCtrl IDC_actionsCurrentPage;
{
_x ctrlShow (GVAR(showActions) && {_showActions});
} forEach [
_actionsCtrlGroupCtrl,
_actionsPreviousPageCtrl,
_actionsNextPageCtrl,
_actionsCurrentPageCtrl
];
}] call CBA_fnc_addEventHandler;
[QGVAR(statsChangePage), LINKFUNC(buttonStatsPage)] call CBA_fnc_addEventHandler;
[QGVAR(displayStats), LINKFUNC(handleStats)] call CBA_fnc_addEventHandler;
[QGVAR(actionsChangePage), LINKFUNC(buttonActionsPage)] call CBA_fnc_addEventHandler;
[QGVAR(displayActions), LINKFUNC(handleActions)] call CBA_fnc_addEventHandler;
call FUNC(compileActions);
call FUNC(compileSorts);
@ -86,5 +39,4 @@ call FUNC(compileStats);
// Setup Tools tab
[keys (uiNamespace getVariable [QGVAR(configItemsTools), createHashMap]), LLSTRING(toolsTab), TOOLS_TAB_ICON, -1, true] call FUNC(addRightPanelButton);
ADDON = true;

View File

@ -2,12 +2,12 @@
#include "..\defines.hpp"
/*
* Author: Brett Mayson
* Handles the previous / next page buttons for actions
* Handles the previous / next page buttons for actions.
*
* Arguments:
* 0: Arsenal display <DISPLAY>
* 1: Actions control <CONTROL>
* 2: Previous or next <BOOL> (false = previous, true = next)
* 1: Actions page <CONTROL>
* 2: Previous (false) or next (true) page <BOOL>
*
* Return Value:
* None
@ -23,4 +23,5 @@ if !(ctrlEnabled _control) exitWith {};
GVAR(currentActionPage) = GVAR(currentActionPage) + ([-1, 1] select _nextPage);
GVAR(actionsInfo) params ["_panelControl", "_curSel", "_itemCfg"];
[QGVAR(displayActions), [_display, _panelControl, _curSel, _itemCfg]] call CBA_fnc_localEvent;

View File

@ -52,10 +52,20 @@ private _ctrl = controlNull;
IDC_buttonCurrentMag2,
IDC_iconBackgroundCurrentMag,
IDC_iconBackgroundCurrentMag2,
IDC_statsBox,
IDC_statsPreviousPage,
IDC_statsNextPage,
IDC_statsCurrentPage
IDC_statsCurrentPage,
IDC_actionsBox,
IDC_actionsPreviousPage,
IDC_actionsNextPage,
IDC_actionsCurrentPage
];
[QGVAR(statsToggle), [_display, _showToggle]] call CBA_fnc_localEvent;
[QGVAR(actionsToggle), [_display, _showToggle]] call CBA_fnc_localEvent;
if (!_showToggle) exitWith {};
// When showing the stats/actions again, update them to fit with currently selected item
GVAR(actionsInfo) params ["_control", "_curSel", "_itemCfg"];
[QGVAR(displayStats), [_display, _control, _curSel, _itemCfg]] call CBA_fnc_localEvent;
[QGVAR(displayActions), [_display, _control, _curSel, _itemCfg]] call CBA_fnc_localEvent;

View File

@ -20,8 +20,8 @@ params ["_display", "_control", "_nextPage"];
TRACE_1("control enabled", ctrlEnabled _control);
if !(ctrlEnabled _control) exitWith {};
GVAR(currentStatPage) = [GVAR(currentStatPage) - 1, GVAR(currentStatPage) + 1] select _nextPage;
GVAR(currentStatPage) = GVAR(currentStatPage) + ([-1, 1] select _nextPage);
GVAR(statsInfo) params ["_isLeftPanel", "_panelControl", "_curSel", "_itemCfg"];
GVAR(statsInfo) params ["", "_panelControl", "_curSel", "_itemCfg"];
[QGVAR(displayStats), [_display, _panelControl, _curSel, _itemCfg]] call CBA_fnc_localEvent;

View File

@ -7,7 +7,7 @@
* Arguments:
* 0: Arsenal display <DISPLAY>
* 1: Current panel control <CONTROL>
* 2: Current panel selection <SCALAR>
* 2: Current panel selection <NUMBER>
* 3: Item config entry <CONFIG>
*
* Return Value:

View File

@ -115,12 +115,11 @@ GVAR(currentVoice) = nil;
GVAR(currentInsignia) = nil;
GVAR(currentAction) = nil;
GVAR(showStats) = nil;
GVAR(currentStatPage) = nil;
GVAR(statsInfo) = nil;
GVAR(showActions) = nil;
GVAR(currentActionPage) = nil;
GVAR(actionsInfo) = nil;
profileNamespace setVariable [QGVAR(favorites), GVAR(favorites)];
GVAR(favoritesOnly) = nil;

View File

@ -74,12 +74,11 @@ GVAR(currentInsignia) = GVAR(center) call BIS_fnc_getUnitInsignia;
GVAR(currentAction) = "Stand";
GVAR(shiftState) = false;
GVAR(showStats) = true;
GVAR(currentStatPage) = 0;
GVAR(statsInfo) = [true, controlNull, nil, nil];
GVAR(showActions) = true;
GVAR(currentActionPage) = 0;
GVAR(actionsInfo) = [controlNull, nil, nil];
// Update current item list
call FUNC(updateCurrentItemsList);

View File

@ -67,7 +67,9 @@ if (!_primaryNVGSupported && {(_opticsModes select {_x select 1}) isEqualTo _opt
_primaryNVGSupported = true;
};
if (_primaryNVGIntegrated) exitWith {LLSTRING(statVisionMode_IntPrim)};
if (_primaryTiIntegrated && _primaryNVGIntegrated) exitWith {LLSTRING(statVisionMode_intPrimTi)};
if (_primaryTiIntegrated) exitWith {LLSTRING(statVisionMode_ti)};
if (_primaryNVGIntegrated) exitWith {LLSTRING(statVisionMode_intPrim)};
if (_primaryNVGSupported) exitWith {LLSTRING(statVisionMode_supPrim)};
if (_secondaryNVGSupported) exitWith {LLSTRING(statVisionMode_supSec)};

View File

@ -1223,7 +1223,7 @@
<Czech>Vedlejší část hledí podporuje</Czech>
<Korean>보조무기 지원여부</Korean>
</Key>
<Key ID="STR_ACE_Arsenal_statVisionMode_IntPrim">
<Key ID="STR_ACE_Arsenal_statVisionMode_intPrim">
<English>Primary integrated</English>
<Spanish>Primaria integrada</Spanish>
<German>Primär Integriert</German>
@ -1238,6 +1238,12 @@
<Czech>Integrováno do hlavní části hledí</Czech>
<Korean>주무기 내장여부</Korean>
</Key>
<Key ID="STR_ACE_Arsenal_statVisionMode_ti">
<English>Thermal integrated</English>
</Key>
<Key ID="STR_ACE_Arsenal_statVisionMode_intPrimTi">
<English>Thermal &amp; Primary integrated</English>
</Key>
<Key ID="STR_ACE_Arsenal_statVisionMode_NoSup">
<English>Not Supported</English>
<Spanish>No soportada</Spanish>

View File

@ -76,7 +76,7 @@ if ([_item, _vehicle] call FUNC(canLoadItemIn)) then {
[QEGVAR(common,fixFloating), _item, _item] call CBA_fnc_targetEvent;
};
},
LLSTRING(loadingItem),
format [LLSTRING(loadingItem), [_item, true] call FUNC(getNameItem), getText (configOf _vehicle >> "displayName")],
{
(_this select 0) call FUNC(canLoadItemIn)
},

View File

@ -58,7 +58,7 @@ if (GVAR(interactionParadrop)) exitWith {
[LSTRING(unlevelFlightWarning)] call EFUNC(common,displayTextStructured);
};
},
LLSTRING(unloadingItem),
format [LLSTRING(unloadingItem), [_item, true] call FUNC(getNameItem), getText (configOf GVAR(interactionVehicle) >> "displayName")],
{
(_this select 0) params ["", "_target"];
@ -109,7 +109,7 @@ if ([_item, GVAR(interactionVehicle), _unit] call FUNC(canUnloadItem)) then {
{
TRACE_1("unload fail",_this);
},
LLSTRING(unloadingItem),
format [LLSTRING(unloadingItem), [_item, true] call FUNC(getNameItem), getText (configOf GVAR(interactionVehicle) >> "displayName")],
{
(_this select 0) params ["_item", "_vehicle", "_unit"];

View File

@ -241,36 +241,12 @@
<Chinesesimp>&lt;br/&gt;%2卸载&lt;br/&gt;%1</Chinesesimp>
</Key>
<Key ID="STR_ACE_Cargo_LoadingItem">
<English>Loading Cargo</English>
<German>Belade</German>
<Portuguese>Carregando carga</Portuguese>
<Polish>Ładowanie cargo</Polish>
<Czech>Nakládám</Czech>
<Russian>Погрузка</Russian>
<Italian>Caricando</Italian>
<Spanish>Cargando</Spanish>
<French>Chargement de la cargaison</French>
<Japanese>カーゴへ積み込んでいます</Japanese>
<Korean>화물 싣기</Korean>
<Chinese>裝載貨物中</Chinese>
<Chinesesimp>正在装载货物</Chinesesimp>
<Turkish>Kargo Yükleniyor</Turkish>
<English>Loading %1 into %2...</English>
<Spanish>Cargando %1 en %2...</Spanish>
</Key>
<Key ID="STR_ACE_Cargo_UnloadingItem">
<English>Unloading Cargo</English>
<German>Entlade</German>
<Portuguese>Descarregando carga</Portuguese>
<Polish>Rozładowywanie cargo</Polish>
<Czech>Vykládám</Czech>
<Russian>Выгрузка</Russian>
<Italian>Scaricando</Italian>
<Spanish>Descargando</Spanish>
<French>Déchargement de la cargaison</French>
<Japanese>カーゴから降ろしています</Japanese>
<Korean>화물 내리기</Korean>
<Chinese>卸載貨物中</Chinese>
<Chinesesimp>正在卸载货物</Chinesesimp>
<Turkish>Kargo Boşaltılıyor</Turkish>
<English>Unloading %1 from %2...</English>
<Spanish>Descargando %1 de %2...</Spanish>
</Key>
<Key ID="STR_ACE_Cargo_LoadingFailed">
<English>%1&lt;br/&gt;could not be loaded</English>

View File

@ -29,7 +29,7 @@
["blockRadio", false, [QEGVAR(captives,Handcuffed), QEGVAR(captives,Surrendered), "ace_unconscious"]] call FUNC(statusEffect_addType);
["blockSpeaking", false, ["ace_unconscious"]] call FUNC(statusEffect_addType);
["disableWeaponAssembly", false, ["ace_common", "ace_common_lockVehicle", "ace_csw"]] call FUNC(statusEffect_addType);
["lockInventory", true, []] call FUNC(statusEffect_addType);
["lockInventory", true, [], true] call FUNC(statusEffect_addType);
[QGVAR(forceWalk), {
params ["_object", "_set"];

View File

@ -32,6 +32,7 @@ ACE_COUNTERS = [];
GVAR(statusEffect_Names) = [];
GVAR(statusEffect_isGlobal) = [];
GVAR(statusEffect_sendJIP) = [];
GVAR(setHearingCapabilityMap) = [];

View File

@ -1,7 +1,7 @@
#include "..\script_component.hpp"
/*
* Author: commy2, PabstMirror
* 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.
* Unit claims the ownership over an object. This is used to prevent multiple players from dragging the same ammo box or using up the same wheel when repairing etc.
* This function only runs on the server and handles the "ace_common_claimSafe" event. It provides a network safe way claiming objects as all claims are run on server.
* Return event is passed [_unit, _target, _success] for new claims, no event on claim release
*

View File

@ -17,4 +17,4 @@
params [["_vehicle", objNull, [objNull]]];
crew _vehicle select {getText (configOf _x >> "simulation") == "UAVPilot"} // return
(crew _vehicle) select {unitIsUAV _x} // return

View File

@ -5,7 +5,7 @@
*
* Arguments:
* 0: The Unit (usually the player) <OBJECT>
* 1: Force a return type <SCALAR, BOOLEAN>
* 1: Force a return type <NUMBER, BOOLEAN>
*
* Return Value:
* The return value <NUMBER>

View File

@ -5,8 +5,9 @@
*
* Arguments:
* 0: Status Effect Name, this should match a corresponding event name <STRING>
* 1: Send event globaly <BOOL>
* 1: Send event globally <BOOL>
* 2: Common Effect Reaons to pre-seed durring init <ARRAY>
* 3: Send event to JIP (requires sending event globally) <BOOL>
*
* Return Value:
* None
@ -17,14 +18,16 @@
* Public: No
*/
params [["_name", "", [""]], ["_isGlobal", false, [false]], ["_commonReasonsArray", [], [[]]]];
params [["_name", "", [""]], ["_isGlobal", false, [false]], ["_commonReasonsArray", [], [[]]], ["_sendJIP", false, [false]]];
TRACE_3("params",_name,_isGlobal,_commonReasonsArray);
if (_name == "") exitWith {ERROR_1("addStatusEffect - Bad Name %1", _this)};
if (_name in GVAR(statusEffect_Names)) exitWith {WARNING_1("addStatusEffect - Effect Already Added (note, will not update global bit) %1", _this)};
if (_sendJIP && !_isGlobal) exitWith {WARNING_1("addStatusEffect - Trying to add non-global JIP effect %1",_this)};
GVAR(statusEffect_Names) pushBack _name;
GVAR(statusEffect_isGlobal) pushBack _isGlobal;
GVAR(statusEffect_sendJIP) pushBack _sendJIP;
//We add reasons at any time, but more efficenet to add all common ones at one time during init
if (isServer && {_commonReasonsArray isNotEqualTo []}) then {

View File

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

View File

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

View File

@ -0,0 +1,87 @@
#define HEARING(CLASSNAME) \
class CLASSNAME: ItemCore { \
ace_hearing_protection = 0.75; \
ace_hearing_lowerVolume = 0; \
}
#define HEARING_PARENT(CLASSNAME,PARENT) \
class CLASSNAME: PARENT { \
ace_hearing_protection = 0.75; \
ace_hearing_lowerVolume = 0; \
}
class CfgWeapons {
class ItemCore;
class CUP_H_PMC_Beanie_Khaki;
HEARING(CUP_H_BAF_DDPM_Mk6_CREW_PRR);
HEARING(CUP_H_BAF_DPM_Mk6_CREW_PRR);
HEARING(CUP_H_BAF_MTP_Mk6_CREW_PRR);
HEARING(CUP_H_CZ_Cap_Headphones);
HEARING(CUP_H_CZ_Cap_Headphones_des);
HEARING(CUP_H_CZ_Helmet05);
HEARING(CUP_H_CZ_Helmet07);
HEARING(CUP_H_CZ_Helmet08);
HEARING(CUP_H_CZ_Helmet09);
HEARING(CUP_H_CZ_Helmet10);
HEARING(CUP_H_FR_ECH);
HEARING(CUP_H_Ger_Beret_TankCommander_Blk);
HEARING(CUP_H_Ger_Beret_TankCommander_Grn);
HEARING(CUP_H_Ger_Cap_EP_Grn1);
HEARING(CUP_H_Ger_Cap_EP_Grn2);
HEARING(CUP_H_Ger_Cap_EP_Tan1);
HEARING(CUP_H_Ger_Cap_EP_Tan2);
HEARING(CUP_H_OpsCore_Black);
HEARING(CUP_H_OpsCore_Black_SF);
HEARING(CUP_H_OpsCore_Covered_AAF);
HEARING(CUP_H_OpsCore_Covered_AAF_SF);
HEARING(CUP_H_OpsCore_Covered_Fleck);
HEARING(CUP_H_OpsCore_Covered_Fleck_SF);
HEARING(CUP_H_OpsCore_Covered_MCAM);
HEARING(CUP_H_OpsCore_Covered_MCAM_SF);
HEARING(CUP_H_OpsCore_Covered_MCAM_US);
HEARING(CUP_H_OpsCore_Covered_MCAM_US_SF);
HEARING(CUP_H_OpsCore_Covered_MTP);
HEARING(CUP_H_OpsCore_Covered_MTP_SF);
HEARING(CUP_H_OpsCore_Covered_Tigerstripe);
HEARING(CUP_H_OpsCore_Covered_Tigerstripe_SF);
HEARING(CUP_H_OpsCore_Covered_Tropen);
HEARING(CUP_H_OpsCore_Covered_Tropen_SF);
HEARING(CUP_H_OpsCore_Covered_UCP);
HEARING(CUP_H_OpsCore_Covered_UCP_SF);
HEARING(CUP_H_OpsCore_Green);
HEARING(CUP_H_OpsCore_Green_SF);
HEARING(CUP_H_OpsCore_Grey);
HEARING(CUP_H_OpsCore_Grey_SF);
HEARING(CUP_H_OpsCore_Spray);
HEARING(CUP_H_OpsCore_Spray_SF);
HEARING(CUP_H_OpsCore_Spray_US);
HEARING(CUP_H_OpsCore_Spray_US_SF);
HEARING(CUP_H_OpsCore_Tan);
HEARING(CUP_H_OpsCore_Tan_SF);
HEARING_PARENT(CUP_H_PMC_Beanie_Headphones_Khaki,CUP_H_PMC_Beanie_Khaki);
HEARING_PARENT(CUP_H_PMC_Beanie_Headphones_Black,CUP_H_PMC_Beanie_Headphones_Khaki);
HEARING_PARENT(CUP_H_PMC_Beanie_Headphones_Winter,CUP_H_PMC_Beanie_Headphones_Khaki);
HEARING(CUP_H_PMC_Cap_Back_EP_Grey);
HEARING(CUP_H_PMC_Cap_Back_EP_Tan);
HEARING(CUP_H_PMC_Cap_EP_Grey);
HEARING(CUP_H_PMC_Cap_EP_Tan);
HEARING(CUP_H_PMC_EP_Headset);
HEARING(CUP_H_USArmy_HelmetMICH_earpro);
HEARING(CUP_H_USArmy_HelmetMICH_earpro_DCU);
HEARING(CUP_H_USArmy_HelmetMICH_earpro_ess);
HEARING(CUP_H_USArmy_HelmetMICH_earpro_ess_DCU);
HEARING(CUP_H_USArmy_HelmetMICH_earpro_ess_wdl);
HEARING(CUP_H_USArmy_HelmetMICH_earpro_wdl);
HEARING(CUP_H_USArmy_Helmet_ECH1_Black);
HEARING(CUP_H_USArmy_Helmet_ECH1_Green);
HEARING(CUP_H_USArmy_Helmet_ECH1_Sand);
HEARING(CUP_H_USArmy_Helmet_ECH2_Black);
HEARING(CUP_H_USArmy_Helmet_ECH2_GREEN);
HEARING(CUP_H_USArmy_Helmet_ECH2_Sand);
HEARING(CUP_H_USMC_Crew_Helmet);
HEARING(CUP_H_USMC_MICH2000_DEF_DES);
HEARING(CUP_H_USMC_MICH2000_DEF_ESS_DES);
HEARING(CUP_H_USMC_MICH2000_DEF_ESS_WDL);
HEARING(CUP_H_USMC_MICH2000_DEF_WDL);
};

View File

@ -0,0 +1,86 @@
class CfgVehicles {
class SoldierWB;
class Civilian_F;
class CUP_BAF_Soldier_DPM_Base: SoldierWB {
modelSides[] = {6};
};
class CUP_BAF_Soldier_DDPM_Base: SoldierWB {
modelSides[] = {6};
};
class CUP_BAF_Soldier_MTP_Base: SoldierWB {
modelSides[] = {6};
};
class CUP_Creatures_Military_GER_Soldier_Base: SoldierWB {
modelSides[] = {6};
};
class CUP_Creatures_Military_NAPA_Soldier_Base: SoldierWB {
modelSides[] = {6};
};
class CUP_Creatures_Military_PMC_Soldier_Base: SoldierWB {
modelSides[] = {6};
};
class CUP_Creatures_Military_PMC_Soldier_Winter_Base: SoldierWB {
modelSides[] = {6};
};
class CUP_Creatures_Military_RUS_Soldier_Base: SoldierWB {
modelSides[] = {6};
};
class CUP_Creatures_Military_TK_Soldier_Base: SoldierWB {
modelSides[] = {6};
};
class CUP_Creatures_Military_TKI_Insurgent_Base: SoldierWB {
modelSides[] = {6};
};
class CUP_Creatures_Military_TKG_Guerrilla_Base: SoldierWB {
modelSides[] = {6};
};
class CUP_Creatures_Military_USMC_Soldier_Base: SoldierWB {
modelSides[] = {6};
};
class CUP_Creatures_Military_FR_Soldier_Base: SoldierWB {
modelSides[] = {6};
};
class CUP_Creatures_Civil_Chernarus_Base: Civilian_F {
modelSides[] = {6};
};
class CUP_Creatures_Civil_Takistan_Base: Civilian_F {
modelSides[] = {6};
};
class CUP_Creatures_Military_ACR_Soldier_Base: SoldierWB {
modelSides[] = {6};
};
class CUP_Creatures_Military_CDF_Soldier_Base: SoldierWB {
modelSides[] = {6};
};
class CUP_Creatures_Military_UNO_Soldier_Base: SoldierWB {
modelSides[] = {6};
};
class CUP_Creatures_Military_OPFINS_Soldier_Base: SoldierWB {
modelSides[] = {6};
};
class CUP_Creatures_Military_RACS_Soldier_Base: SoldierWB {
modelSides[] = {6};
};
class CUP_Creatures_Military_SLA_Soldier_Base: SoldierWB {
modelSides[] = {6};
};
class CUP_Creatures_Military_USA_Soldier_ACU_Base: SoldierWB {
modelSides[] = {6};
};
class CUP_Creatures_Military_USA_Soldier_Base: SoldierWB {
modelSides[] = {6};
};
class CUP_Creatures_Military_HIL_Reservist_Base: SoldierWB {
modelSides[] = {6};
};
class CUP_Creatures_Military_HIL_Recon_Base: SoldierWB {
modelSides[] = {6};
};
class CUP_Creatures_Military_HIL_Man_Base: SoldierWB {
modelSides[] = {6};
};
class CUP_Creatures_Military_HIL_SF_Base: SoldierWB {
modelSides[] = {6};
};
};

View File

@ -0,0 +1,21 @@
#include "script_component.hpp"
class CfgPatches {
class SUBADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {
"CUP_Creatures_People_LoadOrder",
"ace_nouniformrestrictions"
};
skipWhenMissingDependencies = 1;
author = ECSTRING(common,ACETeam);
authors[] = {"Mike", "Jonpas"};
url = ECSTRING(main,URL);
VERSION_CONFIG;
};
};
#include "CfgVehicles.hpp"

View File

@ -0,0 +1,3 @@
#define SUBCOMPONENT nouniformrestrictions
#define SUBCOMPONENT_BEAUTIFIED No Uniform Restrictions
#include "..\script_component.hpp"

View File

@ -0,0 +1,18 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"CUP_Creatures_People_LoadOrder"};
skipWhenMissingDependencies = 1;
author = ECSTRING(common,ACETeam);
authors[] = {"Mike", "Jonpas"};
url = ECSTRING(main,URL);
VERSION_CONFIG;
};
};
#include "CfgWeapons.hpp"

View File

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

View File

@ -26,6 +26,8 @@ PREP(resumeDrag);
PREP(setCarryable);
PREP(setDraggable);
PREP(startCarry);
PREP(startCarryLocal);
PREP(startCarryPFH);
PREP(startDrag);
PREP(startDragLocal);
PREP(startDragPFH);

View File

@ -67,6 +67,9 @@ if (isNil QGVAR(maxWeightCarryRun)) then {
};
}] call CBA_fnc_addEventHandler;
[QGVAR(startCarry), LINKFUNC(startCarryLocal)] call CBA_fnc_addEventHandler;
[QGVAR(startDrag), LINKFUNC(startDragLocal)] call CBA_fnc_addEventHandler;
[QGVAR(carryingContainerClosed), {
params ["_container", "_owner"];
TRACE_2("carryingContainerClosed EH",_container,_owner);

View File

@ -28,7 +28,7 @@ if ((_unit getHitPointDamage "HitLegs") >= 0.5) exitWith {false};
// Static weapons need to be empty for carrying (ignore UAV AI)
if (_target isKindOf "StaticWeapon") exitWith {
(crew _target) findIf {getText (configOf _x >> "simulation") != "UAVPilot"} == -1
(crew _target) findIf {!unitIsUAV _x} == -1
};
// Units need to be unconscious or limping; Units also need to not be in ragdoll, as that causes desync issues

View File

@ -24,7 +24,7 @@ if !([_unit, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)) exi
// Static weapons need to be empty for dragging (ignore UAV AI)
if (_target isKindOf "StaticWeapon") exitWith {
(crew _target) findIf {getText (configOf _x >> "simulation") != "UAVPilot"} == -1
(crew _target) findIf {!unitIsUAV _x} == -1
};
// Units need to be unconscious or limping; Units also need to not be in ragdoll, as that causes desync issues

View File

@ -1,7 +1,7 @@
#include "..\script_component.hpp"
/*
* Author: johnb43
* Removes user input affecting dragging.
* Removes user input affecting carrying.
*
* Arguments:
* 0: Unit <OBJECT>

View File

@ -56,8 +56,25 @@ GVAR(initializedClasses_carry) = _initializedClasses;
private _icon = [QPATHTOF(UI\icons\box_carry.paa), QPATHTOF(UI\icons\person_carry.paa)] select (_object isKindOf "CAManBase");
private _carryAction = [QGVAR(carry), LLSTRING(Carry), _icon, {[_player, _target] call FUNC(startCarry)}, {[_player, _target] call FUNC(canCarry)}] call EFUNC(interact_menu,createAction);
private _dropAction = [QGVAR(drop_carry), LLSTRING(Drop), "", {[_player, _target] call FUNC(dropObject_carry)}, {[_player, _target] call FUNC(canDrop_carry)}] call EFUNC(interact_menu,createAction);
private _carryAction = [
QGVAR(carry),
LLSTRING(Carry),
_icon,
{
[_player, _target] call FUNC(startCarry)
}, {
[_player, _target] call FUNC(canCarry)
}] call EFUNC(interact_menu,createAction);
private _dropAction = [
QGVAR(drop_carry),
LLSTRING(Drop),
"",
{
[_player, _target] call FUNC(dropObject_carry)
}, {
[_player, _target] call FUNC(canDrop_carry)
}] call EFUNC(interact_menu,createAction);
[_type, 0, ["ACE_MainActions"], _carryAction] call EFUNC(interact_menu,addActionToClass);
[_type, 0, [], _dropAction] call EFUNC(interact_menu,addActionToClass);

View File

@ -56,8 +56,25 @@ GVAR(initializedClasses) = _initializedClasses;
private _icon = [QPATHTOF(UI\icons\box_drag.paa), QPATHTOF(UI\icons\person_drag.paa)] select (_object isKindOf "CAManBase");
private _dragAction = [QGVAR(drag), LLSTRING(Drag), _icon, {[_player, _target] call FUNC(startDrag)}, {[_player, _target] call FUNC(canDrag)}] call EFUNC(interact_menu,createAction);
private _dropAction = [QGVAR(drop), LLSTRING(Drop), "", {[_player, _target] call FUNC(dropObject)}, {[_player, _target] call FUNC(canDrop)}] call EFUNC(interact_menu,createAction);
private _dragAction = [
QGVAR(drag),
LLSTRING(Drag),
_icon,
{
[_player, _target] call FUNC(startDrag)
}, {
[_player, _target] call FUNC(canDrag)
}] call EFUNC(interact_menu,createAction);
private _dropAction = [
QGVAR(drop),
LLSTRING(Drop),
"",
{
[_player, _target] call FUNC(dropObject);
}, {
[_player, _target] call FUNC(canDrop)
}] call EFUNC(interact_menu,createAction);
[_type, 0, ["ACE_MainActions"], _dragAction] call EFUNC(interact_menu,addActionToClass);
[_type, 0, [], _dropAction] call EFUNC(interact_menu,addActionToClass);

View File

@ -1,7 +1,7 @@
#include "..\script_component.hpp"
/*
* Author: commy2, PiZZADOX
* Starts the carrying process.
* Author: johnb43
* Starts the carrying process safely.
*
* Arguments:
* 0: Unit that should do the carrying <OBJECT>
@ -11,82 +11,11 @@
* None
*
* Example:
* [player, cursorTarget] call ace_dragging_fnc_startCarry;
* [player, cursorTarget] call ace_dragging_fnc_startCarry
*
* Public: No
*/
params ["_unit", "_target"];
TRACE_2("params",_unit,_target);
// Exempt from weight check if object has override variable set
private _weight = 0;
if !(_target getVariable [QGVAR(ignoreWeightCarry), false]) then {
_weight = _target call FUNC(getWeight);
};
// Exit if object weight is over global var value
if (_weight > GETMVAR(ACE_maxWeightCarry,1E11)) exitWith {
[LLSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured);
};
private _timer = CBA_missionTime + 5;
// Handle objects vs. persons
if (_target isKindOf "CAManBase") then {
private _primaryWeapon = primaryWeapon _unit;
// Add a primary weapon if the unit has none
if (_primaryWeapon == "") then {
_unit addWeapon "ACE_FakePrimaryWeapon";
_primaryWeapon = "ACE_FakePrimaryWeapon";
};
// Select primary, otherwise the drag animation actions don't work
_unit selectWeapon _primaryWeapon;
// Move a bit closer and adjust direction when trying to pick up a person
[QEGVAR(common,setDir), [_target, getDir _unit + 180], _target] call CBA_fnc_targetEvent;
_target setPosASL (getPosASL _unit vectorAdd (vectorDir _unit));
[_unit, "AcinPknlMstpSnonWnonDnon_AcinPercMrunSnonWnonDnon", 2] call EFUNC(common,doAnimation);
[_target, "AinjPfalMstpSnonWrflDnon_carried_Up", 2] call EFUNC(common,doAnimation);
_timer = CBA_missionTime + 10;
} else {
// Select no weapon and stop sprinting
private _previousWeaponIndex = [_unit] call EFUNC(common,getFiremodeIndex);
_unit setVariable [QGVAR(previousWeapon), _previousWeaponIndex, true];
_unit action ["SwitchWeapon", _unit, _unit, 299];
[_unit, "AmovPercMstpSnonWnonDnon", 0] call EFUNC(common,doAnimation);
private _canRun = _weight call FUNC(canRun_carry);
// Only force walking if we're overweight
[_unit, "forceWalk", QUOTE(ADDON), !_canRun] call EFUNC(common,statusEffect_set);
[_unit, "blockSprint", QUOTE(ADDON), _canRun] call EFUNC(common,statusEffect_set);
};
[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set);
// Prevent multiple players from accessing the same object
[_unit, _target, true] call EFUNC(common,claim);
// Prevents dragging and carrying at the same time
_unit setVariable [QGVAR(isCarrying), true, true];
// Required for aborting animation
_unit setVariable [QGVAR(carriedObject), _target, true];
[FUNC(startCarryPFH), 0.2, [_unit, _target, _timer]] call CBA_fnc_addPerFrameHandler;
// Disable collisions by setting the PhysX mass to almost zero
private _mass = getMass _target;
if (_mass > 1) then {
_target setVariable [QGVAR(originalMass), _mass, true];
[QEGVAR(common,setMass), [_target, 1e-12]] call CBA_fnc_globalEvent; // Force global sync
};
// Try to claim the object
[QEGVAR(common,claimSafe), [_unit, _target, true, QGVAR(startCarry)]] call CBA_fnc_serverEvent;

View File

@ -0,0 +1,92 @@
#include "..\script_component.hpp"
/*
* Author: commy2, PiZZADOX
* Starts the carrying process.
*
* Arguments:
* 0: Unit that should do the carrying <OBJECT>
* 1: Object to carry <OBJECT>
* 2: If object was successfully claimed <BOOL>
*
* Return Value:
* None
*
* Example:
* [player, cursorTarget, true] call ace_dragging_fnc_startCarryLocal
*
* Public: No
*/
params ["_unit", "_target", "_claimed"];
TRACE_3("params",_unit,_target,_claimed);
if (!_claimed) exitWith { WARNING_1("already claimed %1",_this) };
// Exempt from weight check if object has override variable set
private _weight = 0;
if !(_target getVariable [QGVAR(ignoreWeightCarry), false]) then {
_weight = _target call FUNC(getWeight);
};
// Exit if object weight is over global var value
if (_weight > GETMVAR(ACE_maxWeightCarry,1E11)) exitWith {
[LLSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured);
};
private _timer = CBA_missionTime + 5;
// Handle objects vs. persons
if (_target isKindOf "CAManBase") then {
private _primaryWeapon = primaryWeapon _unit;
// Add a primary weapon if the unit has none
if (_primaryWeapon == "") then {
_unit addWeapon "ACE_FakePrimaryWeapon";
_primaryWeapon = "ACE_FakePrimaryWeapon";
};
// Select primary, otherwise the drag animation actions don't work
_unit selectWeapon _primaryWeapon;
// Move a bit closer and adjust direction when trying to pick up a person
[QEGVAR(common,setDir), [_target, getDir _unit + 180], _target] call CBA_fnc_targetEvent;
_target setPosASL (getPosASL _unit vectorAdd (vectorDir _unit));
[_unit, "AcinPknlMstpSnonWnonDnon_AcinPercMrunSnonWnonDnon", 2] call EFUNC(common,doAnimation);
[_target, "AinjPfalMstpSnonWrflDnon_carried_Up", 2] call EFUNC(common,doAnimation);
_timer = CBA_missionTime + 10;
} else {
// Select no weapon and stop sprinting
private _previousWeaponIndex = [_unit] call EFUNC(common,getFiremodeIndex);
_unit setVariable [QGVAR(previousWeapon), _previousWeaponIndex, true];
_unit action ["SwitchWeapon", _unit, _unit, 299];
[_unit, "AmovPercMstpSnonWnonDnon", 0] call EFUNC(common,doAnimation);
private _canRun = _weight call FUNC(canRun_carry);
// Only force walking if we're overweight
[_unit, "forceWalk", QUOTE(ADDON), !_canRun] call EFUNC(common,statusEffect_set);
[_unit, "blockSprint", QUOTE(ADDON), _canRun] call EFUNC(common,statusEffect_set);
};
[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set);
// Prevents dragging and carrying at the same time
_unit setVariable [QGVAR(isCarrying), true, true];
// Required for aborting animation
_unit setVariable [QGVAR(carriedObject), _target, true];
[FUNC(startCarryPFH), 0.2, [_unit, _target, _timer]] call CBA_fnc_addPerFrameHandler;
// Disable collisions by setting the PhysX mass to almost zero
private _mass = getMass _target;
if (_mass > 1) then {
_target setVariable [QGVAR(originalMass), _mass, true];
[QEGVAR(common,setMass), [_target, 1e-12]] call CBA_fnc_globalEvent; // Force global sync
};

View File

@ -1,104 +1,21 @@
#include "..\script_component.hpp"
/*
* Author: commy2, PiZZADOX, Malbryn
* Starts the dragging process.
* Author: johnb43
* Starts the dragging process safely.
*
* Arguments:
* 0: Unit that should do the dragging <OBJECT>
* 0: Unit that should do the carrying <OBJECT>
* 1: Object to drag <OBJECT>
*
* Return Value:
* None
*
* Example:
* [player, cursorTarget] call ace_dragging_fnc_startDrag;
* [player, cursorTarget] call ace_dragging_fnc_startDrag
*
* Public: No
*/
params ["_unit", "_target"];
TRACE_2("params",_unit,_target);
// Exempt from weight check if object has override variable set
private _weight = 0;
if !(_target getVariable [QGVAR(ignoreWeightDrag), false]) then {
_weight = _target call FUNC(getWeight);
};
// Exit if object weight is over global var value
if (_weight > GETMVAR(ACE_maxWeightDrag,1E11)) exitWith {
[LLSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured);
};
private _primaryWeapon = primaryWeapon _unit;
// Add a primary weapon if the unit has none
if !(GVAR(dragAndFire)) then {
if (_primaryWeapon == "") then {
_unit addWeapon "ACE_FakePrimaryWeapon";
_primaryWeapon = "ACE_FakePrimaryWeapon";
};
_unit selectWeapon _primaryWeapon;
} else { // Making sure the unit is holding a primary weapon or handgun
private _handgunWeapon = handgunWeapon _unit;
if !(currentWeapon _unit in [_primaryWeapon, _handgunWeapon]) then {
if (_primaryWeapon != "") then {
// Use primary if possible
_unit selectWeapon _primaryWeapon;
} else {
if (_handgunWeapon != "") then {
// Use pistol if unit has no primary
_unit selectWeapon _handgunWeapon;
} else {
// Add fake weapon if no weapons besides launcher are available
_unit addWeapon "ACE_FakePrimaryWeapon";
_unit selectWeapon "ACE_FakePrimaryWeapon";
};
};
};
};
// Save the weapon so we can monitor if it changes
_unit setVariable [QGVAR(currentWeapon), currentWeapon _unit];
[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set);
// Prevent multiple players from accessing the same object
[_unit, _target, true] call EFUNC(common,claim);
// Can't play action that depends on weapon if it was added the same frame
if !(_unit call EFUNC(common,isSwimming)) then {
[{
private _unitWeapon = _this getVariable [QGVAR(currentWeapon), ""];
if (_unitWeapon isKindOf ["Pistol", configFile >> "CfgWeapons"]) then {
[_this, "ACE_dragWithPistol"] call EFUNC(common,doGesture);
} else {
[_this, "ACE_dragWithRifle"] call EFUNC(common,doGesture);
};
}, _unit] call CBA_fnc_execNextFrame;
};
// Move a bit closer and adjust direction when trying to pick up a person
if (_target isKindOf "CAManBase") then {
[QEGVAR(common,setDir), [_target, getDir _unit + 180], _target] call CBA_fnc_targetEvent;
_target setPosASL (getPosASL _unit vectorAdd (vectorDir _unit vectorMultiply 1.5));
[_target, "AinjPpneMrunSnonWnonDb_grab", 2] call EFUNC(common,doAnimation);
};
// Prevents dragging and carrying at the same time
_unit setVariable [QGVAR(isDragging), true, true];
[FUNC(startDragPFH), 0.2, [_unit, _target, CBA_missionTime + 5]] call CBA_fnc_addPerFrameHandler;
// Disable collisions by setting the physx mass to almost zero
private _mass = getMass _target;
if (_mass > 1) then {
_target setVariable [QGVAR(originalMass), _mass, true];
[QEGVAR(common,setMass), [_target, 1e-12]] call CBA_fnc_globalEvent; // Force global sync
};
// Try to claim the object
[QEGVAR(common,claimSafe), [_unit, _target, true, QGVAR(startDrag)]] call CBA_fnc_serverEvent;

View File

@ -0,0 +1,104 @@
#include "..\script_component.hpp"
/*
* Author: commy2, PiZZADOX, Malbryn
* Starts the dragging process.
*
* Arguments:
* 0: Unit that should do the dragging <OBJECT>
* 1: Object to drag <OBJECT>
* 2: If object was successfully claimed <BOOL>
*
* Return Value:
* None
*
* Example:
* [player, cursorTarget, true] call ace_dragging_fnc_startDragLocal
*
* Public: No
*/
params ["_unit", "_target", "_claimed"];
TRACE_3("params",_unit,_target,_claimed);
if (!_claimed) exitWith { WARNING_1("already claimed %1",_this) };
// Exempt from weight check if object has override variable set
private _weight = 0;
if !(_target getVariable [QGVAR(ignoreWeightDrag), false]) then {
_weight = _target call FUNC(getWeight);
};
// Exit if object weight is over global var value
if (_weight > GETMVAR(ACE_maxWeightDrag,1E11)) exitWith {
[LLSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured);
};
private _primaryWeapon = primaryWeapon _unit;
// Add a primary weapon if the unit has none
if !(GVAR(dragAndFire)) then {
if (_primaryWeapon == "") then {
_unit addWeapon "ACE_FakePrimaryWeapon";
_primaryWeapon = "ACE_FakePrimaryWeapon";
};
_unit selectWeapon _primaryWeapon;
} else { // Making sure the unit is holding a primary weapon or handgun
private _handgunWeapon = handgunWeapon _unit;
if !(currentWeapon _unit in [_primaryWeapon, _handgunWeapon]) then {
if (_primaryWeapon != "") then {
// Use primary if possible
_unit selectWeapon _primaryWeapon;
} else {
if (_handgunWeapon != "") then {
// Use pistol if unit has no primary
_unit selectWeapon _handgunWeapon;
} else {
// Add fake weapon if no weapons besides launcher are available
_unit addWeapon "ACE_FakePrimaryWeapon";
_unit selectWeapon "ACE_FakePrimaryWeapon";
};
};
};
};
// Save the weapon so we can monitor if it changes
_unit setVariable [QGVAR(currentWeapon), currentWeapon _unit];
[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set);
// Can't play action that depends on weapon if it was added the same frame
if !(_unit call EFUNC(common,isSwimming)) then {
[{
private _unitWeapon = _this getVariable [QGVAR(currentWeapon), ""];
if (_unitWeapon isKindOf ["Pistol", configFile >> "CfgWeapons"]) then {
[_this, "ACE_dragWithPistol"] call EFUNC(common,doGesture);
} else {
[_this, "ACE_dragWithRifle"] call EFUNC(common,doGesture);
};
}, _unit] call CBA_fnc_execNextFrame;
};
// Move a bit closer and adjust direction when trying to pick up a person
if (_target isKindOf "CAManBase") then {
[QEGVAR(common,setDir), [_target, getDir _unit + 180], _target] call CBA_fnc_targetEvent;
_target setPosASL (getPosASL _unit vectorAdd (vectorDir _unit vectorMultiply 1.5));
[_target, "AinjPpneMrunSnonWnonDb_grab", 2] call EFUNC(common,doAnimation);
};
// Prevents dragging and carrying at the same time
_unit setVariable [QGVAR(isDragging), true, true];
[FUNC(startDragPFH), 0.2, [_unit, _target, CBA_missionTime + 5]] call CBA_fnc_addPerFrameHandler;
// Disable collisions by setting the physx mass to almost zero
private _mass = getMass _target;
if (_mass > 1) then {
_target setVariable [QGVAR(originalMass), _mass, true];
[QEGVAR(common,setMass), [_target, 1e-12]] call CBA_fnc_globalEvent; // Force global sync
};

View File

@ -5,7 +5,7 @@
if (!alive _player) exitWith {false};
if !([_player, objNull, ["isNotDragging", "isNotCarrying", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false};
// If we are drag/carrying something right now then just drop it:
// If we are dragging/carrying something right now then just drop it
if (_player getVariable [QGVAR(isDragging), false]) exitWith {
[_player, _player getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject);
@ -34,7 +34,7 @@
if (!alive _player) exitWith {false};
if !([_player, objNull, ["isNotDragging", "isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith {false};
// If we are drag/carrying something right now then just drop it:
// If we are dragging/carrying something right now then just drop it
if (_player getVariable [QGVAR(isDragging), false]) exitWith {
[_player, _player getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject);

View File

@ -12,8 +12,7 @@ GVAR(playerIsVirtual) = false;
["unit", { // Add unit changed EH to check if player is either virtual (logic) or a UAV AI
params ["_unit"];
GVAR(playerIsVirtual) = ((getNumber (configOf _unit >> "isPlayableLogic")) == 1) ||
{(getText (configOf _unit >> "simulation")) == "UAVPilot"};
GVAR(playerIsVirtual) = unitIsUAV _unit || {(getNumber (configOf _unit >> "isPlayableLogic")) == 1};
TRACE_3("unit changed",_unit,typeOf _unit,GVAR(playerIsVirtual));
}, true] call CBA_fnc_addPlayerEventHandler;

View File

@ -1,4 +1,4 @@
#define MAJOR 3
#define MINOR 16
#define PATCHLVL 1
#define BUILD 74
#define PATCHLVL 3
#define BUILD 79

View File

@ -25,15 +25,8 @@ if (GVAR(plottingBoard_Shown) == 0) then {
_y set [4, 0];
};
} forEach GVAR(plottingBoard_markers);
};
if (((GVAR(mapTool_Shown) == 0) && {GVAR(plottingBoard_Shown) == 0}) || {
private _uniqueItems = ACE_player call EFUNC(common,uniqueItems);
!(("ACE_MapTools" in _uniqueItems) || {"ACE_PlottingBoard" in _uniqueItems})
}) exitWith {};
if (GVAR(plottingBoard_Shown) > 0) then {
} else {
if !([ACE_player, "ACE_PlottingBoard"] call EFUNC(common,hasItem)) exitWith {};
if (GVAR(plottingBoard_moveToMouse)) then {
GVAR(plottingBoard_pos) = _mapCtrl ctrlMapScreenToWorld getMousePosition;
GVAR(plottingBoard_moveToMouse) = false; // we only need to do this once after opening the map tool
@ -97,7 +90,7 @@ if (GVAR(plottingBoard_Shown) > 0) then {
} forEach GVAR(plottingBoard_markers);
};
if (GVAR(mapTool_Shown) > 0) then {
if ((GVAR(mapTool_Shown) > 0) && {[ACE_player, "ACE_MapTools"] call EFUNC(common,hasItem)}) then {
// Open map tools in center of screen when toggled to be shown
if (GVAR(mapTool_moveToMouse)) then {
GVAR(mapTool_pos) = _mapCtrl ctrlMapScreenToWorld getMousePosition;

View File

@ -14,7 +14,7 @@ class CfgWeapons {
mapSize = 0.2;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 1;
mass = 0.5;
};
};

View File

@ -16,9 +16,8 @@
while {(_allHitPoints param [0, ""]) select [0,1] == "#"} do { WARNING_1("Ignoring Reflector hitpoint %1", _allHitPoints deleteAt 0); };
if (_allHitPoints param [0, ""] != "ACE_HDBracket") then {
private _config = configOf _unit;
if (getText (_config >> "simulation") == "UAVPilot") exitWith {TRACE_1("ignore UAV AI",typeOf _unit);};
if (getNumber (_config >> "isPlayableLogic") == 1) exitWith {TRACE_1("ignore logic unit",typeOf _unit)};
if (unitIsUAV _unit) exitWith {TRACE_1("ignore UAV AI",typeOf _unit);};
if (getNumber ((configOf _unit) >> "isPlayableLogic") == 1) exitWith {TRACE_1("ignore logic unit",typeOf _unit)};
ERROR_1("Bad hitpoints for unit type ""%1""",typeOf _unit);
} else {
// Calling this function inside curly brackets allows the usage of

View File

@ -32,6 +32,11 @@ if (_hitPoint isEqualTo "") then {
if !(isDamageAllowed _unit && {_unit getVariable [QEGVAR(medical,allowDamage), true]}) exitWith {_oldDamage};
private _newDamage = _damage - _oldDamage;
// Happens occasionally for vehiclehit events (see line 80 onwards)
// Just exit early to save some frametime
if (_newDamage == 0 && {_hitpoint isNotEqualTo "ace_hdbracket"}) exitWith {_oldDamage};
// Get scaled armor value of hitpoint and calculate damage before armor
// We scale using passThrough to handle explosive-resistant armor properly (#9063)
// We need realDamage to determine which limb was hit correctly

View File

@ -32,7 +32,7 @@ GVAR(actions) = [];
if ("ace_dragging" call EFUNC(common,isModLoaded)) then {
GVAR(actions) pushBack [
localize ELSTRING(dragging,Drag), "drag",
LELSTRING(dragging,Drag), "drag",
{ACE_player != GVAR(target) && {[ACE_player, GVAR(target)] call EFUNC(dragging,canDrag)}},
{
GVAR(pendingReopen) = false;
@ -41,7 +41,7 @@ if ("ace_dragging" call EFUNC(common,isModLoaded)) then {
];
GVAR(actions) pushBack [
localize ELSTRING(dragging,Carry), "drag",
LELSTRING(dragging,Carry), "drag",
{ACE_player != GVAR(target) && {[ACE_player, GVAR(target)] call EFUNC(dragging,canCarry)}},
{
GVAR(pendingReopen) = false;

View File

@ -12,9 +12,8 @@ PREP_RECOMPILE_END;
["CAManBase", "init", {
params ["_unit"];
private _config = configOf _unit;
if (getText (_config >> "simulation") == "UAVPilot") exitWith {TRACE_1("ignore UAV AI",typeOf _unit);};
if (getNumber (_config >> "isPlayableLogic") == 1) exitWith {TRACE_1("ignore logic unit",typeOf _unit)};
if (unitIsUAV _unit) exitWith {TRACE_1("ignore UAV AI",typeOf _unit);};
if (getNumber ((configOf _unit) >> "isPlayableLogic") == 1) exitWith {TRACE_1("ignore logic unit",typeOf _unit)};
// Hopefully this EH gets added first as it can only effect other EH called after it
private _ehIndex = _unit addEventHandler ["Killed", {_this call FUNC(handleKilled)}];

View File

@ -7,10 +7,10 @@
* 0: The Unit <OBJECT>
* 1: Medication <STRING>
* 2: Time in system for the adjustment to reach its peak <NUMBER>
* 3: Duration the adjustment will have an effect <NUMVER>
* 4: Heart Rate Adjust <NUMVER>
* 5: Pain Suppress Adjust <NUMVER>
* 6: Flow Adjust <NUMVER>
* 3: Duration the adjustment will have an effect <NUMBER>
* 4: Heart Rate Adjust <NUMBER>
* 5: Pain Suppress Adjust <NUMBER>
* 6: Flow Adjust <NUMBER>
*
* Return Value:
* None

View File

@ -21,8 +21,16 @@ params ["_medic", "_patient", "_bodyPart"];
private _heartRate = 0;
if (alive _patient && {!([_patient, _bodyPart] call FUNC(hasTourniquetAppliedTo))}) then {
_heartRate = GET_HEART_RATE(_patient);
if (!([_patient, _bodyPart] call FUNC(hasTourniquetAppliedTo))) then {
_heartRate = switch (true) do {
case (alive _patient): {
GET_HEART_RATE(_patient)
};
case (alive (_patient getVariable [QEGVAR(medical,CPR_provider), objNull])): {
random [25, 30, 35] // fake heart rate because patient is dead and off state machine
};
default { 0 };
};
};
private _heartRateOutput = LSTRING(Check_Pulse_Output_5);

View File

@ -19,7 +19,7 @@ if !(hasInterface) exitWith {};
};
// Exit if third person view is not available
if (difficultyOption "thirdPersonView" == 0) exitWith {
if (difficultyOption "thirdPersonView" != 1) exitWith {
WARNING("View Restriction is enabled, but 3rd person is disabled with server difficulty.");
};

View File

@ -9,8 +9,8 @@ ace:
version:
major: 3
minor: 16
patch: 1
build: 74
patch: 3
build: 79
markdown: kramdown

View File

@ -9,8 +9,8 @@ ace:
version:
major: 3
minor: 16
patch: 1
build: 74
patch: 3
build: 79
markdown: kramdown

View File

@ -192,6 +192,9 @@ class FunctionFile:
if arg_default is None:
arg_default = ""
if ("SCALAR" in arg_types or "NUMVER" in arg_types):
self.feedback("Bad Arg Type \"{}\"".format(arg_types), 1)
arguments.append([arg_index, arg_name, arg_types, arg_default, arg_notes])
else:
# Notes about the above argument won't start with an index

View File

@ -57,9 +57,60 @@ class ACE_Medical_Treatment_Actions {
};
```
## 2. Mission Variables
## 2. Medical Vehicles and Facilities
### 2.1 Grave Digging Object Configuration
### 2.1 Medical Vehicles
To configure a vehicle as a Medical Vehicle by default, set the `attendant` property in the vehicle's config to `1`.
```cpp
class CfgVehicles {
class MyAmbulance {
attendant = 1;
};
};
```
To set a vehicle as a Medical Vehicle mid-mission, set the `ace_medical_isMedicalVehicle` variable globally.
```sqf
// Sets the object behind your cursor to be a medical vehicle
cursorObject setVariable ["ace_medical_isMedicalVehicle", true, true];
// Create an interaction to turn a vehicle into a medical vehicle
private _statement = {_target setVariable ["ace_medical_isMedicalVehicle", true, true]};
private _action = ["TAG_makeMedicalVehicle", "Set as Medical Vehicle", _statement, {!([_target] call ace_medical_treatment_fnc_isMedicalVehicle)}] call ace_interact_menu_fnc_createAction;
[cursorObject, 0, ["ACE_MainActions"], _action] call ace_interact_menu_fnc_createAction;
// Set all vehicles of type "B_Truck_01_transport_F" as medical vehicles
private _classname = "B_Truck_01_transport_F";
private _affectChildClasses = false; // Affect variants of this vehicle
["B_Truck_01_transport_F", "InitPost", {
params ["_vehicle"];
if (!local _vehicle) exitWith {};
_vehicle setVariable ["ace_medical_isMedicalVehicle", true, true];
}, _affectChildClasses, [], true] call CBA_fnc_addClassEventHandler;
```
### 2.2 Medical Facilities
To configure an object as a Medical Facility by default, add a new array containing its classname to the `ace_medical_facilities` class in config root.
```cpp
class CfgVehicles {
class ThingX;
class MyMedicalFacility: ThingX {};
class MyMedicalFacility2_ElectricBoogaloo: MyMedicalFacility {};
};
class ace_medical_facilities {
TAG_allOfMyFacilities[] = {"MyMedicalFacility", "MyMedicalFacility2_ElectricBoogaloo"};
};
```
To set an object as a Medical Facility mid-mission, set the `ace_medical_isMedicalFacility` variable globally. See above.
Both Medical Facilities and Medical Vehicles can also be created via the Eden Editor's attributes menu.
## 3. Mission Variables
### 3.1 Grave Digging Object Configuration
The object created when digging a grave can be modified by setting the `ace_medical_treatment_graveClassname` variable.
```sqf
@ -71,7 +122,7 @@ The object's rotation can also be modified, if necessary.
ace_medical_treatment_graveRotation = 0; // rotation angle (will depend on model classname)
```
### 2.2 Zeus Medical Menu Module
### 3.2 Zeus Medical Menu Module
If a mission maker wishes to disable Zeus access to the medical menu, they can set the variable below:
ace_medical_gui_enableZeusModule = false; // default is true