Merge branch 'master' of https://github.com/acemod/ACE3 into glasses-hearing

This commit is contained in:
commy2 2016-08-13 13:03:23 +02:00
commit 58539a0949
230 changed files with 2270 additions and 1535 deletions

View File

@ -1,5 +1,5 @@
**Arma 3 Version:** `x.xx` (stable / rc / dev)
**CBA Version:** `2.x.x` (stable / dev + commit hash)
**CBA Version:** `3.x.x` (stable / dev + commit hash)
**ACE3 Version:** `3.x.x` (stable / dev + commit hash)
**Mods:**

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_add_new_gun
* call ace_atragmx_fnc_add_new_gun
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_calculate_range_card
* call ace_atragmx_fnc_calculate_range_card
*
* Public: No
*/

View File

@ -37,7 +37,7 @@
* 8: Spin drift (MOA) <NUMBER>
*
* Example:
* call ace_atragmx_calculate_solution
* call ace_atragmx_fnc_calculate_solution
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_calculate_target_range_assist
* call ace_atragmx_fnc_calculate_target_range_assist
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_calculate_target_solution
* call ace_atragmx_fnc_calculate_target_solution
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_calculate_target_speed_assist
* call ace_atragmx_fnc_calculate_target_speed_assist
*
* Public: No
*/

View File

@ -11,7 +11,7 @@
* Nothing
*
* Example:
* call ace_atragmx_change_gun
* call ace_atragmx_fnc_change_gun
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_create_dialog
* call ace_atragmx_fnc_create_dialog
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_cycle_scope_unit
* call ace_atragmx_fnc_cycle_scope_unit
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_cycle_image_size_units
* call ace_atragmx_fnc_cycle_image_size_units
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_cycle_num_ticks_units
* call ace_atragmx_fnc_cycle_num_ticks_units
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_cycle_range_card_columns
* call ace_atragmx_fnc_cycle_range_card_columns
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_cycle_scope_unit
* call ace_atragmx_fnc_cycle_scope_unit
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_cycle_target_size_units
* call ace_atragmx_fnc_cycle_target_size_units
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_cycle_target_direction
* call ace_atragmx_fnc_cycle_target_direction
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_delete_gun
* call ace_atragmx_fnc_delete_gun
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_parse_input
* call ace_atragmx_fnc_parse_input
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_reset_relative_click_memory
* call ace_atragmx_fnc_reset_relative_click_memory
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_save_gun
* call ace_atragmx_fnc_save_gun
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_show_add_new_gun
* call ace_atragmx_fnc_show_add_new_gun
*
* Public: No
*/
@ -17,4 +17,4 @@
GVAR(showAddNewGun) = _this;
{ctrlShow [_x, _this]} forEach [11000, 11001, 11002, 11003];
{ctrlShow [_x, _this]} forEach [11000, 11001, 11002, 11003];

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_show_gun_list
* call ace_atragmx_fnc_show_gun_list
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_show_main_page
* call ace_atragmx_fnc_show_main_page
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_show_range_card
* call ace_atragmx_fnc_show_range_card
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_show_range_card_setup
* call ace_atragmx_fnc_show_range_card_setup
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_show_target_range_assist
* call ace_atragmx_fnc_show_target_range_assist
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_show_target_speed_assist
* call ace_atragmx_fnc_show_target_speed_assist
*
* Public: No
*/

View File

@ -9,7 +9,7 @@
* Nothing
*
* Example:
* call ace_atragmx_show_target_speed_assist_timer
* call ace_atragmx_fnc_show_target_speed_assist_timer
*
* Public: No
*/

View File

@ -5,7 +5,7 @@ class RscTitles {
duration = 9999999;
fadein = 0;
fadeout = 0;
onLoad = "uiNamespace setVariable ['ACE_attach_virtualAmmoDisplay', (_this select 0)];";
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(virtualAmmoDisplay), _this select 0)]);
class controls {};
class objects {
class TheObject {

View File

@ -11,7 +11,7 @@ class Cfg3DEN {
expression = QUOTE(if (_value) then {[ARR_3(objNull,[_this],true)] call FUNC(moduleHandcuffed)});
typeName = "BOOL";
condition = "objectBrain";
defaultValue = false;
defaultValue = "(false)";
};
class ace_isSurrendered {
property = QUOTE(ace_isSurrendered);
@ -21,7 +21,7 @@ class Cfg3DEN {
expression = QUOTE(if (_value) then {[ARR_3(objNull,[_this],true)] call FUNC(moduleSurrender)});
typeName = "BOOL";
condition = "objectBrain";
defaultValue = false;
defaultValue = "(false)";
};
};
};

View File

@ -67,4 +67,9 @@ class Extended_InitPost_EventHandlers {
init = QUOTE(_this call DFUNC(initObject));
};
};
class StaticWeapon {
class ADDON {
init = QUOTE(_this call DFUNC(initObject));
};
};
};

View File

