Merge branch 'master' into fixFlashlightPrivates

Conflicts:
	addons/map/functions/fnc_determineMapLight.sqf
This commit is contained in:
PabstMirror 2015-11-10 21:21:06 -06:00
commit e72c1d874a
131 changed files with 784 additions and 410 deletions

View File

@ -44,6 +44,7 @@ BlackPixxel <blackpixxel96@gmail.com>
BlackQwar BlackQwar
Brakoviejo Brakoviejo
Brisse <brisse@outlook.com> Brisse <brisse@outlook.com>
Brostrom.A | Evul <andreas.brostrom.ce@gmail.com>
BullHorn <bullhorn7@gmail.com> BullHorn <bullhorn7@gmail.com>
Clon1998 <ps.patti1998@gmail.com> Clon1998 <ps.patti1998@gmail.com>
Codingboy Codingboy

View File

@ -14,7 +14,7 @@ Indicate if the issue appears on stable or development version. In case it is th
## Reporting the issue ## Reporting the issue
Head over to the <a href="{{ site.githubUrl }}/issues" target="_blank">ACE3 GitHub issue tracker</a> and press the <a href="{{ site.githubUrl }}/issues/new" target="_blank">"New issue"</a> button in the top right corner. Add a descriptive title and copy the following issue template in to the text area: Head over to the [ACE3 GitHub issue tracker](https://github.com/acemod/ACE3/issues) and press the [New issue](https://github.com/acemod/ACE3/issues/new) button in the top right corner. Add a descriptive title and copy the following issue template in to the text area:
``` ```
ACE3 Version: 3.x.x ACE3 Version: 3.x.x
@ -43,8 +43,8 @@ ACE3 Version: 3.x.x
A video of the issue might be helpful in resolving it faster. A video of the issue might be helpful in resolving it faster.
GitHub uses [Markdown](http://daringfireball.net/projects/markdown/syntax) to style the output. If you want to know more about it (e.g. how to [turn text bold](https://help.github.com/articles/markdown-basics/#styling-text), how to denote [code blocks](https://help.github.com/articles/markdown-basics/#inline-formats) or [inline code](https://help.github.com/articles/markdown-basics/#multiple-lines)) have a look at the [GitHub Markdown Documentation](https://help.github.com/articles/github-flavored-markdown).
Github uses <a href="http://daringfireball.net/projects/markdown/syntax" target="_blank">"Markdown"</a> to style the output. If you want to know more about it (e.g. how to <a href="https://help.github.com/articles/markdown-basics/#styling-text" target="_blank">turn text bold</a>, how to denote <a href="https://help.github.com/articles/markdown-basics/#inline-formats" target="_blank">code blocks</a> or <a href="https://help.github.com/articles/markdown-basics/#multiple-lines" target="_blank">inline code</a>) have a look at the <a href="https://help.github.com/articles/github-flavored-markdown/" target="_blank">GitHub markdown documentation</a>.
# Feature Requests # Feature Requests
@ -54,11 +54,11 @@ ACE2, AGM and CSE had a lot of features implemented or planned. All of them are
Please refrain from making requests for any planned or existing features from either ACE2, AGM or CSE. Most of them are already being or have been considered for porting or a rewrite. Please refrain from making requests for any planned or existing features from either ACE2, AGM or CSE. Most of them are already being or have been considered for porting or a rewrite.
## Requesting a feature ## Requesting a feature
In order to avoid duplicates and keep the issue tracker organized, we have created a common issue for <a href="{{ site.githubUrl }}/issues/414/" target="_blank">ACE 3 Feature requests</a>. Any and all relevant requests should be submitted there, where they will also get discussed and evaluated. Before adding a new one, make sure to check the previous entries from the thread and do a quick search for similar suggestions; please don't reiterate requests for features that had already been accepted for inclusion, or those which were disregarded earlier. In order to avoid duplicates and keep the issue tracker organized, we have created a common issue for [ACE3 Feature requests](https://github.com/acemod/ACE3/issues/414). Any and all relevant requests should be submitted there, where they will also get discussed and evaluated. Before adding a new one, make sure to check the previous entries from the thread and do a quick search for similar suggestions; please don't reiterate requests for features that had already been accepted for inclusion, or those which were disregarded earlier.
Following their approval, feature requests may be moved by moderators to a separate issue for further discussion. Following their approval, feature requests may be moved by moderators to a separate issue for further discussion.
# Regarding Pull Requests (PRs) # Regarding Pull Requests (PRs)
- You want to help but don't know where to start ? Check the wiki entry for [setting up the development environment](http://ace3mod.com/wiki/development/setting-up-the-development-environment.html) - You want to help but don't know where to start? Check the wiki entry for [setting up the development environment](http://ace3mod.com/wiki/development/setting-up-the-development-environment.html)
- [Make sure to respect the file structure](http://ace3mod.com/wiki/development/modularity-and-pbo-structure.html) - [Make sure to respect the file structure](http://ace3mod.com/wiki/development/modularity-and-pbo-structure.html)
- [Make sure to respect the coding guidelines](http://ace3mod.com/wiki/development/coding-guidelines.html) - [Make sure to respect the coding guidelines](http://ace3mod.com/wiki/development/coding-guidelines.html)

View File

@ -18,7 +18,8 @@ private ["_muzzleVelocityShiftTableUpperLimit", "_temperatureIndexFunction",
"_temperatureIndexA", "_temperatureIndexB", "_interpolationRatio"]; "_temperatureIndexA", "_temperatureIndexB", "_interpolationRatio"];
params["_muzzleVelocityShiftTable", "_temperature"]; params["_muzzleVelocityShiftTable", "_temperature"];
// Check if muzzleVelocityShiftTable is Larger Than 11 Entrys // Check if muzzleVelocityShiftTable is Less Than 11 Entrys
if ((count _muzzleVelocityShiftTable) < 11) exitWith {0};
_muzzleVelocityShiftTableUpperLimit = _muzzleVelocityShiftTable select 10; _muzzleVelocityShiftTableUpperLimit = _muzzleVelocityShiftTable select 10;
if (isNil "_muzzleVelocityShiftTableUpperLimit") exitWith { 0 }; if (isNil "_muzzleVelocityShiftTableUpperLimit") exitWith { 0 };

View File

@ -24,12 +24,12 @@ if (!hasInterface) exitWith {};
if (!GVAR(enabled)) exitWith {}; if (!GVAR(enabled)) exitWith {};
// Parameterization // Parameterization
private ["_abort", "_AmmoCacheEntry", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_bulletMass", "_bulletLength", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_barrelTwist", "_stabilityFactor"]; private ["_abort", "_AmmoCacheEntry", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_bulletMass", "_bulletLength", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletLength", "_barrelTwist", "_stabilityFactor", "_aceTimeSecond", "_barrelVelocityShift", "_ammoTemperatureVelocityShift"];
params ["_unit", "_weapon", "", "_mode", "_ammo", "_magazine", "_bullet"]; params ["_unit", "_weapon", "", "_mode", "_ammo", "_magazine", "_bullet"];
_abort = false; _abort = false;
if (!(_ammo isKindOf "BulletBase")) exitWith {}; if (!(_ammo isKindOf "BulletBase")) exitWith {};
if (!alive _bullet) exitWith {}; if (!alive _bullet) exitWith {};
if (!([_unit] call EFUNC(common,isPlayer))) exitWith {}; if (!([_unit] call EFUNC(common,isPlayer))) exitWith {};
@ -75,22 +75,22 @@ _WeaponCacheEntry params ["_barrelTwist", "_twistDirection", "_barrelLength"];
_bulletVelocity = velocity _bullet; _bulletVelocity = velocity _bullet;
_muzzleVelocity = vectorMagnitude _bulletVelocity; _muzzleVelocity = vectorMagnitude _bulletVelocity;
_barrelVelocityShift = 0;
if (GVAR(barrelLengthInfluenceEnabled)) then { if (GVAR(barrelLengthInfluenceEnabled)) then {
_barrelVelocityShift = uiNamespace getVariable [format [QGVAR(%1_muzzleVelocityShift),_weapon],nil];
if (isNil "_barrelVelocityShift") then {
_barrelVelocityShift = [_barrelLength, _muzzleVelocityTable, _barrelLengthTable, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift); _barrelVelocityShift = [_barrelLength, _muzzleVelocityTable, _barrelLengthTable, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift);
uiNamespace setVariable [format [QGVAR(%1_muzzleVelocityShift),_weapon],_muzzleVelocityShift];
};
}; };
_ammoTemperatureVelocityShift = 0;
if (GVAR(ammoTemperatureEnabled)) then { if (GVAR(ammoTemperatureEnabled)) then {
_temperature = ((getPosASL _unit) select 2) call EFUNC(weather,calculateTemperatureAtHeight); _temperature = ((getPosASL _unit) select 2) call EFUNC(weather,calculateTemperatureAtHeight);
_temperatureVelocityShift = ([_ammoTempMuzzleVelocityShifts, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift)); _ammoTemperatureVelocityShift = ([_ammoTempMuzzleVelocityShifts, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift));
}; };
if (GVAR(ammoTemperatureEnabled) || GVAR(barrelLengthInfluenceEnabled)) then { if (GVAR(ammoTemperatureEnabled) || GVAR(barrelLengthInfluenceEnabled)) then {
_muzzleVelocityShift = _barrelVelocityShift + _ammoTemperatureVelocityShift;
TRACE_4("shift",_muzzleVelocity,_muzzleVelocityShift, _barrelVelocityShift, _ammoTemperatureVelocityShift);
if (_muzzleVelocityShift != 0) then { if (_muzzleVelocityShift != 0) then {
_muzzleVelocity = _muzzleVelocity + (_barrelVelocityShift + _ammoTemperatureVelocityShift); _muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift;
_bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift)); _bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift));
_bullet setVelocity _bulletVelocity; _bullet setVelocity _bulletVelocity;
}; };

View File

@ -153,16 +153,32 @@ class CfgVehicles {
class GVAR(ModuleSurrender): Module_F { class GVAR(ModuleSurrender): Module_F {
author = ECSTRING(common,ACETeam); author = ECSTRING(common,ACETeam);
category = "ACE"; category = "ACE";
displayName = CSTRING(ModuleSurrender_DisplayName); //Make Unit Surrender displayName = CSTRING(ModuleSurrender_DisplayName);
function = QFUNC(moduleSurrender); function = QFUNC(moduleSurrender);
scope = 2; //show in editor scope = 2; //show in editor
isGlobal = 1; //run global isGlobal = 0; //run on server
isTriggerActivated = 1; //Wait for triggers isTriggerActivated = 1; //Wait for triggers
icon = QUOTE(PATHTOF(UI\Icon_Module_Make_Unit_Surrender_ca.paa)); icon = QUOTE(PATHTOF(UI\Icon_Module_Make_Unit_Surrender_ca.paa));
functionPriority = 0; functionPriority = 0;
class Arguments {}; class Arguments {};
class ModuleDescription: ModuleDescription { class ModuleDescription: ModuleDescription {
description = CSTRING(ModuleSurrender_Description); //Sync a unit to make them surrender.<br/>Source: ace_captives description = CSTRING(ModuleSurrender_Description);
sync[] = {"AnyAI"};
};
};
class GVAR(ModuleHandcuffed): Module_F {
author = ECSTRING(common,ACETeam);
category = "ACE";
displayName = CSTRING(ModuleHandcuffed_DisplayName);
function = QFUNC(moduleHandcuffed);
scope = 2; //show in editor
isGlobal = 0; //run on server
isTriggerActivated = 1; //Wait for triggers
icon = QUOTE(PATHTOF(UI\Icon_Module_Make_Unit_Handcuffed_ca.paa));
functionPriority = 0;
class Arguments {};
class ModuleDescription: ModuleDescription {
description = CSTRING(ModuleHandcuffed_Description);
sync[] = {"AnyAI"}; sync[] = {"AnyAI"};
}; };
}; };

View File

@ -24,6 +24,7 @@ PREP(handlePlayerChanged);
PREP(handleRespawn); PREP(handleRespawn);
PREP(handleUnitInitPost); PREP(handleUnitInitPost);
PREP(handleZeusDisplayChanged); PREP(handleZeusDisplayChanged);
PREP(moduleHandcuffed);
PREP(moduleSettings); PREP(moduleSettings);
PREP(moduleSurrender); PREP(moduleSurrender);
PREP(setHandcuffed); PREP(setHandcuffed);

View File

@ -2,7 +2,7 @@
class CfgPatches { class CfgPatches {
class ADDON { class ADDON {
units[] = {QGVAR(ModuleSettings), QGVAR(ModuleSurrender)}; units[] = {QGVAR(ModuleSettings), QGVAR(ModuleSurrender), QGVAR(ModuleHandcuffed)};
weapons[] = {"ACE_CableTie"}; weapons[] = {"ACE_CableTie"};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ACE_Interaction"}; requiredAddons[] = {"ACE_Interaction"};

View File

@ -20,11 +20,12 @@ params ["_unit", "_target"];
//Check sides, Player has cableTie, target is alive and not already handcuffed //Check sides, Player has cableTie, target is alive and not already handcuffed
(GVAR(allowHandcuffOwnSide) || {(side _unit) != (side _target)}) && (GVAR(allowHandcuffOwnSide) || {(side _unit) != (side _target)}) &&
("ACE_CableTie" in (items _unit)) && {"ACE_CableTie" in (items _unit)} &&
{alive _target} && {alive _target} &&
{!(_target getVariable [QGVAR(isHandcuffed), false])} && {!(_target getVariable [QGVAR(isHandcuffed), false])} &&
{ {
(_target getVariable ["ACE_isUnconscious", false]) || //isUnconscious (_target getVariable ["ACE_isUnconscious", false]) || //isUnconscious
{!([_target] call EFUNC(common,isPlayer))} || //is an AI (not a player)
{GVAR(requireSurrender) == 0} || //or don't require surrendering {GVAR(requireSurrender) == 0} || //or don't require surrendering
{_target getVariable [QGVAR(isSurrendering), false]} || //or is surrendering {_target getVariable [QGVAR(isSurrendering), false]} || //or is surrendering
{(GVAR(requireSurrender) == 2) && {(currentWeapon _target) == ""}} //or "SurrenderOrNoWeapon" and no weapon {(GVAR(requireSurrender) == 2) && {(currentWeapon _target) == ""}} //or "SurrenderOrNoWeapon" and no weapon

View File

@ -0,0 +1,35 @@
/*
* Author: PabstMirror
* Module Function to make a unit handcuffed (can be called from editor)
*
* Arguments:
* 0: The Module Logic <OBJECT>
* 1: synced objects <ARRAY>
* 2: Activated <BOOL>
*
* Return Value:
* Nothing
*
* Example:
* Called from module
*
* Public: No
*/
#include "script_component.hpp"
params ["_logic", "_units", "_activated"];
TRACE_3("params",_logic,_units,_activated);
if (!_activated) exitWith {};
if (!isServer) exitWith {};
//Modules run before postInit can instal the event handler, so we need to wait a little bit
[{
params ["_units"];
{
["SetHandcuffed", [_x], [_x, true]] call EFUNC(common,targetEvent);
} forEach _units;
}, [_units], 0.05] call EFUNC(common,waitAndExecute);
deleteVehicle _logic;

View File

@ -1,9 +1,9 @@
/* /*
* Author: PabstMirror * Author: PabstMirror
* Module Function to make a unit surrender (can be called from editor, or placed with zeus) * Module Function to make a unit surrender (can be called from editor)
* *
* Arguments: * Arguments:
* 0: The Module Logic Object <OBJECT> * 0: The Module Logic <OBJECT>
* 1: synced objects <ARRAY> * 1: synced objects <ARRAY>
* 2: Activated <BOOL> * 2: Activated <BOOL>
* *
@ -17,20 +17,19 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_bisMouseOver", "_mouseOverObject"];
params ["_logic", "_units", "_activated"]; params ["_logic", "_units", "_activated"];
if (!_activated) exitWith {}; TRACE_3("params",_logic,_units,_activated);
if (local _logic) then { if (!_activated) exitWith {};
//Modules run before postInit can instal the event handler, so we need to wait a little bit if (!isServer) exitWith {};
[{
//Modules run before postInit can instal the event handler, so we need to wait a little bit
[{
params ["_units"]; params ["_units"];
{ {
["SetSurrendered", [_x], [_x, true]] call EFUNC(common,targetEvent); ["SetSurrendered", [_x], [_x, true]] call EFUNC(common,targetEvent);
} forEach _units; } forEach _units;
}, [_units], 0.05]call EFUNC(common,waitAndExecute); }, [_units], 0.05] call EFUNC(common,waitAndExecute);
deleteVehicle _logic; deleteVehicle _logic;
};

View File

@ -56,8 +56,11 @@ if (_state) then {
//Adds an animation changed eh //Adds an animation changed eh
//If we get a change in animation then redo the animation (handles people vaulting to break the animation chain) //If we get a change in animation then redo the animation (handles people vaulting to break the animation chain)
private "_animChangedEHID"; local _animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1];
if (_animChangedEHID != -1) then {
TRACE_1("removing animChanged EH",_animChangedEHID);
_unit removeEventHandler ["AnimChanged", _animChangedEHID];
};
_animChangedEHID = _unit addEventHandler ["AnimChanged", { _animChangedEHID = _unit addEventHandler ["AnimChanged", {
params ["_unit", "_newAnimation"]; params ["_unit", "_newAnimation"];
TRACE_2("AnimChanged",_unit,_newAnimation); TRACE_2("AnimChanged",_unit,_newAnimation);
@ -67,7 +70,6 @@ if (_state) then {
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
}; };
} else { } else {
_turretPath = []; _turretPath = [];
{ {
_x params ["_xUnit", "", "", "_xTurretPath"]; _x params ["_xUnit", "", "", "_xTurretPath"];
@ -90,8 +92,7 @@ if (_state) then {
[_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus); [_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus);
//remove AnimChanged EH //remove AnimChanged EH
private "_animChangedEHID"; local _animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1];
_animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1];
TRACE_1("removing animChanged EH",_animChangedEHID); TRACE_1("removing animChanged EH",_animChangedEHID);
_unit removeEventHandler ["AnimChanged", _animChangedEHID]; _unit removeEventHandler ["AnimChanged", _animChangedEHID];
_unit setVariable [QGVAR(handcuffAnimEHID), -1]; _unit setVariable [QGVAR(handcuffAnimEHID), -1];

View File

@ -48,7 +48,11 @@ if (_state) then {
if (_unit getVariable [QGVAR(isSurrendering), false] && {(vehicle _unit) == _unit}) then { if (_unit getVariable [QGVAR(isSurrendering), false] && {(vehicle _unit) == _unit}) then {
//Adds an animation changed eh //Adds an animation changed eh
//If we get a change in animation then redo the animation (handles people vaulting to break the animation chain) //If we get a change in animation then redo the animation (handles people vaulting to break the animation chain)
private "_animChangedEHID"; local _animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1];
if (_animChangedEHID != -1) then {
TRACE_1("removing animChanged EH",_animChangedEHID);
_unit removeEventHandler ["AnimChanged", _animChangedEHID];
};
_animChangedEHID = _unit addEventHandler ["AnimChanged", { _animChangedEHID = _unit addEventHandler ["AnimChanged", {
params ["_unit", "_newAnimation"]; params ["_unit", "_newAnimation"];
if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then {
@ -64,8 +68,7 @@ if (_state) then {
[_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus); [_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus);
//remove AnimChanged EH //remove AnimChanged EH
private "_animChangedEHID"; local _animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1];
_animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1];
_unit removeEventHandler ["AnimChanged", _animChangedEHID]; _unit removeEventHandler ["AnimChanged", _animChangedEHID];
_unit setVariable [QGVAR(surrenderAnimEHID), -1]; _unit setVariable [QGVAR(surrenderAnimEHID), -1];

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project name="ACE"> <Project name="ACE">
<Package name="Captives"> <Package name="Captives">
<Key ID="STR_ACE_Captives_SetCaptive"> <Key ID="STR_ACE_Captives_SetCaptive">
@ -179,6 +179,14 @@
<Hungarian>Egység szinkronizálása, hogy kapituláljon.&lt;br /&gt;Forrás: ace_captives</Hungarian> <Hungarian>Egység szinkronizálása, hogy kapituláljon.&lt;br /&gt;Forrás: ace_captives</Hungarian>
<Russian>Синхронизируйте с юнитами, чтобы сделать их пленными.&lt;br /&gt;Источник: ace_captives</Russian> <Russian>Синхронизируйте с юнитами, чтобы сделать их пленными.&lt;br /&gt;Источник: ace_captives</Russian>
</Key> </Key>
<Key ID="STR_ACE_Captives_ModuleHandcuffed_DisplayName">
<English>Make Unit Handcuffed</English>
<Portuguese>Fazer unidade algemada</Portuguese>
</Key>
<Key ID="STR_ACE_Captives_ModuleHandcuffed_Description">
<English>Sync a unit to make them handcuffed.&lt;br /&gt;Source: ace_captives</English>
<Portuguese>Sincronizar uma unidade para deixá-la algemada.&lt;br/&gt;Source: ace_captives</Portuguese>
</Key>
<Key ID="STR_ACE_Captives_ModuleSettings_DisplayName"> <Key ID="STR_ACE_Captives_ModuleSettings_DisplayName">
<English>Captives Settings</English> <English>Captives Settings</English>
<Polish>Ustawienia więźniów</Polish> <Polish>Ustawienia więźniów</Polish>

View File

@ -171,6 +171,13 @@ class CfgVehicles {
GVAR(hasCargo) = 0; GVAR(hasCargo) = 0;
}; };
// autonomus
class Helicopter_Base_F;
class UAV_01_base_F: Helicopter_Base_F {
GVAR(space) = 0;
GVAR(hasCargo) = 0;
};
// boats // boats
class Ship; class Ship;
class Ship_F: Ship { class Ship_F: Ship {

View File

@ -1,5 +1,45 @@
#include "script_component.hpp" #include "script_component.hpp"
["LoadCargo", {_this call FUNC(loadItem)}] call EFUNC(common,addEventHandler);
["UnloadCargo", {_this call FUNC(unloadItem)}] call EFUNC(common,addEventHandler);
["AddCargoByClass", {_this call FUNC(addCargoItem)}] call EFUNC(common,addEventHandler); ["AddCargoByClass", {_this call FUNC(addCargoItem)}] call EFUNC(common,addEventHandler);
["LoadCargo", {
(_this select 0) params ["_item","_vehicle"];
private ["_loaded", "_hint", "_itemName", "_vehicleName"];
_loaded = [_item, _vehicle] call FUNC(loadItem);
// Show hint as feedback
_hint = [LSTRING(LoadingFailed), LSTRING(LoadedItem)] select _loaded;
_itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName");
_vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
["displayTextStructured", [[_hint, _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent);
if (_loaded) then {
// Invoke listenable event
["cargoLoaded", [_item, _vehicle]] call EFUNC(common,globalEvent);
};
}] call EFUNC(common,addEventHandler);
["UnloadCargo", {
(_this select 0) params ["_item","_vehicle"];
private ["_unloaded", "_itemClass", "_hint", "_itemName", "_vehicleName"];
_unloaded = [_item, _vehicle] call FUNC(unloadItem);
_itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item};
// Show hint as feedback
_hint = [LSTRING(UnloadingFailed), LSTRING(UnloadedItem)] select _unloaded;
_itemName = getText (configFile >> "CfgVehicles" >> _itemClass >> "displayName");
_vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
["displayTextStructured", [[_hint, _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent);
if (_unloaded) then {
// Invoke listenable event
["cargoUnloaded", [_item, _vehicle]] call EFUNC(common,globalEvent);
};
// TOOO maybe drag/carry the unloaded item?
}] call EFUNC(common,addEventHandler);

View File

@ -22,20 +22,9 @@ private ["_position", "_item", "_i"];
params ["_itemClass", "_vehicle", ["_amount", 1], ["_showHint", false, [false]] ]; params ["_itemClass", "_vehicle", ["_amount", 1], ["_showHint", false, [false]] ];
TRACE_3("params",_itemClass,_vehicle,_amount); TRACE_3("params",_itemClass,_vehicle,_amount);
_position = getPos _vehicle;
_position set [1, (_position select 1) + 1];
_position set [2, (_position select 2) + 7.5];
for "_i" from 1 to _amount do { for "_i" from 1 to _amount do {
_item = createVehicle [_itemClass, _position, [], 0, "CAN_COLLIDE"]; [_item, _vehicle] call FUNC(loadItem);
// Load item or delete it if no space left
if !([_item, _vehicle, _showHint] call FUNC(loadItem)) exitWith {
TRACE_1("no room to load item - deleting",_item);
deleteVehicle _item;
};
TRACE_1("Item Loaded",_item);
// Invoke listenable event
["cargoAddedByClass", [_itemClass, _vehicle, _amount]] call EFUNC(common,globalEvent);
}; };
// Invoke listenable event
["cargoAddedByClass", [_itemClass, _vehicle, _amount]] call EFUNC(common,globalEvent);

View File

@ -3,7 +3,7 @@
* Check if item can be loaded into other Object. * Check if item can be loaded into other Object.
* *
* Arguments: * Arguments:
* 0: Item Object <OBJECT> * 0: Item <OBJECT or STRING>
* 1: Holder Object (Vehicle) <OBJECT> * 1: Holder Object (Vehicle) <OBJECT>
* *
* Return value: * Return value:
@ -16,14 +16,24 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_item", "_vehicle"]; params [["_item", "", [objNull,""]], "_vehicle"];
if (speed _vehicle > 1 || (((getPos _vehicle) select 2) > 3)) exitWith {false}; if (speed _vehicle > 1 || (((getPos _vehicle) select 2) > 3)) exitWith {false};
private "_itemSize"; private ["_itemSize", "_validItem"];
_itemSize = ([_item] call FUNC(getSizeItem)); _itemSize = [_item] call FUNC(getSizeItem);
(_itemSize > 0) && if (typeName _item == "STRING") then {
{alive _item && alive _vehicle} && _validItem =
{(_item distance _vehicle <= MAX_LOAD_DISTANCE)} && isClass (configFile >> "CfgVehicles" >> _item) &&
{getNumber (configFile >> "CfgVehicles" >> _item >> QGVAR(canLoad)) == 1};
} else {
_validItem =
(alive _item) &&
{(_item distance _vehicle) <= MAX_LOAD_DISTANCE};
};
_validItem &&
{_itemSize > 0} &&
{alive _vehicle} &&
{_itemSize <= ([_vehicle] call FUNC(getCargoSpaceLeft))} {_itemSize <= ([_vehicle] call FUNC(getCargoSpaceLeft))}

View File

@ -16,18 +16,19 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_loaded", "_validVehiclestate", "_emptyPos"];
params ["_item", "_vehicle"]; params ["_item", "_vehicle"];
private ["_loaded", "_itemClass", "_validVehiclestate", "_emptyPos"];
_loaded = _vehicle getVariable [QGVAR(loaded), []]; _loaded = _vehicle getVariable [QGVAR(loaded), []];
if !(_item in _loaded) exitWith {false}; if !(_item in _loaded) exitWith {false};
_itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item};
_validVehiclestate = true; _validVehiclestate = true;
_emptyPos = []; _emptyPos = [];
if (_vehicle isKindOf "Ship" ) then { if (_vehicle isKindOf "Ship" ) then {
if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false}; if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false};
_emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, typeOf _item]); // TODO: if spot is underwater pick another spot. _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, _itemClass]); // TODO: if spot is underwater pick another spot.
} else { } else {
if (_vehicle isKindOf "Air" ) then { if (_vehicle isKindOf "Air" ) then {
if !(speed _vehicle <1 && {isTouchingGround _vehicle}) then {_validVehiclestate = false}; if !(speed _vehicle <1 && {isTouchingGround _vehicle}) then {_validVehiclestate = false};
@ -35,7 +36,7 @@ if (_vehicle isKindOf "Ship" ) then {
_emptyPos = [(_emptyPos select 0) + random(5), (_emptyPos select 1) + random(5), _emptyPos select 2 ]; _emptyPos = [(_emptyPos select 0) + random(5), (_emptyPos select 1) + random(5), _emptyPos select 2 ];
} else { } else {
if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false}; if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false};
_emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, typeOf _item]); _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, _itemClass]);
}; };
}; };

View File

@ -3,7 +3,7 @@
* Get the cargo size of an object. * Get the cargo size of an object.
* *
* Arguments: * Arguments:
* 0: Object <OBJECT> * 0: Item <OBJECT or STRING>
* *
* Return value: * Return value:
* Cargo size <NUMBER> (default: -1) * Cargo size <NUMBER> (default: -1)
@ -15,14 +15,24 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private "_config";
params ["_item"]; params ["_item"];
private ["_isVirtual","_itemClass","_config"];
scopeName "return";
_config = (configFile >> "CfgVehicles" >> typeOf _item >> QGVAR(size)); _isVirtual = (typeName _item == "STRING");
_itemClass = if (_isVirtual) then {_item} else {typeOf _item};
_config = (configFile >> "CfgVehicles" >> _itemClass >> QGVAR(size));
if (isNumber (_config)) exitWith { if (_isVirtual) then {
_item getVariable [QGVAR(size), getNumber (_config)] if (isNumber _config) then {
(getNumber _config) breakOut "return";
};
} else {
_config = (configFile >> "CfgVehicles" >> typeOf _item >> QGVAR(size));
if (isNumber _config) then {
(_item getVariable [QGVAR(size), getNumber _config]) breakOut "return";
};
}; };
-1 -1

View File

@ -20,12 +20,13 @@ params ["_vehicle"];
private["_loaded"]; private["_loaded"];
_loaded = _vehicle getVariable [QGVAR(loaded), []]; _loaded = _vehicle getVariable [QGVAR(loaded), []];
if (count _loaded == 0) exitWith {}; if (_loaded isEqualTo []) exitWith {};
{ {
// TODO deleteVehicle or just delete vehicle? Do we want to be able to recover destroyed equipment? // TODO Do we want to be able to recover destroyed equipment?
if (typeName _x == "OBJECT") then {
deleteVehicle _x; deleteVehicle _x;
//_x setDamage 1; };
} count _loaded; } count _loaded;
[_vehicle] call FUNC(validateCargoSpace); [_vehicle] call FUNC(validateCargoSpace);

View File

@ -1,9 +1,10 @@
/* /*
* Author: Glowbal * Author: Glowbal
* Load object into vehicle. * Load object into vehicle.
* Objects loaded via classname remain virtual until unloaded.
* *
* Arguments: * Arguments:
* 0: Object <OBJECT> * 0: Item <OBJECT or STRING>
* 1: Vehicle <OBJECT> * 1: Vehicle <OBJECT>
* 2: Show Hint <BOOL> (default: true) * 2: Show Hint <BOOL> (default: true)
* *
@ -17,15 +18,10 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params [["_item","",[objNull,""]], ["_vehicle",objNull,[objNull]]];
private ["_loaded", "_space", "_itemSize"]; private ["_loaded", "_space", "_itemSize"];
params ["_item", "_vehicle", ["_showHint", true, [true]] ]; if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitWith {false};
TRACE_2("params",_item,_vehicle);
if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitWith {
TRACE_2("canLoadItemIn failed",_item,_vehicle);
false
};
_loaded = _vehicle getVariable [QGVAR(loaded), []]; _loaded = _vehicle getVariable [QGVAR(loaded), []];
_loaded pushback _item; _loaded pushback _item;
@ -37,21 +33,10 @@ _space = [_vehicle] call FUNC(getCargoSpaceLeft);
_itemSize = [_item] call FUNC(getSizeItem); _itemSize = [_item] call FUNC(getSizeItem);
_vehicle setVariable [QGVAR(space), _space - _itemSize, true]; _vehicle setVariable [QGVAR(space), _space - _itemSize, true];
detach _item; if (typeName _item == "OBJECT") then {
_item attachTo [_vehicle,[0,0,100]]; detach _item;
["hideObjectGlobal", [_item, true]] call EFUNC(common,serverEvent); _item attachTo [_vehicle,[0,0,-100]];
["hideObjectGlobal", [_item, true]] call EFUNC(common,serverEvent);
// show hint
private ["_itemName", "_vehicleName"];
_itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName");
_vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
if (_showHint) then {
["displayTextStructured", [[localize LSTRING(LoadedItem), _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent);
}; };
// Invoke listenable event
["cargoLoaded", [_item, _vehicle]] call EFUNC(common,globalEvent);
true true

View File

@ -22,7 +22,7 @@ params ["_display"];
uiNamespace setVariable [QGVAR(menuDisplay), _display]; uiNamespace setVariable [QGVAR(menuDisplay), _display];
[{ [{
private ["_display","_loaded", "_ctrl", "_label"]; private ["_display","_loaded", "_ctrl", "_class", "_label"];
disableSerialization; disableSerialization;
_display = uiNamespace getVariable QGVAR(menuDisplay); _display = uiNamespace getVariable QGVAR(menuDisplay);
if (isnil "_display") exitWith { if (isnil "_display") exitWith {
@ -40,7 +40,8 @@ uiNamespace setVariable [QGVAR(menuDisplay), _display];
lbClear _ctrl; lbClear _ctrl;
{ {
_ctrl lbAdd (getText(configfile >> "CfgVehicles" >> typeOf _x >> "displayName")); _class = if (typeName _x == "STRING") then {_x} else {typeOf _x};
_ctrl lbAdd (getText(configfile >> "CfgVehicles" >> _class >> "displayName"));
true true
} count _loaded; } count _loaded;

View File

@ -16,16 +16,25 @@
#include "script_component.hpp" #include "script_component.hpp"
params ["_player", "_object"]; params ["_player", "_object"];
private ["_vehicle", "_size", "_displayName"];
private ["_nearestVehicle"]; _vehicle = [_player] call FUNC(findNearestVehicle);
_nearestVehicle = [_player] call FUNC(findNearestVehicle);
if (isNull _nearestVehicle || _nearestVehicle isKindOf "Cargo_Base_F") then { if (isNull _vehicle || _vehicle isKindOf "Cargo_Base_F") then {
{ {
if ([_object, _x] call FUNC(canLoadItemIn)) exitWith {_nearestVehicle = _x}; if ([_object, _x] call FUNC(canLoadItemIn)) exitWith {_vehicle = _x};
} foreach (nearestObjects [_player, ["Cargo_base_F", "Land_PaperBox_closed_F"], MAX_LOAD_DISTANCE]); } foreach (nearestObjects [_player, ["Cargo_base_F", "Land_PaperBox_closed_F"], MAX_LOAD_DISTANCE]);
}; };
if (isNull _nearestVehicle) exitWith {false}; if (isNull _vehicle) exitWith {false};
[_object, _nearestVehicle] call FUNC(loadItem) // Start progress bar
if ([_object, _vehicle] call FUNC(canLoadItemIn)) then {
_size = [_object] call FUNC(getSizeItem);
[5 * _size, [_object,_vehicle], "LoadCargo", {}, localize LSTRING(LoadingItem)] call EFUNC(common,progressBar);
} else {
_displayName = getText (configFile >> "CfgVehicles" >> typeOf _object >> "displayName");
["displayTextStructured", [[LSTRING(LoadingFailed), _displayName], 3.0]] call EFUNC(common,localEvent);
};

View File

@ -20,7 +20,7 @@ private ["_display", "_loaded", "_ctrl", "_selected", "_item"];
disableSerialization; disableSerialization;
_display = uiNamespace getVariable QGVAR(menuDisplay); _display = uiNamespace getVariable QGVAR(menuDisplay);
if (isnil "_display") exitWith {}; if (isNil "_display") exitWith {};
_loaded = GVAR(interactionVehicle) getVariable [QGVAR(loaded), []]; _loaded = GVAR(interactionVehicle) getVariable [QGVAR(loaded), []];
if (count _loaded == 0) exitWith {}; if (count _loaded == 0) exitWith {};
@ -32,4 +32,17 @@ _selected = (lbCurSel _ctrl) max 0;
if (count _loaded <= _selected) exitWith {}; if (count _loaded <= _selected) exitWith {};
_item = _loaded select _selected; _item = _loaded select _selected;
[_item, GVAR(interactionVehicle)] call FUNC(unloadItem);
// Start progress bar
private ["_size", "_itemClass", "_displayName"];
if ([_item, GVAR(interactionVehicle)] call FUNC(canUnloadItem)) then {
_size = [_item] call FUNC(getSizeItem);
[5 * _size, [_item, GVAR(interactionVehicle)], "UnloadCargo", {}, localize LSTRING(UnloadingItem)] call EFUNC(common,progressBar);
} else {
_itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item};
_displayName = getText (configFile >> "CfgVehicles" >> _itemClass >> "displayName");
["displayTextStructured", [[LSTRING(UnloadingFailed), _displayName], 3.0]] call EFUNC(common,localEvent);
};

View File

@ -3,7 +3,7 @@
* Unload object from vehicle. * Unload object from vehicle.
* *
* Arguments: * Arguments:
* 0: Object <OBJECT> * 0: Item <OBJECT or STRING>
* 1: Vehicle <OBJECT> * 1: Vehicle <OBJECT>
* *
* Return value: * Return value:
@ -16,20 +16,21 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_loaded", "_space", "_itemSize", "_emptyPos", "_validVehiclestate"];
params ["_item", "_vehicle"]; params ["_item", "_vehicle"];
private ["_loaded", "_space", "_itemSize", "_emptyPos", "_validVehiclestate"];
if !([_item, _vehicle] call FUNC(canUnloadItem)) exitWith { if !([_item, _vehicle] call FUNC(canUnloadItem)) exitWith {
false false
}; };
_itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item};
_validVehiclestate = true; _validVehiclestate = true;
_emptyPos = []; _emptyPos = [];
if (_vehicle isKindOf "Ship" ) then { if (_vehicle isKindOf "Ship" ) then {
if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false}; if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false};
TRACE_1("SHIP Ground Check", getPosATL _vehicle ); TRACE_1("SHIP Ground Check", getPosATL _vehicle );
_emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, typeOf _item]); // TODO: if spot is underwater pick another spot. _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, _itemClass]); // TODO: if spot is underwater pick another spot.
} else { } else {
if (_vehicle isKindOf "Air" ) then { if (_vehicle isKindOf "Air" ) then {
if !(speed _vehicle <1 && {isTouchingGround _vehicle}) then {_validVehiclestate = false}; if !(speed _vehicle <1 && {isTouchingGround _vehicle}) then {_validVehiclestate = false};
@ -39,38 +40,29 @@ if (_vehicle isKindOf "Ship" ) then {
} else { } else {
if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false}; if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false};
TRACE_1("Vehicle Ground Check", isTouchingGround _vehicle); TRACE_1("Vehicle Ground Check", isTouchingGround _vehicle);
_emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 13, typeOf _item]); _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 13, _itemClass]);
}; };
}; };
TRACE_1("getPosASL Vehicle Check", getPosASL _vehicle); TRACE_1("getPosASL Vehicle Check", getPosASL _vehicle);
if (!_validVehiclestate) exitWith {false}; if (!_validVehiclestate) exitWith {false};
if (count _emptyPos == 0) exitWith {false}; //consider displaying text saying there are no safe places to exit the vehicle if (count _emptyPos == 0) exitWith {false};
_loaded = _vehicle getVariable [QGVAR(loaded), []]; _loaded = _vehicle getVariable [QGVAR(loaded), []];
_loaded = _loaded - [_item]; _loaded deleteAt (_loaded find _item);
_vehicle setVariable [QGVAR(loaded), _loaded, true]; _vehicle setVariable [QGVAR(loaded), _loaded, true];
_space = [_vehicle] call FUNC(getCargoSpaceLeft); _space = [_vehicle] call FUNC(getCargoSpaceLeft);
_itemSize = [_item] call FUNC(getSizeItem); _itemSize = [_item] call FUNC(getSizeItem);
_vehicle setVariable [QGVAR(space), (_space + _itemSize), true]; _vehicle setVariable [QGVAR(space), (_space + _itemSize), true];
detach _item; if (typeName _item == "OBJECT") then {
_item setPosASL (_emptyPos call EFUNC(common,PositiontoASL)); detach _item;
["hideObjectGlobal", [_item, false]] call EFUNC(common,serverEvent); _item setPosASL (_emptyPos call EFUNC(common,PositiontoASL));
["hideObjectGlobal", [_item, false]] call EFUNC(common,serverEvent);
// show hint } else {
private ["_itemName", "_vehicleName"]; createVehicle [_item, _emptyPos, [], 0, ""];
};
_itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName");
_vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
["displayTextStructured", [[localize LSTRING(UnloadedItem), _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent);
// TOOO maybe drag/carry the unloaded item?
// Invoke listenable event
["cargoUnloaded", [_item, _vehicle]] call EFUNC(common,globalEvent);
true true

View File

@ -24,7 +24,7 @@ _loaded = _vehicle getVariable [QGVAR(loaded), []];
_newLoaded = []; _newLoaded = [];
_totalSpaceOccupied = 0; _totalSpaceOccupied = 0;
{ {
if !(isNull _x) then { if ((typeName _x == "STRING") || {!isNull _x}) then {
_newLoaded pushback _x; _newLoaded pushback _x;
_totalSpaceOccupied = _totalSpaceOccupied + ([_x] call FUNC(getSizeItem)); _totalSpaceOccupied = _totalSpaceOccupied + ([_x] call FUNC(getSizeItem));
}; };
@ -35,4 +35,4 @@ if (count _loaded != count _newLoaded) then {
_vehicle setVariable [QGVAR(loaded), _newLoaded, true]; _vehicle setVariable [QGVAR(loaded), _newLoaded, true];
}; };
_vehicle setVariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeof _vehicle >> QGVAR(space)) - _totalSpaceOccupied, true]; _vehicle setVariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(space)) - _totalSpaceOccupied, true];

View File

@ -95,5 +95,17 @@
<Hungarian>1%&lt;br/&gt;kirakodva ebből:&lt;br/&gt;%2</Hungarian> <Hungarian>1%&lt;br/&gt;kirakodva ebből:&lt;br/&gt;%2</Hungarian>
<Russian>%1&lt;br/&gt;разгружен из&lt;br/&gt;%2</Russian> <Russian>%1&lt;br/&gt;разгружен из&lt;br/&gt;%2</Russian>
</Key> </Key>
<Key ID="STR_ACE_Cargo_LoadingItem">
<English>Loading Cargo</English>
</Key>
<Key ID="STR_ACE_Cargo_UnloadingItem">
<English>Unloading Cargo</English>
</Key>
<Key ID="STR_ACE_Cargo_LoadingFailed">
<English>%1&lt;br/&gt;could not be loaded</English>
</Key>
<Key ID="STR_ACE_Cargo_UnloadingFailed">
<English>%1&lt;br/&gt;could not be unloaded</English>
</Key>
</Package> </Package>
</Project> </Project>

View File

@ -223,6 +223,7 @@ PREP(getTurretCopilot);
PREP(getDoorTurrets); PREP(getDoorTurrets);
PREP(getTurretsFFV); PREP(getTurretsFFV);
PREP(getTurretsOther); PREP(getTurretsOther);
PREP(hasHatch);
// missing inventory commands // missing inventory commands
PREP(binocularMagazine); PREP(binocularMagazine);

View File

@ -1,6 +1,6 @@
/* /*
* Author: commy2 * Author: commy2
* Add an event handler that executes every ACE_time the scroll wheel is used. This is needed, because adding a MouseZ display event handler to display 46 will break in save games. * Add an event handler that executes every time the scroll wheel is used. This is needed, because adding a MouseZ display event handler to display 46 will break in save games.
* _this will be [Interval] where 'Interval' is a number. * _this will be [Interval] where 'Interval' is a number.
* *
* Arguments: * Arguments:

View File

@ -1,6 +1,6 @@
/* /*
* Author: esteldunedain, Jaynus * Author: esteldunedain, Jaynus
* Returns the result of the function and caches it up to a given ACE_time or event * Returns the result of the function and caches it up to a given time or event
* *
* Arguments: * Arguments:
* 0: Parameters <ARRAY> * 0: Parameters <ARRAY>

View File

@ -1,6 +1,6 @@
/* /*
* Author: Glowbal, PabstMirror * Author: Glowbal, PabstMirror
* Get the death animation for the unit at current ACE_time * Get the death animation for the unit at current time
* *
* Arguments: * Arguments:
* 0: unit <OBJECT> * 0: unit <OBJECT>

View File

@ -0,0 +1,35 @@
/*
* Author: commy2
* Check if unit is in a vehicle position where it can turn in or out.
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* Unit has a hatch? <BOOL>
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit"];
local _vehicle = vehicle _unit;
if (_unit == _vehicle) exitWith {false};
local _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
if (getNumber (_config >> "hideProxyInCombat") != 1) exitWith {false};
if (_unit == driver _vehicle) exitWith {
getNumber (_config >> "forceHideDriver") == 0; // return
};
local _turret = [_unit] call FUNC(getTurretIndex);
if (_turret isEqualTo []) exitWith {false};
local _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
getNumber (_turretConfig >> "forceHideGunner") == 0; // return

View File

@ -4,7 +4,7 @@
* Finish/Failure/Conditional are all passed [_args, _elapsedTime, _totalTime, _errorCode] * Finish/Failure/Conditional are all passed [_args, _elapsedTime, _totalTime, _errorCode]
* *
* Arguments: * Arguments:
* 0: NUMBER - Total Time (in game "ACE_time" seconds) * 0: NUMBER - Total Time (in game "time" seconds)
* 1: ARRAY - Arguments, passed to condition, fail and finish * 1: ARRAY - Arguments, passed to condition, fail and finish
* 2: CODE or STRING - On Finish: Code called or STRING raised as event. * 2: CODE or STRING - On Finish: Code called or STRING raised as event.
* 3: CODE or STRING - On Failure: Code called or STRING raised as event. * 3: CODE or STRING - On Failure: Code called or STRING raised as event.

View File

@ -1,12 +1,12 @@
/* /*
* Author: commy2 and joko // Jonas * Author: commy2 and joko // Jonas
* Sets a public variable, but wait a certain amount of ACE_time to transfer the value over the network. Changing the value by calling this function again resets the windup timer. * Sets a public variable, but wait a certain amount of time to transfer the value over the network. Changing the value by calling this function again resets the windup timer.
* *
* Arguments: * Arguments:
* 0: Object the variable should be assigned to <OBJECT> * 0: Object the variable should be assigned to <OBJECT>
* 1: Name of the variable <STRING> * 1: Name of the variable <STRING>
* 2: Value of the variable <ANY> * 2: Value of the variable <ANY>
* 3: Windup ACE_time <NUMBER> (default: 1) * 3: Windup time <NUMBER> (default: 1)
* *
* Return Value: * Return Value:
* None * None

View File

@ -19,7 +19,7 @@
params ["_unit", "_varName", "_maxDelay"]; params ["_unit", "_varName", "_maxDelay"];
// Create the publish scheduler PFH the first ACE_time // Create the publish scheduler PFH the first time
if (isNil QGVAR(publishSchedId)) then { if (isNil QGVAR(publishSchedId)) then {
GVAR(publishVarNames) = []; GVAR(publishVarNames) = [];
GVAR(publishNextTime) = 1e7; GVAR(publishNextTime) = 1e7;

View File

@ -1,6 +1,6 @@
/* /*
* Author: esteldunedain * Author: esteldunedain
* Executes a code once with a given game ACE_time delay, using a PFH * Executes a code once with a given game time delay, using a PFH
* *
* Arguments: * Arguments:
* 0: Code to execute <CODE> * 0: Code to execute <CODE>

View File

@ -11,7 +11,7 @@
* None * None
* *
* Example: * Example:
* [{(_this select 0) == vehicle (_this select 0)}, {(_this select 0) setDamage 1;}, [ACE_player]] call ace_common_fnc_waitAndExecute * [{(_this select 0) == vehicle (_this select 0)}, {(_this select 0) setDamage 1;}, [ACE_player]] call ace_common_fnc_waitUntilAndExecute
* *
* Public: No * Public: No
*/ */

View File

@ -30,4 +30,4 @@ GVAR(vectorConnected) = false;
GVAR(noVectorData) = true; GVAR(noVectorData) = true;
GVAR(vectorGrid) = "00000000"; GVAR(vectorGrid) = "00000000";
["RangerfinderData", {_this call FUNC(handleRangeFinderData)}] call EFUNC(common,addEventHandler); ["RangerfinderData", FUNC(handleRangeFinderData)] call EFUNC(common,addEventHandler);

View File

@ -41,7 +41,8 @@ GVAR(outputPFH) = [{
// GRID // GRID
_gridArray = [(getPos ACE_player), false] call EFUNC(common,getMapGridFromPos); _gridArray = [(getPos ACE_player), false] call EFUNC(common,getMapGridFromPos);
_dagrGrid = format ["%1 %2", ((_gridArray select 0) select [0,4]), ((_gridArray select 1) select [0,4])]; _gridArray params ["_gridArrayX","_gridArrayY"];
_dagrGrid = format ["%1 %2", ((_gridArrayX) select [0,4]), ((_gridArrayY) select [0,4])];
// SPEED // SPEED
_speed = speed (vehicle ACE_player); _speed = speed (vehicle ACE_player);
@ -68,7 +69,7 @@ GVAR(outputPFH) = [{
__gridControl ctrlSetText format ["%1", _dagrGrid]; __gridControl ctrlSetText format ["%1", _dagrGrid];
__speedControl ctrlSetText format ["%1", _dagrSpeed]; __speedControl ctrlSetText format ["%1", _dagrSpeed];
__elevationControl ctrlSetText format ["%1", _dagrElevation]; __elevationControl ctrlSetText format ["%1", _dagrElevation];
__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1 °", _dagrHeading] }); __headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1 <EFBFBD>", _dagrHeading] });
__timeControl ctrlSetText format ["%1", _dagrTime]; __timeControl ctrlSetText format ["%1", _dagrTime];
}, GVAR(updateInterval), []] call CBA_fnc_addPerFrameHandler; }, GVAR(updateInterval), []] call CBA_fnc_addPerFrameHandler;

View File

@ -1,4 +1,4 @@
/* /*
* Author: Rosuto * Author: Rosuto
* DAGR vector output loop * DAGR vector output loop
* *
@ -14,7 +14,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_pos", "_xGrid", "_yGrid", "_dagrGrid", "_bearing", "_dagrDist", "_dagrElevation", "_dagrTime", "_elevation", "_xCoord", "_yCoord"]; private ["_xGrid", "_yGrid", "_dagrGrid", "_bearing", "_dagrDist", "_dagrElevation", "_dagrTime", "_elevation", "_xCoord", "_yCoord"];
135471 cutRsc ["DAGR_DISPLAY", "plain down"]; 135471 cutRsc ["DAGR_DISPLAY", "plain down"];
@ -30,15 +30,14 @@ private ["_pos", "_xGrid", "_yGrid", "_dagrGrid", "_bearing", "_dagrDist", "_dag
__background ctrlSetText QUOTE(PATHTOF(UI\dagr_vector.paa)); __background ctrlSetText QUOTE(PATHTOF(UI\dagr_vector.paa));
if (GVAR(noVectorData)) exitwith {}; if (GVAR(noVectorData)) exitwith {};
GVAR(LAZPOS) params ["_lazPosX", "_lazPosY", "_lazPosZ"];
_pos = [GVAR(LAZPOS) select 0, GVAR(LAZPOS) select 1];
// Incase grids go neg due to 99-00 boundry // Incase grids go neg due to 99-00 boundry
if (_pos select 0 < 0) then {_pos set [0, (_pos select 0) + 99999];}; if (_lazPosX < 0) then { _lazPosX = _lazPosX + 99999;};
if (_pos select 1 < 0) then {_pos set [1, (_pos select 1) + 99999];}; if (_lazPosY < 0) then {_lazPosY = _lazPosY + 99999;};
// Find laser position // Find laser position
_xGrid = toArray Str(round(_pos select 0)); _xGrid = toArray Str(round _lazPosX);
while {count _xGrid < 5} do { while {count _xGrid < 5} do {
_xGrid = [48] + _xGrid; _xGrid = [48] + _xGrid;
@ -47,7 +46,7 @@ _xGrid resize 4;
_xGrid = toString _xGrid; _xGrid = toString _xGrid;
_xGrid = parseNumber _xGrid; _xGrid = parseNumber _xGrid;
_yGrid = toArray Str(round(_pos select 1)); _yGrid = toArray Str(round _lazPosY);
while {count _yGrid < 5} do { while {count _yGrid < 5} do {
_yGrid = [48] + _yGrid; _yGrid = [48] + _yGrid;
}; };
@ -72,7 +71,7 @@ _yCoord = switch true do {
_dagrGrid = _xCoord + " " + _yCoord; _dagrGrid = _xCoord + " " + _yCoord;
// Find target elevation // Find target elevation
_elevation = floor ((GVAR(LAZPOS) select 2) + EGVAR(common,mapAltitude)); _elevation = floor ((_lazPosZ) + EGVAR(common,mapAltitude));
_dagrElevation = str _elevation + "m"; _dagrElevation = str _elevation + "m";
// Time // Time
@ -94,5 +93,5 @@ GVAR(vectorGrid) = _dagrGrid;
__gridControl ctrlSetText format ["%1", _dagrGrid]; __gridControl ctrlSetText format ["%1", _dagrGrid];
__speedControl ctrlSetText format ["%1", _dagrDist]; __speedControl ctrlSetText format ["%1", _dagrDist];
__elevationControl ctrlSetText format ["%1", _dagrElevation]; __elevationControl ctrlSetText format ["%1", _dagrElevation];
__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _bearing] } else { format ["%1°", _bearing] }); __headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _bearing] } else { format ["%1°", _bearing] });
__timeControl ctrlSetText format ["%1", _dagrTime]; __timeControl ctrlSetText format ["%1", _dagrTime];

View File

@ -1,4 +1,4 @@
/* /*
* Author: Rosuto * Author: Rosuto
* DAGR waypoint output loop * DAGR waypoint output loop
* *
@ -41,7 +41,8 @@ GVAR(outputPFH) = [{
// GRID // GRID
_gridArray = [(getPos ACE_player), false] call EFUNC(common,getMapGridFromPos); _gridArray = [(getPos ACE_player), false] call EFUNC(common,getMapGridFromPos);
_dagrGrid = format ["%1 %2", ((_gridArray select 0) select [0,4]), ((_gridArray select 1) select [0,4])]; _gridArray params ["_gridArrayX","_gridArrayY"];
_dagrGrid = format ["%1 %2", (_gridArrayX select [0,4]), (_gridArrayY select [0,4])];
// WP Grid // WP Grid
_xGrid2 = floor (DAGR_WP_INFO / 10000); _xGrid2 = floor (DAGR_WP_INFO / 10000);
@ -84,7 +85,7 @@ GVAR(outputPFH) = [{
__gridControl ctrlSetText format ["%1", _dagrGrid]; __gridControl ctrlSetText format ["%1", _dagrGrid];
__speedControl ctrlSetText format ["%1", _bearing]; __speedControl ctrlSetText format ["%1", _bearing];
__elevationControl ctrlSetText format ["%1", _dagrGrid2]; __elevationControl ctrlSetText format ["%1", _dagrGrid2];
__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1°", _dagrHeading] }); __headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1°", _dagrHeading] });
__timeControl ctrlSetText format ["%1", _dagrDistance]; __timeControl ctrlSetText format ["%1", _dagrDistance];
}, GVAR(updateInterval), []] call CBA_fnc_addPerFrameHandler; }, GVAR(updateInterval), []] call CBA_fnc_addPerFrameHandler;

View File

@ -23,11 +23,12 @@ if (GVAR(run)) then {
}; };
GVAR(hidden) = true; GVAR(hidden) = true;
[{ [{
EXPLODE_1_PVT(_this select 0,_vehicle); params ["_args", "_idPFH"];
_args params ["_vehicle"];
if (!GVAR(run) || (!alive ACE_player) || (vehicle ACE_player != _vehicle)) exitWith { if (!GVAR(run) || (!alive ACE_player) || (vehicle ACE_player != _vehicle)) exitWith {
GVAR(run) = false; GVAR(run) = false;
135471 cutText ["", "PLAIN"]; 135471 cutText ["", "PLAIN"];
[_this select 1] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
}; };
if (cameraView == "GUNNER") then { if (cameraView == "GUNNER") then {
if (!GVAR(hidden)) then { if (!GVAR(hidden)) then {

View File

@ -6,24 +6,28 @@
<Polish>DAGR</Polish> <Polish>DAGR</Polish>
<Spanish>DAGR</Spanish> <Spanish>DAGR</Spanish>
<Russian>DAGR</Russian> <Russian>DAGR</Russian>
<Portuguese>DAGR</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_DAGR_ConfigureDAGR"> <Key ID="STR_ACE_DAGR_ConfigureDAGR">
<English>Configure DAGR</English> <English>Configure DAGR</English>
<Polish>Konfiguruj DAGR</Polish> <Polish>Konfiguruj DAGR</Polish>
<Spanish>Configurar DAGR</Spanish> <Spanish>Configurar DAGR</Spanish>
<Russian>Настроить DAGR</Russian> <Russian>Настроить DAGR</Russian>
<Portuguese>Configurar DAGR</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_DAGR_ToggleDAGR"> <Key ID="STR_ACE_DAGR_ToggleDAGR">
<English>Toggle DAGR</English> <English>Toggle DAGR</English>
<Polish>Przełącz DAGR</Polish> <Polish>Przełącz DAGR</Polish>
<Spanish>Mostrar DAGR</Spanish> <Spanish>Mostrar DAGR</Spanish>
<Russian>Вкл./выкл. DAGR</Russian> <Russian>Вкл./выкл. DAGR</Russian>
<Portuguese>Mostrar DAGR</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_DAGR_Description"> <Key ID="STR_ACE_DAGR_Description">
<English>Defense Advanced GPS Receiver</English> <English>Defense Advanced GPS Receiver</English>
<Polish>Defense Advanced GPS Receiver</Polish> <Polish>Defense Advanced GPS Receiver</Polish>
<Spanish>Defense Advanced GPS Receiver</Spanish> <Spanish>Defense Advanced GPS Receiver</Spanish>
<Russian>Военный многофункциональный GPS-приёмник</Russian> <Russian>Военный многофункциональный GPS-приёмник</Russian>
<Portuguese>Defense Advanced GPS Receiver</Portuguese>
</Key> </Key>
</Package> </Package>
</Project> </Project>

View File

@ -63,7 +63,7 @@ if (isNull _holder) then {
if (isNull _holder) exitWith { if (isNull _holder) exitWith {
[_caller, _target, "Debug: Null Holder"] call FUNC(eventTargetFinish); [_caller, _target, "Debug: Null Holder"] call FUNC(eventTargetFinish);
}; };
//Make sure only one drop operation at a ACE_time (using PFEH system as a queue) //Make sure only one drop operation at a time (using PFEH system as a queue)
if (_holder getVariable [QGVAR(holderInUse), false]) exitWith { if (_holder getVariable [QGVAR(holderInUse), false]) exitWith {
[{ [{
_this call FUNC(disarmDropItems); _this call FUNC(disarmDropItems);

View File

@ -61,7 +61,7 @@ if (_target isKindOf "CAManBase") then {
[_unit, _target, true] call EFUNC(common,claim); [_unit, _target, true] call EFUNC(common,claim);
// prevents draging and carrying at the same ACE_time // prevents draging and carrying at the same time
_unit setVariable [QGVAR(isCarrying), true, true]; _unit setVariable [QGVAR(isCarrying), true, true];
// required for aborting animation // required for aborting animation

View File

@ -45,7 +45,7 @@ if (_target isKindOf "CAManBase") then {
[_target, "AinjPpneMrunSnonWnonDb_grab", 2, true] call EFUNC(common,doAnimation); [_target, "AinjPpneMrunSnonWnonDb_grab", 2, true] call EFUNC(common,doAnimation);
}; };
// prevents draging and carrying at the same ACE_time // prevents draging and carrying at the same time
_unit setVariable [QGVAR(isDragging), true, true]; _unit setVariable [QGVAR(isDragging), true, true];
[FUNC(startDragPFH), 0.2, [_unit, _target, ACE_time + 5]] call CBA_fnc_addPerFrameHandler; [FUNC(startDragPFH), 0.2, [_unit, _target, ACE_time + 5]] call CBA_fnc_addPerFrameHandler;

View File

@ -31,7 +31,7 @@ if (!alive _target || {_unit distance _target > 10}) then {
[_idPFH] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
}; };
// timeout. Do nothing. Quit. ACE_time, because anim length is linked to ingame ACE_time. // timeout. Do nothing. Quit. ACE_time, because anim length is linked to ingame time.
if (ACE_time > _timeOut) exitWith { if (ACE_time > _timeOut) exitWith {
[_idPFH] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project name="ACE"> <Project name="ACE">
<Package name="Dragging"> <Package name="Dragging">
<Key ID="STR_ACE_Dragging_Drag"> <Key ID="STR_ACE_Dragging_Drag">
@ -53,6 +53,7 @@
<English>Raise/Lower</English> <English>Raise/Lower</English>
<German>Heben/Senken</German> <German>Heben/Senken</German>
<Polish>Wyżej/Niżej</Polish> <Polish>Wyżej/Niżej</Polish>
<Portuguese>Levantar/Abaixar</Portuguese>
</Key> </Key>
</Package> </Package>
</Project> </Project>

View File

@ -7,7 +7,7 @@
* 1: Max range (-1 to ignore) <NUMBER> * 1: Max range (-1 to ignore) <NUMBER>
* 2: Explosive <ARRAY> * 2: Explosive <ARRAY>
* 0: Explosive <OBJECT> * 0: Explosive <OBJECT>
* 1: Fuse ACE_time <NUMBER> * 1: Fuse time <NUMBER>
* *
* Return Value: * Return Value:
* None * None

View File

@ -1,7 +1,7 @@
#include "script_component.hpp" #include "script_component.hpp"
GVAR(enabled) = false; GVAR(enabled) = false;
GVAR(ACE_time) = 0; GVAR(time) = 0;
GVAR(position) = [0,0,0]; GVAR(position) = [0,0,0];
if (!hasInterface) exitWith {}; if (!hasInterface) exitWith {};

View File

@ -22,7 +22,7 @@ _distance = call FUNC(getRange);
if !(!GVAR(enabled) && FUNC(canUseFCS)) exitWith {}; if !(!GVAR(enabled) && FUNC(canUseFCS)) exitWith {};
GVAR(Enabled) = true; GVAR(Enabled) = true;
GVAR(Time) = ACE_time; GVAR(time) = ACE_time;
if (_distance == 0) then { if (_distance == 0) then {
_distance = [5, 5000, 0] call EFUNC(common,getTargetDistance); // maximum distance: 5000m, 5m precision _distance = [5, 5000, 0] call EFUNC(common,getTargetDistance); // maximum distance: 5000m, 5m precision

View File

@ -60,7 +60,7 @@ private ["_movingAzimuth", "_posTarget", "_velocityTarget"];
// MOVING TARGETS // MOVING TARGETS
_movingAzimuth = 0; _movingAzimuth = 0;
if (ACE_time - GVAR(ACE_time) > 1 and GVAR(ACE_time) != -1 and count _this < 3) then { if (ACE_time - GVAR(time) > 1 and GVAR(time) != -1 and count _this < 3) then {
// calculate speed of target // calculate speed of target
_posTarget = [ _posTarget = [
(getPos _vehicle select 0) + _distance * (_weaponDirection select 0), (getPos _vehicle select 0) + _distance * (_weaponDirection select 0),
@ -68,14 +68,14 @@ if (ACE_time - GVAR(ACE_time) > 1 and GVAR(ACE_time) != -1 and count _this < 3)
(getPos _vehicle select 2) + _distance * (_weaponDirection select 2) (getPos _vehicle select 2) + _distance * (_weaponDirection select 2)
]; ];
_velocityTarget = [ _velocityTarget = [
((_posTarget select 0) - (GVAR(position) select 0)) / (ACE_time - GVAR(ACE_time)), ((_posTarget select 0) - (GVAR(position) select 0)) / (ACE_time - GVAR(time)),
((_posTarget select 1) - (GVAR(position) select 1)) / (ACE_time - GVAR(ACE_time)), ((_posTarget select 1) - (GVAR(position) select 1)) / (ACE_time - GVAR(time)),
((_posTarget select 2) - (GVAR(position) select 2)) / (ACE_time - GVAR(ACE_time)) ((_posTarget select 2) - (GVAR(position) select 2)) / (ACE_time - GVAR(time))
]; ];
private ["_magazineType", "_ammoType", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep", "_initSpeedCoef", "_velocityMagnitude"]; private ["_magazineType", "_ammoType", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep", "_initSpeedCoef", "_velocityMagnitude"];
// estimate ACE_time to target // estimate time to target
_magazineType = _vehicle currentMagazineTurret _turret; _magazineType = _vehicle currentMagazineTurret _turret;
_ammoType = getText (configFile >> "CfgMagazines" >> _magazineType >> "ammo"); _ammoType = getText (configFile >> "CfgMagazines" >> _magazineType >> "ammo");
_initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazineType >> "initSpeed"); _initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazineType >> "initSpeed");
@ -130,7 +130,7 @@ if (ACE_time - GVAR(ACE_time) > 1 and GVAR(ACE_time) != -1 and count _this < 3)
}; };
}; };
GVAR(enabled) = false; GVAR(enabled) = false;
GVAR(ACE_time) = -1; GVAR(time) = -1;
private ["_viewDiff", "_FCSAzimuth", "_FCSMagazines", "_FCSElevation"]; private ["_viewDiff", "_FCSAzimuth", "_FCSMagazines", "_FCSElevation"];

View File

@ -19,7 +19,7 @@ EXPLODE_2_PVT(_this,_params,_pfhId);
_interval = ACE_time - GVAR(lastUpdateTime); _interval = ACE_time - GVAR(lastUpdateTime);
// Update the g-forces at constant game ACE_time intervals // Update the g-forces at constant game time intervals
if (_interval < INTERVAL) exitWith {}; if (_interval < INTERVAL) exitWith {};
if (isNull ACE_player) exitWith {}; if (isNull ACE_player) exitWith {};

View File

@ -103,7 +103,7 @@ _affected = _grenade nearEntities ["CAManBase", 20];
GVAR(flashbangPPEffectCC) ppEffectAdjust [1,1,(0.8 + _strength) min 1,[1,1,1,0],[0,0,0,1],[0,0,0,0]]; GVAR(flashbangPPEffectCC) ppEffectAdjust [1,1,(0.8 + _strength) min 1,[1,1,1,0],[0,0,0,1],[0,0,0,0]];
GVAR(flashbangPPEffectCC) ppEffectCommit 0.01; GVAR(flashbangPPEffectCC) ppEffectCommit 0.01;
//PARTIALRECOVERY - start decreasing effect over ACE_time //PARTIALRECOVERY - start decreasing effect over time
[{ [{
params ["_strength"]; params ["_strength"];

View File

@ -29,12 +29,9 @@ GVAR(isOpeningDoor) = false;
if (_unit == ACE_player) then { if (_unit == ACE_player) then {
addCamShake [4, 0.5, 5]; addCamShake [4, 0.5, 5];
local _message = parseText format ([["%1 &gt;", localize LSTRING(YouWereTappedRight)], ["&lt; %1", localize LSTRING(YouWereTappedLeft)]] select (_shoulderNum == 0));
[_message] call FUNC(displayTextStructured);
}; };
private "_message";
_message = parseText format ([["%1 &gt;", localize LSTRING(YouWereTappedRight)], ["&lt; %1", localize LSTRING(YouWereTappedLeft)]] select (_shoulderNum == 0));
["displayTextStructured", _message] call EFUNC(common,targetEvent);
}] call EFUNC(common,addEventHandler); }] call EFUNC(common,addEventHandler);
// restore global fire teams for JIP // restore global fire teams for JIP

View File

@ -2,7 +2,7 @@
#include "script_component.hpp" #include "script_component.hpp"
TRACE_1("enter", _this); TRACE_1("enter", _this);
#define __LOCKONTIMERANDOM 2 // Deviation in lock on ACE_time #define __LOCKONTIMERANDOM 2 // Deviation in lock on time
if((count _this) > 0) then { if((count _this) > 0) then {
uiNameSpace setVariable ['ACE_RscOptics_javelin',_this select 0]; uiNameSpace setVariable ['ACE_RscOptics_javelin',_this select 0];
@ -29,7 +29,7 @@ uiNameSpace setVariable [QGVAR(arguments),
0, // Run Time 0, // Run Time
0, // Lock Time 0, // Lock Time
0, // Sound timer 0, // Sound timer
(random __LOCKONTIMERANDOM), // random lock ACE_time addition (random __LOCKONTIMERANDOM), // random lock time addition
-1 -1
] ]
]; ];

View File

@ -11,16 +11,16 @@ class CfgVehicles {
class Land_Net_Fence_4m_F: Wall_F { GVAR(isFence) = 1; }; class Land_Net_Fence_4m_F: Wall_F { GVAR(isFence) = 1; };
class Land_Net_Fence_8m_F: Wall_F { GVAR(isFence) = 1; }; class Land_Net_Fence_8m_F: Wall_F { GVAR(isFence) = 1; };
class Land_Net_FenceD_8m_F: Wall_F { GVAR(isFence) = 1; };
class Land_New_WiredFence_5m_F: Wall_F { GVAR(isFence) = 1; }; class Land_New_WiredFence_5m_F: Wall_F { GVAR(isFence) = 1; };
class Land_New_WiredFence_10m_Dam_F: Wall_F { GVAR(isFence) = 1; };
class Land_New_WiredFence_10m_F: Wall_F { GVAR(isFence) = 1; }; class Land_New_WiredFence_10m_F: Wall_F { GVAR(isFence) = 1; };
class Land_Pipe_fence_4m_F: Wall_F { GVAR(isFence) = 1; };
class Land_Pipe_fence_4mNoLC_F: Wall_F { GVAR(isFence) = 1; };
class Land_SportGround_fence_F: Wall_F { GVAR(isFence) = 1; }; class Land_SportGround_fence_F: Wall_F { GVAR(isFence) = 1; };
class Land_Wired_Fence_4m_F: Wall_F { GVAR(isFence) = 1; }; class Land_Wired_Fence_4m_F: Wall_F { GVAR(isFence) = 1; };
class Land_Wired_Fence_4mD_F: Wall_F { GVAR(isFence) = 1; };
class Land_Wired_Fence_8m_F: Wall_F { GVAR(isFence) = 1; }; class Land_Wired_Fence_8m_F: Wall_F { GVAR(isFence) = 1; };
class Land_Wired_Fence_8mD_F: Wall_F { GVAR(isFence) = 1; }; class Land_SportGround_fence_noLC_F: Wall_F { GVAR(isFence) = 1; };
class Land_Mil_WiredFence_F: Wall_F { GVAR(isFence) = 1; };
class Land_IndFnc_Corner_F: Wall_F { GVAR(isFence) = 1; };
class Land_IndFnc_9_F: Wall_F { GVAR(isFence) = 1; };
class Land_IndFnc_3_Hole_F: Wall_F { GVAR(isFence) = 1; };
class Land_IndFnc_3_F: Wall_F { GVAR(isFence) = 1; };
class Land_Razorwire_F: NonStrategic { GVAR(isFence) = 1; }; class Land_Razorwire_F: NonStrategic { GVAR(isFence) = 1; };
}; };

View File

@ -56,7 +56,7 @@ TRACE_1("Starting wire-cut action PFEH",_interactionType);
if ([_x] call FUNC(isFence)) then { if ([_x] call FUNC(isFence)) then {
_fencesHelped pushBack _x; _fencesHelped pushBack _x;
_helper = "ACE_LogicDummy" createVehicleLocal (getpos _x); _helper = "ACE_LogicDummy" createVehicleLocal (getpos _x);
_action = [QGVAR(helperCutFence), (localize LSTRING(CutFence)), QUOTE(PATHTOF(ui\wirecutter_ca.paa)), _fncStatement, _fncCondition, {}, _x, [0,0,0], 5] call EFUNC(interact_menu,createAction); _action = [QGVAR(helperCutFence), (localize LSTRING(CutFence)), QUOTE(PATHTOF(ui\wirecutter_ca.paa)), _fncStatement, _fncCondition, {}, _x, {[0,0,0]}, 5.5] call EFUNC(interact_menu,createAction);
[_helper, 0, [],_action] call EFUNC(interact_menu,addActionToObject); [_helper, 0, [],_action] call EFUNC(interact_menu,addActionToObject);
_helper setPosASL ((getPosASL _x) vectorAdd [0,0,1.25]); _helper setPosASL ((getPosASL _x) vectorAdd [0,0,1.25]);
_addedHelpers pushBack _helper; _addedHelpers pushBack _helper;

View File

@ -19,23 +19,14 @@
params ["_object"]; params ["_object"];
TRACE_1("params",_object); TRACE_1("params",_object);
private ["_typeOf", "_returnValue"]; local _typeOf = typeOf _object;
_typeOf = typeOf _object; local _returnValue = if (_typeOf != "") then {
_returnValue = false;
if (_typeOf != "") then {
//If the fence has configEntry we can check it directly //If the fence has configEntry we can check it directly
_returnValue = (1 == (getNumber (configFile >> "CfgVehicles" >> _typeOf >> QGVAR(isFence)))); (1 == (getNumber (configFile >> "CfgVehicles" >> _typeOf >> QGVAR(isFence))));
} else { } else {
//TODO: 1.50 use getModelInfo //Check the p3d name against list (in script_component.hpp)
_typeOf = toLower (str _object); //something like "123201: wall_indfnc_9.p3d" ((getModelInfo _object) select 0) in FENCE_P3DS;
{
if ((_typeOf find _x) != -1) exitWith {
_returnValue = true;
};
nil
} count FENCE_P3DS;
}; };
_returnValue _returnValue

View File

@ -9,7 +9,7 @@
* 2: Magazine is a belt <BOOL> * 2: Magazine is a belt <BOOL>
* *
* Return Value: * Return Value:
* Array in format [ACE_time, isBullet, array of ammo counts] <ARRAY> * Array in format [time, isBullet, array of ammo counts] <ARRAY>
* *
* Example: * Example:
* [10, [1,2,3,8], false] call ace_magazinerepack_fnc_simulateRepackEvents = * [10, [1,2,3,8], false] call ace_magazinerepack_fnc_simulateRepackEvents =

View File

@ -6,22 +6,16 @@ STACK TRACING
//#define DEBUG_EVENTS //#define DEBUG_EVENTS
#ifdef ENABLE_CALLSTACK #ifdef ENABLE_CALLSTACK
#define CALLSTACK(function) {private ['_ret']; if(ACE_IS_ERRORED) then { ['AUTO','AUTO'] call ACE_DUMPSTACK_FNC; ACE_IS_ERRORED = false; }; ACE_IS_ERRORED = true; ACE_STACK_TRACE set [ACE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACE_CURRENT_FUNCTION, 'ANON', _this]]; ACE_STACK_DEPTH = ACE_STACK_DEPTH + 1; ACE_CURRENT_FUNCTION = 'ANON'; _ret = _this call ##function; ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;}
#define CALLSTACK_NAMED(function, functionName) {private ['_ret']; if(ACE_IS_ERRORED) then { ['AUTO','AUTO'] call ACE_DUMPSTACK_FNC; ACE_IS_ERRORED = false; }; ACE_IS_ERRORED = true; ACE_STACK_TRACE set [ACE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACE_CURRENT_FUNCTION, functionName, _this]]; ACE_STACK_DEPTH = ACE_STACK_DEPTH + 1; ACE_CURRENT_FUNCTION = functionName; _ret = _this call ##function; ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;}
#define DUMPSTACK ([__FILE__, __LINE__] call ACE_DUMPSTACK_FNC)
#define CALLSTACK(function) {private ['_ret']; if(ACE_IS_ERRORED) then { ['AUTO','AUTO'] call ACE_DUMPSTACK_FNC; ACE_IS_ERRORED = false; }; ACE_IS_ERRORED = true; ACE_STACK_TRACE set [ACE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACE_CURRENT_FUNCTION, 'ANON', _this]]; ACE_STACK_DEPTH = ACE_STACK_DEPTH + 1; ACE_CURRENT_FUNCTION = 'ANON'; _ret = _this call ##function; ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;} #define FUNC(var1) {private ['_ret']; if(ACE_IS_ERRORED) then { ['AUTO','AUTO'] call ACE_DUMPSTACK_FNC; ACE_IS_ERRORED = false; }; ACE_IS_ERRORED = true; ACE_STACK_TRACE set [ACE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACE_CURRENT_FUNCTION, 'TRIPLES(ADDON,fnc,var1)', _this]]; ACE_STACK_DEPTH = ACE_STACK_DEPTH + 1; ACE_CURRENT_FUNCTION = 'TRIPLES(ADDON,fnc,var1)'; _ret = _this call TRIPLES(ADDON,fnc,var1); ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;}
#define CALLSTACK_NAMED(function, functionName) {private ['_ret']; if(ACE_IS_ERRORED) then { ['AUTO','AUTO'] call ACE_DUMPSTACK_FNC; ACE_IS_ERRORED = false; }; ACE_IS_ERRORED = true; ACE_STACK_TRACE set [ACE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACE_CURRENT_FUNCTION, functionName, _this]]; ACE_STACK_DEPTH = ACE_STACK_DEPTH + 1; ACE_CURRENT_FUNCTION = functionName; _ret = _this call ##function; ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;} #define EFUNC(var1,var2) {private ['_ret']; if(ACE_IS_ERRORED) then { ['AUTO','AUTO'] call ACE_DUMPSTACK_FNC; ACE_IS_ERRORED = false; }; ACE_IS_ERRORED = true; ACE_STACK_TRACE set [ACE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACE_CURRENT_FUNCTION, 'TRIPLES(DOUBLES(PREFIX,var1),fnc,var2)', _this]]; ACE_STACK_DEPTH = ACE_STACK_DEPTH + 1; ACE_CURRENT_FUNCTION = 'TRIPLES(DOUBLES(PREFIX,var1),fnc,var2)'; _ret = _this call TRIPLES(DOUBLES(PREFIX,var1),fnc,var2); ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;}
#define DUMPSTACK ([__FILE__, __LINE__] call ACE_DUMPSTACK_FNC)
#define FUNC(var1) {private ['_ret']; if(ACE_IS_ERRORED) then { ['AUTO','AUTO'] call ACE_DUMPSTACK_FNC; ACE_IS_ERRORED = false; }; ACE_IS_ERRORED = true; ACE_STACK_TRACE set [ACE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACE_CURRENT_FUNCTION, 'TRIPLES(ADDON,fnc,var1)', _this]]; ACE_STACK_DEPTH = ACE_STACK_DEPTH + 1; ACE_CURRENT_FUNCTION = 'TRIPLES(ADDON,fnc,var1)'; _ret = _this call TRIPLES(ADDON,fnc,var1); ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;}
#define EFUNC(var1,var2) {private ['_ret']; if(ACE_IS_ERRORED) then { ['AUTO','AUTO'] call ACE_DUMPSTACK_FNC; ACE_IS_ERRORED = false; }; ACE_IS_ERRORED = true; ACE_STACK_TRACE set [ACE_STACK_DEPTH, [diag_tickTime, __FILE__, __LINE__, ACE_CURRENT_FUNCTION, 'TRIPLES(DOUBLES(PREFIX,var1),fnc,var2)', _this]]; ACE_STACK_DEPTH = ACE_STACK_DEPTH + 1; ACE_CURRENT_FUNCTION = 'TRIPLES(DOUBLES(PREFIX,var1),fnc,var2)'; _ret = _this call TRIPLES(DOUBLES(PREFIX,var1),fnc,var2); ACE_STACK_DEPTH = ACE_STACK_DEPTH - 1; ACE_IS_ERRORED = false; _ret;}
#else #else
#define CALLSTACK(function) function #define CALLSTACK(function) function
#define CALLSTACK_NAMED(function, functionName) function #define CALLSTACK_NAMED(function, functionName) function
#define DUMPSTACK #define DUMPSTACK
#define FUNC(var1) TRIPLES(ADDON,fnc,var1)
#define EFUNC(var1,var2) TRIPLES(DOUBLES(PREFIX,var1),fnc,var2)
#endif #endif

View File

@ -1,17 +1,9 @@
#include "\x\cba\addons\main\script_macros_common.hpp" #include "\x\cba\addons\main\script_macros_common.hpp"
#include "\x\cba\addons\xeh\script_xeh.hpp" #include "\x\cba\addons\xeh\script_xeh.hpp"
//Faster Array Unwraping (skips the IS_ARRAY check normaly found in EXPLODE_1_SYS)
#undef EXPLODE_2_SYS
#define EXPLODE_1_SYS_FAST(ARRAY,A) A =(ARRAY) select 0
#define EXPLODE_2_SYS(ARRAY,A,B) EXPLODE_1_SYS_FAST(ARRAY,A); B = (ARRAY) select 1
// Default versioning level // Default versioning level
#define DEFAULT_VERSIONING_LEVEL 2 #define DEFAULT_VERSIONING_LEVEL 2
#define EGVAR(module,var) TRIPLES(PREFIX,module,var)
#define QEGVAR(module,var) QUOTE(EGVAR(module,var))
#define DGVAR(varName) if(isNil "ACE_DEBUG_NAMESPACE") then { ACE_DEBUG_NAMESPACE = []; }; if(!(QUOTE(GVAR(varName)) in ACE_DEBUG_NAMESPACE)) then { PUSH(ACE_DEBUG_NAMESPACE, QUOTE(GVAR(varName))); }; GVAR(varName) #define DGVAR(varName) if(isNil "ACE_DEBUG_NAMESPACE") then { ACE_DEBUG_NAMESPACE = []; }; if(!(QUOTE(GVAR(varName)) in ACE_DEBUG_NAMESPACE)) then { PUSH(ACE_DEBUG_NAMESPACE, QUOTE(GVAR(varName))); }; GVAR(varName)
#define DVAR(varName) if(isNil "ACE_DEBUG_NAMESPACE") then { ACE_DEBUG_NAMESPACE = []; }; if(!(QUOTE(varName) in ACE_DEBUG_NAMESPACE)) then { PUSH(ACE_DEBUG_NAMESPACE, QUOTE(varName)); }; varName #define DVAR(varName) if(isNil "ACE_DEBUG_NAMESPACE") then { ACE_DEBUG_NAMESPACE = []; }; if(!(QUOTE(varName) in ACE_DEBUG_NAMESPACE)) then { PUSH(ACE_DEBUG_NAMESPACE, QUOTE(varName)); }; varName
#define DFUNC(var1) TRIPLES(ADDON,fnc,var1) #define DFUNC(var1) TRIPLES(ADDON,fnc,var1)
@ -22,14 +14,6 @@
#define PATHTOEF(var1,var2) PATHTOF_SYS(PREFIX,var1,var2) #define PATHTOEF(var1,var2) PATHTOF_SYS(PREFIX,var1,var2)
#ifndef STRING_MACROS_GUARD
#define STRING_MACROS_GUARD
#define LSTRING(var1) QUOTE(TRIPLES(STR,ADDON,var1))
#define ELSTRING(var1,var2) QUOTE(TRIPLES(STR,DOUBLES(PREFIX,var1),var2))
#define CSTRING(var1) QUOTE(TRIPLES($STR,ADDON,var1))
#define ECSTRING(var1,var2) QUOTE(TRIPLES($STR,DOUBLES(PREFIX,var1),var2))
#endif
#define GETVAR_SYS(var1,var2) getVariable [ARR_2(QUOTE(var1),var2)] #define GETVAR_SYS(var1,var2) getVariable [ARR_2(QUOTE(var1),var2)]
#define SETVAR_SYS(var1,var2) setVariable [ARR_2(QUOTE(var1),var2)] #define SETVAR_SYS(var1,var2) setVariable [ARR_2(QUOTE(var1),var2)]
#define SETPVAR_SYS(var1,var2) setVariable [ARR_3(QUOTE(var1),var2,true)] #define SETPVAR_SYS(var1,var2) setVariable [ARR_3(QUOTE(var1),var2,true)]

View File

@ -5,13 +5,11 @@
#define MAJOR 3 #define MAJOR 3
#define MINOR 3 #define MINOR 3
#define PATCHLVL 2 #define PATCHLVL 3
#define BUILD 0 #define BUILD 0
#define VERSION MAJOR.MINOR.PATCHLVL.BUILD #define VERSION MAJOR.MINOR.PATCHLVL.BUILD
#define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD #define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD
#define ACE_TAG A.C.E.
// MINIMAL required version for the Mod. Components can specify others.. // MINIMAL required version for the Mod. Components can specify others..
#define REQUIRED_VERSION 0.5 #define REQUIRED_VERSION 1.52

View File

@ -6,7 +6,7 @@ class CfgAmmo {
class F_20mm_White: FlareBase {}; class F_20mm_White: FlareBase {};
class ACE_FlashlightProxy_White: F_20mm_White { class ACE_FlashlightProxy_White: F_20mm_White {
model = ""; model = "\A3\Weapons_f\empty";
effectFlare = "FlareShell"; effectFlare = "FlareShell";
triggerTime = 0; triggerTime = 0;

View File

@ -1,5 +1,22 @@
#include "script_component.hpp" #include "script_component.hpp"
//Delete map glow lights from disconnecting players #2810
if (isServer) then {
addMissionEventHandler ["HandleDisconnect",{
params ["_disconnectedPlayer"];
if ((!GVAR(mapGlow)) || {isNull _disconnectedPlayer}) exitWith {};
{
if (_x isKindOf "ACE_FlashlightProxy_White") then {
// ACE_LOGINFO_2("Deleting leftover light [%1:%2] from DC player [%3]", _x, typeOf _x, _disconnectedPlayer);
deleteVehicle _x;
};
} forEach attachedObjects _disconnectedPlayer;
nil
}];
};
// Exit on Headless as well // Exit on Headless as well
if (!hasInterface) exitWith {}; if (!hasInterface) exitWith {};

View File

@ -25,7 +25,7 @@ _fnc_blendColor = {
(_c1 select 3) * (1 - _alpha) + (_c2 select 3) * _alpha] (_c1 select 3) * (1 - _alpha) + (_c2 select 3) * _alpha]
}; };
// Ambient light tint depending on ACE_time of day // Ambient light tint depending on time of day
_lightTint = call { _lightTint = call {
if (sunOrMoon == 1.0) exitWith { [0.5,0.5,0.5,1] }; if (sunOrMoon == 1.0) exitWith { [0.5,0.5,0.5,1] };
if (sunOrMoon > 0.80) exitWith { [[1.0 - overcast,0.2,0,1], [1,1,1,1], (sunOrMoon - 0.8)/0.2] call _fnc_blendColor }; if (sunOrMoon > 0.80) exitWith { [[1.0 - overcast,0.2,0,1], [1,1,1,1], (sunOrMoon - 0.8)/0.2] call _fnc_blendColor };

View File

@ -283,10 +283,12 @@
<Key ID="STR_ACE_Map_DefaultChannel_DisplayName"> <Key ID="STR_ACE_Map_DefaultChannel_DisplayName">
<English>Set Channel At Start</English> <English>Set Channel At Start</English>
<Polish>Ust. domyślny kanał</Polish> <Polish>Ust. domyślny kanał</Polish>
<Portuguese>Definir canal no início</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_Map_DefaultChannel_Description"> <Key ID="STR_ACE_Map_DefaultChannel_Description">
<English>Change the starting marker channel at mission start</English> <English>Change the starting marker channel at mission start</English>
<Polish>Ustaw domyślny kanał dla markerów przy starcie misji</Polish> <Polish>Ustaw domyślny kanał dla markerów przy starcie misji</Polish>
<Portuguese>Muda o canal do marcador no início da missão</Portuguese>
</Key> </Key>
</Package> </Package>
</Project> </Project>

View File

@ -3,96 +3,127 @@
<Package name="map_gestures"> <Package name="map_gestures">
<Key ID="STR_ACE_map_gestures_moduleSettings_displayName"> <Key ID="STR_ACE_map_gestures_moduleSettings_displayName">
<English>Map Gestures</English> <English>Map Gestures</English>
<Portuguese>Gestos no mapa</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_enabled_displayName"> <Key ID="STR_ACE_map_gestures_enabled_displayName">
<English>Enabled</English> <English>Enabled</English>
<Portuguese>Ativado</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_maxRange_displayName"> <Key ID="STR_ACE_map_gestures_maxRange_displayName">
<English>Map Gesture Max Range</English> <English>Map Gesture Max Range</English>
<Portuguese>Distância para gestos no mapa</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_maxRange_description"> <Key ID="STR_ACE_map_gestures_maxRange_description">
<English>Max range between players to show the map gesture indicator [default: 7 meters]</English> <English>Max range between players to show the map gesture indicator [default: 7 meters]</English>
<Portuguese>Distância max. entre os jogadores para mostrar o indicador de gesto no mapa [padrão: 7 metros]</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_defaultLeadAlpha_displayName"> <Key ID="STR_ACE_map_gestures_defaultLeadAlpha_displayName">
<English>Lead Default Alpha</English> <English>Lead Default Alpha</English>
<Portuguese>Transparência padrão do líder</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_defaultLeadAlpha_description"> <Key ID="STR_ACE_map_gestures_defaultLeadAlpha_description">
<English>Fallback Alpha value for group leaders.</English> <English>Fallback Alpha value for group leaders.</English>
<Portuguese>Valor de transparência alternativo para líderes de grupo</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_defaultAlpha_displayName"> <Key ID="STR_ACE_map_gestures_defaultAlpha_displayName">
<English>Default Alpha</English> <English>Default Alpha</English>
<Portuguese>Transparência padrão</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_defaultAlpha_descriptions"> <Key ID="STR_ACE_map_gestures_defaultAlpha_descriptions">
<English>Fallback Alpha value.</English> <English>Fallback Alpha value.</English>
<Portuguese>Valor alternativo de transparência</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_defaultLeadColor_displayName"> <Key ID="STR_ACE_map_gestures_defaultLeadColor_displayName">
<English>Lead Default Color</English> <English>Lead Default Color</English>
<Portuguese>Cor padrão para o líder</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_defaultLeadColor_description"> <Key ID="STR_ACE_map_gestures_defaultLeadColor_description">
<English>Fallback Color value for group leaders.</English> <English>Fallback Color value for group leaders.</English>
<Portuguese>Valor de cor alternativa para líderes de grupo</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_defaultColor_displayName"> <Key ID="STR_ACE_map_gestures_defaultColor_displayName">
<English>Default Color</English> <English>Default Color</English>
<Portuguese>Cor padrão</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_defaultColor_description"> <Key ID="STR_ACE_map_gestures_defaultColor_description">
<English>Fallback Color value.</English> <English>Fallback Color value.</English>
<Portuguese>Valor alternativo de cor</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_leadAlpha_displayName"> <Key ID="STR_ACE_map_gestures_leadAlpha_displayName">
<English>Lead Alpha</English> <English>Lead Alpha</English>
<Portuguese>Transparência do líder</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_leadAlpha_description"> <Key ID="STR_ACE_map_gestures_leadAlpha_description">
<English>Alpha value for group leaders of groups synced with this module.</English> <English>Alpha value for group leaders of groups synced with this module.</English>
<Portuguese>Valor de transparência para líderes de grupo sincronizados com este módulo.</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_alpha_displayName"> <Key ID="STR_ACE_map_gestures_alpha_displayName">
<English>Alpha</English> <English>Alpha</English>
<Portuguese>Transparência</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_alpha_description"> <Key ID="STR_ACE_map_gestures_alpha_description">
<English>Alpha value for group members of groups synced with this module.</English> <English>Alpha value for group members of groups synced with this module.</English>
<Portuguese>Valor de transparência para membros de grupo sincronizados com este módulo.</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_leadColor_displayName"> <Key ID="STR_ACE_map_gestures_leadColor_displayName">
<English>Lead Color</English> <English>Lead Color</English>
<Portuguese>Cor do líder</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_leadColor_description"> <Key ID="STR_ACE_map_gestures_leadColor_description">
<English>Color value for group leaders of groups synced with this module.</English> <English>Color value for group leaders of groups synced with this module.</English>
<Portuguese>Valor de cor para líderes de grupo sincronizados com este módulo.</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_color_displayName"> <Key ID="STR_ACE_map_gestures_color_displayName">
<English>Color</English> <English>Color</English>
<Portuguese>Cor</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_color_description"> <Key ID="STR_ACE_map_gestures_color_description">
<English>Color value for group members of groups synced with this module.</English> <English>Color value for group members of groups synced with this module.</English>
<Portuguese>Valor de cor para membros de grupo sincronizados com este módulo.</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_moduleGroupSettings_displayName"> <Key ID="STR_ACE_map_gestures_moduleGroupSettings_displayName">
<English>Map Gestures - Group Settings</English> <English>Map Gestures - Group Settings</English>
<Portuguese>Gestos no mapa - Definições de Grupo</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_interval_displayName"> <Key ID="STR_ACE_map_gestures_interval_displayName">
<English>Update Interval</English> <English>Update Interval</English>
<Portuguese>Intervalo de atualizações</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_interval_description"> <Key ID="STR_ACE_map_gestures_interval_description">
<English>Time between data updates.</English> <English>Time between data updates.</English>
<Portuguese>Tempo entre atualização de dados</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_GroupColorConfigurations_displayName"> <Key ID="STR_ACE_map_gestures_GroupColorConfigurations_displayName">
<English>Group color configurations</English> <English>Group color configurations</English>
<Portuguese>Configurações de cores de grupo</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_GroupColorConfigurations_description"> <Key ID="STR_ACE_map_gestures_GroupColorConfigurations_description">
<English>Group color configuration containing arrays of color pairs ([leadColor, color]).</English> <English>Group color configuration containing arrays of color pairs ([leadColor, color]).</English>
<Portuguese>Configuração de cores de grupo contendo arrays com pares de cores ([leadColor, color]).</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_GroupColorConfigurationMapping_description"> <Key ID="STR_ACE_map_gestures_GroupColorConfigurationMapping_description">
<English>Hash of Group ID mapped to the Group color configuration index.</English> <English>Hash of Group ID mapped to the Group color configuration index.</English>
<Portuguese>Hashes de ID de grupos mapeados para o índice de configuração de cor de grupos.</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_GroupColorConfigurationMapping_displayName"> <Key ID="STR_ACE_map_gestures_GroupColorConfigurationMapping_displayName">
<English>GroupID Color configuration mapping</English> <English>GroupID Color configuration mapping</English>
<Portuguese>Mapeamento de configuração para cores de GroupID</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_enabled_description"> <Key ID="STR_ACE_map_gestures_enabled_description">
<English>Enables the Map Gestures.</English> <English>Enables the Map Gestures.</English>
<Portuguese>Ativa os gestos no mapa</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_nameTextColor_displayName"> <Key ID="STR_ACE_map_gestures_nameTextColor_displayName">
<English>Name Text Color</English> <English>Name Text Color</English>
<Portuguese>Cor do texto do nome</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_nameTextColor_description"> <Key ID="STR_ACE_map_gestures_nameTextColor_description">
<English>Color of the name tag text besides the map gestures mark.</English> <English>Color of the name tag text besides the map gestures mark.</English>
<Portuguese>Cor do texto da etiqueta de nome que fica embaixo da marcação de gestos no mapa.</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_map_gestures_mapGestures_category"> <Key ID="STR_ACE_map_gestures_mapGestures_category">
<English>Map Gestures</English> <English>Map Gestures</English>
<Portuguese>Gestos no mapa</Portuguese>
</Key> </Key>
</Package> </Package>
</Project> </Project>

View File

@ -154,13 +154,13 @@ class ACE_Settings {
category = CSTRING(Category_Medical); category = CSTRING(Category_Medical);
typeName = "SCALAR"; typeName = "SCALAR";
value = 3; value = 3;
values[] = {"Anywhere", "Medical vehicles", "Medical facility", "vehicle & facility", "Disabled"}; values[] = {CSTRING(AdvancedMedicalSettings_anywhere), CSTRING(AdvancedMedicalSettings_vehicle), CSTRING(AdvancedMedicalSettings_facility), CSTRING(AdvancedMedicalSettings_vehicleAndFacility), ECSTRING(common,Disabled)};
}; };
class GVAR(useLocation_SurgicalKit) { class GVAR(useLocation_SurgicalKit) {
category = CSTRING(Category_Medical); category = CSTRING(Category_Medical);
typeName = "SCALAR"; typeName = "SCALAR";
value = 2; value = 2;
values[] = {"Anywhere", "Medical vehicles", "Medical facility", "vehicle & facility", "Disabled"}; values[] = {CSTRING(AdvancedMedicalSettings_anywhere), CSTRING(AdvancedMedicalSettings_vehicle), CSTRING(AdvancedMedicalSettings_facility), CSTRING(AdvancedMedicalSettings_vehicleAndFacility), ECSTRING(common,Disabled)};
}; };
class GVAR(useCondition_PAK) { class GVAR(useCondition_PAK) {
category = CSTRING(Category_Medical); category = CSTRING(Category_Medical);

View File

@ -70,6 +70,7 @@ PREP(setDead);
PREP(setHitPointDamage); PREP(setHitPointDamage);
PREP(setStructuralDamage); PREP(setStructuralDamage);
PREP(setUnconscious); PREP(setUnconscious);
PREP(translateSelections);
PREP(treatment); PREP(treatment);
PREP(treatment_failure); PREP(treatment_failure);
PREP(treatment_success); PREP(treatment_success);

View File

@ -10,7 +10,7 @@ if (!(_unit getVariable ["ACE_isUnconscious", false])) then {
[_unit, QGVAR(unconscious), false] call EFUNC(common,setCaptivityStatus); [_unit, QGVAR(unconscious), false] call EFUNC(common,setCaptivityStatus);
}; };
// Remove maximum unconsciousness ACE_time handler // Remove maximum unconsciousness time handler
_maxUnconHandle = _unit getVariable [QGVAR(maxUnconTimeHandle), -1]; _maxUnconHandle = _unit getVariable [QGVAR(maxUnconTimeHandle), -1];
if (_maxUnconHandle > 0) then { if (_maxUnconHandle > 0) then {
[_maxUnconHandle] call CBA_fnc_removePerFrameHandler; [_maxUnconHandle] call CBA_fnc_removePerFrameHandler;

View File

@ -5,7 +5,7 @@
* Arguments: * Arguments:
* 0: The unit <OBJECT> * 0: The unit <OBJECT>
* 1: value <NUMBER> * 1: value <NUMBER>
* 2: ACE_time in seconds <NUMBER> * 2: time in seconds <NUMBER>
* 3: callback <CODE> * 3: callback <CODE>
* *
* Return Value: * Return Value:

View File

@ -11,6 +11,9 @@
* ReturnValue: * ReturnValue:
* Can Treat <BOOL> * Can Treat <BOOL>
* *
* Example:
* [player, cursorTarget, "Head", "SurgicalKit"] call ace_medical_fnc_canTreat
*
* Public: Yes * Public: Yes
*/ */
@ -85,10 +88,11 @@ _medVeh = {([_caller] call FUNC(isInMedicalVehicle)) || ([_target] call FUNC(isI
_val = missionNamespace getvariable _x; _val = missionNamespace getvariable _x;
if (typeName _val == "SCALAR") then { if (typeName _val == "SCALAR") then {
_return = switch (_val) do { _return = switch (_val) do {
case 0: {true}; case 0: {true}; //AdvancedMedicalSettings_anywhere
case 1: _medVeh; case 1: {call _medVeh}; //AdvancedMedicalSettings_vehicle
case 2: _medFacility; case 2: {call _medFacility}; //AdvancedMedicalSettings_facility
case 3: {call _medFacility || call _medVeh}; case 3: {(call _medFacility) || {call _medVeh}}; //AdvancedMedicalSettings_vehicleAndFacility
default {false}; //Disabled
}; };
}; };
}; };

View File

@ -45,12 +45,9 @@ _createLitter = {
if(surfaceIsWater (getPos _unit)) exitWith { false }; if(surfaceIsWater (getPos _unit)) exitWith { false };
_position = getPosATL _unit; _position = getPosATL _unit;
_position params ["_posX", "_posY"]; _position params ["_posX", "_posY", "_posZ"];
_position = if (random(1) >= 0.5) then { _position = [_posX + (random 2) - 1, _posY + (random 2) - 1, _posZ];
[_posX + random 1, _posY + random 1, 0]
} else {
[_posX - random 1, _posY - random 1, 0];
};
_direction = (random 360); _direction = (random 360);
// Create the litter, and timeout the event based on the cleanup delay // Create the litter, and timeout the event based on the cleanup delay

View File

@ -54,7 +54,7 @@ if (_show) then {
_allInjuryTexts = []; _allInjuryTexts = [];
_genericMessages = []; _genericMessages = [];
if (GVAR(level) >= 2) then { if (GVAR(level) >= 2 && {([_unit] call FUNC(hasMedicalEnabled))}) then {
_partText = [LSTRING(Head), LSTRING(Torso), LSTRING(LeftArm) ,LSTRING(RightArm) ,LSTRING(LeftLeg), LSTRING(RightLeg)] select _selectionN; _partText = [LSTRING(Head), LSTRING(Torso), LSTRING(LeftArm) ,LSTRING(RightArm) ,LSTRING(LeftLeg), LSTRING(RightLeg)] select _selectionN;
_genericMessages pushback [localize _partText, [1, 1, 1, 1]]; _genericMessages pushback [localize _partText, [1, 1, 1, 1]];
}; };
@ -87,7 +87,7 @@ if (_show) then {
_damaged = [false, false, false, false, false, false]; _damaged = [false, false, false, false, false, false];
_selectionBloodLoss = [0,0,0,0,0,0]; _selectionBloodLoss = [0,0,0,0,0,0];
if (GVAR(level) >= 2) then { if (GVAR(level) >= 2 && {([_target] call FUNC(hasMedicalEnabled))}) then {
_openWounds = _target getvariable [QGVAR(openWounds), []]; _openWounds = _target getvariable [QGVAR(openWounds), []];
private "_amountOf"; private "_amountOf";
{ {

View File

@ -16,7 +16,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_unit", "_selection", "_damage", "_shooter", "_projectile"]; params ["_unit", "_selection", "_damage", "_shooter", "_projectile", "_hitPointIndex"];
TRACE_5("ACE_DEBUG: HandleDamage Called",_unit, _selection, _damage, _shooter, _projectile); TRACE_5("ACE_DEBUG: HandleDamage Called",_unit, _selection, _damage, _shooter, _projectile);
// bug, apparently can fire for remote units in special cases // bug, apparently can fire for remote units in special cases
@ -39,6 +39,13 @@ TRACE_3("ACE_DEBUG: HandleDamage",_selection,_damage,_unit);
if (_selection == "hands") exitWith {_unit getHit "hands"}; if (_selection == "hands") exitWith {_unit getHit "hands"};
if (_selection == "legs") exitWith {_unit getHit "legs"}; if (_selection == "legs") exitWith {_unit getHit "legs"};
// Deal with the new hitpoint and selection names introduced with Arma v1.50 and later.
// This will convert new selection names into selection names that the medical system understands
// TODO This should be cleaned up when we revisit the medical system at a later stage
// and instead we should deal with the new hitpoints directly
_selection = [_unit, _selection, _hitPointIndex] call FUNC(translateSelections);
_this set [1, _selection]; // ensure that the parameters are set correctly
// If the damage is being weird, we just tell it to fuck off. Ignore: "hands", "legs", "?" // If the damage is being weird, we just tell it to fuck off. Ignore: "hands", "legs", "?"
if (_selection != "" && {!(_selection in GVAR(SELECTIONS))}) exitWith {0}; //@todo "neck", "pelvis", "spine1", "spine2", "spine3" if (_selection != "" && {!(_selection in GVAR(SELECTIONS))}) exitWith {0}; //@todo "neck", "pelvis", "spine1", "spine2", "spine3"

View File

@ -19,7 +19,7 @@
params ["_target", "_player", "_selectionN", "_actionData"]; params ["_target", "_player", "_selectionN", "_actionData"];
if (GVAR(level) < 2) exitwith { if (GVAR(level) < 2 || {!([_target] call FUNC(hasMedicalEnabled))}) exitwith {
private ["_pointDamage"]; private ["_pointDamage"];
_pointDamage = (_target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]) select _selectionN; _pointDamage = (_target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]) select _selectionN;

View File

@ -7,7 +7,7 @@
* 1: Medication Treatment classname <STRING> * 1: Medication Treatment classname <STRING>
* 2: The medication treatment variablename <STRING> * 2: The medication treatment variablename <STRING>
* 3: Max dosage <NUMBER> * 3: Max dosage <NUMBER>
* 4: The ACE_time in the system <NUMBER> * 4: The time in the system <NUMBER>
* 5: Incompatable medication <ARRAY<STRING>> * 5: Incompatable medication <ARRAY<STRING>>
* *
* Return Value: * Return Value:

View File

@ -1,7 +1,7 @@
/* /*
* Author: Glowbal * Author: Glowbal
* Play the injured sound for a unit if the unit is damaged. The sound broadcasted across MP. * Play the injured sound for a unit if the unit is damaged. The sound broadcasted across MP.
* Will not play if the unit has already played a sound within to close a ACE_time frame. * Will not play if the unit has already played a sound within to close a time frame.
* Delay: With minimal damage (below 1), the delay is (10 + random(50)) seconds. Otherwise it is 60 seconds / damage. * Delay: With minimal damage (below 1), the delay is (10 + random(50)) seconds. Otherwise it is 60 seconds / damage.
* *
* Arguments: * Arguments:

View File

@ -5,7 +5,7 @@
* Arguments: * Arguments:
* 0: The unit that will be put in an unconscious state <OBJECT> * 0: The unit that will be put in an unconscious state <OBJECT>
* 1: Set unconsciouns <BOOL> (default: true) * 1: Set unconsciouns <BOOL> (default: true)
* 2: Minimum unconscious ACE_time <NUMBER> (default: (round(random(10)+5))) * 2: Minimum unconscious time <NUMBER> (default: (round(random(10)+5)))
* 3: Force AI Unconscious (skip random death chance) <BOOL> (default: false) * 3: Force AI Unconscious (skip random death chance) <BOOL> (default: false)
* *
* ReturnValue: * ReturnValue:

View File

@ -0,0 +1,63 @@
/*
* Author: Glowbal
* Translate selection names into medical usable hit selection names.
* Aims to deal with the new hitpoint system introduced in Arma3 v1.50 and later.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: selection name <STRING>
* 2: HitPoint Index <SCALAR>
*
* Return Value:
* translated selection name <STRING>
*
* Example:
* [bob, "pelvis", 4] call ace_medical_fnc_translateSelections
* Returns "body"
*
* Public: No
*/
#include "script_component.hpp"
#define HEAD_SELECTIONS ["face_hub", "neck", "head"]
#define HEAD_HITPOINTS ["hitface", "hitneck", "hithead"]
#define TORSO_SELECTIONS ["pelvis", "spine1", "spine2", "spine3", "body"]
#define TORSO_HITPOINTS ["hitpelvis", "hitabdomen", "hitdiaphragm", "hitchest", "hitbody"]
#define L_ARM_SELECTIONS ["hand_l"]
#define L_ARM_HITPOINTS ["hitleftarm", "hand_l"]
#define R_ARM_SELECTIONS ["hand_r"]
#define R_ARM_HITPOINTS ["hitrightarm", "hand_r"]
#define L_LEG_SELECTIONS ["leg_l"]
#define L_LEG_HITPOINTS ["hitleftleg", "leg_l"]
#define R_LEG_SELECTIONS ["leg_r"]
#define R_LEG_HITPOINTS ["hitrightleg", "leg_r"]
params ["_unit", "_selection", "_hitPointIndex"];
if (_selection == "") exitWith {""};
if (_selection in HEAD_SELECTIONS) exitWith {"head"};
if (_selection in TORSO_SELECTIONS) exitWith {"body"};
// Not necessary unless we get more hitpoints variants in an next arma update
/*if (_selection in L_ARM_SELECTIONS) exitwith {"hand_l"};
if (_selection in R_ARM_SELECTIONS) exitwith {"hand_r"};
if (_selection in L_LEG_SELECTIONS) exitwith {"leg_l"};
if (_selection in R_LEG_SELECTIONS) exitwith {"leg_r"};*/
//Backup method to detect weird selections/hitpoints
if ((_selection == "?") || {!(_selection in GVAR(SELECTIONS))}) exitWith {
if (_hitPointIndex < 0) exitWith {_selection};
local _hitPoint = toLower configName ((configProperties [(configFile >> "CfgVehicles" >> (typeOf _unit) >> "HitPoints")]) select _hitPointIndex);
TRACE_4("Weird sel/hit", _unit, _selection, _hitPointIndex, _hitPoint);
if (_hitPoint in HEAD_HITPOINTS) exitWith {"head"};
if (_hitPoint in TORSO_HITPOINTS) exitWith {"body"};
if (_hitPoint in L_ARM_HITPOINTS) exitWith {"hand_l"};
if (_hitPoint in R_ARM_HITPOINTS) exitWith {"hand_r"};
if (_hitPoint in L_LEG_HITPOINTS) exitWith {"leg_l"};
if (_hitPoint in R_LEG_HITPOINTS) exitWith {"leg_r"};
_selection
};
_selection;

View File

@ -100,10 +100,11 @@ if ("All" in _locations) then {
_val = missionNamespace getvariable _x; _val = missionNamespace getvariable _x;
if (typeName _val == "SCALAR") then { if (typeName _val == "SCALAR") then {
_return = switch (_val) do { _return = switch (_val) do {
case 0: {true}; case 0: {true}; //AdvancedMedicalSettings_anywhere
case 1: _medVeh; case 1: {call _medVeh}; //AdvancedMedicalSettings_vehicle
case 2: _medFacility; case 2: {call _medFacility}; //AdvancedMedicalSettings_facility
case 3: {call _medFacility || call _medVeh}; case 3: {(call _medFacility) || {call _medVeh}}; //AdvancedMedicalSettings_vehicleAndFacility
default {false}; //Disabled
}; };
}; };
}; };

View File

@ -84,7 +84,7 @@ _resistance = _target getvariable [QGVAR(peripheralResistance), 100];
_resistance = _resistance + _viscosityChange; _resistance = _resistance + _viscosityChange;
_target setvariable [QGVAR(peripheralResistance), _resistance max 0]; _target setvariable [QGVAR(peripheralResistance), _resistance max 0];
// Call back to ensure that the medication is decreased over ACE_time // Call back to ensure that the medication is decreased over time
[_target, _classname, _varName, _maxDose, _timeInSystem, _inCompatableMedication, _viscosityChange, _painReduce] call FUNC(onMedicationUsage); [_target, _classname, _varName, _maxDose, _timeInSystem, _inCompatableMedication, _viscosityChange, _painReduce] call FUNC(onMedicationUsage);
true true

View File

@ -2105,10 +2105,12 @@
<Polish>%1 wykonał cykl RKO</Polish> <Polish>%1 wykonał cykl RKO</Polish>
<Russian>%1 провел сердечно-легочную реанимацию</Russian> <Russian>%1 провел сердечно-легочную реанимацию</Russian>
<Spanish>%1 realicó RCP</Spanish> <Spanish>%1 realicó RCP</Spanish>
<Portuguese>%1 realizou RCP</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_Medical_Activity_fullHeal"> <Key ID="STR_ACE_Medical_Activity_fullHeal">
<English>%1 used Personal Aid Kit</English> <English>%1 used Personal Aid Kit</English>
<Polish>%1 użył apteczki</Polish> <Polish>%1 użył apteczki</Polish>
<Portuguese>%1 utilizou KPS</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_Medical_HeavilyWounded"> <Key ID="STR_ACE_Medical_HeavilyWounded">
<English>Heavily wounded</English> <English>Heavily wounded</English>
@ -2223,6 +2225,7 @@
<Polish>Lecz w pełni zabandażowane hitpointy</Polish> <Polish>Lecz w pełni zabandażowane hitpointy</Polish>
<Spanish>Curar miembros totalmente vendados</Spanish> <Spanish>Curar miembros totalmente vendados</Spanish>
<Russian>Исцелять полностью перебинтованные части тела</Russian> <Russian>Исцелять полностью перебинтованные части тела</Russian>
<Portuguese>Curar hitpoints totalmente enfaixados</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_Medical_painIsOnlySuppressed"> <Key ID="STR_ACE_Medical_painIsOnlySuppressed">
<English>Pain is only temporarily suppressed</English> <English>Pain is only temporarily suppressed</English>
@ -3441,12 +3444,14 @@
<Polish>Lecz hitpointy</Polish> <Polish>Lecz hitpointy</Polish>
<Spanish>Curar puntos de vida</Spanish> <Spanish>Curar puntos de vida</Spanish>
<Russian>Исцелять части тела</Russian> <Russian>Исцелять части тела</Russian>
<Portuguese>Curar hitpoints</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_Medical_AdvancedMedicalSettings_healHitPointAfterAdvBandage_Description"> <Key ID="STR_ACE_Medical_AdvancedMedicalSettings_healHitPointAfterAdvBandage_Description">
<English>Heal fully bandaged hitpoints</English> <English>Heal fully bandaged hitpoints</English>
<Polish>Po bandażowaniu ulecz hitpointy, usuwając z nich ślady krwi i przywracając im pełną sprawność.</Polish> <Polish>Po bandażowaniu ulecz hitpointy, usuwając z nich ślady krwi i przywracając im pełną sprawność.</Polish>
<Spanish>Curar miembros totalmente vendados</Spanish> <Spanish>Curar miembros totalmente vendados</Spanish>
<Russian>Исцелять полностью перебинтованные части тела</Russian> <Russian>Исцелять полностью перебинтованные части тела</Russian>
<Portuguese>Curar totalmente hitpoints enfaixados</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_Medical_AdvancedMedicalSettings_painIsOnlySuppressed_DisplayName"> <Key ID="STR_ACE_Medical_AdvancedMedicalSettings_painIsOnlySuppressed_DisplayName">
<English>Pain suppression</English> <English>Pain suppression</English>
@ -3844,12 +3849,14 @@
<Polish>Ta osoba (%1) jest przytomna i nie może zostać załadowana</Polish> <Polish>Ta osoba (%1) jest przytomna i nie może zostać załadowana</Polish>
<Spanish>Esta persona (%1) está despierto y no puede ser cargado</Spanish> <Spanish>Esta persona (%1) está despierto y no puede ser cargado</Spanish>
<Russian>Боец (%1) в сознании и не может быть погружен</Russian> <Russian>Боец (%1) в сознании и не может быть погружен</Russian>
<Portuguese>Esta pessoa (%1) está acordada e não pode ser carregada</Portuguese>
</Key> </Key>
<Key ID="STR_ACE_Medical_noTourniquetOnBodyPart"> <Key ID="STR_ACE_Medical_noTourniquetOnBodyPart">
<English>There is no tourniquet on this body part!</English> <English>There is no tourniquet on this body part!</English>
<Polish>Na tej części ciała nie ma stazy!</Polish> <Polish>Na tej części ciała nie ma stazy!</Polish>
<Spanish>No hay torniquete en esta parte del cuerpo!</Spanish> <Spanish>No hay torniquete en esta parte del cuerpo!</Spanish>
<Russian>Нет жгута на этой части тела!</Russian> <Russian>Нет жгута на этой части тела!</Russian>
<Portuguese>Não existe nenhum torniquete nesta parte do corpo!</Portuguese>
</Key> </Key>
</Package> </Package>
</Project> </Project>

View File

@ -24,4 +24,10 @@ class ACE_Settings {
isClientSettable = 1; isClientSettable = 1;
category = ECSTRING(medical,Category_Medical); category = ECSTRING(medical,Category_Medical);
}; };
class GVAR(maxRange) {
//for ref: 3d interaction (MEDICAL_ACTION_DISTANCE) is 1.75
value = 3;
typeName = "SCALAR";
category = ECSTRING(medical,Category_Medical);
};
}; };

View File

@ -2,6 +2,10 @@
if (!hasInterface) exitwith {}; if (!hasInterface) exitwith {};
GVAR(MenuPFHID) = -1;
GVAR(lastOpenedOn) = -1;
GVAR(pendingReopen) = false;
["medical_treatmentSuccess", { ["medical_treatmentSuccess", {
if (GVAR(openAfterTreatment) && {GVAR(pendingReopen)}) then { if (GVAR(openAfterTreatment) && {GVAR(pendingReopen)}) then {
@ -15,8 +19,9 @@ if (!hasInterface) exitwith {};
["ACE3 Common", QGVAR(displayMenuKeyPressed), localize LSTRING(DisplayMenuKey), ["ACE3 Common", QGVAR(displayMenuKeyPressed), localize LSTRING(DisplayMenuKey),
{ {
_target = cursorTarget; local _target = cursorTarget;
if (!(_target isKindOf "CAManBase") || ACE_player distance _target > 10) then {_target = ACE_player}; if (!((_target isKindOf "CAManBase") && {[ACE_player, _target] call FUNC(canOpenMenu)})) then {_target = ACE_player};
// Conditions: canInteract // Conditions: canInteract
if !([ACE_player, _target, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; if !([ACE_player, _target, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
if !([ACE_player, _target] call FUNC(canOpenMenu)) exitwith {false}; if !([ACE_player, _target] call FUNC(canOpenMenu)) exitwith {false};
@ -27,7 +32,7 @@ if (!hasInterface) exitwith {};
}, },
{ {
if (ACE_time - GVAR(lastOpenedOn) > 0.5) exitWith { if (ACE_time - GVAR(lastOpenedOn) > 0.5) exitWith {
[ObjNull] call FUNC(openMenu); [objNull] call FUNC(openMenu);
}; };
false false
}, },

View File

@ -10,7 +10,7 @@
* Can open <BOOL> * Can open <BOOL>
* *
* Example: * Example:
* [] call ace_medical_menu_canOpenMenu * [player, cursorTarget] call ace_medical_menu_fnc_canOpenMenu
* *
* Public: No * Public: No
*/ */
@ -18,7 +18,8 @@
params ["_caller", "_target"]; params ["_caller", "_target"];
if !(GVAR(allow) == 1 || (GVAR(allow) == 2 && {vehicle _caller != _caller || vehicle _target != _target} && {alive ACE_player})) exitwith {false}; (alive _caller)
if !(GVAR(useMenu) == 1 || (GVAR(useMenu) == 2 && {vehicle _caller != _caller || vehicle _target != _target} && {alive ACE_player})) exitwith {false}; && {!isNull _target}
&& {((_caller distance _target) < GVAR(maxRange)) || {(vehicle _caller) == (vehicle _target)}} //for now, ignore range when in same vehicle
true && {(GVAR(allow) == 1) || {(GVAR(allow) == 2) && {(vehicle _caller != _caller) || {vehicle _target != _target}}}}
&& {(GVAR(useMenu) == 1) || {(GVAR(useMenu) == 2) && {(vehicle _caller != _caller) || {vehicle _target != _target}}}}

View File

@ -20,7 +20,7 @@ _configBasic = (configFile >> "ACE_Medical_Actions" >> "Basic");
_configAdvanced = (configFile >> "ACE_Medical_Actions" >> "Advanced"); _configAdvanced = (configFile >> "ACE_Medical_Actions" >> "Advanced");
_fnc_compileActionsLevel = { _fnc_compileActionsLevel = {
private ["_entryCount", "_actions", "_displayName", "_condition", "_category", "_statement"]; private ["_actions", "_displayName", "_condition", "_category", "_statement"];
params ["_config"]; params ["_config"];
_actions = []; _actions = [];
@ -40,3 +40,26 @@ _fnc_compileActionsLevel = {
GVAR(actionsBasic) = [_configBasic] call _fnc_compileActionsLevel; GVAR(actionsBasic) = [_configBasic] call _fnc_compileActionsLevel;
GVAR(actionsAdvanced) = [_configAdvanced] call _fnc_compileActionsLevel; GVAR(actionsAdvanced) = [_configAdvanced] call _fnc_compileActionsLevel;
//Manually add the drag actions, if dragging exists.
if (["ace_dragging"] call EFUNC(common,isModLoaded)) then {
_condition = {
(ACE_player != GVAR(INTERACTION_TARGET)) && {[ACE_player, GVAR(INTERACTION_TARGET)] call EFUNC(dragging,canDrag)}
};
_statement = {
GVAR(pendingReopen) = false; //No medical_treatmentSuccess event after drag, so don't want this true
[ACE_player, GVAR(INTERACTION_TARGET)] call EFUNC(dragging,startDrag);
};
GVAR(actionsBasic) pushBack [localize ELSTRING(dragging,Drag), "drag", _condition, _statement];
GVAR(actionsAdvanced) pushBack [localize ELSTRING(dragging,Drag), "drag", _condition, _statement];
_condition = {
(ACE_player != GVAR(INTERACTION_TARGET)) && {[ACE_player, GVAR(INTERACTION_TARGET)] call EFUNC(dragging,canCarry)}
};
_statement = {
GVAR(pendingReopen) = false; //No medical_treatmentSuccess event after drag, so don't want this true
[ACE_player, GVAR(INTERACTION_TARGET)] call EFUNC(dragging,startCarry);
};
GVAR(actionsBasic) pushBack [localize ELSTRING(dragging,Carry), "drag", _condition, _statement];
GVAR(actionsAdvanced) pushBack [localize ELSTRING(dragging,Carry), "drag", _condition, _statement];
};

View File

@ -17,9 +17,10 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private "_actions";
params ["_player", "_target", "_name"]; params ["_player", "_target", "_name"];
private ["_actions", "_collectedActions", "_bodyPart"];
if (!([ACE_player, _target, ["isNotInside"]] call EFUNC(common,canInteractWith))) exitwith {[]}; if (!([ACE_player, _target, ["isNotInside"]] call EFUNC(common,canInteractWith))) exitwith {[]};
_actions = if (EGVAR(medical,level) == 2) then { _actions = if (EGVAR(medical,level) == 2) then {

View File

@ -9,7 +9,7 @@
* None * None
* *
* Example: * Example:
* ["some category"] call ace_medical_menu_handleUI_DisplayOptions * ["some category"] call ace_medical_menu_fnc_handleUI_DisplayOptions
* *
* Public: No * Public: No
*/ */
@ -21,7 +21,7 @@
if (!hasInterface) exitwith{}; if (!hasInterface) exitwith{};
private ["_entries", "_display", "_newTarget", "_card", "_ctrl", "_code"]; private ["_entries", "_display", "_newTarget", "_ctrl", "_code"];
params ["_name"]; params ["_name"];
@ -31,9 +31,11 @@ _display = uiNamespace getVariable QGVAR(medicalMenu);
if (isNil "_display") exitwith {}; // no valid dialog present if (isNil "_display") exitwith {}; // no valid dialog present
if (_name isEqualTo "toggle") exitwith { if (_name isEqualTo "toggle") exitwith {
if (GVAR(INTERACTION_TARGET) != ACE_player) then {
_newTarget = ACE_player; _newTarget = ACE_player;
} else { //If we are on the player, and only if our old target is still valid, switch to it:
if ((GVAR(INTERACTION_TARGET) == ACE_player) &&
{[ACE_player, GVAR(INTERACTION_TARGET_PREVIOUS), ["isNotInside"]] call EFUNC(common,canInteractWith)} &&
{[ACE_player, GVAR(INTERACTION_TARGET_PREVIOUS)] call FUNC(canOpenMenu)}) then {
_newTarget = GVAR(INTERACTION_TARGET_PREVIOUS); _newTarget = GVAR(INTERACTION_TARGET_PREVIOUS);
}; };

View File

@ -9,7 +9,7 @@
* None * None
* *
* Example: * Example:
* [] call ace_medical_menu_handleUI_dropDownTriageCard * [] call ace_medical_menu_fnc_handleUI_dropDownTriageCard
* *
* Public: No * Public: No
*/ */

View File

@ -15,7 +15,7 @@
#include "script_component.hpp" #include "script_component.hpp"
params ["_logic", "_units", "_activated"]; params ["_logic", "", "_activated"];
if !(_activated) exitWith {}; if !(_activated) exitWith {};

View File

@ -9,7 +9,7 @@
* None * None
* *
* Example: * Example:
* call ace_medical_menu_onMenuClosed * call ace_medical_menu_fnc_onMenuClosed
* *
* Public: No * Public: No
*/ */
@ -19,3 +19,4 @@ if (EGVAR(interact_menu,menuBackground)==1) then {[QGVAR(id), false] call EFUNC(
if (EGVAR(interact_menu,menuBackground)==2) then {(uiNamespace getVariable [QEGVAR(interact_menu,menuBackground), displayNull]) closeDisplay 0;}; if (EGVAR(interact_menu,menuBackground)==2) then {(uiNamespace getVariable [QEGVAR(interact_menu,menuBackground), displayNull]) closeDisplay 0;};
[GVAR(MenuPFHID)] call CBA_fnc_removePerFrameHandler; [GVAR(MenuPFHID)] call CBA_fnc_removePerFrameHandler;
GVAR(MenuPFHID) = -1;

View File

@ -9,7 +9,7 @@
* None * None
* *
* Example: * Example:
* [medical_menu] call ace_medical_menu_onMenuOpen * [medical_menu] call ace_medical_menu_fnc_onMenuOpen
* *
* Public: No * Public: No
*/ */
@ -64,6 +64,8 @@ disableSerialization;
(_display displayCtrl 1) ctrlSetText format ["%1", [_target] call EFUNC(common,getName)]; (_display displayCtrl 1) ctrlSetText format ["%1", [_target] call EFUNC(common,getName)];
setMousePosition [0.4, 0.4]; setMousePosition [0.4, 0.4];
if (GVAR(MenuPFHID) != -1) exitWith {ERROR("PFID already running");};
GVAR(MenuPFHID) = [{ GVAR(MenuPFHID) = [{
(_this select 0) params ["_display"]; (_this select 0) params ["_display"];
@ -74,15 +76,15 @@ GVAR(MenuPFHID) = [{
[GVAR(INTERACTION_TARGET)] call FUNC(updateIcons); [GVAR(INTERACTION_TARGET)] call FUNC(updateIcons);
[GVAR(LatestDisplayOptionMenu)] call FUNC(handleUI_DisplayOptions); [GVAR(LatestDisplayOptionMenu)] call FUNC(handleUI_DisplayOptions);
_status = [GVAR(INTERACTION_TARGET)] call EFUNC(medical,getTriageStatus); //Check that it's valid to stay open:
(_display displayCtrl 2000) ctrlSetText (_status select 0); if !(([ACE_player, _target, ["isNotInside"]] call EFUNC(common,canInteractWith)) && {[ACE_player, _target] call FUNC(canOpenMenu)}) then {
(_display displayCtrl 2000) ctrlSetBackgroundColor (_status select 2);
if (ACE_player distance _target > MAX_DISTANCE) exitwith {
closeDialog 314412; closeDialog 314412;
["displayTextStructured", [ACE_player], [[ELSTRING(medical,DistanceToFar), [_target] call EFUNC(common,getName)], 1.75, ACE_player]] call EFUNC(common,targetEvent); //If we failed because of distance check, show UI message:
if ((ACE_player distance GVAR(INTERACTION_TARGET)) > GVAR(maxRange)) then {
["displayTextStructured", [ACE_player], [[ELSTRING(medical,DistanceToFar), [GVAR(INTERACTION_TARGET)] call EFUNC(common,getName)], 1.75, ACE_player]] call EFUNC(common,targetEvent);
};
}; };
}, 0, [_display]] call CBA_fnc_addPerFrameHandler; }, 0, [_display]] call CBA_fnc_addPerFrameHandler;
["Medical_onMenuOpen", [ACE_player, _interactionTarget]] call EFUNC(common,localEvent); ["Medical_onMenuOpen", [ACE_player, _target]] call EFUNC(common,localEvent);

View File

@ -9,7 +9,7 @@
* If action was taken <BOOL> * If action was taken <BOOL>
* *
* Example: * Example:
* [some_player] call ace_medical_menu_openMenu * [some_player] call ace_medical_menu_fnc_openMenu
* *
* Public: No * Public: No
*/ */
@ -17,7 +17,7 @@
params ["_interactionTarget"]; params ["_interactionTarget"];
if (dialog || isNull _interactionTarget) exitwith { if (dialog || {isNull _interactionTarget}) exitwith {
disableSerialization; disableSerialization;
private ["_display", "_handled"]; private ["_display", "_handled"];

View File

@ -10,7 +10,7 @@
* None * None
* *
* Example: * Example:
* [some_display, log] call ace_medical_menu_updateActivityLog * [some_display, log] call ace_medical_menu_fnc_updateActivityLog
* *
* Public: No * Public: No
*/ */
@ -24,7 +24,7 @@ _logCtrl = _display displayCtrl 214;
lbClear _logCtrl; lbClear _logCtrl;
{ {
_x params ["_message", "_moment", "_dummy", "_arguments"]; _x params ["_message", "_moment", "", "_arguments"];
if (isLocalized _message) then { if (isLocalized _message) then {
_message = localize _message; _message = localize _message;

View File

@ -4,22 +4,23 @@
* *
* Arguments: * Arguments:
* 0: selection bloodloss <ARRAY> * 0: selection bloodloss <ARRAY>
* 1: display <DISPLAY> * 1: damaged (array of bools) <ARRAY>
* 2: display <DISPLAY>
* *
* Return Value: * Return Value:
* None * None
* *
* Example: * Example:
* [0.3, some_display] call ace_medical_menu_updateBodyImage * [0.3, some_display] call ace_medical_menu_fnc_updateBodyImage
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_selectionBloodLoss", "_display"]; params ["_selectionBloodLoss", "_damaged", "_display"];
// Handle the body image coloring // Handle the body image coloring
_availableSelections = [50, 51, 52, 53, 54, 55]; local _availableSelections = [50, 51, 52, 53, 54, 55];
{ {
private ["_red", "_green", "_blue"]; private ["_red", "_green", "_blue"];

View File

@ -9,7 +9,7 @@
* None * None
* *
* Example: * Example:
* [] call ace_medical_menu_updateIcons * [] call ace_medical_menu_fnc_updateIcons
* *
* Public: No * Public: No
*/ */
@ -18,7 +18,7 @@
#define START_IDC 111 #define START_IDC 111
#define END_IDC 118 #define END_IDC 118
private ["_display", "_idc", "_options", "_name", "_amount"]; private ["_display", "_idc", "_options", "_amount"];
disableSerialization; disableSerialization;

View File

@ -14,7 +14,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private "_lbCtrl"; private ["_lbCtrl", "_amountOfGeneric"];
params ["_display", "_genericMessages", "_allInjuryTexts"]; params ["_display", "_genericMessages", "_allInjuryTexts"];
@ -28,7 +28,7 @@ lbClear _lbCtrl;
_amountOfGeneric = count _genericMessages; _amountOfGeneric = count _genericMessages;
{ {
_x params ["_add", "_Color"]; _x params ["_add", "_color"];
_lbCtrl lbAdd _add; _lbCtrl lbAdd _add;
_lbCtrl lbSetColor [_forEachIndex + _amountOfGeneric, _color]; _lbCtrl lbSetColor [_forEachIndex + _amountOfGeneric, _color];
} forEach _allInjuryTexts; } forEach _allInjuryTexts;

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