Merge remote-tracking branch 'refs/remotes/acemod/master' into refuel

This commit is contained in:
IngoKauffmann 2015-11-23 19:29:05 +01:00
commit cbe8d98f86
290 changed files with 2811 additions and 1483 deletions

View File

@ -1,15 +1,30 @@
branches: branches:
only: only:
- master - master
language: python language: python
python: python:
- "3.4" - '3.4'
before_script: before_script:
- pip install pygithub - if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
- pip install pygithub3 pip install pygithub;
pip install pygithub3;
fi
script: script:
- python3 tools/deploy.py - python3 tools/sqf_validator.py
- python3 tools/sqf_validator.py - if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
python3 tools/deploy.py;
fi
env: env:
global: global:
- secure: "KcJQbknBOdC5lA4nFGKPXVRVIGLDXDRzC8XkHuXJCE9pIR/wbxbkvx8fHKcC6SC9eHgzneC3+o4m4+CjIbVvIwDgslRbJ8Y59i90ncONmdoRx1HUYHwuYWVZm9HJFjCsIbrEqhSyyKS+PB3WZVOLbErtNHsgS8f43PTh5Ujg7Vg=" - secure: KcJQbknBOdC5lA4nFGKPXVRVIGLDXDRzC8XkHuXJCE9pIR/wbxbkvx8fHKcC6SC9eHgzneC3+o4m4+CjIbVvIwDgslRbJ8Y59i90ncONmdoRx1HUYHwuYWVZm9HJFjCsIbrEqhSyyKS+PB3WZVOLbErtNHsgS8f43PTh5Ujg7Vg=
notifications:
slack:
secure: aWYF/YX7vxEdXJ5w1jhYJQ2TtTP2NRdnXzJDMYXTv2dlXYhO9qp2qjxDGW3dezuPY7B1mPBgebfSKRx3Robkt1rAfEwPWivOiEztL30rwzOy+5Q1wpORv1JkvTC/q2wqQzxQCU/FPVjD2GkF1wtq1Rnx3ESWD8gbvzYoMNdIw1g=
on_success: change
on_failure: always
on_start: never
rooms:
secure: MvxmqL1NGwiGTVv6uIVTM7jeNLQH95KYtTgSWlXaSw4jdjnf4cmrb/ofHQ3FHhhNVdhRN6W8n0cJfTC3DBZ90bionVh+528qw2mDnDbKljVdIwmoFSexBcH7H1uTLF3gsEz0tbrHtLcnAyTMxdjsdIXDLZ5hwxABNmW5/03jOgs=
email:
on_success: never
on_failure: change

View File

@ -44,6 +44,7 @@ BlackPixxel <blackpixxel96@gmail.com>
BlackQwar BlackQwar
Brakoviejo Brakoviejo
Brisse <brisse@outlook.com> Brisse <brisse@outlook.com>
Brostrom.A | Evul <andreas.brostrom.ce@gmail.com>
BullHorn <bullhorn7@gmail.com> BullHorn <bullhorn7@gmail.com>
Clon1998 <ps.patti1998@gmail.com> Clon1998 <ps.patti1998@gmail.com>
Codingboy Codingboy
@ -53,6 +54,7 @@ Dharma Bellamkonda <dharma.bellamkonda@gmail.com>
Dimaslg <dimaslg@telecable.es> Dimaslg <dimaslg@telecable.es>
Drill <drill87@gmail.com> Drill <drill87@gmail.com>
Dudakov <dudakov.s@gmail.com> Dudakov <dudakov.s@gmail.com>
Dslyecxi <dslyecxi@gmail.com>
eRazeri eRazeri
evromalarkey <evromalarkey@gmail.com> evromalarkey <evromalarkey@gmail.com>
F3 Project <alanr@ferstaberinde.com> F3 Project <alanr@ferstaberinde.com>