@ -403,6 +403,36 @@ class CfgVehicles {
};
};
};
class Constructions_base_F;
class Land_WoodenBox_F: Constructions_base_F {
class EventHandlers {
class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {};
};
GVAR(space) = 2;
GVAR(hasCargo) = 2;
GVAR(size) = 3;
GVAR(canLoad) = 1;
maximumLoad = 2000;
transportMaxBackpacks = 12;
transportMaxMagazines = 64;
transportMaxWeapons = 12;
};
class Land_WoodenCrate_01_F: ThingX {
class EventHandlers {
class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {};
};
GVAR(space) = 3;
GVAR(hasCargo) = 3;
GVAR(size) = 3;
GVAR(canLoad) = 1;
maximumLoad = 2000;
transportMaxBackpacks = 12;
transportMaxMagazines = 64;
transportMaxWeapons = 12;
};
class Cargo_base_F: ThingX {
GVAR(space) = 4;

View File

@ -177,6 +177,7 @@
<French>Rendre l'objet chargeable</French>
<Czech>Vytvořit objekt nakladatelným</Czech>
<Portuguese>Fazer objeto carregável</Portuguese>
<Russian>Сделать объект загружаемым</Russian>
</Key>
<Key ID="STR_ACE_Cargo_makeLoadable_description">
<English>Sets the synced object as loadable by the cargo system.</English>
@ -187,6 +188,7 @@
<French>Rend l'objet synchronisé comme chargeable par le système de cargaison.</French>
<Czech>Nastaví synchronizované objekty nakladatelnými za pomocí Nákladního systému.</Czech>
<Portuguese>Seta o objeto sincronizado como carregável</Portuguese>
<Russian>Делает синхронизированный объект загружаемым для модуля перевозки грузов.</Russian>
</Key>
<Key ID="STR_ACE_Cargo_makeLoadable_setSize_displayName">
<English>Object's Size</English>
@ -197,6 +199,7 @@
<French>Taille de l'objet</French>
<Czech>Velikost objektu</Czech>
<Portuguese>Tamanho do objeto</Portuguese>
<Russian>Размер объекта</Russian>
</Key>
</Package>
</Project>

View File

@ -1,14 +0,0 @@
class CfgActions {
// fixes pick up action on mine detectors, because all ACE items are of that simulationClass and BI doesn't seem to care
class None;
class TakeWeapon: None {
show = 0;
};
class TakeItem: None {
show = 0;
};
class TakeMagazine: None {
show = 0;
};
};

View File

@ -26,11 +26,6 @@ class Extended_DisplayLoad_EventHandlers {
};
class Extended_InitPost_EventHandlers {
class All {
class GVAR(executePersistent) {
init = QUOTE([_this select 0] call FUNC(executePersistent));
};
};
class CAManBase {
class GVAR(setName) {
init = QUOTE(if (local (_this select 0)) then {[ARR_2(FUNC(setName),_this)] call CBA_fnc_execNextFrame};);

View File

@ -39,10 +39,6 @@ PREP(endRadioTransmission);
PREP(eraseCache);
PREP(errorMessage);
PREP(execNextFrame);
PREP(execPersistentFnc);
PREP(execRemoteFnc);
PREP(executePersistent);
PREP(filter);
PREP(findUnloadPosition);
PREP(firedEH);
PREP(fixCollision);
@ -50,16 +46,13 @@ PREP(fixFloating);
PREP(fixLoweredRifleAnimation);
PREP(fixPosition);
PREP(getAllDefinedSetVariables);
PREP(getAllGear);
PREP(getDeathAnim);
PREP(getCaptivityStatus);
PREP(getDefaultAnim);
PREP(getDefinedVariable);
PREP(getDefinedVariableDefault);
PREP(getDefinedVariableInfo);
PREP(getFirstObjectIntersection);
PREP(getFirstTerrainIntersection);
PREP(getForceWalkStatus);
PREP(getGunner);
PREP(getInPosition);
PREP(getMapData);
@ -69,12 +62,10 @@ PREP(getMapPosFromGrid);
PREP(getMarkerType);
PREP(getMGRSdata);
PREP(getName);
PREP(getNumberFromMissionSQM);
PREP(getNumberMagazinesIn);
PREP(getPitchBankYaw);
PREP(getSettingData);
PREP(getStaminaBarControl);
PREP(getStringFromMissionSQM);
PREP(getTargetAzimuthAndInclination);
PREP(getTargetDistance);
PREP(getTargetObject);
@ -102,7 +93,6 @@ PREP(hideUnit);
PREP(insertionSort);
PREP(interpolateFromArray);
PREP(inTransitionAnim);
PREP(isAutoWind);
PREP(isAwake);
PREP(isEngineer);
PREP(isEOD);
@ -117,7 +107,6 @@ PREP(loadPersonLocal);
PREP(loadSettingsFromProfile);
PREP(loadSettingsOnServer);
PREP(loadSettingsLocalizedText);
PREP(map);
PREP(moduleCheckPBOs);
PREP(moduleLSDVehicles);
PREP(muteUnit);
@ -146,12 +135,9 @@ PREP(runAfterSettingsInit);
PREP(sanitizeString);
PREP(sendRequest);
PREP(serverLog);
PREP(setAllGear);
PREP(setApproximateVariablePublic);
PREP(setCaptivityStatus);
PREP(setDefinedVariable);
PREP(setDisableUserInputStatus);
PREP(setForceWalkStatus);
PREP(setHearingCapability);
PREP(setName);
PREP(setParameter);
@ -215,7 +201,6 @@ PREP(getVehicleCrew);
PREP(getVehicleUAVCrew);
// turrets
PREP(getTurrets);
PREP(getTurretIndex);
PREP(getTurretConfigPath);
PREP(getTurretGunner);
@ -276,8 +261,3 @@ PREP(hashSet);
PREP(hashGet);
PREP(hashHasKey);
PREP(hashRem);
PREP(hashListCreateList);
PREP(hashListCreateHash);
PREP(hashListSelect);
PREP(hashListSet);
PREP(hashListPush);

View File

@ -160,14 +160,6 @@ if (isServer) then {
[FUNC(syncedEventPFH), 0.5, []] call CBA_fnc_addPerFrameHandler;
};
// @todo deprecated
QGVAR(remoteFnc) addPublicVariableEventHandler {
(_this select 1) call FUNC(execRemoteFnc);
};
// @todo figure out what this does.
[missionNamespace] call FUNC(executePersistent);
//////////////////////////////////////////////////
// Check files, previous installed version etc.
@ -274,8 +266,8 @@ enableCamShake true;
//FUNC(showHud) needs to be refreshed if it was set during mission init
["ace_infoDisplayChanged", {
GVAR(showHudHash) params ["", "_masks"];
if (!(_masks isEqualTo [])) then {
GVAR(showHudHash) params ["", "", "_masks"];
if !(_masks isEqualTo []) then {
[] call FUNC(showHud);
};
}] call CBA_fnc_addEventHandler;
@ -326,7 +318,37 @@ enableCamShake true;
// "playerInventoryChanged" event
["loadout", {
["ace_playerInventoryChanged", [ACE_player, [ACE_player, false] call FUNC(getAllGear)]] call CBA_fnc_localEvent;
private _fnc_getAllGear = {
if (isNull _this) exitWith {[
"",
"",
"", [],
"", [],
"", [],
"", ["","","",""], [],
"", ["","","",""], [],
"", ["","","",""], [],
[],
"",
""
]};
[
headgear _this,
goggles _this,
uniform _this, uniformItems _this,
vest _this, vestItems _this,
backpack _this, backpackItems _this,
primaryWeapon _this, primaryWeaponItems _this, primaryWeaponMagazine _this,
secondaryWeapon _this, secondaryWeaponItems _this, secondaryWeaponMagazine _this,
handgunWeapon _this, handgunItems _this, handgunMagazine _this,
assignedItems _this,
binocular _this,
_this call CBA_fnc_binocularMagazine
]
};
["ace_playerInventoryChanged", [ACE_player, ACE_player call _fnc_getAllGear]] call CBA_fnc_localEvent;
}] call CBA_fnc_addPlayerEventHandler;
// "playerVisionModeChanged" event

View File

@ -5,19 +5,8 @@ ADDON = false;
#include "XEH_PREP.hpp"
// backwards comp
DFUNC(canUseWeapon) = {
ACE_DEPRECATED("ace_common_fnc_canUseWeapon","3.7.0","CBA_fnc_canUseWeapon");
_this call CBA_fnc_canUseWeapon;
};
DFUNC(selectWeaponMode) = {
ACE_DEPRECATED("ace_common_fnc_selectWeaponMode","3.7.0","CBA_fnc_selectWeapon");
_this call CBA_fnc_selectWeapon;
};
GVAR(syncedEvents) = HASH_CREATE;
GVAR(showHudHash) = [] call FUNC(hashCreate);
GVAR(syncedEvents) = [] call CBA_fnc_hashCreate;
GVAR(showHudHash) = [] call CBA_fnc_hashCreate;
GVAR(settingsInitFinished) = false;
GVAR(runAtSettingsInitialized) = [];

View File

@ -86,7 +86,6 @@ class ACE_newEvents {
#include "CfgWeapons.hpp"
#include "CfgMagazines.hpp"
#include "CfgActions.hpp"
#include "CfgMoves.hpp"
#include "CfgVoice.hpp"
#include "CfgUnitInsignia.hpp"

View File

@ -14,12 +14,11 @@
params ["_client"];
{
private _eventEntry = HASH_GET(GVAR(syncedEvents),_x);
_eventEntry params ["", "_eventLog"];
[GVAR(syncedEvents), {
_value params ["", "_eventLog"];
["ACEs", [_x, _eventLog], _client] call CBA_fnc_targetEvent;
["ACEs", [_key, _eventLog], _client] call CBA_fnc_targetEvent;
false
} count (GVAR(syncedEvents) select 0);
}] call CBA_fnc_hashEachPair;
true

View File

@ -22,12 +22,12 @@ if (isServer) then {
// Find the event name, and shovel out the events to the client
params ["_eventName", "_client"];
if (!HASH_HASKEY(GVAR(syncedEvents),_eventName)) exitWith {
if !([GVAR(syncedEvents), _eventName] call CBA_fnc_hashHasKey) exitWith {
ACE_LOGERROR_1("Request for synced event - key [%1] not found.", _eventName);
false
};
private _eventEntry = HASH_GET(GVAR(syncedEvents),_eventName);
private _eventEntry = [GVAR(syncedEvents), _eventName] call CBA_fnc_hashGet;
_eventEntry params ["", "_eventLog"];
["ACEs", [_eventName, _eventLog], _client] call CBA_fnc_targetEvent;

View File

@ -16,22 +16,19 @@
params ["_name", "_args", "_ttl"];
if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
if !([GVAR(syncedEvents), _name] call CBA_fnc_hashHasKey) exitWith {
ACE_LOGERROR_1("Synced event key [%1] not found (_handleSyncedEvent).", _name);
false
};
private _internalData = HASH_GET(GVAR(syncedEvents),_name);
private _internalData = [GVAR(syncedEvents), _name] call CBA_fnc_hashGet;
_internalData params ["_eventCode", "_eventLog"];
if (isServer) then {
// Server needs to internally log it for synchronization
if (_ttl > -1) then {
_internalData = HASH_GET(GVAR(syncedEvents),_name);
_internalData params ["", "_eventLog"];
_eventLog pushBack [diag_tickTime, _args, _ttl];
};
};
_internalData params ["_eventCode"];
_args call _eventCode;

View File

@ -19,7 +19,7 @@
params ["_name", "_handler", ["_ttl", 0]];
if (HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
if ([GVAR(syncedEvents), _name] call CBA_fnc_hashHasKey) exitWith {
ACE_LOGERROR_1("Duplicate synced event [%1] creation.",_name);
false
};
@ -27,4 +27,4 @@ if (HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
private _eventId = [_name, FUNC(_handleSyncedEvent)] call CBA_fnc_addEventHandler;
private _data = [_handler, [], _ttl, _eventId];
HASH_SET(GVAR(syncedEvents),_name,_data);
[GVAR(syncedEvents), _name, _data] call CBA_fnc_hashSet;

View File

@ -30,7 +30,7 @@ if !([_unit] call EFUNC(common,isPlayer)) then {
} else {
//Sanity check to make sure we don't enable unconsious AI
if (_unit getVariable ["ace_isunconscious", false] && alive _unit) exitWith {
ERROR("Enabling AI for unconsious unit");
ACE_LOGERROR("Enabling AI for unconsious unit");
};
_unit enableAI "MOVE";

View File

@ -1,53 +0,0 @@
/*
* Author: commy2
* Execute a function on every machine. Function will also be called upon JIP (postInit). The arguments are stored in (_this select 0), while the assigned namespace is stored in (_this select 1).
*
* Arguments:
* 0: Function arguments <ARRAY>
* 1: Function to execute, has to be defined on the remote machine first <STRING>
* 2: Namespace to save that variable in <OBJECT, NAMESPACE>
* 3: Name. Will overwrite previously defined functions with that name <STRING>
*
* Return Value:
* None
*
* Public: No
*
* Deprecated
*/
#include "script_component.hpp"
ACE_DEPRECATED("ace_common_fnc_execPersistentFnc","3.7.0","ace_common_fnc_globalEvent");
GVAR(remoteFnc) = _this;
params ["_arguments", "_function", "_unit", "_name"];
TRACE_4("params", _arguments, _function, _unit, _name);
_function = call compile _function;
// execute function on every currently connected machine
[[_arguments, _unit], _this select 1, 2] call FUNC(execRemoteFnc);
// save persistent function for JIP
private _persistentFunctions = _unit getVariable ["ACE_PersistentFunctions", []];
// find index to overwrite function with the same name, add to end otherwise
private _index = count _persistentFunctions;
{
if (_x select 2 == _name) exitWith {
_index = _forEachIndex;
};
} forEach _persistentFunctions;
// set new value
_persistentFunctions set [_index, [_arguments, _function, _name]];
// broadcast variable
if (typeName _unit == "NAMESPACE") then {
ACE_PersistentFunctions = _persistentFunctions;
publicVariable "ACE_PersistentFunctions";
} else {
_unit setVariable ["ACE_PersistentFunctions", _persistentFunctions, true];
};

View File

@ -1,68 +0,0 @@
/*
* Author: commy2
* Execute a function on a remote machine in mp.
*
* Arguments:
* 0: Function arguments <ARRAY>
* 1: Function to execute, has to be defined on the remote machine first <STRING>
* 2: The function will be executed where this unit is local OR the mode were this function should be executed. (default: 2) <OBJECT, NUMBER>
* 0 = execute on this machine only
* 1 = execute on server
* 2 = execute on all clients + server
* 3 = execute on dedicated only
*
* Return Value:
* None
*
* Public: No
*
* Deprecated
*/
#include "script_component.hpp"
ACE_DEPRECATED("ace_common_fnc_execRemoteFnc","3.7.0","ace_common_fnc_globalEvent");
GVAR(remoteFnc) = _this;
params ["_arguments", "_function", ["_unit", 2]];
TRACE_3("params", _arguments, _function, _unit);
_function = call compile _function;
if (_unit isEqualType 0) exitWith {
switch (_unit) do {
case 0 : {
_arguments call _function;
};
case 1 : {
if (isServer) then {
_arguments call _function;
} else {
publicVariableServer QGVAR(remoteFnc);
};
};
case 2 : {
_arguments call _function;
GVAR(remoteFnc) set [2, 0];
publicVariable QGVAR(remoteFnc);
};
case 3 : {
if (isDedicated) then {
_arguments call _function;
} else {
if (!isServer) then {publicVariableServer QGVAR(remoteFnc)};
};
};
};
};
if (local _unit) then {
_arguments call _function;
} else {
if (isServer) then {
(owner _unit) publicVariableClient QGVAR(remoteFnc);
} else {
publicVariableServer QGVAR(remoteFnc);
};
};

View File

@ -1,25 +0,0 @@
/*
* Author: commy2
* Execute all Persistent Functions
*
* Arguments:
* ?
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
params ["_target"];
{
if (isNil "_x") then {
ACE_LOGERROR_1("No arguments and function for remote function. ID: %1",_forEachIndex);
} else {
if (_x isEqualType []) then {
[_x select 0, _target] call (_x select 1);
};
};
} forEach (_target getVariable ["ACE_PersistentFunctions", []]);

View File

@ -1,31 +0,0 @@
/*
* Author: KoffeinFlummi, commy2
* Filters array and removes every element not fitting the condition
*
* Arguments:
* 0: Array to be filtered.
* 1: Code to be evaluated.
*
* Return Value:
* Final array
*
* Public: Yes
*
* Deprecated
*/
#include "script_component.hpp"
params [["_array", [], [[]]], ["_code", {}, [{}]]];
ACE_DEPRECATED("ace_common_fnc_filter","3.7.0","select CODE");
private _result = [];
{
if (_x call _code) then {
_result pushBack _x;
};
false
} count _array;
_result

View File

@ -1,68 +0,0 @@
/*
* Author: bux578, commy2
* Returns an array containing all items of a given unit
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* 0: Headgear <STRING>
* 1: Goggles <STRING>
* 2: Uniform <STRING>
* 3: Uniform Items <ARRAY>
* 4: Vest <String>
* 5: Vest Items <ARRAY>
* 6: Backback <STRING>
* 7: Backpack Items <ARRAY>
* 8: Rifle <STRING>
* 9: Rifle Items <ARRAY>
* 10: Rifle Magazines <ARRAY>
* 11: Launcher <STRING>
* 12: Launcher Items <ARRAY>
* 13: Launcher Magazines <ARRAY>
* 14: Handgun <STRING>
* 15: Handgun Items <ARRAY>
* 16: Handgun Magazines <ARRAY>
* 17: Assigned Items (map, compass, watch, etc.) <ARRAY>
* 18: Binoculars <STRING>
* 19: Binocular Magazine (E.g. Laserbatteries) <STRING>
*
* Public: Yes
*
* Note: Element 17 includes the Head Mounted Display (HMD)
*/
#include "script_component.hpp"
params ["_unit", ["_showDeprecated", true]];
if (_showDeprecated) then {
ACE_DEPRECATED("ace_common_fnc_getAllGear","3.7.0","getUnitLoadout");
};
if (isNull _unit) exitWith {[
"",
"",
"", [],
"", [],
"", [],
"", ["","","",""], [],
"", ["","","",""], [],
"", ["","","",""], [],
[],
"",
""
]};
[
headgear _unit,
goggles _unit,
uniform _unit, uniformItems _unit,
vest _unit, vestItems _unit,
backpack _unit, backpackItems _unit,
primaryWeapon _unit, primaryWeaponItems _unit, primaryWeaponMagazine _unit,
secondaryWeapon _unit, secondaryWeaponItems _unit, secondaryWeaponMagazine _unit,
handgunWeapon _unit, handgunItems _unit, handgunMagazine _unit,
assignedItems _unit,
binocular _unit,
[_unit] call CBA_fnc_binocularMagazine
]

View File

@ -1,20 +0,0 @@
/*
* Author: commy2
* Return the captivity status of an unit.
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* Captivity Reasons, empty if not captive <ARRAY>
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit"];
//Now just a wrapper for FUNC(statusEffect_get) [No longer used in ace as of 3.5]
ACE_DEPRECATED("ace_common_fnc_getCaptivityStatus","3.7.0","ace_common_fnc_statusEffect_get");
([_unit, "setCaptive"] call FUNC(statusEffect_get)) select 1

View File

@ -1,23 +0,0 @@
/*
* Author: PabstMirror, commy2
* Returns reasons why the unit is forceWalk-ing.
*
* Arguments:
* 0: unit <OBJECT>
*
* Return Value:
* Force Walk reasons <ARRAY>
*
* Example:
* [ACE_Player] call ace_common_fnc_getForceWalkStatus
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit"];
//Now just a wrapper for FUNC(statusEffect_get) [No longer used in ace as of 3.5]
ACE_DEPRECATED("ace_common_fnc_getForceWalkStatus","3.7.0","ace_common_fnc_statusEffect_get");
([_unit, "forceWalk"] call FUNC(statusEffect_get)) select 1

View File

@ -19,7 +19,7 @@
params ["_inputString", ["_getCenterOfGrid", true]];
if (count GVAR(mapGridData) == 0) exitWith {
ERROR("Map has bad data, falling back to BIS_fnc_gridToPos");
ACE_LOGERROR("Map has bad data, falling back to BIS_fnc_gridToPos");
(_this call BIS_fnc_gridToPos) select 0
};

View File

@ -1,16 +0,0 @@
/*
* Author: commy2
* Get a number from the mission.sqm file. Mission has to be saved in the Editor.
* On non-existing entries, it might return 0 or the value of an entry with the same name of another calss.
*
* Arguments:
* 0: Path of the entry in the mission.sqm <ARRAY>
*
* Return Value:
* Entry value <NUMBER>
*
* Public: No
*/
#include "script_component.hpp"
parseNumber (_this call FUNC(getStringFromMissionSQM)) // return

View File

@ -1,66 +0,0 @@
/*
* Author: commy2
* Get a string from the mission.sqm file. Mission has to be saved in the Editor.
* The string cannot contain the ; character.
* If the entry does not exist, it might return an empty string or an entry with the same name of another class!
*
* Arguments:
* 0: Path of the entry in the mission.sqm <ARRAY>
*
* Return Value:
* Value of the entry. <STRING>
*
* Public: No
*/
#include "script_component.hpp"
[_this] params ["_path", [], [[]]];
if (missionName == "") exitWith {""};
private _mission = toArray toLower loadFile "mission.sqm";
_mission resize 65536;
{
if (_x < 33) then {
_mission set [_forEachIndex, -1];
}
} forEach _mission;
_mission = toString (_mission - [-1]);
{_path set [_forEachIndex, toLower _x]} forEach _path;
for "_a" from 0 to (count _path - 2) do {
private _class = format ["class%1{", _path select _a];
private _index = _mission find _class;
private _array = toArray _mission;
for "_b" from 0 to (_index + count toArray _class - 1) do {
_array set [_b, -1];
};
_array = _array - [-1];
_mission = toString _array;
};
private _entry = format ["%1=", _path select (count _path - 1)];
_index = _mission find _entry;
if (_index == -1) exitWith {""};
_array = toArray _mission;
for "_b" from 0 to (_index + count toArray _entry - 1) do {
_array set [_b, -1];
};
_mission = toString (_array - [-1]);
_index = _mission find ";";
_mission = toArray _mission;
_mission resize _index;
format ["%1", toString _mission] // return

View File

@ -1,54 +0,0 @@
/*
* Author: commy2
* Get all turret indicies of a vehicle type.
*
* Arguments:
* 0: Vehicle type <STRING>
*
* Return Value:
* Turret Indecies <ARRAY>
*
* Public: No
*
* Note: It's advised to use allTurrets [_vehicle, true] instead whenever possible
*/
#include "script_component.hpp"
ACE_DEPRECATED("ace_common_fnc_getTurrets","3.7.0","allTurrets [_vehicle, true]");
params ["_type"];
private _varName = format [QGVAR(CachedTurrets_%1), _type];
private _turrets = + (uiNamespace getVariable _varName);
if (!isNil "_turrets") exitWith {_turrets};
private _config = configFile >> "CfgVehicles" >> _type;
_turrets = [];
private _fnc_addTurret = {
params ["_config", "_path"];
_config = _config >> "Turrets";
private _offset = 0;
for "_index" from 0 to (count _config - 1) do {
private _path2 = _path + [_index - _offset];
private _config2 = _config select _index;
if (isClass _config2) then {
_turrets pushBack _path2;
[_config2, _path2] call _fnc_addTurret;
} else {
_offset = _offset + 1;
};
};
};
[_config, []] call _fnc_addTurret;
uiNamespace setVariable [_varName, _turrets];
_turrets

View File

@ -12,4 +12,6 @@
*/
#include "script_component.hpp"
ACE_DEPRECATED(QFUNC(hashCreate),"3.8.0","CBA_fnc_hashCreate");
[[],[]]

View File

@ -13,6 +13,8 @@
*/
#include "script_component.hpp"
ACE_DEPRECATED(QFUNC(hashGet),"3.8.0","CBA_fnc_hashGet");
params ["_hash", "_key"];
ERRORDATA(2);

View File

@ -12,6 +12,8 @@
*/
#include "script_component.hpp"
ACE_DEPRECATED(QFUNC(hashHasKey),"3.8.0","CBA_fnc_hashHasKey");
// diag_log text format["%1 HASH HAS KEY: %2", diag_tickTime, _this];
params ["_hash", "_key"];

View File

@ -1,28 +0,0 @@
/*
* Author: ?
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
params ["_hashList"];
ERRORDATA(1);
private _hashKeys = [];
try {
if(VALIDHASH(_hashList)) then {
_hashKeys = (_hashList select 0);
} else {
ERROR("Input hashlist is not valid");
};
} catch {
HANDLECATCH;
};
[_hashKeys, []];

View File

@ -1,17 +0,0 @@
/*
* Author: ?
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
params ["_keys"];
[_keys,[]];

View File

@ -1,26 +0,0 @@
/*
* Author: ?
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
params ["_hashList", "_value"];
ERRORDATA(2);
try {
if(VALIDHASH(_hashList)) then {
[_hashList, (count (_hashList select 1)), _value] call FUNC(hashListSet);
} else {
ERROR("Input hashlist in push not valid");
};
} catch {
HANDLECATCH;
};

View File

@ -1,38 +0,0 @@
/*
* Author: ?
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
params ["_hashList", "_index"];
ERRORDATA(2);
private _hash = nil;
try {
if(VALIDHASH(_hashList)) then {
_hashList params ["_keys", "_hashes"];
if(_index < (count _hashes)) then {
private _values = _hashes select _index;
_hash = [_keys, _values, 1];
} else {
ERROR("Index of hashlist is out of range");
};
} else {
ERROR("Input hashlist is not valid");
};
} catch {
HANDLECATCH;
};
if (isNil "_hash") exitWith { nil };
_hash;

View File

@ -1,32 +0,0 @@
/*
* Author: ?
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
params ["_hashList", "_index", "_value"];
ERRORDATA(3);
try {
if(VALIDHASH(_hashList)) then {
if(VALIDHASH(_value)) then {
_value params ["", "_vals"];
(_hashList select 1) set[_index, _vals];
} else {
ERROR("Set hash in hashlist is not valid");
};
} else {
ERROR("Input hashlist is not valid");
};
} catch {
HANDLECATCH;
};

View File

@ -12,6 +12,8 @@
*/
#include "script_component.hpp"
ACE_DEPRECATED(QFUNC(hashRem),"3.8.0","CBA_fnc_hashRem");
params ["_hash", "_key"];
ERRORDATA(2);

View File

@ -12,6 +12,8 @@
*/
#include "script_component.hpp"
ACE_DEPRECATED(QFUNC(hashSet),"3.8.0","CBA_fnc_hashSet");
// diag_log text format["%1 HASH SET: %2", diag_tickTime, _this];
params ["_hash", "_key", "_val"];

View File

@ -9,28 +9,14 @@
* Return Value:
* sortedArray (ARRAY)
*
* Public: Yes
* Public: No
*/
#include "script_component.hpp"
params ["_list", ["_ascending", true]];
ACE_DEPRECATED(QFUNC(insertionSort),"3.8.0","sort");
params [["_list", [], [[]]], ["_ascending", true, [false]]];
_list = + _list; // copy array to not alter the original one
for "_i" from 1 to (count _list - 1) do {
private _tmp = _list select _i;
_j = _i;
while {_j >= 1 && {_tmp < _list select (_j - 1)}} do {
_list set [_j, _list select (_j - 1)];
_j = _j - 1;
};
_list set [_j, _tmp];
};
if (!_ascending) then {
reverse _list;
};
_list sort _ascending;
_list

View File

@ -1,15 +0,0 @@
/*
* Author: commy2
* Check if wind is set on auto.
*
* Arguments
* None
*
* Return Value:
* This mission has automatic wind? <BOOL>
*
* Public: Yes
*/
#include "script_component.hpp"
["Mission", "Intel", "windForced"] call FUNC(getNumberFromMissionSQM) != 1 // return

View File

@ -1,29 +0,0 @@
/*
* Author: KoffeinFlummi, commy2
* Applies given code to every element in an array, LIKE SOMETHING SQF SHOULD HAVE BY DEFAULT. <- :kappa:
*
* Arguments:
* 0: Array to be thingied.
* 1: Code to be applied to every element.
*
* Return Value:
* Final array
*
* Public: Yes
*
* Deprecated
*/
#include "script_component.hpp"
params [["_array", [], [[]]], ["_code", {}, [{}]]];
ACE_DEPRECATED("ace_common_fnc_map","3.7.0","apply");
// copy array to not alter the original one
_array = + _array;
{
_array set [_forEachIndex, _x call _code];
} forEach _array;
_array

View File

@ -14,13 +14,13 @@
params ["_name"];
if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
if !([GVAR(syncedEvents), _name] call CBA_fnc_hashHasKey) exitWith {
ACE_LOGERROR_1("Synced event key [%1] not found (removeSyncedEventHandler).", _name);
false
};
private _data = HASH_GET(GVAR(syncedEvents),_name);
private _data = [GVAR(syncedEvents), _name] call CBA_fnc_hashGet;
_data params ["", "", "", "_eventId"];
[_eventId] call CBA_fnc_removeEventHandler;
HASH_REM(GVAR(syncedEvents),_name);
[GVAR(syncedEvents), _name] call CBA_fnc_hashRem;

View File

@ -1,178 +0,0 @@
/*
* Author: bux578, commy2
* Applies gear to unit. It must be called in the machine in which the unit is local.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: All Gear based on return value of ACE_common_fnc_getAllGear <ARRAY>
* 2: Remove all attachments from weapons? (default: false) <BOOL>
* 3: Remove all items from prefilled backpacks? (default: false) <BOOL>
*
* Return Value:
* None
*
* Example:
* [player, gear_array, true, true] call ace_common_fnc_setAllGear
*
* Public: Yes
*/
#include "script_component.hpp"
ACE_DEPRECATED("ace_common_fnc_setAllGear","3.7.0","setUnitLoadout");
params ["_unit", "_allGear", ["_clearAttachments", false], ["_clearBackpack", false]];
if (!local _unit) exitWith {
ACE_LOGWARNING_1("setAllGear - %1 has to be local.",_unit);
};
// remove all starting gear of a player
removeAllWeapons _unit;
removeGoggles _unit;
removeHeadgear _unit;
removeVest _unit;
removeUniform _unit;
removeAllAssignedItems _unit;
removeBackpack _unit;
_allGear params [
"_headgear", "_goggles",
"_uniform", "_uniformitems",
"_vest", "_vestitems",
"_backpack", "_backpackitems",
"_primaryweapon", "_primaryweaponitems", "_primaryweaponmagazine",
"_secondaryweapon", "_secondaryweaponitems", "_secondaryweaponmagazine",
"_handgunweapon", "_handgunweaponitems", "_handgunweaponmagazine",
"_assigneditems",
"_binocular",
"_binocularmagazine"
];
// start restoring the items
if (_headgear != "") then {_unit addHeadgear _headgear};
if (_goggles != "") then {_unit addGoggles _goggles};
// ensure all weapons being loaded
_unit addBackpack "ACE_FakeBackpack";
// primaryWeapon
if (_primaryweapon != "") then {
{
_unit addMagazine _x;
false
} count _primaryweaponmagazine;
_unit addWeapon _primaryweapon;
if (_clearAttachments) then {
removeAllPrimaryWeaponItems _unit;
};
{
if (_x != "") then {
_unit addPrimaryWeaponItem _x;
};
false
} count _primaryweaponitems;
};
// secondaryWeapon
if (_secondaryweapon != "") then {
{
_unit addMagazine _x;
false
} count _secondaryweaponmagazine;
_unit addWeapon _secondaryweapon;
if (_clearAttachments) then {
//removeAllSecondaryWeaponItems _unit;
{
_unit removeSecondaryWeaponItem _x;
false
} count secondaryWeaponItems _unit;
};
{
if (_x != "") then {
_unit addSecondaryWeaponItem _x;
};
false
} count _secondaryweaponitems;
};
// handgun
if (_handgunweapon != "") then {
{
_unit addMagazine _x;
false
} count _handgunweaponmagazine;
_unit addWeapon _handgunweapon;
if (_clearAttachments) then {
removeAllHandgunItems _unit;
};
{
if (_x != "") then {
_unit addHandgunItem _x;
};
false
} count _handgunweaponitems;
};
// binocular
_unit addWeapon _binocular;
_unit addMagazine _binocularmagazine;
// done with dummy backpack. now remove
removeBackpack _unit;
// uniform
if (_uniform != "") then {
_unit forceAddUniform _uniform;
};
{
_unit addItemToUniform _x;
false
} count _uniformitems;
// vest
if (_vest != "") then {
_unit addVest _vest;
};
{
_unit addItemToVest _x;
false
} count _vestitems;
// backpack
if (_backpack != "") then {
_unit addBackpack _backpack;
if (_clearBackpack) then {
private _backpackObject = unitBackpack _unit;
clearMagazineCargoGlobal _backpackObject;
clearWeaponCargoGlobal _backpackObject;
clearItemCargoGlobal _backpackObject;
};
{
_unit addItemToBackpack _x;
false
} count _backpackitems;
};
// assigned items
_assignedItems deleteAt (_assignedItems find _binocular);
{
_unit linkItem _x;
false
} count _assignedItems;
nil

View File

@ -1,22 +0,0 @@
/*
* Author: commy2
* Set the captivity status of an unit. This allows the handling of more than one reason to set a unit captive.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: The reason of the captivity <STRING>
* 2: Is the reason still valid? True for setting this reason, false for removing it <BOOL>
*
* Return Value:
* None
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit", "_reason", "_status"];
//Now just a wrapper for FUNC(statusEffect_set) [No longer used in ace as of 3.5]
ACE_DEPRECATED("ace_common_fnc_setCaptivityStatus","3.7.0","ace_common_fnc_statusEffect_set");
[_unit, "setCaptive", _reason, _status] call FUNC(statusEffect_set);

View File

@ -1,26 +0,0 @@
/*
* Author: Pabst Mirror (from captivity by commy2)
* Sets the forceWalk status of an unit. This allows the handling of more than one reason to set forceWalk.
* Unit will force walk until all reasons are removed.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Reason for forcing walking <STRING>
* 2: Is the reason still valid. True to force walk, false to remove restriction. <BOOL>
*
* Returns:
* None
*
* Example:
* [ACE_Player, "BrokenLeg", true] call FUNC(setForceWalkStatus)
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit", "_reason", "_status"];
//Now just a wrapper for FUNC(statusEffect_set) [No longer used in ace as of 3.5]
ACE_DEPRECATED("ace_common_fnc_setForceWalkStatus","3.7.0","ace_common_fnc_statusEffect_set");
[_unit, "forceWalk", _reason, _status] call FUNC(statusEffect_set);

View File

@ -40,14 +40,14 @@ if (_reason != "") then {
_reason = toLower _reason;
if (_mask isEqualTo []) then {
TRACE_2("Setting", _reason, _mask);
[GVAR(showHudHash), _reason] call FUNC(hashRem);
[GVAR(showHudHash), _reason] call CBA_fnc_hashRem;
} else {
TRACE_2("Removing", _reason, _mask);
[GVAR(showHudHash), _reason, _mask] call FUNC(hashSet);
[GVAR(showHudHash), _reason, _mask] call CBA_fnc_hashSet;
};
};
GVAR(showHudHash) params ["_reasons", "_masks"];
GVAR(showHudHash) params ["", "_reasons", "_masks"];
private _resultMask = [];
for "_index" from 0 to 7 do {

View File

@ -1,13 +1,15 @@
/*
* Author: Glowbal
* Removes white spaces from string
* Removes whitespace from a string.
*
* Arguments:
* 0: stringA <STRING>
* 1: stringB <STRING>
* 0: String <STRING>
*
* Return Value:
* copy of string <STRING>
* String Without Whitespace <STRING>
*
* Example:
* _stringWithoutWhitespace = ["String with whitespace"] call ace_common_fnc_stringRemoveWhiteSpace
*
* Public: Yes
*/

View File

@ -16,7 +16,7 @@
params ["_name", "_args", ["_ttl", 0]];
if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
if !([GVAR(syncedEvents), _name] call CBA_fnc_hashHasKey) exitWith {
ACE_LOGERROR_1("Synced event key [%1] not found (syncedEvent).", _name);
false
};

View File

@ -18,11 +18,8 @@ if (!isServer) exitWith {false};
// Walk through the local synced events and clean up anything thats already EOL
// @TODO: This should be iteration limited to prevent FPS lag
{
private _name = _x;
private _data = HASH_GET(GVAR(syncedEvents),_name);
_data params ["_eventTime", "_eventLog", "_globalEventTTL"];
[GVAR(syncedEvents), {
_value params ["_eventTime", "_eventLog", "_globalEventTTL"];
private _newEventLog = [];
@ -55,8 +52,8 @@ if (!isServer) exitWith {false};
false
} count _eventLog;
_data set [1, _newEventLog];
_value set [1, _newEventLog];
false
} count (GVAR(syncedEvents) select 0);
}] call CBA_fnc_hashEachPair;
// @TODO: Next, detect if we had a new request from a JIP player, and we need to continue syncing events

View File

@ -804,6 +804,7 @@
<French>Pas de place pour décharger</French>
<Czech>Nedostatek místa k vyložení</Czech>
<Portuguese>Sem espaço para descarregar</Portuguese>
<Russian>Нет места для выгрузки</Russian>
</Key>
</Package>
</Project>

View File

@ -19,7 +19,7 @@ TRACE_2("params",_wire,_killer);
private ["_distance", "_vehicle"];
if (isNull _killer) then {
_killer = _wire getVariable ["ace_concertina_wire_lastDamager", objNull];
_killer = _wire getVariable [QGVAR(lastDamager), objNull];
if (isNull _killer) then {
private _midPoint = ((_wire selectionPosition "start") vectorAdd (_wire selectionPosition "deploy")) vectorMultiply 0.5;
{

View File

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

View File

@ -0,0 +1,9 @@
class ACE_Settings {
class GVAR(enableCookoff) {
displayName = CSTRING(enable_name);
description = CSTRING(enable_tooltip);
value = 1;
typeName = "BOOL";
};
};

View File

@ -0,0 +1,54 @@
class CfgCloudlets {
class GVAR(CookOff) {
interval = 0.004;
circleRadius = 0;
circleVelocity[] = {2,2,2};
particleShape = "\A3\data_f\ParticleEffects\Universal\Universal";
particleFSNtieth = 16;
particleFSIndex = 0;
particleFSFrameCount = 32;
particleFSLoop = 0;
angle = 0;
angleVar = 0;
animationName = "";
particleType = "Billboard";
timerPeriod = 1;
lifeTime = 1;
moveVelocity[] = {0,4,0};
rotationVelocity = 1;
weight = 0.4;
volume = 0.45;
rubbing = 0;
size[] = {0.01,0.5,1,1,1.5,0.01,0.001};
color[] = {{1,1,1,-4},{1,1,1,-3},{1,1,1,-2},{1,1,1,-1},{1,1,1,0}};
animationSpeed[] = {1};
randomDirectionPeriod = 5;
randomDirectionIntensity = 1;
onTimerScript = "";
beforeDestroyScript = "";
position[] = {0,0,0};
lifeTimeVar = 0;
positionVar[] = {0,0,0};
positionVarConst[] = {0,0,0};
moveVelocityVar[] = {1,2,1};
moveVelocityVarConst[] = {0,0,0};
rotationVelocityVar = 3;
sizeVar = 0.1;
colorVar[] = {0,0,0,2};
randomDirectionPeriodVar = 1;
randomDirectionIntensityVar = 2;
colorCoef[] = {1,1,1,1};
sizeCoef = 1;
animationSpeedCoef = 1;
particleEffects = "";
postEffects = "";
onSurface = 1;
surfaceOffset = 0;
keepOnSurface = 0;
bounceOnSurface = 0.6;
bounceOnSurfaceVar = 0;
destroyOnWaterSurface = 0;
destroyOnWaterSurfaceOffset = 0;
};
};

View File

@ -0,0 +1,18 @@
class Extended_PreStart_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preStart));
};
};
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};

View File

@ -0,0 +1,9 @@
class CfgSFX {
class GVAR(CookOff) {
name = QGVAR(cookoff);
sounds[] = {QGVAR(cookoff)};
GVAR(cookoff)[] = {PATHTOF(sounds\cookoff.wss),6,1.8,400,1,0,0,0};
empty[] = {"",0,0,0,0,0,0,0};
};
};

View File

@ -0,0 +1,56 @@
class CfgVehicles {
class Sound;
class GVAR(Sound): Sound {
author = ECSTRING(common,ACETeam);
_generalMacro = QGVAR(Sound);
scope = 1;
sound = QGVAR(CookOff);
};
class ThingX;
class GVAR(Turret_MBT_01): ThingX {
author = ECSTRING(common,ACETeam);
_generalMacro = QGVAR(TurretDummy);
scope = 1;
model = "\A3\Structures_F\Wrecks\Wreck_Slammer_turret_F.p3d";
};
class GVAR(Turret_MBT_02): ThingX {
author = ECSTRING(common,ACETeam);
_generalMacro = QGVAR(TurretDummy);
scope = 1;
model = "\A3\Structures_F\Wrecks\Wreck_T72_turret_F.p3d";
};
class Tank;
class Tank_F: Tank {
GVAR(ammoLocation) = "HitTurret";
GVAR(cookoffSelections)[] = {"poklop_gunner","poklop_commander"};
};
class MBT_01_base_F: Tank_F {
GVAR(ammoLocation) = "HitHull";
};
class APC_Tracked_01_base_F: Tank_F {
GVAR(ammoLocation) = "HitHull";
};
class Car_F;
class Wheeled_APC_F: Car_F {
GVAR(ammoLocation) = "HitTurret";
GVAR(cookoffSelections)[] = {"poklop_gunner","poklop_commander"};
// big explosions for wheeled APCs (same as for tanks)
explosionEffect = "FuelExplosionBig";
};
class B_MBT_01_base_F;
class B_MBT_01_cannon_F: B_MBT_01_base_F {
GVAR(turret)[] = {QGVAR(Turret_MBT_01),{0,-1,0.5}};
};
class O_MBT_02_base_F;
class O_MBT_02_cannon_F: O_MBT_02_base_F {
GVAR(turret)[] = {QGVAR(Turret_MBT_02),{0,-1,0}};
};
};

View File

@ -0,0 +1,6 @@
PREP(handleDamage);
PREP(engineFire);
PREP(cookOff);
PREP(blowOffTurret);
PREP(secondaryExplosions);

View File

@ -0,0 +1,43 @@
#include "script_component.hpp"
[QGVAR(engineFire), FUNC(engineFire)] call CBA_fnc_addEventHandler;
[QGVAR(cookOff), FUNC(cookOff)] call CBA_fnc_addEventHandler;
// cookoff and burning engine
["Tank", "init", {
(_this select 0) addEventHandler ["HandleDamage", {
if (GVAR(enableCookoff)) then {
["tank", _this] call FUNC(handleDamage);
};
}];
}, nil, nil, true] call CBA_fnc_addClassEventHandler;
["Wheeled_APC_F", "init", {
(_this select 0) addEventHandler ["HandleDamage", {
if (GVAR(enableCookoff)) then {
["tank", _this] call FUNC(handleDamage);
};
}];
}, nil, nil, true] call CBA_fnc_addClassEventHandler;
["Car", "init", {
(_this select 0) addEventHandler ["HandleDamage", {
if (GVAR(enableCookoff)) then {
["car", _this] call FUNC(handleDamage);
};
}];
}, nil, ["Wheeled_APC_F"], true] call CBA_fnc_addClassEventHandler;
// secondary explosions
["AllVehicles", "killed", {
if (GVAR(enableCookoff)) then {
(_this select 0) call FUNC(secondaryExplosions);
};
}, nil, ["Man"]] call CBA_fnc_addClassEventHandler;
// blow off turret effect
["Tank", "killed", {
if (GVAR(enableCookoff)) then {
(_this select 0) call FUNC(blowOffTurret);
};
}] call CBA_fnc_addClassEventHandler;

View File

@ -0,0 +1,7 @@
#include "script_component.hpp"
ADDON = false;
#include "XEH_PREP.hpp"
ADDON = true;

View File

@ -0,0 +1,3 @@
#include "script_component.hpp"
#include "XEH_PREP.hpp"

22
addons/cookoff/config.cpp Normal file
View File

@ -0,0 +1,22 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {QGVAR(Sound),QGVAR(Turret_MBT_01),QGVAR(Turret_MBT_02)};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author = ECSTRING(common,ACETeam);
authors[] = {"commy2"};
url = ECSTRING(main,URL);
VERSION_CONFIG;
};
};
#include "ACE_Settings.hpp"
#include "CfgEventHandlers.hpp"
#include "CfgCloudlets.hpp"
#include "CfgSFX.hpp"
#include "CfgVehicles.hpp"

View File

@ -0,0 +1,33 @@
/*
* Author: commy2
* Blow off turret effect.
*
* Arguments:
* 0: Vehicle <Object>
*
* Return Value:
* None
*
* Example:
* (vehicle player) call ace_cookoff_fnc_blowOffTurret
*
* Public: No
*/
#include "script_component.hpp"
// delayed so the object is spawned after the model changes to a wreck
// the sudden change in the model would cause nearby physx objects to get stuck
[{
params ["_vehicle"];
private _config = _vehicle call CBA_fnc_getObjectConfig;
getArray (_config >> QGVAR(turret)) params [["_model", "", [""]], ["_offset", [0,0,0], [[]], 3]];
if (_model isEqualTo "") exitWith {};
private _position = _vehicle modelToWorld _offset;
private _turret = createVehicle [_model, _position, [], 0, "CAN_COLLIDE"];
_turret setVectorUp [random 1, random 1, 1];
_turret setVelocity [random 7, random 7, 8 + random 5];
}, _this, 1] call CBA_fnc_waitAndExecute;

View File

@ -0,0 +1,126 @@
/*
* Author: KoffeinFlummi, commy2
* Start a cook-off in the given vehicle.
*
* Arguments:
* 0: Vehicle <Object>
*
* Return Value:
* None
*
* Example:
* (vehicle player) call ace_cookoff_fnc_cookOff
*
* Public: No
*/
#include "script_component.hpp"
params ["_vehicle"];
if (_vehicle getVariable [QGVAR(isCookingOff), false]) exitWith {};
_vehicle setVariable [QGVAR(isCookingOff), true];
[QGVAR(cookOff), _vehicle] call CBA_fnc_remoteEvent;
[{
params ["_vehicle"];
private _config = _vehicle call CBA_fnc_getObjectConfig;
private _positions = getArray (_config >> QGVAR(cookoffSelections)) select {!((_vehicle selectionPosition _x) isEqualTo [0,0,0])};
if (_positions isEqualTo []) then {
ACE_LOGWARNING_1("no valid selection for cookoff found. %1", typeOf _vehicle);
_positions pushBack "#noselection";
};
private _turretConfig = [_vehicle, [0]] call CBA_fnc_getTurret;
private _positionBarrelEnd = getText (_turretConfig >> "gunBeg");
// smoke out of cannon and hatches
private _smokeBarrel = "#particlesource" createVehicleLocal [0,0,0];
_smokeBarrel setParticleClass "MediumDestructionSmoke";
_smokeBarrel attachTo [_vehicle, [0,0,0], _positionBarrelEnd];
private _effects = [_smokeBarrel];
{
private _position = [0,-2,0];
if !(_x isEqualTo "#noselection") then {
_position = _vehicle selectionPosition _x;
};
private _smoke = "#particlesource" createVehicleLocal [0,0,0];
_smoke setParticleClass "ObjectDestructionSmoke1_2Smallx";
_smoke attachTo [_vehicle, _position];
_effects pushBack _smoke;
} forEach _positions;
[{
params ["_vehicle", "_effects", "_positions"];
// this shit is busy being on fire, can't go driving around all over the place
if (local _vehicle) then {
_vehicle setFuel 0;
};
private _light = "#lightpoint" createVehicleLocal [0,0,0];
_light setLightBrightness 0.7;
_light setLightAmbient [1,0.4,0.15];
_light setLightColor [1,0.4,0.15];
_light lightAttachObject [_vehicle, [0,0,4]];
_effects pushBack _light;
// cookoffs
{
private _position = [0,-2,0];
if !(_x isEqualTo "#noselection") then {
_position = _vehicle selectionPosition _x;
};
private _fire = "#particlesource" createVehicleLocal [0,0,0];
_fire setParticleClass QGVAR(CookOff);
_fire attachTo [_vehicle, _position];
_effects pushBack _fire;
} forEach _positions;
if (isServer) then {
private _sound = createSoundSource [QGVAR(Sound), position _vehicle, [], 0];
_effects pushBack _sound;
};
// indicator for the crew - yo, your shit's on fire
private _fnc_FlameEffect = {
params ["_vehicle", "_fnc_FlameEffect", "_counter"];
if (_vehicle == cameraOn) then {
[] call BIS_fnc_flamesEffect;
};
DEC(_counter);
if (_counter > 0) then {
[_fnc_FlameEffect, [_vehicle, _fnc_FlameEffect, _counter], 0.4] call CBA_fnc_waitAndExecute
};
};
[_vehicle, _fnc_FlameEffect, 12] call _fnc_FlameEffect; // recursive function
[{
params ["_vehicle", "_effects"];
{
deleteVehicle _x;
} forEach _effects;
if (local _vehicle) then {
_vehicle setDamage 1;
};
}, [_vehicle, _effects], 4 + random 1] call CBA_fnc_waitAndExecute;
}, [_vehicle, _effects, _positions], 3 + random 2] call CBA_fnc_waitAndExecute;
}, _vehicle, 0.5 + random 0.3] call CBA_fnc_waitAndExecute;

View File

@ -0,0 +1,43 @@
/*
* Author: KoffeinFlummi, commy2
* Start fire in engine block of a car.
*
* Arguments:
* 0: Vehicle <Object>
*
* Return Value:
* None
*
* Example:
* (vehicle player) call ace_cookoff_fnc_engineFire
*
* Public: No
*/
#include "script_component.hpp"
params ["_vehicle"];
if (_vehicle getVariable [QGVAR(isEngineSmoking), false]) exitWith {};
_vehicle setVariable [QGVAR(isEngineSmoking), true];
[QGVAR(engineFire), _vehicle] call CBA_fnc_remoteEvent;
private _position = [
0,
(boundingBoxReal _vehicle select 1 select 1) - 4,
(boundingBoxReal _vehicle select 0 select 2) + 2
];
private _smoke = "#particlesource" createVehicleLocal [0,0,0];
_smoke setParticleClass "ObjectDestructionSmoke1_2Smallx";
_smoke attachTo [_vehicle, _position];
[{
(_this select 0) params ["_vehicle", "_smoke", "_time"];
if (!alive _vehicle || {_vehicle getHitPointDamage "HitEngine" < 0.9} || {CBA_missionTime > _time}) then {
deleteVehicle _smoke;
_vehicle setVariable [QGVAR(isEngineSmoking), false];
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
}, 5, [_vehicle, _smoke, CBA_missionTime + 240]] call CBA_fnc_addPerFrameHandler;

View File

@ -0,0 +1,80 @@
/*
* Author: KoffeinFlummi, commy2
* Handles all incoming damage for tanks (including wheeled APCs).
*
* Arguments:
* HandleDamage EH
*
* Return Value:
* Damage to be inflicted.
*
* Example:
* _this call ace_cookoff_fnc_handleDamage
*
* Public: No
*/
#include "script_component.hpp"
params ["_simulationType", "_thisHandleDamage"];
_thisHandleDamage params ["_vehicle", "", "_damage", "", "_ammo", "_hitIndex"];
// it's already dead, who cares?
if (damage _vehicle >= 1) exitWith {};
// get hitpoint name
private _hitpoint = "#structural";
if (_hitIndex != -1) then {
_hitpoint = toLower ((getAllHitPointsDamage _vehicle param [0, []]) select _hitIndex);
};
// get change in damage
private "_oldDamage";
if (_hitpoint isEqualTo "#structural") then {
_oldDamage = damage _vehicle;
} else {
_oldDamage = _vehicle getHitIndex _hitIndex;
};
private _newDamage = _damage - _oldDamage;
// handle different types of vehicles
// note: exitWith only works here, because this is not the main scope of handleDamage
// you cannot use the return value together with exitWith in the main scope, it's a bug
// also, we add this event handler with the addEventHandler SQF command,
// because the config version ignores the return value completely
if (_simulationType == "car") exitWith {
// prevent destruction, let cook-off handle it if necessary
if (_hitpoint in ["hithull", "hitfuel", "#structural"] && {!IS_EXPLOSIVE_AMMO(_ammo)}) then {
_damage min 0.89
} else {
if (_hitpoint isEqualTo "hitengine" && {_damage > 0.9}) then {
_vehicle call FUNC(engineFire);
};
_damage
};
};
if (_simulationType == "tank") exitWith {
// determine ammo storage location
private _ammoLocationHitpoint = getText (_vehicle call CBA_fnc_getObjectConfig >> QGVAR(ammoLocation));
// ammo was hit, high chance for cook-off
if (_hitpoint == _ammoLocationHitpoint) then {
if (_damage > 0.5 && {random 1 < 0.7}) then {
_vehicle call FUNC(cookOff);
};
} else {
if (_hitpoint in ["hitbody", "hitturret", "#structural"] && {_newDamage > 0.6 + random 0.3}) then {
_vehicle call FUNC(cookOff);
};
};
// prevent destruction, let cook-off handle it if necessary
if (_hitpoint in ["hithull", "hitfuel", "#structural"]) then {
_damage min 0.89
} else {
_damage
};
};

View File

@ -0,0 +1,64 @@
/*
* Author: Maddmatt, commy2
* Generate an amount of secondary explosions
*
* Arguments:
* 0: Vehicle <OBJECT>
* 1: Amount <NUMBER>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
#define SECONDARIES_DELAY (1 + random 45)
params ["_vehicle", "_amount"];
if (isNil "_amount") then {
// calculate amount of secondary explosions if not specified
_amount = 0;
{
_x params ["_magazine", "_count"];
private _ammo = getText (_magazine call CBA_fnc_getItemConfig >> "ammo");
if (IS_EXPLOSIVE_AMMO(_ammo)) then {
if (_ammo isKindOf "ShellBase") then {
ADD(_amount,_count);
} else {
ADD(_amount,_count/50);
};
};
} forEach magazinesAmmo _vehicle;
};
if (_amount <= 0) exitWith {};
private _fnc_secondaryExplosion = {
params ["_vehicle", "_amount", "_fnc_secondaryExplosion"];
private _position = _vehicle modelToWorld (_vehicle selectionPosition "destructionEffect2");
// these CfgAmmo objects are always global
"SmallSecondary" createVehicle _position;
DEC(_amount);
if (!isNull _vehicle && {_amount > 0}) then {
[_fnc_secondaryExplosion, [_vehicle, _amount, _fnc_secondaryExplosion], SECONDARIES_DELAY] call CBA_fnc_waitAndExecute;
};
};
[_fnc_secondaryExplosion, [_vehicle, _amount, _fnc_secondaryExplosion], SECONDARIES_DELAY] call CBA_fnc_waitAndExecute;
nil
/*SencondaryExplosion
SecondaryExp
SecondarySmoke
GrenadeExploLight
*/

View File

@ -0,0 +1 @@
#include "\z\ace\addons\cookoff\script_component.hpp"

View File

@ -0,0 +1,20 @@
#define COMPONENT cookoff
#define COMPONENT_BEAUTIFIED Cook off
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_COOKOFF
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_SETTINGS_COOKOFF
#define DEBUG_SETTINGS DEBUG_SETTINGS_COOKOFF
#endif
#include "\z\ace\addons\main\script_macros.hpp"
#define IS_EXPLOSIVE_AMMO(ammo) (getNumber (ammo call CBA_fnc_getObjectConfig >> "explosive") > 0.5)

Binary file not shown.

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project name="ACE">
<Package name="CookOff">
<Key ID="STR_ACE_CookOff_enable_name">
<English>Enable cook off</English>
<German>Cook-off ermöglichen</German>
</Key>
<Key ID="STR_ACE_CookOff_enable_tooltip">
<English>Enables cook off and related vehicle destruction effects.</English>
<German>Ermöglicht Cook-off und zugehörige Fahrzeug-Zerstörungseffekte.</German>
</Key>
</Package>
</Project>

View File

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

View File

@ -4,8 +4,8 @@ class RscStructuredText;
class RscTitles {
class GVAR(singleTag) {
idd = -1;
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(tag)),_this select 0)]);
onUnload = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(tag)),nil)]);
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(tag),_this select 0)]);
onUnload = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(tag),nil)]);
movingEnable = false;
duration = 5;
fadeIn = 0.2;
@ -49,8 +49,8 @@ class RscTitles {
};
class GVAR(doubleTag): GVAR(singleTag) {
idd = -1;
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(tag)),_this select 0)]);
onUnload = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(tag)),nil)]);
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(tag),_this select 0)]);
onUnload = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(tag),nil)]);
class controls: controls {
class background: background {

Some files were not shown because too many files have changed in this diff Show More