mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge remote-tracking branch 'refs/remotes/acemod/master' into rearm
This commit is contained in:
commit
fd2fd3241e
@ -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
|
||||||
|
@ -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)
|
||||||
|
22
README.md
22
README.md
@ -1,30 +1,35 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="https://github.com/acemod/ACE3/blob/master/extras/assets/logo/black/ACE3-Logo.jpg" width="480">
|
<img src="https://github.com/acemod/ACE3/blob/master/extras/assets/logo/black/ACE3-Logo.jpg" width="480">
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://github.com/acemod/ACE3/releases">
|
<a href="https://github.com/acemod/ACE3/releases">
|
||||||
<img src="https://img.shields.io/badge/Version-3.3.2-blue.svg" alt="ACE3 Version">
|
<img src="https://img.shields.io/badge/Version-3.3.2-blue.svg?style=flat-square" alt="ACE3 Version">
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/acemod/ACE3/releases/download/v3.3.2/ace3_3.3.2.zip">
|
<a href="https://github.com/acemod/ACE3/releases/download/v3.3.2/ace3_3.3.2.zip">
|
||||||
<img src="https://img.shields.io/badge/Download-65.7_MB-green.svg" alt="ACE3 Download">
|
<img src="https://img.shields.io/badge/Download-65.7_MB-green.svg?style=flat-square" alt="ACE3 Download">
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/acemod/ACE3/issues">
|
<a href="https://github.com/acemod/ACE3/issues">
|
||||||
<img src="https://img.shields.io/github/issues-raw/acemod/ACE3.svg?label=Issues" alt="ACE3 Issues">
|
<img src="https://img.shields.io/github/issues-raw/acemod/ACE3.svg?style=flat-square&label=Issues" alt="ACE3 Issues">
|
||||||
</a>
|
</a>
|
||||||
<a href="https://forums.bistudio.com/topic/181341-ace3-a-collaborative-merger-between-agm-cse-and-ace/?p=2859670">
|
<a href="https://forums.bistudio.com/topic/181341-ace3-a-collaborative-merger-between-agm-cse-and-ace/?p=2859670">
|
||||||
<img src="https://img.shields.io/badge/BIF-Thread-lightgrey.svg" alt="BIF Thread">
|
<img src="https://img.shields.io/badge/BIF-Thread-lightgrey.svg?style=flat-square" alt="BIF Thread">
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/acemod/ACE3/blob/master/LICENSE">
|
<a href="https://github.com/acemod/ACE3/blob/master/LICENSE">
|
||||||
<img src="https://img.shields.io/badge/License-GPLv2-red.svg" alt="ACE3 License">
|
<img src="https://img.shields.io/badge/License-GPLv2-red.svg?style=flat-square" alt="ACE3 License">
|
||||||
</a>
|
</a>
|
||||||
<a href="http://slackin.ace3mod.com/">
|
<a href="http://slackin.ace3mod.com/">
|
||||||
<img src="http://slackin.ace3mod.com/badge.svg" alt="ACE3 Slack">
|
<img src="http://slackin.ace3mod.com/badge.svg?style=flat-square&label=Slack" alt="ACE3 Slack">
|
||||||
</a>
|
</a>
|
||||||
<a href="https://travis-ci.org/acemod/ACE3">
|
<a href="https://travis-ci.org/acemod/ACE3">
|
||||||
<img src="https://img.shields.io/travis/acemod/ACE3.svg" alt="ACE3 Build Status">
|
<img src="https://img.shields.io/travis/acemod/ACE3.svg?style=flat-square&label=Build" alt="ACE3 Build Status">
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
<p align="center"><sup><strong>Requires the latest version of <a href="https://github.com/CBATeam/CBA_A3/releases">CBA A3</a>. Visit us on <a href="https://www.facebook.com/ACE3Mod">Facebook</a> | <a href="https://www.youtube.com/c/ACE3Mod">YouTube</a> | <a href="https://twitter.com/ACE3Mod">Twitter</a> | <a href="http://www.reddit.com/r/arma/search?q=ACE&restrict_sr=on&sort=new&t=all">Reddit</a></strong></sup></p>
|
|
||||||
|
<p align="center">
|
||||||
|
<sup><strong>Requires the latest version of <a href="https://github.com/CBATeam/CBA_A3/releases">CBA A3</a>.<br/>
|
||||||
|
Visit us on <a href="https://twitter.com/ACE3Mod">Twitter</a> | <a href="https://www.facebook.com/ACE3Mod">Facebook</a> | <a href="https://www.youtube.com/c/ACE3Mod">YouTube</a> | <a href="http://www.reddit.com/r/arma/search?q=ACE&restrict_sr=on&sort=new&t=all">Reddit</a></strong></sup>
|
||||||
|
</p>
|
||||||
|
|
||||||
**ACE3** is a joint effort by the teams behind **ACE2**, **AGM** and **CSE** to improve the realism and authenticity of Arma 3.
|
**ACE3** is a joint effort by the teams behind **ACE2**, **AGM** and **CSE** to improve the realism and authenticity of Arma 3.
|
||||||
|
|
||||||
@ -43,6 +48,7 @@ The mod is **built modularly**, so almost any included PBO can be easily removed
|
|||||||
- Captivity system
|
- Captivity system
|
||||||
- Explosives system, including different trigger types
|
- Explosives system, including different trigger types
|
||||||
- Map screen improvements – marker placement and map tools
|
- Map screen improvements – marker placement and map tools
|
||||||
|
- Logistics
|
||||||
- Advanced missile guidance and laser designation
|
- Advanced missile guidance and laser designation
|
||||||
|
|
||||||
#### Additional features
|
#### Additional features
|
||||||
|
@ -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 };
|
||||||
|
|
||||||
|
@ -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];
|
_barrelVelocityShift = [_barrelLength, _muzzleVelocityTable, _barrelLengthTable, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift);
|
||||||
if (isNil "_barrelVelocityShift") then {
|
|
||||||
_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;
|
||||||
};
|
};
|
||||||
|
@ -20,9 +20,11 @@ _weaponConfig = (configFile >> "CfgWeapons" >> _this);
|
|||||||
|
|
||||||
_barrelTwist = getNumber(_weaponConfig >> "ACE_barrelTwist");
|
_barrelTwist = getNumber(_weaponConfig >> "ACE_barrelTwist");
|
||||||
_twistDirection = 1;
|
_twistDirection = 1;
|
||||||
_twistDirection = getNumber(_weaponConfig >> "ACE_twistDirection");
|
if (isNumber (_weaponConfig >> "ACE_twistDirection")) then {
|
||||||
if !(_twistDirection in [-1, 0, 1]) then {
|
_twistDirection = getNumber (_weaponConfig >> "ACE_twistDirection");
|
||||||
_twistDirection = 1;
|
if !(_twistDirection in [-1, 0, 1]) then {
|
||||||
|
_twistDirection = 1;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
_barrelLength = getNumber(_weaponConfig >> "ACE_barrelLength");
|
_barrelLength = getNumber(_weaponConfig >> "ACE_barrelLength");
|
||||||
|
@ -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"};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -176,6 +192,7 @@ class CfgVehicles {
|
|||||||
scope = 2;
|
scope = 2;
|
||||||
icon = QUOTE(PATHTOF(UI\Icon_Module_settings_ca.paa));
|
icon = QUOTE(PATHTOF(UI\Icon_Module_settings_ca.paa));
|
||||||
isGlobal = 1;
|
isGlobal = 1;
|
||||||
|
isSingular = 1;
|
||||||
class Arguments {
|
class Arguments {
|
||||||
class allowHandcuffOwnSide {
|
class allowHandcuffOwnSide {
|
||||||
displayName = CSTRING(ModuleSettings_handcuffSide_name);
|
displayName = CSTRING(ModuleSettings_handcuffSide_name);
|
||||||
|
BIN
addons/captives/UI/Icon_Module_Make_Unit_Handcuffed_ca.paa
Normal file
BIN
addons/captives/UI/Icon_Module_Make_Unit_Handcuffed_ca.paa
Normal file
Binary file not shown.
@ -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);
|
||||||
|
@ -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"};
|
||||||
|
@ -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
|
||||||
|
35
addons/captives/functions/fnc_moduleHandcuffed.sqf
Normal file
35
addons/captives/functions/fnc_moduleHandcuffed.sqf
Normal 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;
|
@ -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"];
|
||||||
|
|
||||||
|
TRACE_3("params",_logic,_units,_activated);
|
||||||
|
|
||||||
if (!_activated) exitWith {};
|
if (!_activated) exitWith {};
|
||||||
|
if (!isServer) exitWith {};
|
||||||
|
|
||||||
if (local _logic) then {
|
//Modules run before postInit can instal the event handler, so we need to wait a little bit
|
||||||
//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;
|
||||||
};
|
|
||||||
|
@ -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";
|
private _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";
|
private _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];
|
||||||
|
@ -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";
|
private _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";
|
private _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];
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@
|
|||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Captives_CableTieDescription">
|
<Key ID="STR_ACE_Captives_CableTieDescription">
|
||||||
<English>Cable ties that allow you to restrain prisoners.</English>
|
<English>Cable ties that allow you to restrain prisoners.</English>
|
||||||
<German>Kabelbinder ermöglichen es, Gefangene zu fesseln.</German>
|
<German>Mit Kabelbindern können Gefangene gefesselt werden.</German>
|
||||||
<Polish>Opaska zaciskowa pozwala na skrępowanie dłoni u więźnia.</Polish>
|
<Polish>Opaska zaciskowa pozwala na skrępowanie dłoni u więźnia.</Polish>
|
||||||
<Spanish>Los precintos permiten maniatar prisioneros</Spanish>
|
<Spanish>Los precintos permiten maniatar prisioneros</Spanish>
|
||||||
<French>Les Serflex permettent de menotter les prisonniers.</French>
|
<French>Les Serflex permettent de menotter les prisonniers.</French>
|
||||||
@ -166,7 +166,7 @@
|
|||||||
<Portuguese>Fazer unidade se render</Portuguese>
|
<Portuguese>Fazer unidade se render</Portuguese>
|
||||||
<French>Faire capituler l'unité</French>
|
<French>Faire capituler l'unité</French>
|
||||||
<Hungarian>Egység kapitulálása</Hungarian>
|
<Hungarian>Egység kapitulálása</Hungarian>
|
||||||
<Russian>Сделать юнита пленным</Russian>
|
<Russian>Заставить юнита сдаться</Russian>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Captives_ModuleSurrender_Description">
|
<Key ID="STR_ACE_Captives_ModuleSurrender_Description">
|
||||||
<English>Sync a unit to make them surrender.<br />Source: ace_captives</English>
|
<English>Sync a unit to make them surrender.<br />Source: ace_captives</English>
|
||||||
@ -177,7 +177,17 @@
|
|||||||
<Portuguese>Sincroniza uma unidade para fazer com que ela se renda. <br/>Fonte: ace_captives</Portuguese>
|
<Portuguese>Sincroniza uma unidade para fazer com que ela se renda. <br/>Fonte: ace_captives</Portuguese>
|
||||||
<French>Synchronise une unité pour la rendre captive. <br/>Source: ace_captives</French>
|
<French>Synchronise une unité pour la rendre captive. <br/>Source: ace_captives</French>
|
||||||
<Hungarian>Egység szinkronizálása, hogy kapituláljon.<br />Forrás: ace_captives</Hungarian>
|
<Hungarian>Egység szinkronizálása, hogy kapituláljon.<br />Forrás: ace_captives</Hungarian>
|
||||||
<Russian>Синхронизируйте с юнитами, чтобы сделать их пленными.<br />Источник: ace_captives</Russian>
|
<Russian>Синхронизируйте с юнитами, чтобы заставить их сдаться в плен.<br />Источник: ace_captives</Russian>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Captives_ModuleHandcuffed_DisplayName">
|
||||||
|
<English>Make Unit Handcuffed</English>
|
||||||
|
<Portuguese>Fazer unidade algemada</Portuguese>
|
||||||
|
<Russian>Связать юнита</Russian>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Captives_ModuleHandcuffed_Description">
|
||||||
|
<English>Sync a unit to make them handcuffed.<br />Source: ace_captives</English>
|
||||||
|
<Portuguese>Sincronizar uma unidade para deixá-la algemada.<br/>Source: ace_captives</Portuguese>
|
||||||
|
<Russian>Синхронизируйте с юнитами, чтобы сделать их связанными.<br />Источник: ace_captives</Russian>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Captives_ModuleSettings_DisplayName">
|
<Key ID="STR_ACE_Captives_ModuleSettings_DisplayName">
|
||||||
<English>Captives Settings</English>
|
<English>Captives Settings</English>
|
||||||
@ -206,7 +216,7 @@
|
|||||||
<Polish>Skuwanie sojuszników</Polish>
|
<Polish>Skuwanie sojuszników</Polish>
|
||||||
<Spanish>Se puede esposar el bando propio</Spanish>
|
<Spanish>Se puede esposar el bando propio</Spanish>
|
||||||
<Czech>Může spoutat spolubojovníky</Czech>
|
<Czech>Může spoutat spolubojovníky</Czech>
|
||||||
<German>Kann Teamkollegen fesseln</German>
|
<German>Kann Kameraden fesseln</German>
|
||||||
<Portuguese>Pode algemar o próprio lado</Portuguese>
|
<Portuguese>Pode algemar o próprio lado</Portuguese>
|
||||||
<French>Peut libérer sa propre faction</French>
|
<French>Peut libérer sa propre faction</French>
|
||||||
<Hungarian>Saját oldal megbilincselhető</Hungarian>
|
<Hungarian>Saját oldal megbilincselhető</Hungarian>
|
||||||
@ -217,7 +227,7 @@
|
|||||||
<Polish>Czy gracze mogą skuwać sojuszników?</Polish>
|
<Polish>Czy gracze mogą skuwać sojuszników?</Polish>
|
||||||
<Spanish>Pueden los jugadores esposar unidades en su propio bando</Spanish>
|
<Spanish>Pueden los jugadores esposar unidades en su propio bando</Spanish>
|
||||||
<Czech>Mohou hráči spoutat jednotky na své straně</Czech>
|
<Czech>Mohou hráči spoutat jednotky na své straně</Czech>
|
||||||
<German>Können Spieler eigene Einheiten fesseln</German>
|
<German>Spieler können eigene Einheiten fesseln. </German>
|
||||||
<Portuguese>Os jogadores podem algemar unidades do seu lado</Portuguese>
|
<Portuguese>Os jogadores podem algemar unidades do seu lado</Portuguese>
|
||||||
<French>Les joueurs peuvent utiliser les Serflex sur leur propre camp</French>
|
<French>Les joueurs peuvent utiliser les Serflex sur leur propre camp</French>
|
||||||
<Hungarian>A játékosok megkötözhetik-e a saját oldalukon lévő egységeket</Hungarian>
|
<Hungarian>A játékosok megkötözhetik-e a saját oldalukon lévő egységeket</Hungarian>
|
||||||
@ -239,7 +249,7 @@
|
|||||||
<Polish>Gracze mogą skapitulować po schowaniu swojej broni do kabury</Polish>
|
<Polish>Gracze mogą skapitulować po schowaniu swojej broni do kabury</Polish>
|
||||||
<Spanish>Los jugadores pueden rendirse después de enfundar su arma</Spanish>
|
<Spanish>Los jugadores pueden rendirse después de enfundar su arma</Spanish>
|
||||||
<Czech>Hráč se může vzdát poté, co si skryje zbraň</Czech>
|
<Czech>Hráč se může vzdát poté, co si skryje zbraň</Czech>
|
||||||
<German>Spieler können kapitulieren, nachdem sie ihre Waffe geholstert haben</German>
|
<German>Spieler können kapitulieren, nachdem sie ihre Waffe geholstert haben.</German>
|
||||||
<Portuguese>Jogadores podem se render depois de guardar sua arma</Portuguese>
|
<Portuguese>Jogadores podem se render depois de guardar sua arma</Portuguese>
|
||||||
<French>Les joueurs peuvent se rendre après avoir rangé leur arme</French>
|
<French>Les joueurs peuvent se rendre après avoir rangé leur arme</French>
|
||||||
<Hungarian>A játékosok megadhatják magukat a fegyverük elrakása után</Hungarian>
|
<Hungarian>A játékosok megadhatják magukat a fegyverük elrakása után</Hungarian>
|
||||||
@ -247,6 +257,7 @@
|
|||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Captives_ModuleSettings_requireSurrender_name">
|
<Key ID="STR_ACE_Captives_ModuleSettings_requireSurrender_name">
|
||||||
<English>Require surrendering</English>
|
<English>Require surrendering</English>
|
||||||
|
<German>Benötigt Kapitulation</German>
|
||||||
<Polish>Wymagaj kapitulacji</Polish>
|
<Polish>Wymagaj kapitulacji</Polish>
|
||||||
<Portuguese>Requer rendição</Portuguese>
|
<Portuguese>Requer rendição</Portuguese>
|
||||||
<Russian>Требовать пленения</Russian>
|
<Russian>Требовать пленения</Russian>
|
||||||
@ -254,6 +265,7 @@
|
|||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Captives_ModuleSettings_requireSurrender_description">
|
<Key ID="STR_ACE_Captives_ModuleSettings_requireSurrender_description">
|
||||||
<English>Require Players to surrender before they can be arrested</English>
|
<English>Require Players to surrender before they can be arrested</English>
|
||||||
|
<German>Spieler müssen sich erst ergeben, bevor sie gefangen genommen werden können</German>
|
||||||
<Polish>Wymagaj od graczy kapitulacji zanim będzie można ich zaaresztować</Polish>
|
<Polish>Wymagaj od graczy kapitulacji zanim będzie można ich zaaresztować</Polish>
|
||||||
<Portuguese>Requer que jogadores se rendam antes de poderem ser presos</Portuguese>
|
<Portuguese>Requer que jogadores se rendam antes de poderem ser presos</Portuguese>
|
||||||
<Russian>Требуется, чтобы игрок сдался в плен прежде, чем его можно будет связать</Russian>
|
<Russian>Требуется, чтобы игрок сдался в плен прежде, чем его можно будет связать</Russian>
|
||||||
@ -261,6 +273,7 @@
|
|||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Captives_SurrenderOnly">
|
<Key ID="STR_ACE_Captives_SurrenderOnly">
|
||||||
<English>Surrendering only</English>
|
<English>Surrendering only</English>
|
||||||
|
<German>Nur Ergeben</German>
|
||||||
<Polish>Tylko kapitulacja</Polish>
|
<Polish>Tylko kapitulacja</Polish>
|
||||||
<Portuguese>Somente rendição </Portuguese>
|
<Portuguese>Somente rendição </Portuguese>
|
||||||
<Russian>Только сдавшийся в плен</Russian>
|
<Russian>Только сдавшийся в плен</Russian>
|
||||||
@ -268,10 +281,11 @@
|
|||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Captives_SurrenderOrNoWeapon">
|
<Key ID="STR_ACE_Captives_SurrenderOrNoWeapon">
|
||||||
<English>Surrendering or No weapon</English>
|
<English>Surrendering or No weapon</English>
|
||||||
|
<German>Ergeben oder keine Waffe</German>
|
||||||
<Polish>Kapitulacja lub brak broni</Polish>
|
<Polish>Kapitulacja lub brak broni</Polish>
|
||||||
<Portuguese>Rendição ou desarmado</Portuguese>
|
<Portuguese>Rendição ou desarmado</Portuguese>
|
||||||
<Russian>Сдавшийся или безоружный</Russian>
|
<Russian>Сдавшийся или безоружный</Russian>
|
||||||
<Spanish>Rendición o desarme</Spanish>
|
<Spanish>Rendición o desarme</Spanish>
|
||||||
</Key>
|
</Key>
|
||||||
</Package>
|
</Package>
|
||||||
</Project>
|
</Project>
|
@ -8,6 +8,7 @@ class CfgVehicles {
|
|||||||
function = QFUNC(moduleSettings);
|
function = QFUNC(moduleSettings);
|
||||||
functionPriority = 1;
|
functionPriority = 1;
|
||||||
isGlobal = 1;
|
isGlobal = 1;
|
||||||
|
isSingular = 1;
|
||||||
isTriggerActivated = 0;
|
isTriggerActivated = 0;
|
||||||
author = ECSTRING(common,ACETeam);
|
author = ECSTRING(common,ACETeam);
|
||||||
|
|
||||||
@ -171,6 +172,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 {
|
||||||
|
@ -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);
|
||||||
|
@ -18,24 +18,12 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
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"];
|
[_itemClass, _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);
|
||||||
|
@ -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))}
|
||||||
|
@ -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]);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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?
|
||||||
deleteVehicle _x;
|
if (typeName _x == "OBJECT") then {
|
||||||
//_x setDamage 1;
|
deleteVehicle _x;
|
||||||
|
};
|
||||||
} count _loaded;
|
} count _loaded;
|
||||||
|
|
||||||
[_vehicle] call FUNC(validateCargoSpace);
|
[_vehicle] call FUNC(validateCargoSpace);
|
||||||
|
@ -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
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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);
|
||||||
|
};
|
||||||
|
@ -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);
|
||||||
|
};
|
||||||
|
@ -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
|
||||||
|
@ -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];
|
||||||
|
@ -95,5 +95,21 @@
|
|||||||
<Hungarian>1%<br/>kirakodva ebből:<br/>%2</Hungarian>
|
<Hungarian>1%<br/>kirakodva ebből:<br/>%2</Hungarian>
|
||||||
<Russian>%1<br/>разгружен из<br/>%2</Russian>
|
<Russian>%1<br/>разгружен из<br/>%2</Russian>
|
||||||
</Key>
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Cargo_LoadingItem">
|
||||||
|
<English>Loading Cargo</English>
|
||||||
|
<Portuguese>Carregando carga</Portuguese>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Cargo_UnloadingItem">
|
||||||
|
<English>Unloading Cargo</English>
|
||||||
|
<Portuguese>Descarregando carga</Portuguese>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Cargo_LoadingFailed">
|
||||||
|
<English>%1<br/>could not be loaded</English>
|
||||||
|
<Portuguese>%1<br/>não pode ser carregado</Portuguese>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Cargo_UnloadingFailed">
|
||||||
|
<English>%1<br/>could not be unloaded</English>
|
||||||
|
<Portuguese>%1<br/>não pode ser descarregado</Portuguese>
|
||||||
|
</Key>
|
||||||
</Package>
|
</Package>
|
||||||
</Project>
|
</Project>
|
@ -35,6 +35,7 @@ class CfgVehicles {
|
|||||||
function = QFUNC(moduleCheckPBOs);
|
function = QFUNC(moduleCheckPBOs);
|
||||||
scope = 2;
|
scope = 2;
|
||||||
isGlobal = 1;
|
isGlobal = 1;
|
||||||
|
isSingular = 1;
|
||||||
icon = QUOTE(PATHTOF(UI\Icon_Module_CheckPBO_ca.paa));
|
icon = QUOTE(PATHTOF(UI\Icon_Module_CheckPBO_ca.paa));
|
||||||
class Arguments {
|
class Arguments {
|
||||||
class Action {
|
class Action {
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
//Handle the waitAndExec array:
|
//Handle the waitAndExec array:
|
||||||
while {!(GVAR(waitAndExecArray) isEqualTo []) && {GVAR(waitAndExecArray) select 0 select 0 <= ACE_Time}} do {
|
while {!(GVAR(waitAndExecArray) isEqualTo []) && {GVAR(waitAndExecArray) select 0 select 0 <= ACE_Time}} do {
|
||||||
local _entry = GVAR(waitAndExecArray) deleteAt 0;
|
private _entry = GVAR(waitAndExecArray) deleteAt 0;
|
||||||
(_entry select 2) call (_entry select 1);
|
(_entry select 2) call (_entry select 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -29,7 +29,7 @@
|
|||||||
GVAR(nextFrameNo) = diag_frameno + 1;
|
GVAR(nextFrameNo) = diag_frameno + 1;
|
||||||
|
|
||||||
//Handle the waitUntilAndExec array:
|
//Handle the waitUntilAndExec array:
|
||||||
local _deleted = 0;
|
private _deleted = 0;
|
||||||
{
|
{
|
||||||
// if condition is satisifed call statement
|
// if condition is satisifed call statement
|
||||||
if ((_x select 2) call (_x select 0)) then {
|
if ((_x select 2) call (_x select 0)) then {
|
||||||
@ -194,9 +194,17 @@ call FUNC(checkFiles);
|
|||||||
|
|
||||||
ACE_LOGINFO("Settings received from server.");
|
ACE_LOGINFO("Settings received from server.");
|
||||||
|
|
||||||
|
if (isServer) then { //read settings from paramsArray
|
||||||
|
[] call FUNC(readSettingsFromParamsArray);
|
||||||
|
};
|
||||||
// Event so that ACE_Modules have their settings loaded:
|
// Event so that ACE_Modules have their settings loaded:
|
||||||
["InitSettingsFromModules", []] call FUNC(localEvent);
|
["InitSettingsFromModules", []] call FUNC(localEvent);
|
||||||
|
|
||||||
|
if (isServer) then {
|
||||||
|
// Publish all settings data after all configs and modules are read
|
||||||
|
publicVariable QGVAR(settings);
|
||||||
|
};
|
||||||
|
|
||||||
// Load user settings from profile
|
// Load user settings from profile
|
||||||
if (hasInterface) then {
|
if (hasInterface) then {
|
||||||
call FUNC(loadSettingsFromProfile);
|
call FUNC(loadSettingsFromProfile);
|
||||||
|
@ -115,6 +115,7 @@ PREP(isInBuilding);
|
|||||||
PREP(isModLoaded);
|
PREP(isModLoaded);
|
||||||
PREP(isPlayer);
|
PREP(isPlayer);
|
||||||
PREP(isTurnedOut);
|
PREP(isTurnedOut);
|
||||||
|
PREP(isUnderwater);
|
||||||
PREP(letterToCode);
|
PREP(letterToCode);
|
||||||
PREP(lightIntensityFromObject);
|
PREP(lightIntensityFromObject);
|
||||||
PREP(loadPerson);
|
PREP(loadPerson);
|
||||||
@ -139,6 +140,7 @@ PREP(playerSide);
|
|||||||
PREP(positionToASL);
|
PREP(positionToASL);
|
||||||
PREP(progressBar);
|
PREP(progressBar);
|
||||||
PREP(readSettingFromModule);
|
PREP(readSettingFromModule);
|
||||||
|
PREP(readSettingsFromParamsArray);
|
||||||
PREP(receiveRequest);
|
PREP(receiveRequest);
|
||||||
PREP(removeCanInteractWithCondition);
|
PREP(removeCanInteractWithCondition);
|
||||||
PREP(removeSpecificMagazine);
|
PREP(removeSpecificMagazine);
|
||||||
@ -223,6 +225,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);
|
||||||
|
@ -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:
|
||||||
|
@ -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>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
params ["_var", ["_depth", 0, [0]]];
|
params ["_var", ["_depth", 0, [0]]];
|
||||||
|
|
||||||
local _pad = "";
|
private _pad = "";
|
||||||
|
|
||||||
for "_i" from 0 to _depth do {
|
for "_i" from 0 to _depth do {
|
||||||
_pad = _pad + toString [9];
|
_pad = _pad + toString [9];
|
||||||
|
@ -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>
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
params ["_unit"];
|
params ["_unit"];
|
||||||
|
|
||||||
local _vehicle = vehicle _unit;
|
private _vehicle = vehicle _unit;
|
||||||
if (_unit == _vehicle) exitWith {[]};
|
if (_unit == _vehicle) exitWith {[]};
|
||||||
|
|
||||||
scopeName "main";
|
scopeName "main";
|
||||||
|
35
addons/common/functions/fnc_hasHatch.sqf
Normal file
35
addons/common/functions/fnc_hasHatch.sqf
Normal 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"];
|
||||||
|
|
||||||
|
private _vehicle = vehicle _unit;
|
||||||
|
|
||||||
|
if (_unit == _vehicle) exitWith {false};
|
||||||
|
|
||||||
|
private _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||||
|
|
||||||
|
if (getNumber (_config >> "hideProxyInCombat") != 1) exitWith {false};
|
||||||
|
|
||||||
|
if (_unit == driver _vehicle) exitWith {
|
||||||
|
getNumber (_config >> "forceHideDriver") == 0; // return
|
||||||
|
};
|
||||||
|
|
||||||
|
private _turret = [_unit] call FUNC(getTurretIndex);
|
||||||
|
|
||||||
|
if (_turret isEqualTo []) exitWith {false};
|
||||||
|
|
||||||
|
private _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
|
||||||
|
|
||||||
|
getNumber (_turretConfig >> "forceHideGunner") == 0; // return
|
@ -1,29 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Glowbal
|
* Author: Glowbal
|
||||||
* Check if unit is underwater
|
* Check if unit's head is underwater
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Unit <OBJECT>
|
* 0: Unit <OBJECT>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* if unit is in the water (BOOLEAN)
|
* If unit's head is underwater <BOOL>
|
||||||
*
|
*
|
||||||
* Public: Yes
|
* Public: Yes
|
||||||
|
*
|
||||||
|
* Deprecated
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
params ["_unit"];
|
ACE_DEPRECATED("ace_common_fnc_inWater","3.5.0","ace_common_fnc_isUnderwater");
|
||||||
|
|
||||||
private "_return";
|
_this call FUNC(isUnderwater)
|
||||||
_return = false;
|
|
||||||
|
|
||||||
if (surfaceIsWater getPosASL _unit) then {
|
|
||||||
private "_pos";
|
|
||||||
_pos = _unit modelToWorldVisual (_unit selectionPosition "head");
|
|
||||||
|
|
||||||
if (_pos select 2 < 0) then {
|
|
||||||
_return = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
_return
|
|
||||||
|
29
addons/common/functions/fnc_isUnderwater.sqf
Normal file
29
addons/common/functions/fnc_isUnderwater.sqf
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* Author: Glowbal
|
||||||
|
* Check if unit's head is underwater
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: Unit <OBJECT>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* If unit's head is underwater <BOOL>
|
||||||
|
*
|
||||||
|
* Public: Yes
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
params ["_unit"];
|
||||||
|
|
||||||
|
private "_return";
|
||||||
|
_return = false;
|
||||||
|
|
||||||
|
if (surfaceIsWater getPosASL _unit) then {
|
||||||
|
private "_pos";
|
||||||
|
_pos = _unit modelToWorldVisual (_unit selectionPosition "head");
|
||||||
|
|
||||||
|
if (_pos select 2 < 0) then {
|
||||||
|
_return = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
_return
|
@ -35,12 +35,23 @@ _fnc_parseConfigForDisplayNames = {
|
|||||||
_values set [_forEachIndex, _text];
|
_values set [_forEachIndex, _text];
|
||||||
};
|
};
|
||||||
} forEach _values;
|
} forEach _values;
|
||||||
|
|
||||||
|
if (!(_values isEqualTo [])) then {
|
||||||
|
if (_typeOf != "SCALAR") then {
|
||||||
|
ACE_LOGWARNING_2("Setting [%1] has values[] but is not SCALAR (%2)", _name, _typeOf);
|
||||||
|
} else {
|
||||||
|
private _value = missionNamespace getVariable [_name, -1];
|
||||||
|
if ((_value < 0) || {_value >= (count _values)}) then {
|
||||||
|
ACE_LOGWARNING_3("Setting [%1] out of bounds %2 (values[] count is %3)(", _name, _value, count _values);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
true
|
true
|
||||||
};
|
};
|
||||||
|
|
||||||
// Iterate through settings
|
// Iterate through settings
|
||||||
{
|
{
|
||||||
_x params ["_name"];
|
_x params ["_name", "_typeOf"];
|
||||||
|
|
||||||
if !([configFile >> "ACE_Settings" >> _name] call _fnc_parseConfigForDisplayNames) then {
|
if !([configFile >> "ACE_Settings" >> _name] call _fnc_parseConfigForDisplayNames) then {
|
||||||
if !([configFile >> "ACE_ServerSettings" >> _name] call _fnc_parseConfigForDisplayNames) then {
|
if !([configFile >> "ACE_ServerSettings" >> _name] call _fnc_parseConfigForDisplayNames) then {
|
||||||
|
@ -51,8 +51,6 @@ _fnc_parseConfigForSettings = {
|
|||||||
// mission side settings
|
// mission side settings
|
||||||
[missionConfigFile >> "ACE_Settings"] call _fnc_parseConfigForSettings;
|
[missionConfigFile >> "ACE_Settings"] call _fnc_parseConfigForSettings;
|
||||||
|
|
||||||
// Publish all settings data
|
|
||||||
publicVariable QGVAR(settings);
|
|
||||||
// Publish all setting values
|
// Publish all setting values
|
||||||
{
|
{
|
||||||
publicVariable (_x select 0);
|
publicVariable (_x select 0);
|
||||||
|
@ -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.
|
||||||
|
63
addons/common/functions/fnc_readSettingsFromParamsArray.sqf
Normal file
63
addons/common/functions/fnc_readSettingsFromParamsArray.sqf
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* Author: PabstMirror
|
||||||
|
* Read settins from paramsArray that have a ACE_setting = 1.
|
||||||
|
* Happens before modules but after all other configs (for force priority)
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [] call ace_common_fnc_readSettingsFromParamsArray
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
//paramsArray is a normal variable not a command
|
||||||
|
private _paramsArray = missionnamespace getvariable ["paramsArray", []];
|
||||||
|
|
||||||
|
TRACE_1("Reading missionConfigFile params",_paramsArray);
|
||||||
|
|
||||||
|
{
|
||||||
|
private _config = (missionConfigFile >> "params") select _forEachIndex;
|
||||||
|
if ((getNumber (_config >> "ACE_setting")) > 0) then {
|
||||||
|
private _settingName = configName _config;
|
||||||
|
private _settingValue = _x;
|
||||||
|
private _title = getText (_config >> "title");
|
||||||
|
|
||||||
|
TRACE_3("ace_setting",_title,_settingName,_settingValue);
|
||||||
|
|
||||||
|
// Check if the variable is already defined
|
||||||
|
if (isNil _settingName) exitWith {
|
||||||
|
ACE_LOGERROR_1("readSettingsFromParamsArray - param [%1] is not an ace_setting", _settingName);
|
||||||
|
};
|
||||||
|
|
||||||
|
private _settingData = [_settingName] call FUNC(getSettingData);
|
||||||
|
_settingData params ["", "_typeName", "", "", "", "", "_isForced"];
|
||||||
|
|
||||||
|
// Check if it's already forced and quit
|
||||||
|
if (_isForced) exitWith {ACE_LOGWARNING_1("readSettingsFromParamsArray - param [%1] is already set and forced", _settingName);};
|
||||||
|
|
||||||
|
// The setting is not forced, so update the value
|
||||||
|
// Read entry and cast it to the correct type from the existing variable
|
||||||
|
private _validValue = false;
|
||||||
|
switch (true) do {
|
||||||
|
case (_typeName == "SCALAR"): {_validValue = true;};
|
||||||
|
case (_typeName == "BOOL"): {
|
||||||
|
_settingValue = _settingValue > 0;
|
||||||
|
_validValue = true;
|
||||||
|
};
|
||||||
|
//TODO: Handle ARRAY,COLOR,STRING??? (bool/scalar covers most important settings)
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!_validValue) exitWith {
|
||||||
|
ACE_LOGWARNING_3("readSettingsFromParamsArray - param [%1] type not valid [%2] - expected type [%3]", _settingName,_settingValue,_typeName);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Update the variable globaly and Force
|
||||||
|
[_settingName, _settingValue, true, true] call FUNC(setSetting);
|
||||||
|
};
|
||||||
|
} foreach _paramsArray;
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
params ["_unit", "_muzzle", "_mode"];
|
params ["_unit", "_muzzle", "_mode"];
|
||||||
|
|
||||||
local _index = 0;
|
private _index = 0;
|
||||||
|
|
||||||
while {
|
while {
|
||||||
_index < 100 && {currentMuzzle _unit != _muzzle || {currentWeaponMode _unit != _mode}}
|
_index < 100 && {currentMuzzle _unit != _muzzle || {currentWeaponMode _unit != _mode}}
|
||||||
|
@ -148,7 +148,7 @@ if (_backpack != "") then {
|
|||||||
_unit addBackpack _backpack;
|
_unit addBackpack _backpack;
|
||||||
|
|
||||||
if (_clearBackpack) then {
|
if (_clearBackpack) then {
|
||||||
local _backpackObject = unitBackpack _unit;
|
private _backpackObject = unitBackpack _unit;
|
||||||
|
|
||||||
clearMagazineCargoGlobal _backpackObject;
|
clearMagazineCargoGlobal _backpackObject;
|
||||||
clearWeaponCargoGlobal _backpackObject;
|
clearWeaponCargoGlobal _backpackObject;
|
||||||
|
@ -13,27 +13,39 @@
|
|||||||
* Return Value:
|
* Return Value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
|
* Example:
|
||||||
|
* ["ace_map_gestures_enabled", true, false, true] call ace_common_fnc_setSetting
|
||||||
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
params ["_name", "_value", ["_force", false], ["_broadcastChanges", false]];
|
params ["_name", "_value", ["_force", false], ["_broadcastChanges", false]];
|
||||||
|
|
||||||
private ["_settingData", "_failed"];
|
private _settingData = [_name] call FUNC(getSettingData);
|
||||||
|
|
||||||
_settingData = [_name] call FUNC(getSettingData);
|
|
||||||
|
|
||||||
// Exit if the setting does not exist
|
// Exit if the setting does not exist
|
||||||
if (count _settingData == 0) exitWith {};
|
if (_settingData isEqualTo []) exitWith {
|
||||||
|
ACE_LOGERROR_1("SetSetting [%1] setting does not exist", _name);
|
||||||
|
};
|
||||||
|
|
||||||
|
_settingData params ["", "_typeName", "_isClientSetable", "", "", "", "_isForced"];
|
||||||
|
|
||||||
// Exit if the setting is already forced
|
// Exit if the setting is already forced
|
||||||
if (_settingData select 6) exitWith {};
|
if (_isForced) exitWith {
|
||||||
|
ACE_LOGINFO_1("SetSetting [%1] Trying to set forced setting", _name);
|
||||||
|
};
|
||||||
|
|
||||||
|
//This does NOT broadcast changes to GVAR(settings), so clients would not get updated force status
|
||||||
|
if ((missionNamespace getVariable [QEGVAR(modules,serverModulesRead), false]) && {!(_isForced isEqualTo _force)}) then {
|
||||||
|
ACE_LOGWARNING_3("SetSetting [%1] attempting to broadcast a change to force (%2 to %3)", _name, _isForced, _force);
|
||||||
|
};
|
||||||
|
|
||||||
// If the type is not equal, try to cast it
|
// If the type is not equal, try to cast it
|
||||||
_failed = false;
|
private _failed = false;
|
||||||
if (typeName _value != _settingData select 1) then {
|
if (typeName _value != _settingData select 1) then {
|
||||||
_failed = true;
|
_failed = true;
|
||||||
if (_settingData select 1 == "BOOL" && typeName _value == "SCALAR") then {
|
if ((_typeName == "BOOL") && {typeName _value == "SCALAR"}) then {
|
||||||
// If value is not 0 or 1 consider it invalid and don't set anything
|
// If value is not 0 or 1 consider it invalid and don't set anything
|
||||||
if (_value isEqualTo 0) then {
|
if (_value isEqualTo 0) then {
|
||||||
_value = false;
|
_value = false;
|
||||||
@ -44,12 +56,12 @@ if (typeName _value != _settingData select 1) then {
|
|||||||
_failed = false;
|
_failed = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
if (_settingData select 1 == "COLOR" && typeName _value == "ARRAY") then {
|
if ((_typeName == "COLOR") && {typeName _value == "ARRAY"}) then {
|
||||||
_failed = false;
|
_failed = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_failed) exitWith {};
|
if (_failed) exitWith {ACE_LOGERROR_3("SetSetting [%1] bad data type expected %2 got %3", _name, _typeName, typeName _value);};
|
||||||
|
|
||||||
// Force it if it was required
|
// Force it if it was required
|
||||||
_settingData set [6, _force];
|
_settingData set [6, _force];
|
||||||
|
@ -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
|
||||||
|
@ -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;
|
||||||
|
@ -14,13 +14,13 @@
|
|||||||
|
|
||||||
BEGIN_COUNTER(timePFH);
|
BEGIN_COUNTER(timePFH);
|
||||||
|
|
||||||
local _lastTickTime = ACE_diagTime;
|
private _lastTickTime = ACE_diagTime;
|
||||||
local _lastGameTime = ACE_gameTime;
|
private _lastGameTime = ACE_gameTime;
|
||||||
|
|
||||||
ACE_gameTime = time;
|
ACE_gameTime = time;
|
||||||
ACE_diagTime = diag_tickTime;
|
ACE_diagTime = diag_tickTime;
|
||||||
|
|
||||||
local _delta = ACE_diagTime - _lastTickTime;
|
private _delta = ACE_diagTime - _lastTickTime;
|
||||||
|
|
||||||
if (ACE_gameTime <= _lastGameTime) then {
|
if (ACE_gameTime <= _lastGameTime) then {
|
||||||
TRACE_1("paused",_delta);
|
TRACE_1("paused",_delta);
|
||||||
|
@ -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>
|
||||||
|
@ -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
|
||||||
*/
|
*/
|
||||||
|
@ -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);
|
||||||
|
@ -74,13 +74,13 @@ GVAR(menuRun) = true;
|
|||||||
GVAR(menuRun) = false;
|
GVAR(menuRun) = false;
|
||||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (GVAR(MENU_B)) then {
|
if (GVAR(MENU_B)) then {
|
||||||
GVAR(menu) = "main";
|
GVAR(menu) = "main";
|
||||||
GVAR(selection) = 0;
|
GVAR(selection) = 0;
|
||||||
GVAR(numSelections) = 5;
|
GVAR(numSelections) = 5;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!GVAR(add) && !GVAR(edit)) then {
|
if (!GVAR(add) && !GVAR(edit)) then {
|
||||||
if (GVAR(DOWN)) then {
|
if (GVAR(DOWN)) then {
|
||||||
GVAR(selection) = (GVAR(numSelections) + GVAR(selection) + 1);
|
GVAR(selection) = (GVAR(numSelections) + GVAR(selection) + 1);
|
||||||
@ -90,7 +90,7 @@ GVAR(menuRun) = true;
|
|||||||
};
|
};
|
||||||
GVAR(selection) = if (GVAR(numSelections) > 0) then { GVAR(selection) % GVAR(numSelections) } else { 0 };
|
GVAR(selection) = if (GVAR(numSelections) > 0) then { GVAR(selection) % GVAR(numSelections) } else { 0 };
|
||||||
};
|
};
|
||||||
|
|
||||||
if (GVAR(LEFT)) then {
|
if (GVAR(LEFT)) then {
|
||||||
GVAR(pointer) = (8 + GVAR(pointer) - 1);
|
GVAR(pointer) = (8 + GVAR(pointer) - 1);
|
||||||
};
|
};
|
||||||
@ -98,7 +98,7 @@ GVAR(menuRun) = true;
|
|||||||
GVAR(pointer) = (8 + GVAR(pointer) + 1);
|
GVAR(pointer) = (8 + GVAR(pointer) + 1);
|
||||||
};
|
};
|
||||||
GVAR(pointer) = GVAR(pointer) % 8;
|
GVAR(pointer) = GVAR(pointer) % 8;
|
||||||
|
|
||||||
(__dsp displayCtrl __PSelection1) ctrlSetText "";
|
(__dsp displayCtrl __PSelection1) ctrlSetText "";
|
||||||
(__dsp displayCtrl __PSelection2) ctrlSetText "";
|
(__dsp displayCtrl __PSelection2) ctrlSetText "";
|
||||||
(__dsp displayCtrl __PSelection3) ctrlSetText "";
|
(__dsp displayCtrl __PSelection3) ctrlSetText "";
|
||||||
@ -113,7 +113,7 @@ GVAR(menuRun) = true;
|
|||||||
(__dsp displayCtrl __Selection2) ctrlSetText "";
|
(__dsp displayCtrl __Selection2) ctrlSetText "";
|
||||||
(__dsp displayCtrl __Selection3) ctrlSetText "";
|
(__dsp displayCtrl __Selection3) ctrlSetText "";
|
||||||
(__dsp displayCtrl __Selection4) ctrlSetText "";
|
(__dsp displayCtrl __Selection4) ctrlSetText "";
|
||||||
|
|
||||||
(__dsp displayCtrl __F1) ctrlSetText "";
|
(__dsp displayCtrl __F1) ctrlSetText "";
|
||||||
(__dsp displayCtrl __F2) ctrlSetText "";
|
(__dsp displayCtrl __F2) ctrlSetText "";
|
||||||
(__dsp displayCtrl __F3) ctrlSetText "";
|
(__dsp displayCtrl __F3) ctrlSetText "";
|
||||||
@ -124,7 +124,7 @@ GVAR(menuRun) = true;
|
|||||||
(__dsp displayCtrl __Option2) ctrlSetText "";
|
(__dsp displayCtrl __Option2) ctrlSetText "";
|
||||||
(__dsp displayCtrl __Option3) ctrlSetText "";
|
(__dsp displayCtrl __Option3) ctrlSetText "";
|
||||||
(__dsp displayCtrl __Option4) ctrlSetText "";
|
(__dsp displayCtrl __Option4) ctrlSetText "";
|
||||||
|
|
||||||
switch (GVAR(menu)) do {
|
switch (GVAR(menu)) do {
|
||||||
case "main": {
|
case "main": {
|
||||||
if (GVAR(SEL)) then {
|
if (GVAR(SEL)) then {
|
||||||
@ -500,7 +500,7 @@ GVAR(menuRun) = true;
|
|||||||
case 6: { GVAR(digit6) = (10 + GVAR(digit6) - 1) % 10 };
|
case 6: { GVAR(digit6) = (10 + GVAR(digit6) - 1) % 10 };
|
||||||
case 7: { GVAR(digit7) = (10 + GVAR(digit7) - 1) % 10 };
|
case 7: { GVAR(digit7) = (10 + GVAR(digit7) - 1) % 10 };
|
||||||
case 8: { GVAR(digit8) = (10 + GVAR(digit8) - 1) % 10 };
|
case 8: { GVAR(digit8) = (10 + GVAR(digit8) - 1) % 10 };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -590,7 +590,7 @@ GVAR(menuRun) = true;
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!GVAR(busy)) then {
|
if (!GVAR(busy)) then {
|
||||||
GVAR(F3) = false;
|
GVAR(F3) = false;
|
||||||
GVAR(F2) = false;
|
GVAR(F2) = false;
|
||||||
|
@ -31,18 +31,19 @@ if (GVAR(outputPFH) != -1) exitWith {};
|
|||||||
|
|
||||||
GVAR(outputPFH) = [{
|
GVAR(outputPFH) = [{
|
||||||
private["_dagrElevation", "_dagrGrid", "_dagrHeading", "_dagrSpeed", "_dagrTime", "_elevation", "_gridArray", "_speed"];
|
private["_dagrElevation", "_dagrGrid", "_dagrHeading", "_dagrSpeed", "_dagrTime", "_elevation", "_gridArray", "_speed"];
|
||||||
|
|
||||||
// Abort Condition
|
// Abort Condition
|
||||||
if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith {
|
if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith {
|
||||||
GVAR(outputPFH) = -1;
|
GVAR(outputPFH) = -1;
|
||||||
135471 cutText ["", "PLAIN"];
|
135471 cutText ["", "PLAIN"];
|
||||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 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);
|
||||||
_speed = floor (_speed * 10) / 10;
|
_speed = floor (_speed * 10) / 10;
|
||||||
@ -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;
|
||||||
|
@ -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];
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Rosuto
|
* Author: Rosuto
|
||||||
* DAGR waypoint output loop
|
* DAGR waypoint output loop
|
||||||
*
|
*
|
||||||
@ -31,22 +31,23 @@ if (GVAR(outputPFH) != -1) exitWith {};
|
|||||||
|
|
||||||
GVAR(outputPFH) = [{
|
GVAR(outputPFH) = [{
|
||||||
private["_MYpos", "_WPpos", "_bearing", "_dagrDistance", "_dagrGrid", "_dagrHeading", "_distance", "_gridArray"];
|
private["_MYpos", "_WPpos", "_bearing", "_dagrDistance", "_dagrGrid", "_dagrHeading", "_distance", "_gridArray"];
|
||||||
|
|
||||||
// Abort Condition
|
// Abort Condition
|
||||||
if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith {
|
if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith {
|
||||||
GVAR(outputPFH) = -1;
|
GVAR(outputPFH) = -1;
|
||||||
135471 cutText ["", "PLAIN"];
|
135471 cutText ["", "PLAIN"];
|
||||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 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);
|
||||||
_yGrid2 = DAGR_WP_INFO - _xGrid2 * 10000;
|
_yGrid2 = DAGR_WP_INFO - _xGrid2 * 10000;
|
||||||
|
|
||||||
_xCoord2 = switch true do {
|
_xCoord2 = switch true do {
|
||||||
case (_xGrid2 >= 1000): { "" + Str(_xGrid2) };
|
case (_xGrid2 >= 1000): { "" + Str(_xGrid2) };
|
||||||
case (_xGrid2 >= 100): { "0" + Str(_xGrid2) };
|
case (_xGrid2 >= 100): { "0" + Str(_xGrid2) };
|
||||||
@ -60,7 +61,7 @@ GVAR(outputPFH) = [{
|
|||||||
case (_yGrid2 >= 10): { "00" + Str(_yGrid2) };
|
case (_yGrid2 >= 10): { "00" + Str(_yGrid2) };
|
||||||
default { "000" + Str(_yGrid2) };
|
default { "000" + Str(_yGrid2) };
|
||||||
};
|
};
|
||||||
|
|
||||||
_dagrGrid2 = _xCoord2 + " " + _yCoord2;
|
_dagrGrid2 = _xCoord2 + " " + _yCoord2;
|
||||||
|
|
||||||
// Distance
|
// Distance
|
||||||
@ -69,7 +70,7 @@ GVAR(outputPFH) = [{
|
|||||||
_distance = _MYpos distance _WPpos;
|
_distance = _MYpos distance _WPpos;
|
||||||
_distance = floor (_distance * 10) / 10;
|
_distance = floor (_distance * 10) / 10;
|
||||||
_dagrDistance = str _distance + "m";
|
_dagrDistance = str _distance + "m";
|
||||||
|
|
||||||
// Heading
|
// Heading
|
||||||
_dagrHeading = floor (if (GVAR(useDegrees)) then {
|
_dagrHeading = floor (if (GVAR(useDegrees)) then {
|
||||||
direction (vehicle ACE_player)
|
direction (vehicle ACE_player)
|
||||||
@ -79,12 +80,12 @@ GVAR(outputPFH) = [{
|
|||||||
|
|
||||||
// WP Heading
|
// WP Heading
|
||||||
_bearing = floor ((_WPpos vectorDiff _MYpos) call CBA_fnc_vectDir);
|
_bearing = floor ((_WPpos vectorDiff _MYpos) call CBA_fnc_vectDir);
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
__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;
|
||||||
|
@ -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 {
|
||||||
|
@ -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>
|
@ -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);
|
||||||
|
@ -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
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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,8 @@
|
|||||||
<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>
|
||||||
|
<Russian>Поднять/Опустить</Russian>
|
||||||
</Key>
|
</Key>
|
||||||
</Package>
|
</Package>
|
||||||
</Project>
|
</Project>
|
@ -6,6 +6,7 @@ class ACE_ModuleExplosive: ACE_Module {
|
|||||||
function = QUOTE(FUNC(module));
|
function = QUOTE(FUNC(module));
|
||||||
scope = 2;
|
scope = 2;
|
||||||
isGlobal = 1;
|
isGlobal = 1;
|
||||||
|
isSingular = 1;
|
||||||
icon = PATHTOF(UI\Icon_Module_Explosives_ca.paa);
|
icon = PATHTOF(UI\Icon_Module_Explosives_ca.paa);
|
||||||
class Arguments {
|
class Arguments {
|
||||||
class RequireSpecialist {
|
class RequireSpecialist {
|
||||||
|
@ -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
|
||||||
|
@ -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 {};
|
||||||
|
@ -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
|
||||||
|
@ -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");
|
||||||
@ -90,7 +90,7 @@ if (ACE_time - GVAR(ACE_time) > 1 and GVAR(ACE_time) != -1 and count _this < 3)
|
|||||||
if (_initSpeedCoef > 0) then {
|
if (_initSpeedCoef > 0) then {
|
||||||
_initSpeed = _initSpeedCoef;
|
_initSpeed = _initSpeedCoef;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_simulationStep != 0) then {
|
if (_simulationStep != 0) then {
|
||||||
private ["_posX", "_velocityX", "_velocityY", "_timeToTarget"];
|
private ["_posX", "_velocityX", "_velocityY", "_timeToTarget"];
|
||||||
|
|
||||||
@ -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"];
|
||||||
|
|
||||||
@ -157,7 +157,7 @@ _FCSElevation = [];
|
|||||||
_maxElev = getNumber (_turretConfig >> "maxElev");
|
_maxElev = getNumber (_turretConfig >> "maxElev");
|
||||||
_initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed");
|
_initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed");
|
||||||
_airFriction = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "airFriction");
|
_airFriction = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "airFriction");
|
||||||
|
|
||||||
{
|
{
|
||||||
private ["_weapon", "_muzzles", "_weaponMagazines", "_muzzleMagazines"];
|
private ["_weapon", "_muzzles", "_weaponMagazines", "_muzzleMagazines"];
|
||||||
_weapon = _x;
|
_weapon = _x;
|
||||||
@ -179,7 +179,7 @@ _FCSElevation = [];
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
} forEach _weapons;
|
} forEach _weapons;
|
||||||
|
|
||||||
_offset = "ace_fcs" callExtension format ["%1,%2,%3,%4", _initSpeed, _airFriction, _angleTarget, _distance];
|
_offset = "ace_fcs" callExtension format ["%1,%2,%3,%4", _initSpeed, _airFriction, _angleTarget, _distance];
|
||||||
_offset = parseNumber _offset;
|
_offset = parseNumber _offset;
|
||||||
|
|
||||||
@ -209,4 +209,12 @@ if(_playSound) then {
|
|||||||
|
|
||||||
if(_showHint) then {
|
if(_showHint) then {
|
||||||
[format ["%1: %2", localize LSTRING(ZeroedTo), _distance]] call EFUNC(common,displayTextStructured);
|
[format ["%1: %2", localize LSTRING(ZeroedTo), _distance]] call EFUNC(common,displayTextStructured);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//Update the hud's distance display to the new value or "----" if out of range
|
||||||
|
//(10m fudge because of EFUNC(common,getTargetDistance))
|
||||||
|
if ((_distance + 10) >= (getNumber (_turretConfig >> QGVAR(MaxDistance)))) then {
|
||||||
|
((uiNamespace getVariable ["ACE_dlgRangefinder", displayNull]) displayCtrl 1713151) ctrlSetText "----";
|
||||||
|
} else {
|
||||||
|
((uiNamespace getVariable ["ACE_dlgRangefinder", displayNull]) displayCtrl 1713151) ctrlSetText ([_distance, 4, 0] call CBA_fnc_formatNumber);
|
||||||
|
};
|
||||||
|
@ -1,12 +1 @@
|
|||||||
#define COMPONENT fcs
|
#include "\z\ace\addons\fcs\script_component.hpp"
|
||||||
#include "\z\ace\addons\main\script_mod.hpp"
|
|
||||||
|
|
||||||
#ifdef DEBUG_ENABLED_FCS
|
|
||||||
#define DEBUG_MODE_FULL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef DEBUG_SETTINGS_FCS
|
|
||||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_FCS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "\z\ace\addons\main\script_macros.hpp"
|
|
@ -7,6 +7,7 @@ class CfgVehicles {
|
|||||||
icon = QUOTE(PATHTOF(UI\Icon_Module_finger_ca.paa));
|
icon = QUOTE(PATHTOF(UI\Icon_Module_finger_ca.paa));
|
||||||
function = QFUNC(moduleSettings);
|
function = QFUNC(moduleSettings);
|
||||||
isGlobal = 0;
|
isGlobal = 0;
|
||||||
|
isSingular = 1;
|
||||||
author = ECSTRING(common,ACETeam);
|
author = ECSTRING(common,ACETeam);
|
||||||
class Arguments {
|
class Arguments {
|
||||||
class enabled {
|
class enabled {
|
||||||
|
@ -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 {};
|
||||||
|
@ -95,7 +95,7 @@ GVAR(OldGlasses) = "#NULLSTRING";
|
|||||||
}] call EFUNC(common,addEventHandler);
|
}] call EFUNC(common,addEventHandler);
|
||||||
|
|
||||||
// check goggles
|
// check goggles
|
||||||
local _fnc_checkGoggles = {
|
private _fnc_checkGoggles = {
|
||||||
params ["_unit"];
|
params ["_unit"];
|
||||||
|
|
||||||
if (GVAR(EffectsActive)) then {
|
if (GVAR(EffectsActive)) then {
|
||||||
|
@ -28,7 +28,7 @@ _effects set [DIRT, true];
|
|||||||
SETGLASSES(_unit,_effects);
|
SETGLASSES(_unit,_effects);
|
||||||
|
|
||||||
if ([_unit] call FUNC(isGogglesVisible)) then {
|
if ([_unit] call FUNC(isGogglesVisible)) then {
|
||||||
local _dirtImage = getText (configFile >> "CfgGlasses" >> goggles _unit >> "ACE_OverlayDirt");
|
private _dirtImage = getText (configFile >> "CfgGlasses" >> goggles _unit >> "ACE_OverlayDirt");
|
||||||
|
|
||||||
if (_dirtImage != "") then {
|
if (_dirtImage != "") then {
|
||||||
GVAR(GogglesEffectsLayer) cutRsc ["RscACE_GogglesEffects", "PLAIN", 0.1, false];
|
GVAR(GogglesEffectsLayer) cutRsc ["RscACE_GogglesEffects", "PLAIN", 0.1, false];
|
||||||
|
@ -54,7 +54,7 @@ GVAR(DustHandler) = [{
|
|||||||
if (ACE_diagTime >= GETDUSTT(DTIME) + 3) then {
|
if (ACE_diagTime >= GETDUSTT(DTIME) + 3) then {
|
||||||
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2));
|
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2));
|
||||||
|
|
||||||
local _amount = 1 - (GETDUSTT(DAMOUNT) * 0.125);
|
private _amount = 1 - (GETDUSTT(DAMOUNT) * 0.125);
|
||||||
|
|
||||||
if !(_unit getVariable ["ACE_EyesDamaged", false]) then {
|
if !(_unit getVariable ["ACE_EyesDamaged", false]) then {
|
||||||
GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [_amount, _amount, _amount, _amount], [1, 1, 1, 0]];
|
GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [_amount, _amount, _amount, _amount], [1, 1, 1, 0]];
|
||||||
|
@ -27,7 +27,7 @@ _fnc_underCover = {
|
|||||||
if (vehicle _unit != _unit && {!isTurnedOut _unit}) exitWith {true};
|
if (vehicle _unit != _unit && {!isTurnedOut _unit}) exitWith {true};
|
||||||
|
|
||||||
// looking up and no roof over head
|
// looking up and no roof over head
|
||||||
local _position = eyePos _unit;
|
private _position = eyePos _unit;
|
||||||
positionCameraToWorld [0, 0, 1] select 2 < (positionCameraToWorld [0, 0, 0] select 2) - 0.4 || {(lineIntersects [_position, _position vectorAdd [0, 0, 15], _unit])} // return
|
positionCameraToWorld [0, 0, 1] select 2 < (positionCameraToWorld [0, 0, 0] select 2) - 0.4 || {(lineIntersects [_position, _position vectorAdd [0, 0, 15], _unit])} // return
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ if (_safe) exitWith {};
|
|||||||
|
|
||||||
// apply rotor wash effect
|
// apply rotor wash effect
|
||||||
if (_rotorWash select 1 > 0) then {
|
if (_rotorWash select 1 > 0) then {
|
||||||
local _scale = 0.7;
|
private _scale = 0.7;
|
||||||
|
|
||||||
if (_rotorWash select 1 > 0) then {
|
if (_rotorWash select 1 > 0) then {
|
||||||
_scale = CLAMP(0.3 * (_rotorWash select 1),0.1,0.3);
|
_scale = CLAMP(0.3 * (_rotorWash select 1),0.1,0.3);
|
||||||
|
@ -73,7 +73,7 @@ SETDUST(DTIME,ACE_diagTime);
|
|||||||
|
|
||||||
// apply dust effect if the amount of fired bullets is over the threshold
|
// apply dust effect if the amount of fired bullets is over the threshold
|
||||||
if (GETDUSTT(DAMOUNT) < 2) then {
|
if (GETDUSTT(DAMOUNT) < 2) then {
|
||||||
local _bulletsRequired = 100;
|
private _bulletsRequired = 100;
|
||||||
|
|
||||||
if (isNumber (configFile >> _cloudType >> QGVAR(BulletCount))) then {
|
if (isNumber (configFile >> _cloudType >> QGVAR(BulletCount))) then {
|
||||||
_bulletsRequired = getNumber (configFile >> _cloudType >> QGVAR(BulletCount));
|
_bulletsRequired = getNumber (configFile >> _cloudType >> QGVAR(BulletCount));
|
||||||
|
@ -26,7 +26,9 @@ GVAR(EffectsActive) = false;
|
|||||||
|
|
||||||
_unit setVariable ["ACE_EyesDamaged", false];
|
_unit setVariable ["ACE_EyesDamaged", false];
|
||||||
|
|
||||||
[GVAR(DustHandler)] call CBA_fnc_removePerFrameHandler;
|
if (GVAR(DustHandler) != -1) then {
|
||||||
|
[GVAR(DustHandler)] call CBA_fnc_removePerFrameHandler;
|
||||||
|
};
|
||||||
GVAR(DustHandler) = -1;
|
GVAR(DustHandler) = -1;
|
||||||
|
|
||||||
true
|
true
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
params ["_glasses"];
|
params ["_glasses"];
|
||||||
|
|
||||||
local _config = configFile >> "CfgGlasses" >> _glasses;
|
private _config = configFile >> "CfgGlasses" >> _glasses;
|
||||||
|
|
||||||
if (!isClass _config) exitWith {false};
|
if (!isClass _config) exitWith {false};
|
||||||
|
|
||||||
|
@ -21,11 +21,11 @@
|
|||||||
|
|
||||||
params ["_unit", ["_radius", 15]];
|
params ["_unit", ["_radius", 15]];
|
||||||
|
|
||||||
local _rotorWash = [false, 0];
|
private _rotorWash = [false, 0];
|
||||||
|
|
||||||
{
|
{
|
||||||
if (isEngineOn _x) then {
|
if (isEngineOn _x) then {
|
||||||
local _distance = _unit distance _x;
|
private _distance = _unit distance _x;
|
||||||
|
|
||||||
// convert distance to 0...1 range, where 0 is the maximum radius
|
// convert distance to 0...1 range, where 0 is the maximum radius
|
||||||
_distance = 1 - _distance / _radius;
|
_distance = 1 - _distance / _radius;
|
||||||
|
@ -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"];
|
||||||
|
|
||||||
|
@ -101,6 +101,7 @@ class CfgVehicles {
|
|||||||
function = QFUNC(moduleHearing);
|
function = QFUNC(moduleHearing);
|
||||||
scope = 2;
|
scope = 2;
|
||||||
isGlobal = 1;
|
isGlobal = 1;
|
||||||
|
isSingular = 1;
|
||||||
icon = PATHTOF(UI\Icon_Module_Hearing_ca.paa);
|
icon = PATHTOF(UI\Icon_Module_Hearing_ca.paa);
|
||||||
class Arguments {
|
class Arguments {
|
||||||
class EnableCombatDeafness {
|
class EnableCombatDeafness {
|
||||||
|
@ -96,4 +96,13 @@ class ACE_Settings {
|
|||||||
displayName = CSTRING(addBuildingActions);
|
displayName = CSTRING(addBuildingActions);
|
||||||
description = CSTRING(addBuildingActionsDescription);
|
description = CSTRING(addBuildingActionsDescription);
|
||||||
};
|
};
|
||||||
|
class GVAR(menuAnimationSpeed) {
|
||||||
|
value = 0;
|
||||||
|
typeName = "SCALAR";
|
||||||
|
isClientSettable = 1;
|
||||||
|
category = CSTRING(Category_InteractionMenu);
|
||||||
|
displayName = CSTRING(menuAnimationSpeed);
|
||||||
|
description = CSTRING(menuAnimationSpeed_Description);
|
||||||
|
values[] = {"$str_speed_normal", "2x", "3x"};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
@ -78,6 +78,21 @@ if (GVAR(useCursorMenu)) then {
|
|||||||
GVAR(selfMenuOffset) = ((positionCameraToWorld [0, 0, 2]) call EFUNC(common,positionToASL)) vectorDiff
|
GVAR(selfMenuOffset) = ((positionCameraToWorld [0, 0, 2]) call EFUNC(common,positionToASL)) vectorDiff
|
||||||
((positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL));
|
((positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL));
|
||||||
|
|
||||||
|
if (GVAR(menuAnimationSpeed) > 0) then {
|
||||||
|
//Auto expand the first level when self, mounted vehicle or zeus (skips the first animation as there is only one choice)
|
||||||
|
if (GVAR(openedMenuType) == 0) then {
|
||||||
|
if (isNull curatorCamera) then {
|
||||||
|
if (vehicle ACE_player != ACE_player) then {
|
||||||
|
GVAR(menuDepthPath) = [["ACE_SelfActions", (vehicle ACE_player)]];
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
GVAR(menuDepthPath) = [["ACE_ZeusActions", (getAssignedCuratorLogic player)]];
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
GVAR(menuDepthPath) = [["ACE_SelfActions", ACE_player]];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
["interactMenuOpened", [_menuType]] call EFUNC(common,localEvent);
|
["interactMenuOpened", [_menuType]] call EFUNC(common,localEvent);
|
||||||
|
|
||||||
true
|
true
|
||||||
|
@ -14,13 +14,12 @@
|
|||||||
|
|
||||||
BEGIN_COUNTER(fnc_render);
|
BEGIN_COUNTER(fnc_render);
|
||||||
|
|
||||||
private ["_cursorPos2", "_p1", "_p2", "_forEachIndex", "_x", "_cursorScreenPos", "_closestDistance", "_closestSelection", "_sPos", "_disSq", "_closest", "_cTime", "_delta", "_foundTarget", "_misMatch", "_hoverPath", "_i", "_actionData", "_player", "_target"];
|
private _foundTarget = false;
|
||||||
|
|
||||||
_foundTarget = false;
|
|
||||||
|
|
||||||
if (GVAR(openedMenuType) >= 0) then {
|
if (GVAR(openedMenuType) >= 0) then {
|
||||||
// _cursorPos1 = positionCameraToWorld [0, 0, 2];
|
BEGIN_COUNTER(fnc_renderMenuOpen);
|
||||||
_cursorPos2 = positionCameraToWorld [0, 0, 2];
|
|
||||||
|
private _cursorPos2 = positionCameraToWorld [0, 0, 2];
|
||||||
|
|
||||||
// Render all available nearby interactions
|
// Render all available nearby interactions
|
||||||
call FUNC(renderActionPoints);
|
call FUNC(renderActionPoints);
|
||||||
@ -30,27 +29,26 @@ if (GVAR(openedMenuType) >= 0) then {
|
|||||||
[[0.5,0.5], "\a3\ui_f\data\IGUI\Cfg\Cursors\selected_ca.paa"] call FUNC(renderSelector);
|
[[0.5,0.5], "\a3\ui_f\data\IGUI\Cfg\Cursors\selected_ca.paa"] call FUNC(renderSelector);
|
||||||
};
|
};
|
||||||
|
|
||||||
_cursorScreenPos = [worldToScreen _cursorPos2, GVAR(cursorPos)] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]);
|
private _cursorScreenPos = [worldToScreen _cursorPos2, GVAR(cursorPos)] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]);
|
||||||
|
|
||||||
_closestDistance = 1000000;
|
private _closestDistance = 1000000;
|
||||||
_closestSelection = -1;
|
private _closestSelection = -1;
|
||||||
{
|
{
|
||||||
_sPos = _x select 1;
|
_x params ["", "_sPos"];
|
||||||
_disSq = (((_cursorScreenPos select 0) - (_sPos select 0))^2 + ((_cursorScreenPos select 1) - (_sPos select 1))^2);
|
private _distanceFromCursor = _cursorScreenPos distance2d _sPos;
|
||||||
if(_disSq < 0.0125 && _disSq < _closestDistance) then {
|
if ((_distanceFromCursor < 0.1118) && {_distanceFromCursor < _closestDistance}) then {
|
||||||
_closestDistance = _disSq;
|
_closestDistance = _distanceFromCursor;
|
||||||
_closestSelection = _forEachIndex;
|
_closestSelection = _forEachIndex;
|
||||||
};
|
};
|
||||||
} forEach GVAR(currentOptions);
|
} forEach GVAR(currentOptions);
|
||||||
|
|
||||||
|
|
||||||
if(_closestSelection == -1) exitWith {};
|
if(_closestSelection == -1) exitWith {};
|
||||||
|
|
||||||
_closest = GVAR(currentOptions) select _closestSelection;
|
private _closest = GVAR(currentOptions) select _closestSelection;
|
||||||
|
_closest params ["_action", "_sPos", "_hoverPath"];
|
||||||
|
|
||||||
_sPos = _closest select 1;
|
private _cTime = ACE_diagTime;
|
||||||
_cTime = ACE_diagTime;
|
private _delta = _cTime - GVAR(lastTime);
|
||||||
_delta = _cTime - GVAR(lastTime);
|
|
||||||
GVAR(lastTime) = _cTime;
|
GVAR(lastTime) = _cTime;
|
||||||
|
|
||||||
GVAR(rotationAngle) = (GVAR(rotationAngle) + (270*_delta)) mod 360;
|
GVAR(rotationAngle) = (GVAR(rotationAngle) + (270*_delta)) mod 360;
|
||||||
@ -58,28 +56,17 @@ if (GVAR(openedMenuType) >= 0) then {
|
|||||||
|
|
||||||
_foundTarget = true;
|
_foundTarget = true;
|
||||||
GVAR(actionSelected) = true;
|
GVAR(actionSelected) = true;
|
||||||
GVAR(selectedAction) = (_closest select 0) select 1;
|
GVAR(selectedAction) = _action select 1;
|
||||||
GVAR(selectedTarget) = (GVAR(selectedAction)) select 2;
|
GVAR(selectedTarget) = (GVAR(selectedAction)) select 2;
|
||||||
|
|
||||||
_misMatch = false;
|
private _misMatch = !(GVAR(lastPath) isEqualTo _hoverPath);
|
||||||
_hoverPath = (_closest select 2);
|
|
||||||
|
|
||||||
if((count GVAR(lastPath)) != (count _hoverPath)) then {
|
if(_misMatch && {ACE_diagTime-GVAR(expandedTime) > linearConversion [0, 2, GVAR(menuAnimationSpeed), 0.25, 0.08333333]}) then {
|
||||||
_misMatch = true;
|
|
||||||
} else {
|
|
||||||
{
|
|
||||||
if !(_x isEqualTo (_hoverPath select _forEachIndex)) exitWith {
|
|
||||||
_misMatch = true;
|
|
||||||
};
|
|
||||||
} forEach GVAR(lastPath);
|
|
||||||
};
|
|
||||||
|
|
||||||
if(_misMatch && {ACE_diagTime-GVAR(expandedTime) > 0.25}) then {
|
|
||||||
GVAR(startHoverTime) = ACE_diagTime;
|
GVAR(startHoverTime) = ACE_diagTime;
|
||||||
GVAR(lastPath) = _hoverPath;
|
GVAR(lastPath) = _hoverPath;
|
||||||
GVAR(expanded) = false;
|
GVAR(expanded) = false;
|
||||||
} else {
|
} else {
|
||||||
if(!GVAR(expanded) && ACE_diagTime-GVAR(startHoverTime) > 0.25) then {
|
if(!GVAR(expanded) && {ACE_diagTime-GVAR(startHoverTime) > linearConversion [0, 2, GVAR(menuAnimationSpeed), 0.25, 0.08333333]}) then {
|
||||||
GVAR(expanded) = true;
|
GVAR(expanded) = true;
|
||||||
|
|
||||||
// Start the expanding menu animation only if the user is not going up the menu
|
// Start the expanding menu animation only if the user is not going up the menu
|
||||||
@ -89,9 +76,8 @@ if (GVAR(openedMenuType) >= 0) then {
|
|||||||
GVAR(menuDepthPath) = +GVAR(lastPath);
|
GVAR(menuDepthPath) = +GVAR(lastPath);
|
||||||
|
|
||||||
// Execute the current action if it's run on hover
|
// Execute the current action if it's run on hover
|
||||||
private "_runOnHover";
|
private _tmp = ((GVAR(selectedAction) select 0) select 9) select 3;
|
||||||
_tmp = ((GVAR(selectedAction) select 0) select 9) select 3;
|
private _runOnHover = true;
|
||||||
_runOnHover = true;
|
|
||||||
if ((typeName _tmp) == "CODE" ) then {
|
if ((typeName _tmp) == "CODE" ) then {
|
||||||
_runOnHover = call _tmp;
|
_runOnHover = call _tmp;
|
||||||
} else {
|
} else {
|
||||||
@ -103,14 +89,14 @@ if (GVAR(openedMenuType) >= 0) then {
|
|||||||
};
|
};
|
||||||
if (_runOnHover) then {
|
if (_runOnHover) then {
|
||||||
this = GVAR(selectedTarget);
|
this = GVAR(selectedTarget);
|
||||||
_player = ACE_Player;
|
private _player = ACE_Player;
|
||||||
_target = GVAR(selectedTarget);
|
private _target = GVAR(selectedTarget);
|
||||||
|
|
||||||
// Clear the conditions caches
|
// Clear the conditions caches
|
||||||
["clearConditionCaches", []] call EFUNC(common,localEvent);
|
["clearConditionCaches", []] call EFUNC(common,localEvent);
|
||||||
|
|
||||||
// Check the action conditions
|
// Check the action conditions
|
||||||
_actionData = GVAR(selectedAction) select 0;
|
private _actionData = GVAR(selectedAction) select 0;
|
||||||
if ([_target, _player, _actionData select 6] call (_actionData select 4)) then {
|
if ([_target, _player, _actionData select 6] call (_actionData select 4)) then {
|
||||||
// Call the statement
|
// Call the statement
|
||||||
[_target, _player, _actionData select 6] call (_actionData select 3);
|
[_target, _player, _actionData select 6] call (_actionData select 3);
|
||||||
@ -121,6 +107,7 @@ if (GVAR(openedMenuType) >= 0) then {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
END_COUNTER(fnc_renderMenuOpen);
|
||||||
};
|
};
|
||||||
|
|
||||||
if(!_foundTarget && GVAR(actionSelected)) then {
|
if(!_foundTarget && GVAR(actionSelected)) then {
|
||||||
|
@ -101,9 +101,9 @@ if (GVAR(UseListMenu)) then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Animate menu scale
|
// Animate menu scale
|
||||||
if (_menuInSelectedPath && (_menuDepth == count _path)) then {
|
if (_menuInSelectedPath && {_menuDepth == count _path}) then {
|
||||||
_scaleX = _scaleX * (0.3 + 0.7 * (((ACE_diagTime - GVAR(expandedTime)) * 8) min 1));
|
_scaleX = _scaleX * (0.3 + 0.7 * (((ACE_diagTime - GVAR(expandedTime)) * linearConversion [0, 2, GVAR(menuAnimationSpeed), 8, 16]) min 1));
|
||||||
_scaleY = _scaleY * (0.3 + 0.7 * (((ACE_diagTime - GVAR(expandedTime)) * 8) min 1));
|
_scaleY = _scaleY * (0.3 + 0.7 * (((ACE_diagTime - GVAR(expandedTime)) * linearConversion [0, 2, GVAR(menuAnimationSpeed), 8, 16]) min 1));
|
||||||
};
|
};
|
||||||
|
|
||||||
_target = _actionObject;
|
_target = _actionObject;
|
||||||
|
@ -299,5 +299,11 @@
|
|||||||
<Czech>Menu interakce</Czech>
|
<Czech>Menu interakce</Czech>
|
||||||
<Spanish>Menú de interacción</Spanish>
|
<Spanish>Menú de interacción</Spanish>
|
||||||
</Key>
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Interact_Menu_menuAnimationSpeed">
|
||||||
|
<English>Interaction Animation Speed</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Interact_Menu_menuAnimationSpeed_Description">
|
||||||
|
<English>Makes menu animations faster and decreases the time needed to hover to show sub actions</English>
|
||||||
|
</Key>
|
||||||
</Package>
|
</Package>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -199,47 +199,47 @@ class ACE_ZeusActions {
|
|||||||
class wedge {
|
class wedge {
|
||||||
displayName = "$STR_Wedge";
|
displayName = "$STR_Wedge";
|
||||||
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\wedge_ca.paa";
|
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\wedge_ca.paa";
|
||||||
statement = "{_x setWaypointFormation 'WEDGE';} forEach (curatorSelected select 1);";
|
statement = "{_x setWaypointFormation 'WEDGE';} forEach (curatorSelected select 2);";
|
||||||
};
|
};
|
||||||
class vee {
|
class vee {
|
||||||
displayName = "$STR_Vee";
|
displayName = "$STR_Vee";
|
||||||
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\vee_ca.paa";
|
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\vee_ca.paa";
|
||||||
statement = "{_x setWaypointFormation 'VEE';} forEach (curatorSelected select 1);";
|
statement = "{_x setWaypointFormation 'VEE';} forEach (curatorSelected select 2);";
|
||||||
};
|
};
|
||||||
class line {
|
class line {
|
||||||
displayName = "$STR_Line";
|
displayName = "$STR_Line";
|
||||||
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\line_ca.paa";
|
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\line_ca.paa";
|
||||||
statement = "{_x setWaypointFormation 'LINE';} forEach (curatorSelected select 1);";
|
statement = "{_x setWaypointFormation 'LINE';} forEach (curatorSelected select 2);";
|
||||||
};
|
};
|
||||||
class column {
|
class column {
|
||||||
displayName = "$STR_Column";
|
displayName = "$STR_Column";
|
||||||
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\column_ca.paa";
|
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\column_ca.paa";
|
||||||
statement = "{_x setWaypointFormation 'COLUMN';} forEach (curatorSelected select 1);";
|
statement = "{_x setWaypointFormation 'COLUMN';} forEach (curatorSelected select 2);";
|
||||||
};
|
};
|
||||||
class file {
|
class file {
|
||||||
displayName = "$STR_File";
|
displayName = "$STR_File";
|
||||||
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\file_ca.paa";
|
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\file_ca.paa";
|
||||||
statement = "{_x setWaypointFormation 'FILE';} forEach (curatorSelected select 1);";
|
statement = "{_x setWaypointFormation 'FILE';} forEach (curatorSelected select 2);";
|
||||||
};
|
};
|
||||||
class stag_column {
|
class stag_column {
|
||||||
displayName = "$STR_Staggered";
|
displayName = "$STR_Staggered";
|
||||||
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\stag_column_ca.paa";
|
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\stag_column_ca.paa";
|
||||||
statement = "{_x setWaypointFormation 'STAG COLUMN';} forEach (curatorSelected select 1);";
|
statement = "{_x setWaypointFormation 'STAG COLUMN';} forEach (curatorSelected select 2);";
|
||||||
};
|
};
|
||||||
class ech_left {
|
class ech_left {
|
||||||
displayName = "$STR_EchL";
|
displayName = "$STR_EchL";
|
||||||
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_left_ca.paa";
|
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_left_ca.paa";
|
||||||
statement = "{_x setWaypointFormation 'ECH LEFT';} forEach (curatorSelected select 1);";
|
statement = "{_x setWaypointFormation 'ECH LEFT';} forEach (curatorSelected select 2);";
|
||||||
};
|
};
|
||||||
class ech_right {
|
class ech_right {
|
||||||
displayName = "$STR_EchR";
|
displayName = "$STR_EchR";
|
||||||
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_right_ca.paa";
|
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_right_ca.paa";
|
||||||
statement = "{_x setWaypointFormation 'ECH RIGHT';} forEach (curatorSelected select 1);";
|
statement = "{_x setWaypointFormation 'ECH RIGHT';} forEach (curatorSelected select 2);";
|
||||||
};
|
};
|
||||||
class diamond {
|
class diamond {
|
||||||
displayName = "$STR_Diamond";
|
displayName = "$STR_Diamond";
|
||||||
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\diamond_ca.paa";
|
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\diamond_ca.paa";
|
||||||
statement = "{_x setWaypointFormation 'DIAMOND';} forEach (curatorSelected select 1);";
|
statement = "{_x setWaypointFormation 'DIAMOND';} forEach (curatorSelected select 2);";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -8,6 +8,7 @@ class CfgVehicles {
|
|||||||
function = "ACE_Interaction_fnc_moduleInteraction";
|
function = "ACE_Interaction_fnc_moduleInteraction";
|
||||||
scope = 2;
|
scope = 2;
|
||||||
isGlobal = 1;
|
isGlobal = 1;
|
||||||
|
isSingular = 1;
|
||||||
icon = PATHTOF(UI\Icon_Module_Interaction_ca.paa);
|
icon = PATHTOF(UI\Icon_Module_Interaction_ca.paa);
|
||||||
|
|
||||||
class Arguments {
|
class Arguments {
|
||||||
|
@ -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];
|
||||||
|
private _message = parseText format ([["%1 >", localize LSTRING(YouWereTappedRight)], ["< %1", localize LSTRING(YouWereTappedLeft)]] select (_shoulderNum == 0));
|
||||||
|
[_message] call FUNC(displayTextStructured);
|
||||||
};
|
};
|
||||||
|
|
||||||
private "_message";
|
|
||||||
_message = parseText format ([["%1 >", localize LSTRING(YouWereTappedRight)], ["< %1", localize LSTRING(YouWereTappedLeft)]] select (_shoulderNum == 0));
|
|
||||||
|
|
||||||
["displayTextStructured", _message] call EFUNC(common,targetEvent);
|
|
||||||
}] call EFUNC(common,addEventHandler);
|
}] call EFUNC(common,addEventHandler);
|
||||||
|
|
||||||
// restore global fire teams for JIP
|
// restore global fire teams for JIP
|
||||||
|
@ -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
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
@ -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; };
|
||||||
};
|
};
|
||||||
|
@ -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;
|
||||||
|
@ -19,23 +19,14 @@
|
|||||||
params ["_object"];
|
params ["_object"];
|
||||||
TRACE_1("params",_object);
|
TRACE_1("params",_object);
|
||||||
|
|
||||||
private ["_typeOf", "_returnValue"];
|
private _typeOf = typeOf _object;
|
||||||
|
|
||||||
_typeOf = typeOf _object;
|
private _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
|
||||||
|
@ -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 =
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
@ -32,7 +26,7 @@ PERFORMANCE COUNTERS SECTION
|
|||||||
|
|
||||||
#ifdef ENABLE_PERFORMANCE_COUNTERS
|
#ifdef ENABLE_PERFORMANCE_COUNTERS
|
||||||
#define CBA_fnc_addPerFrameHandler { _ret = [(_this select 0), (_this select 1), (_this select 2), #function] call CBA_fnc_addPerFrameHandler; if(isNil "ACE_PFH_COUNTER" ) then { ACE_PFH_COUNTER=[]; }; ACE_PFH_COUNTER pushBack [[_ret, __FILE__, __LINE__], [(_this select 0), (_this select 1), (_this select 2)]]; _ret }
|
#define CBA_fnc_addPerFrameHandler { _ret = [(_this select 0), (_this select 1), (_this select 2), #function] call CBA_fnc_addPerFrameHandler; if(isNil "ACE_PFH_COUNTER" ) then { ACE_PFH_COUNTER=[]; }; ACE_PFH_COUNTER pushBack [[_ret, __FILE__, __LINE__], [(_this select 0), (_this select 1), (_this select 2)]]; _ret }
|
||||||
|
|
||||||
#define CREATE_COUNTER(x) if(isNil "ACE_COUNTERS" ) then { ACE_COUNTERS=[]; }; GVAR(DOUBLES(x,counter))=[]; GVAR(DOUBLES(x,counter)) set[0, QUOTE(GVAR(DOUBLES(x,counter)))]; GVAR(DOUBLES(x,counter)) set[1, diag_tickTime]; ACE_COUNTERS pushBack GVAR(DOUBLES(x,counter));
|
#define CREATE_COUNTER(x) if(isNil "ACE_COUNTERS" ) then { ACE_COUNTERS=[]; }; GVAR(DOUBLES(x,counter))=[]; GVAR(DOUBLES(x,counter)) set[0, QUOTE(GVAR(DOUBLES(x,counter)))]; GVAR(DOUBLES(x,counter)) set[1, diag_tickTime]; ACE_COUNTERS pushBack GVAR(DOUBLES(x,counter));
|
||||||
#define BEGIN_COUNTER(x) if(isNil QUOTE(GVAR(DOUBLES(x,counter)))) then { CREATE_COUNTER(x) }; GVAR(DOUBLES(x,counter)) set[2, diag_tickTime];
|
#define BEGIN_COUNTER(x) if(isNil QUOTE(GVAR(DOUBLES(x,counter)))) then { CREATE_COUNTER(x) }; GVAR(DOUBLES(x,counter)) set[2, diag_tickTime];
|
||||||
#define END_COUNTER(x) GVAR(DOUBLES(x,counter)) pushBack [(GVAR(DOUBLES(x,counter)) select 2), diag_tickTime];
|
#define END_COUNTER(x) GVAR(DOUBLES(x,counter)) pushBack [(GVAR(DOUBLES(x,counter)) select 2), diag_tickTime];
|
||||||
@ -43,4 +37,4 @@ PERFORMANCE COUNTERS SECTION
|
|||||||
#define BEGIN_COUNTER(x) /* disabled */
|
#define BEGIN_COUNTER(x) /* disabled */
|
||||||
#define END_COUNTER(x) /* disabled */
|
#define END_COUNTER(x) /* disabled */
|
||||||
#define DUMP_COUNTERS /* disabled */
|
#define DUMP_COUNTERS /* disabled */
|
||||||
#endif
|
#endif
|
||||||
|
@ -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)]
|
||||||
|
@ -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
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user