64
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,64 @@
# Reporting an issue
## Before reporting
If you have found an issue with ACE3 please make sure that ACE3 is really the cause of the problem. To do this try to reproduce the issue with using only `@CBA_A3` and `@ace` on a newly created mission.
Indicate if the issue appears on stable or development version. In case it is the development version, please also include the commit SHA-1 hash.
<div class="panel callout">
<h5>Please note:</h5>
<p>It's not a valid to simply remove <code>@ace</code> from the mod list to confirm that ACE3 is the culprit.</p>
<p>If the error happens when using a <b>third-party mod</b> contact the author of the appropriate mod and report the issue there.</p>
</div>
## Reporting the issue
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
(indicate if stable or dev, if dev indicate the commit the version is based on)
**Mods:**
* `@CBA_A3`
* `@ace`
**Placed ACE3 Modules:**
* *Add the list of modules you have placed on the map. Use 'None' if the error occurs without using any modules.*
* You can also press the `Debug to` button in the ACE3 option menu (escape -> ACE3 options -> Debug to) and add a link (pastebin.com) to the results.
**Description:**
* Add a detailed description of the error. This makes it easier for us to fix the issue.*
**Steps to reproduce:**
* *Add the steps needed to reproduce the issue.*
**Where did the issue occur?**
* A possible answer might be "Multiplayer", "Editor" or "Singleplayer"*
**RPT log file:**
* Add a link (pastebin.com) to the client or server RPT file.*
```
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).
# Feature Requests
## Background
ACE2, AGM and CSE had a lot of features implemented or planned. All of them are or have been evaluated for inclusion in ACE3 itself, and we'd like to port the majority of them eventually. However, due to time constraints, we have managed to finish only a fraction of the job so far.
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
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.
# 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)
- [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)

View File

@ -22,13 +22,13 @@ source code of the individual modules.
When publishing a derivative of this product you may not use a name that When publishing a derivative of this product you may not use a name that
might create the impression that your version is an official release. might create the impression that your version is an official release.
Some folders of this project may contain a seperate LICENSE file. Should Some folders of this project may contain a separate LICENSE file. Should
that be the case, everything in that folder and all subfolders is subject that be the case, everything in that folder and all subfolders is subject
to that license instead. to that license instead.
============================================================================ ============================================================================
Full Gnu General Public License Text Full GNU General Public License Text
============================================================================ ============================================================================

View File

@ -1,27 +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="http://img.shields.io/badge/Download-62.0_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="http://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="http://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.koffeinflummi.de"> <a href="http://slackin.ace3mod.com/">
<img src="http://slackin.koffeinflummi.de/badge.svg" alt="ACE3 Slack"> <img src="http://slackin.ace3mod.com/badge.svg?style=flat-square&label=Slack" alt="ACE3 Slack">
</a>
<a href="https://travis-ci.org/acemod/ACE3">
<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.
@ -40,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
@ -66,7 +75,8 @@ The mod is **built modularly**, so almost any included PBO can be easily removed
### Guides & how-tos ### Guides & how-tos
If you installed ACE3 but have trouble understanding how it all works, or where to start, read this first: If you installed ACE3 but have trouble understanding how it all works, or where to start, read this first:
- [Getting started](http://ace3mod.com/wiki/user/getting-started.html) - [Installation guide](http://ace3mod.com/wiki/user/installation-guide.html)
- [Information center](http://ace3mod.com/wiki/user/information-center.html)
#### Contributing #### Contributing
You can help out with the ongoing development by looking for potential bugs in our code base, or by contributing new features. To contribute something to ACE3, simply fork this repository and submit your pull requests for review by other collaborators. Remember to add yourself to the author array of any PBO you will be editing and the [`AUTHORS.txt`](https://github.com/acemod/ACE3/blob/master/AUTHORS.txt) file; including a valid email address. You can help out with the ongoing development by looking for potential bugs in our code base, or by contributing new features. To contribute something to ACE3, simply fork this repository and submit your pull requests for review by other collaborators. Remember to add yourself to the author array of any PBO you will be editing and the [`AUTHORS.txt`](https://github.com/acemod/ACE3/blob/master/AUTHORS.txt) file; including a valid email address.

View File

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

View File

@ -24,12 +24,12 @@ if (!hasInterface) exitWith {};
if (!GVAR(enabled)) exitWith {}; if (!GVAR(enabled)) exitWith {};
// Parameterization // Parameterization
private ["_abort", "_AmmoCacheEntry", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_bulletMass", "_bulletLength", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_barrelTwist", "_stabilityFactor"]; private ["_abort", "_AmmoCacheEntry", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_bulletMass", "_bulletLength", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletLength", "_barrelTwist", "_stabilityFactor", "_aceTimeSecond", "_barrelVelocityShift", "_ammoTemperatureVelocityShift"];
params ["_unit", "_weapon", "", "_mode", "_ammo", "_magazine", "_bullet"]; params ["_unit", "_weapon", "", "_mode", "_ammo", "_magazine", "_bullet"];
_abort = false; _abort = false;
if (!(_ammo isKindOf "BulletBase")) exitWith {}; if (!(_ammo isKindOf "BulletBase")) exitWith {};
if (!alive _bullet) exitWith {}; if (!alive _bullet) exitWith {};
if (!([_unit] call EFUNC(common,isPlayer))) exitWith {}; if (!([_unit] call EFUNC(common,isPlayer))) exitWith {};
@ -75,22 +75,22 @@ _WeaponCacheEntry params ["_barrelTwist", "_twistDirection", "_barrelLength"];
_bulletVelocity = velocity _bullet; _bulletVelocity = velocity _bullet;
_muzzleVelocity = vectorMagnitude _bulletVelocity; _muzzleVelocity = vectorMagnitude _bulletVelocity;
_barrelVelocityShift = 0;
if (GVAR(barrelLengthInfluenceEnabled)) then { if (GVAR(barrelLengthInfluenceEnabled)) then {
_barrelVelocityShift = uiNamespace getVariable [format [QGVAR(%1_muzzleVelocityShift),_weapon],nil]; _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;
}; };

View File

@ -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");

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,9 +1,9 @@
/* /*
* Author: PabstMirror * Author: PabstMirror
* Module Function to make a unit surrender (can be called from editor, or placed with zeus) * Module Function to make a unit surrender (can be called from editor)
* *
* Arguments: * Arguments:
* 0: The Module Logic Object <OBJECT> * 0: The Module Logic <OBJECT>
* 1: synced objects <ARRAY> * 1: synced objects <ARRAY>
* 2: Activated <BOOL> * 2: Activated <BOOL>
* *
@ -17,20 +17,19 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_bisMouseOver", "_mouseOverObject"];
params ["_logic", "_units", "_activated"]; params ["_logic", "_units", "_activated"];
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;
};

View File

@ -56,8 +56,11 @@ if (_state) then {
//Adds an animation changed eh //Adds an animation changed eh
//If we get a change in animation then redo the animation (handles people vaulting to break the animation chain) //If we get a change in animation then redo the animation (handles people vaulting to break the animation chain)
private "_animChangedEHID"; 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];

View File

@ -48,7 +48,11 @@ if (_state) then {
if (_unit getVariable [QGVAR(isSurrendering), false] && {(vehicle _unit) == _unit}) then { if (_unit getVariable [QGVAR(isSurrendering), false] && {(vehicle _unit) == _unit}) then {
//Adds an animation changed eh //Adds an animation changed eh
//If we get a change in animation then redo the animation (handles people vaulting to break the animation chain) //If we get a change in animation then redo the animation (handles people vaulting to break the animation chain)
private "_animChangedEHID"; 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];

View File

@ -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.&lt;br /&gt;Source: ace_captives</English> <English>Sync a unit to make them surrender.&lt;br /&gt;Source: ace_captives</English>
@ -177,7 +177,17 @@
<Portuguese>Sincroniza uma unidade para fazer com que ela se renda. &lt;br/&gt;Fonte: ace_captives</Portuguese> <Portuguese>Sincroniza uma unidade para fazer com que ela se renda. &lt;br/&gt;Fonte: ace_captives</Portuguese>
<French>Synchronise une unité pour la rendre captive. &lt;br/&gt;Source: ace_captives</French> <French>Synchronise une unité pour la rendre captive. &lt;br/&gt;Source: ace_captives</French>
<Hungarian>Egység szinkronizálása, hogy kapituláljon.&lt;br /&gt;Forrás: ace_captives</Hungarian> <Hungarian>Egység szinkronizálása, hogy kapituláljon.&lt;br /&gt;Forrás: ace_captives</Hungarian>
<Russian>Синхронизируйте с юнитами, чтобы сделать их пленными.&lt;br /&gt;Источник: ace_captives</Russian> <Russian>Синхронизируйте с юнитами, чтобы заставить их сдаться в плен.&lt;br /&gt;Источник: ace_captives</Russian>
</Key>
<Key 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.&lt;br /&gt;Source: ace_captives</English>
<Portuguese>Sincronizar uma unidade para deixá-la algemada.&lt;br/&gt;Source: ace_captives</Portuguese>
<Russian>Синхронизируйте с юнитами, чтобы сделать их связанными.&lt;br /&gt;Источник: 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>

View File

@ -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 {
@ -218,6 +226,18 @@ class CfgVehicles {
GVAR(size) = 2; // 1 = small, 2 = large GVAR(size) = 2; // 1 = small, 2 = large
GVAR(canLoad) = 1; GVAR(canLoad) = 1;
}; };
//"Supply Box" - Small Pallets
class B_supplyCrate_F: ReammoBox_F {
GVAR(size) = 6;
};
class IG_supplyCrate_F: ReammoBox_F {
GVAR(size) = 6;
};
class C_supplyCrate_F: ReammoBox_F {
GVAR(size) = 6;
};
class Scrapyard_base_F; class Scrapyard_base_F;
class Land_PaperBox_closed_F: Scrapyard_base_F { class Land_PaperBox_closed_F: Scrapyard_base_F {
@ -425,5 +445,5 @@ class CfgVehicles {
selection = ""; selection = "";
}; };
}; };
}; };
}; };

View File

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

View File

@ -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);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -95,5 +95,21 @@
<Hungarian>1%&lt;br/&gt;kirakodva ebből:&lt;br/&gt;%2</Hungarian> <Hungarian>1%&lt;br/&gt;kirakodva ebből:&lt;br/&gt;%2</Hungarian>
<Russian>%1&lt;br/&gt;разгружен из&lt;br/&gt;%2</Russian> <Russian>%1&lt;br/&gt;разгружен из&lt;br/&gt;%2</Russian>
</Key> </Key>
<Key ID="STR_ACE_Cargo_LoadingItem">
<English>Loading Cargo</English>
<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&lt;br/&gt;could not be loaded</English>
<Portuguese>%1&lt;br/&gt;não pode ser carregado</Portuguese>
</Key>
<Key ID="STR_ACE_Cargo_UnloadingFailed">
<English>%1&lt;br/&gt;could not be unloaded</English>
<Portuguese>%1&lt;br/&gt;não pode ser descarregado</Portuguese>
</Key>
</Package> </Package>
</Project> </Project>

View File

@ -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 {

View File

@ -9,11 +9,11 @@
//Singe PFEH to handle execNextFrame, waitAndExec and waitUntilAndExec: //Singe PFEH to handle execNextFrame, waitAndExec and waitUntilAndExec:
[{ [{
private ["_entry", "_deleted"]; BEGIN_COUNTER(waitAndExec);
//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 {
_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:
_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 {
@ -39,6 +39,8 @@
(_x select 2) call (_x select 1); (_x select 2) call (_x select 1);
}; };
} forEach GVAR(waitUntilAndExecArray); } forEach GVAR(waitUntilAndExecArray);
END_COUNTER(waitAndExec);
}, 0, []] call CBA_fnc_addPerFrameHandler; }, 0, []] call CBA_fnc_addPerFrameHandler;
@ -192,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);

View File

@ -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);
@ -133,11 +134,13 @@ PREP(numberToDigitsString);
PREP(numberToString); PREP(numberToString);
PREP(onAnswerRequest); PREP(onAnswerRequest);
PREP(owned); PREP(owned);
PREP(parseList);
PREP(player); PREP(player);
PREP(playerSide); 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);
@ -222,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);

View File

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

View File

@ -4,50 +4,41 @@
* Used by moduleAssign* within various parts of the ACE3 project. * Used by moduleAssign* within various parts of the ACE3 project.
* *
* Arguments: * Arguments:
* 0: list <STRING> * 0: List <STRING>
* 1: variableName <STRING> * 1: Variable Name <STRING>
* 2: value <ANY> * 2: Value <ANY>
* 3: Global <BOOL> * 3: Global <BOOL>
* 4: Vehicle <BOOL> (default: false)
* *
* Return Value: * Return Value:
* None <NIL> * None
*
* Example:
* ["text", "variable", value, true] call ace_common_fnc_assignObjectsInList
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_list", "_variable", "_setting", "_global"]; params ["_list", "_variable", "_setting", "_global", ["_vehicle", false]];
if (typeName _list == "STRING") then { if (typeName _list == "STRING") then {
private ["_splittedList", "_nilCheckPassedList"]; _list = [_list, true, true] call FUNC(parseList);
TRACE_1("Parsed",_list)
_splittedList = [_list, ","] call BIS_fnc_splitString;
_nilCheckPassedList = "";
{
_x = [_x] call FUNC(stringRemoveWhiteSpace);
if !(isNil _x) then {
if (_nilCheckPassedList == "") then {
_nilCheckPassedList = _x;
} else {
_nilCheckPassedList = _nilCheckPassedList + ","+ _x;
};
};
false
} count _splittedList;
_list = [] call compile format["[%1]",_nilCheckPassedList];
}; };
{ {
if (!isNil "_x") then { if (!isNil "_x") then {
if (typeName _x == typeName objNull) then { if (typeName _x == typeName objNull) then {
if (local _x) then { if (local _x) then {
_x setvariable [_variable, _setting, _global]; if (_vehicle) then {
(vehicle _x) setVariable [_variable, _setting, _global];
TRACE_6("Set variable vehicle",_x,vehicle _x,typeOf (vehicle _x),_variable,_setting,_global);
} else {
_x setVariable [_variable, _setting, _global];
TRACE_5("Set variable",_x,typeOf _x,_variable,_setting,_global);
};
}; };
}; };
}; };
false
} count _list; } count _list;
true

View File

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

View File

@ -1,22 +1,24 @@
/* /*
* Author: ? * Author: ?
* ? * Dumps an array to the RPT, showing the depth of each element.
* *
* Arguments: * Arguments:
* 0: Array to be dumped <ARRAY> * 0: Array to be dumped <ARRAY>
* 1: Depth <NUMBER> * 1: Depth <NUMBER><OPTIONAL>
* *
* Return Value: * Return Value:
* None * None
* *
* Example:
* [[0, [1,2], [[3]]]] call ace_common_fnc_dumpArray
*
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_var", "_depth"]; params ["_var", ["_depth", 0, [0]]];
private "_pad"; private _pad = "";
_pad = "";
for "_i" from 0 to _depth do { for "_i" from 0 to _depth do {
_pad = _pad + toString [9]; _pad = _pad + toString [9];
@ -38,5 +40,5 @@ if (IS_ARRAY(_var)) then {
diag_log text format ["%1],", _pad]; diag_log text format ["%1],", _pad];
}; };
} else { } else {
diag_log text format ["%1%2", _pad, [_var] call FUNC(formatVar)]; diag_log text format ["%1%2", _pad, _var];
}; };

View File

@ -20,11 +20,10 @@
GVAR(remoteFnc) = _this; GVAR(remoteFnc) = _this;
params ["_arguments", "_function", "_unit", "_name"]; params ["_arguments", "_function", "_unit", "_name"];
TRACE_4("params", _arguments, _function, _unit, _name);
_function = call compile _function; _function = call compile _function;
//["Remote", [_arguments, _this select 1, _name], {format ["%1 call %2 id: %3", _this select 0, _this select 1, _this select 2]}, false] call FUNC(log);
// execute function on every currently connected machine // execute function on every currently connected machine
[[_arguments, _unit], _this select 1, 2] call FUNC(execRemoteFnc); [[_arguments, _unit], _this select 1, 2] call FUNC(execRemoteFnc);

View File

@ -23,11 +23,10 @@
GVAR(remoteFnc) = _this; GVAR(remoteFnc) = _this;
params ["_arguments", "_function", ["_unit", 2]]; params ["_arguments", "_function", ["_unit", 2]];
TRACE_3("params", _arguments, _function, _unit);
_function = call compile _function; _function = call compile _function;
//["Remote", [_arguments, _this select 1, _unit], {format ["%1 call %2 to: %3", _this select 0, _this select 1, _this select 2]}, false] call FUNC(log);
if (typeName _unit == "SCALAR") exitWith { if (typeName _unit == "SCALAR") exitWith {
switch (_unit) do { switch (_unit) do {
case 0 : { case 0 : {

View File

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

View File

@ -8,29 +8,23 @@
* Return Value: * Return Value:
* Turret Index <ARRAY> * Turret Index <ARRAY>
* *
* Example:
* [ace_player] call ace_common_fnc_getTurretIndex
*
* Public: Yes * Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_unit"]; params ["_unit"];
private ["_vehicle", "_turrets", "_units", "_index"]; private _vehicle = vehicle _unit;
_vehicle = vehicle _unit;
if (_unit == _vehicle) exitWith {[]}; if (_unit == _vehicle) exitWith {[]};
_turrets = allTurrets [_vehicle, true]; scopeName "main";
_units = [];
{ {
_units pushBack (_vehicle turretUnit _x); if (_unit == (_vehicle turretUnit _x)) then {_x breakOut "main"};
false nil
} count _turrets; } count allTurrets [_vehicle, true];
_index = _units find _unit; []
if (_index == -1) exitWith {[]};
_turrets select _index;

View File

@ -0,0 +1,35 @@
/*
* Author: commy2
* Check if unit is in a vehicle position where it can turn in or out.
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* Unit has a hatch? <BOOL>
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit"];
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

View File

@ -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

View 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

View File

@ -21,7 +21,7 @@ private ["_vehicle", "_loadcar", "_loadair", "_loadtank", "_loadboat"];
_vehicle = objNull; _vehicle = objNull;
if (!([_caller] call FUNC(canInteract)) || {_caller == _unit}) exitwith {_vehicle}; if (!([_caller, _unit, ["isNotDragging", "isNotCarrying"]] call FUNC(canInteractWith)) || {_caller == _unit}) exitwith {_vehicle};
_loadcar = nearestObject [_unit, "Car"]; _loadcar = nearestObject [_unit, "Car"];

View File

@ -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 {

View File

@ -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);

View File

@ -0,0 +1,59 @@
/*
* Author: Glowbal, Jonpas
* Makes a list from a string using comma as a delimiter, optionally trim or remove whitespace and check each for object existence.
*
* Arguments:
* 0: List <STRING>
* 1: Remove or Trim Whitespace <BOOL> (default: false (trim))
* 2: Check Nil <BOOL> (default: false)
*
* Return Value:
* Parsed List <ARRAY>
*
* Example:
* ["text", true, false] call ace_common_fnc_parseList
*
* Public: No
*/
#include "script_component.hpp"
params ["_list", ["_removeWhitespace", false], ["_checkNil", false]];
private ["_whitespaceList", "_nilCheckedList"];
// Split using comma delimiter
_list = _list splitString ",";
TRACE_1("Splitted List",_list);
// Remove or Trim Whitespace
_whitespaceList = [];
{
if (_removeWhitespace) then {
_whitespaceList pushBack ([_x] call FUNC(stringRemoveWhiteSpace));
} else {
_whitespaceList pushBack ([_x] call CBA_fnc_trim);
};
nil
} count _list;
_list = _whitespaceList;
TRACE_1("Whitespace List",_list);
// Check for object existence
if (_checkNil) then {
_nilCheckedList = [];
{
if !(isNil _x) then {
_nilCheckedList pushBack (missionNamespace getVariable _x);
};
nil
} count _list;
_list = _nilCheckedList;
};
TRACE_1("Final List",_list);
_list

View File

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

View File

@ -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;

View File

@ -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}}

View File

@ -1,53 +0,0 @@
/*
* Author: Glowbal
* Sends a display information hint to a receiver
*
* Arguments:
* 0: receiver <OBJECT>
* 1: title <STRING>
* 2: content <ARRAY>
* 3: type (optional) <NUMBER>
*
* Return Value:
* None
*
* Public: Yes
*/
#include "script_component.hpp"
params [["_reciever", objNull], ["_title", ""], ["_content", ""], ["_type", 0], ["_parameters", []]];
if (isPlayer _reciever) then {
if (!local _reciever) then {
[_this, QFUNC(sendDisplayInformationTo), _reciever, false] call FUNC(execRemoteFnc);
} else {
if (isLocalized _title) then {
_title = localize _title;
};
private "_localizationArray";
_localizationArray = [_title];
{
_localizationArray pushback _x;
false
} count _parameters;
_title = format _localizationArray;
{
if (isLocalized _x) then {
_localizationArray = [localize _x];
{
_localizationArray pushBack _x;
false
} count _parameters;
_content set [_forEachIndex, format _localizationArray];
};
} forEach _content;
[_title, _content, _type] call FUNC(displayInformation);
};
};

View File

@ -1,53 +0,0 @@
/*
* Author: Glowbal
* Displays a message on locality of receiver
*
* Arguments:
* 0: receiver <OBJECT>
* 1: title <STRING>
* 2: content <ARRAY>
* 3: type (optional) <NUMBER>
*
* Return Value:
* None
*
* Public: Yes
*/
#include "script_component.hpp"
params [["_reciever", objNull], ["_title", ""], ["_content", ""], ["_type", 0], ["_parameters", []]];
if (isPlayer _reciever) then {
if (!local _reciever) then {
[_this, QFUNC(sendDisplayMessageTo), _reciever, false] call FUNC(execRemoteFnc);
} else {
if (isLocalized _title) then {
_title = localize _title;
};
if (isLocalized _content) then {
_content = localize _content;
};
private "_localizationArray";
_localizationArray = [_title];
{
_localizationArray pushBack _x;
false
} count _parameters;
_title = format _localizationArray;
_localizationArray = [_content];
{
_localizationArray pushBack _x;
false
} count _parameters;
_content = format _localizationArray;
[_title, _content, _type] call FUNC(displayMessage);
};
};

View File

@ -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;

View File

@ -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];

View File

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

View File

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

View File

@ -1,26 +1,26 @@
/* /*
* Author: ? * Author: jaynus
* ? * PFEH to set all Ace Time Variables
* *
* Arguments: * Arguments:
* ? * None
* *
* Return Value: * Return Value:
* ? * None
* *
* Public: ? * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_lastTickTime", "_lastGameTime", "_delta"]; BEGIN_COUNTER(timePFH);
_lastTickTime = ACE_diagTime; private _lastTickTime = ACE_diagTime;
_lastGameTime = ACE_gameTime; private _lastGameTime = ACE_gameTime;
ACE_gameTime = time; ACE_gameTime = time;
ACE_diagTime = diag_tickTime; ACE_diagTime = diag_tickTime;
_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);
@ -36,3 +36,5 @@ if (ACE_gameTime <= _lastGameTime) then {
ACE_virtualTime = ACE_virtualTime + (_delta * accTime); ACE_virtualTime = ACE_virtualTime + (_delta * accTime);
ACE_time = ACE_virtualTime; ACE_time = ACE_virtualTime;
}; };
END_COUNTER(timePFH);

View File

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

View File

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

View File

@ -1,4 +1,3 @@
#include "script_component.hpp" #include "script_component.hpp"
params ["_wire"];
PARAMS_1(_wire); _wire addEventHandler ["HandleDamage", FUNC(handleDamage)];
_wire addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}];

View File

@ -8,10 +8,9 @@
* 1: unit <OBJECT> * 1: unit <OBJECT>
* *
* Return Value: * Return Value:
* Nothing
*
* Return value:
* None * None
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
@ -22,7 +21,7 @@ private ["_wireNoGeo", "_dir", "_pos", "_wireNoGeoPos"];
_wireNoGeo = "ACE_ConcertinaWireNoGeo" createVehicle [0,0,0]; _wireNoGeo = "ACE_ConcertinaWireNoGeo" createVehicle [0,0,0];
{ {
_wireNoGeo animate [_x, 1]; _wireNoGeo animate [_x, 1];
} foreach WIRE_FAST; } count WIRE_FAST;
GVAR(placer) = _unit; GVAR(placer) = _unit;
_dir = getDir _unit; _dir = getDir _unit;
@ -37,8 +36,9 @@ deleteVehicle _wirecoil;
_unit setVariable [QGVAR(wireDeployed), false]; _unit setVariable [QGVAR(wireDeployed), false];
GVAR(deployPFH) = [{ GVAR(deployPFH) = [{
EXPLODE_3_PVT(_this select 0,_wireNoGeo,_wireNoGeoPos,_unit); params ["_args", "_idPFH"];
_args params ["_wireNoGeo", "_wireNoGeoPos", "_unit"];
private ["_range", "_posStart", "_posEnd", "_dirVect", "_dir", "_anim", "_wire"]; private ["_range", "_posStart", "_posEnd", "_dirVect", "_dir", "_anim", "_wire"];
_posStart = (_wireNoGeo modelToWorldVisual (_wireNoGeo selectionPosition "start")) call EFUNC(common,positionToASL); _posStart = (_wireNoGeo modelToWorldVisual (_wireNoGeo selectionPosition "start")) call EFUNC(common,positionToASL);
_posEnd = (getPosASL _unit) vectorAdd (vectorDir _unit); _posEnd = (getPosASL _unit) vectorAdd (vectorDir _unit);
@ -46,37 +46,38 @@ GVAR(deployPFH) = [{
_dir = _dirVect call CBA_fnc_vectDir; _dir = _dirVect call CBA_fnc_vectDir;
_range = vectorMagnitude _dirVect; _range = vectorMagnitude _dirVect;
_anim = 0 max (1 - (_range / 12)); _anim = 0 max (1 - (_range / 12));
if (!(alive _unit) || _range >= 12 || (_unit getVariable [QGVAR(wireDeployed), false])) exitWith { if (!(alive _unit) || _range >= 12 || (_unit getVariable [QGVAR(wireDeployed), false])) exitWith {
_wire = "ACE_ConcertinaWire" createvehicle [0, 0, 0]; _wire = "ACE_ConcertinaWire" createvehicle [0, 0, 0];
{ {
_wire animate [_x, _anim]; _wire animate [_x, _anim];
} foreach WIRE_FAST; } count WIRE_FAST;
[{ [{
EXPLODE_5_PVT(_this select 0,_wireNoGeo,_wire,_anim,_dir,_wireNoGeoPos); params ["_args", "_idPFH"];
_args params ["_wireNoGeo", "_wire", "_anim", "_dir", "_wireNoGeoPos"];
if (_wire animationPhase "wire_2" == _anim) then { if (_wire animationPhase "wire_2" == _anim) then {
deleteVehicle _wireNoGeo; deleteVehicle _wireNoGeo;
_wire setDir _dir; _wire setDir _dir;
_wire setPosASL _wireNoGeoPos; _wire setPosASL _wireNoGeoPos;
[_this select 1] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
}; };
}, 0, [_wireNoGeo, _wire, _anim, _dir, _wireNoGeoPos]] call CBA_fnc_addPerFrameHandler; }, 0, [_wireNoGeo, _wire, _anim, _dir, _wireNoGeoPos]] call CBA_fnc_addPerFrameHandler;
[_unit, "DefaultAction", _unit getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); [_unit, "DefaultAction", _unit getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler);
call EFUNC(interaction,hideMouseHint); call EFUNC(interaction,hideMouseHint);
[_this select 1] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
}; };
_wireNoGeo setDir _dir; _wireNoGeo setDir _dir;
{ {
_wireNoGeo animate [_x, _anim]; _wireNoGeo animate [_x, _anim];
} foreach WIRE_FAST; } count WIRE_FAST;
}, 0, [_wireNoGeo, _wireNoGeoPos, _unit]] call CBA_fnc_addPerFrameHandler; }, 0, [_wireNoGeo, _wireNoGeoPos, _unit]] call CBA_fnc_addPerFrameHandler;
[localize "STR_ACE_ROLLWIRE", "", ""] call EFUNC(interaction,showMouseHint); [localize "STR_ACE_ROLLWIRE", "", ""] call EFUNC(interaction,showMouseHint);
GVAR(placer) setVariable [QGVAR(Deploy), GVAR(placer) setVariable [QGVAR(Deploy),
[GVAR(placer), "DefaultAction", [GVAR(placer), "DefaultAction",
{GVAR(deployPFH) != -1}, {GVAR(deployPFH) != -1},

View File

@ -8,10 +8,9 @@
* 1: unit <OBJECT> * 1: unit <OBJECT>
* *
* Return Value: * Return Value:
* Nothing
*
* Return value:
* None * None
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
@ -21,8 +20,7 @@ if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened),false]) exit
_this call FUNC(dismount); _this call FUNC(dismount);
}, _this] call EFUNC(common,execNextFrame); }, _this] call EFUNC(common,execNextFrame);
}; };
params ["_wire", "_unit"];
PARAMS_2(_wire,_unit);
private ["_config", "_delay"]; private ["_config", "_delay"];
_config = (configFile >> "CfgVehicles" >> typeOf _unit); _config = (configFile >> "CfgVehicles" >> typeOf _unit);

View File

@ -7,10 +7,9 @@
* 0: wire <OBJECT> * 0: wire <OBJECT>
* *
* Return Value: * Return Value:
* Nothing
*
* Return value:
* None * None
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
@ -18,25 +17,26 @@ PARAMS_1(_wire);
{ {
_wire animate [_x, 1]; _wire animate [_x, 1];
} foreach WIRE_FAST; } count WIRE_FAST;
[{ [{
EXPLODE_1_PVT(_this select 0,_wire); params ["_args", "_idPFH"];
_args params ["_wire"];
if (_wire animationPhase "wire_2" == 1) then { if (_wire animationPhase "wire_2" == 1) then {
private ["_dir", "_pos", "_wirecoil"]; private ["_dir", "_pos", "_wirecoil"];
_dir = getDir _wire; _dir = getDir _wire;
_pos = getPosASL _wire; _pos = getPosASL _wire;
_wirecoil = "ACE_ConcertinaWireCoil" createvehicle [0, 0, 0]; _wirecoil = "ACE_ConcertinaWireCoil" createvehicle [0, 0, 0];
deleteVehicle _wire; deleteVehicle _wire;
_wirecoil setDir _dir; _wirecoil setDir _dir;
_wirecoil setPosASL _pos; _wirecoil setPosASL _pos;
_wirecoil setVelocity [0, 0, 0]; _wirecoil setVelocity [0, 0, 0];
[_this select 1] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
}; };
}, 0, [_wire]] call CBA_fnc_addPerFrameHandler; }, 0, [_wire]] call CBA_fnc_addPerFrameHandler;

View File

@ -11,15 +11,12 @@
* 4: projectile <STRING> * 4: projectile <STRING>
* *
* Return Value: * Return Value:
* Nothing
*
* Return value:
* None * None
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_wire", "", "_damage", "_source", ""];
PARAMS_5(_wire,_selectionName,_damage,_source,_projectile);
if (_damage < 0.5) exitWith { 0 }; if (_damage < 0.5) exitWith { 0 };
if (!(isNull _source)) then { if (!(isNull _source)) then {

View File

@ -8,14 +8,12 @@
* 1: killer (vehicle) <OBJECT> * 1: killer (vehicle) <OBJECT>
* *
* Return Value: * Return Value:
* Nothing
*
* Return value:
* None * None
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_wire", "_killer"];
PARAMS_2(_wire,_killer);
private ["_distance", "_vehicle"]; private ["_distance", "_vehicle"];

View File

@ -7,14 +7,12 @@
* 1: vehicle <OBJECT> * 1: vehicle <OBJECT>
* *
* Return Value: * Return Value:
* Nothing
*
* Return value:
* None * None
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_wire", "_vehicle"];
PARAMS_2(_wire,_vehicle);
private ["_type", "_mode", "_anim", "_parts", "_selectionPart", "_selection", "_pos_w", "_dir_w"]; private ["_type", "_mode", "_anim", "_parts", "_selectionPart", "_selection", "_pos_w", "_dir_w"];
@ -43,8 +41,8 @@ _dir_w = getDir _wire;
if (_mode == 0) then { if (_mode == 0) then {
private ["_x", "_y", "_found", "_wireCheckPosAr", "_no"]; private ["_x", "_y", "_found", "_wireCheckPosAr", "_no"];
_x = _pos_w select 0; _pos_w params ["_x","_y"];
_y = _pos_w select 1;
// Check if two Single coils are placed next to each other (i.e playes have built a big wire obstacle) // Check if two Single coils are placed next to each other (i.e playes have built a big wire obstacle)
_wireCheckPosAr = [ _wireCheckPosAr = [
[_x + (sin (_dir_w+90) * 1.5),_y + (cos (_dir_w+90) * 1.5)], [_x + (sin (_dir_w+90) * 1.5),_y + (cos (_dir_w+90) * 1.5)],

View File

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

View File

@ -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;

View File

@ -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;

View File

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

View File

@ -1,4 +1,4 @@
/* /*
* Author: Rosuto * Author: Rosuto
* DAGR waypoint output loop * DAGR waypoint output loop
* *
@ -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;

View File

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

View File

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

View File

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

View File

@ -22,12 +22,7 @@ class Extended_Init_EventHandlers {
init = QUOTE(_this call DFUNC(initObject)); init = QUOTE(_this call DFUNC(initObject));
}; };
}; };
class ReammoBox_F { class ThingX {
class ADDON {
init = QUOTE(_this call DFUNC(initObject));
};
};
class ACE_RepairItem_Base {
class ADDON { class ADDON {
init = QUOTE(_this call DFUNC(initObject)); init = QUOTE(_this call DFUNC(initObject));
}; };

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project name="ACE"> <Project name="ACE">
<Package name="Dragging"> <Package name="Dragging">
<Key ID="STR_ACE_Dragging_Drag"> <Key ID="STR_ACE_Dragging_Drag">
@ -53,6 +53,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>

View File

@ -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 {

View File

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

View File

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

View File

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

View File

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

View File

@ -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"

View File

@ -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 {

View File

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

View File

@ -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 {

View File

@ -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];

View File

@ -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]];

View File

@ -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
}; };

View File

@ -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);

View File

@ -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));

View File

@ -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

View File

@ -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};

View File

@ -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;

View File

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

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