Merge branch 'master' into parseList

Conflicts:
	addons/slideshow/functions/fnc_makeList.sqf
This commit is contained in:
jonpas 2015-09-04 18:40:35 +02:00
commit 644460ed96
379 changed files with 8361 additions and 5479 deletions

View File

@ -1,4 +1,4 @@
# ACE 3 CONTRIBUTOR LIST # ACE3 CONTRIBUTOR LIST
# If you contributed, but are not listed here, contact me: # If you contributed, but are not listed here, contact me:
# koffeinflummi@gmail.com # koffeinflummi@gmail.com
# #
@ -14,6 +14,7 @@ Garth "L-H" de Wet <garthofhearts@gmail.com>
Giallustio Giallustio
Glowbal Glowbal
Janus Janus
jokoho482 <jokoho482@gmail.com>`
Kieran Kieran
NouberNou NouberNou
PabstMirror <pabstmirror@gmail.com> PabstMirror <pabstmirror@gmail.com>
@ -50,6 +51,7 @@ Coren <coren4@gmail.com>
Crusty Crusty
Dharma Bellamkonda <dharma.bellamkonda@gmail.com> Dharma Bellamkonda <dharma.bellamkonda@gmail.com>
Dimaslg <dimaslg@telecable.es> Dimaslg <dimaslg@telecable.es>
Drill <drill87@gmail.com>
eRazeri eRazeri
evromalarkey <evromalarkey@gmail.com> evromalarkey <evromalarkey@gmail.com>
F3 Project <alanr@ferstaberinde.com> F3 Project <alanr@ferstaberinde.com>
@ -68,8 +70,7 @@ Hamburger SV
Harakhti <shadowdragonphd@gmail.com> Harakhti <shadowdragonphd@gmail.com>
havena <silveredenis@gmail.com> havena <silveredenis@gmail.com>
Hawkins Hawkins
Head Head <brobergsebastian@gmail.com>
jokoho482 <jokoho482@gmail.com>`
Jonpas <jonpas33@gmail.com> Jonpas <jonpas33@gmail.com>
Karneck <dschultz26@hotmail.com> Karneck <dschultz26@hotmail.com>
Kavinsky <nmunozfernandez@gmail.com> Kavinsky <nmunozfernandez@gmail.com>
@ -81,6 +82,7 @@ Macusercom <macusercom@gmail.com>
MarcBook MarcBook
meat <p.humberdroz@gmail.com> meat <p.humberdroz@gmail.com>
Michail Nikolaev Michail Nikolaev
MikeMatrix <m.braun92@gmail.com>
nic547 <nic547@outlook.com> nic547 <nic547@outlook.com>
nikolauska <nikolauska1@gmail.com> nikolauska <nikolauska1@gmail.com>
nomisum <nomisum@gmail.com> nomisum <nomisum@gmail.com>
@ -106,5 +108,3 @@ Valentin Torikian <valentin.torikian@gmail.com>
VyMajoris(W-Cephei)<vycanismajoriscsa@gmail.com> VyMajoris(W-Cephei)<vycanismajoriscsa@gmail.com>
Winter <simon@agius-muscat.net> Winter <simon@agius-muscat.net>
zGuba zGuba
Drill <drill87@gmail.com>
MikeMatrix <m.braun92@gmail.com>

View File

@ -3,75 +3,75 @@
</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.2.1-blue.svg" alt="ACE3 version"> <img src="https://img.shields.io/badge/Version-3.2.1-blue.svg" alt="ACE3 Version">
</a> </a>
<a href="https://github.com/acemod/ACE3/releases/download/v3.2.1/ace3_3.2.1.zip"> <a href="https://github.com/acemod/ACE3/releases/download/v3.2.1/ace3_3.2.1.zip">
<img src="http://img.shields.io/badge/Download-56.5_MB-green.svg" alt="ACE3 download"> <img src="http://img.shields.io/badge/Download-56.5_MB-green.svg" 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="http://img.shields.io/github/issues-raw/acemod/ACE3.svg?label=Issues" alt="ACE3 Issues">
</a> </a>
<a href="http://forums.bistudio.com/showthread.php?191716-ACE3-A-collaborative-merger-between-AGM-CSE-and-ACE&p=2935435&viewfull=1#post2935435"> <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" 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="http://img.shields.io/badge/License-GPLv2-red.svg" alt="ACE3 License">
</a> </a>
</p> </p>
<p align="center"><sup><strong>Requires the latest version of <a href="http://www.armaholic.com/page.php?id=18767">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>. 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>
**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.
The project is entirely **open-source** and all contributions are welcome. Feel free to maintain your own custom version, so long as the changes you make are open to the public in accordance with the GNU General Public License ([GPLv2](https://github.com/acemod/ACE3/blob/master/LICENSE)). The project is entirely **open-source** and all contributions are welcome. Feel free to maintain your own custom version, so long as the changes you make are open to the public in accordance with the GNU General Public License ([GPLv2](https://github.com/acemod/ACE3/blob/master/LICENSE)).
The mod is **built modularly**, so almost any included PBO can be easily removed from the configuration. This way, a team can maintain its own tailored version of ACE by simply excluding any components they don't need, or those possibly in conflict with other add-ons. Modules themselves, e.g. the medical system, also include various customization options, allowing mission designers to tweak the overall experience. The mod is **built modularly**, so almost any included PBO can be easily removed from the configuration. This way, a team can maintain its own tailored version of ACE3 by simply excluding any components they don't need, or those possibly in conflict with other mods. Modules themselves, e.g. the medical system, also include various customization options, allowing mission designers to tweak the overall experience.
### Core features ### Core features
* Brand new 3D interaction/action system - Brand new 3D interaction/action system
* Performance and reliability framework - Performance and reliability framework
* Focus on modularity and customization - Focus on modularity and customization
* New flexible client and server settings & configuration - New flexible client and server settings & configuration
* Improved medical system with various levels (basic/advanced) focus on gameplay/realism - Improved medical system with various levels (basic/advanced) focus on gameplay/realism
* Proper & consistent network-synced weather - Proper & consistent network-synced weather
* Wind and weather-based ballistics - Wind and weather-based ballistics
* 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
* Advanced missile guidance and laser designation - Advanced missile guidance and laser designation
#### Additional features #### Additional features
* Carrying and dragging - Carrying and dragging
* Realistic names for vehicles and weapons - Realistic names for vehicles and weapons
* A fire control system (FCS) for armored vehicles and helicopters - A fire control system (FCS) for armored vehicles and helicopters
* Realistic ballistics/FCS calculated in C/C++ extensions - Realistic ballistics/FCS calculated in C/C++ extensions
* Backblast area and overpressure simulation - Backblast area and overpressure simulation
* Disposable launchers - Disposable launchers
* Realistic G-forces - Realistic G-forces
* Vehicle locking - Vehicle locking
* Realistic night and thermal vision modes - Realistic night and thermal vision modes
* Magazine repacking - Magazine repacking
* Realistic weapon overheating mechanic - Realistic weapon overheating mechanic
* Combat deafness (temporary loss of hearing) simulation - Combat deafness (temporary loss of hearing) simulation
* Improved ragdoll physics - Improved ragdoll physics
* Improved interactions for AARs and ammo bearers - Improved interactions for AARs and ammo bearers
* Adjustable sniper scopes - Adjustable sniper scopes
* No idle animation with lowered weapon - No idle animation with lowered weapon
* No talking player avatar - No talking player avatar
* Jumping over obstacles, climbing over walls and cutting down fences - Jumping over obstacles, climbing over walls and cutting down fences
* Vector, MicroDAGR and Kestrel devices<br> - Vector, MicroDAGR and Kestrel devices<br>
***and much more...*** ***and much more...***
### 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) - [Getting started](http://ace3mod.com/wiki/user/getting-started.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 ACE, 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.
Please, use our [Issue Tracker](https://github.com/acemod/ACE3/issues) to report a bug, propose a feature, or suggest changes to the existing ones. See also: Please, use our [Issue Tracker](https://github.com/acemod/ACE3/issues) to report a bug, propose a feature, or suggest changes to the existing ones. See also:
* [How to report an issue](http://ace3mod.com/wiki/user/how-to-report-an-issue.html) - [How to report an issue](http://ace3mod.com/wiki/user/how-to-report-an-issue.html)
* [How to make a feature request](http://ace3mod.com/wiki/user/how-to-make-a-feature-request.html) - [How to make a feature request](http://ace3mod.com/wiki/user/how-to-make-a-feature-request.html)
#### Testing & building #### Testing & building
To help us test the latest development changes, download our master branch ([directly](https://github.com/acemod/ACE3/archive/master.zip), or [with git](https://help.github.com/articles/fetching-a-remote/)), then assemble a test build: To help us test the latest development changes, download our master branch ([directly](https://github.com/acemod/ACE3/archive/master.zip), or [with git](https://help.github.com/articles/fetching-a-remote/)), then assemble a test build:
* [Setting up the development environment](http://ace3mod.com/wiki/development/setting-up-the-development-environment.html) step-by-step instructions on how to properly setup and build a version of ACE for testing purposes. - [Setting up the development environment](http://ace3mod.com/wiki/development/setting-up-the-development-environment.html) step-by-step instructions on how to properly setup and build a version of ACE3 for testing purposes.

View File

@ -6,9 +6,8 @@ GVAR(currentbulletID) = -1;
GVAR(Protractor) = false; GVAR(Protractor) = false;
GVAR(ProtractorStart) = ACE_time; GVAR(ProtractorStart) = ACE_time;
GVAR(allBullets) = [];
GVAR(currentGrid) = 0; GVAR(currentGrid) = 0;
GVAR(initMessageEnabled) = false;
GVAR(extensionAvailable) = true; GVAR(extensionAvailable) = true;
/* @TODO: Remove this until versioning is in sync with cmake/build versioning /* @TODO: Remove this until versioning is in sync with cmake/build versioning

View File

@ -13,5 +13,5 @@ PREP(initializeTerrainExtension);
PREP(initModuleSettings); PREP(initModuleSettings);
PREP(readAmmoDataFromConfig); PREP(readAmmoDataFromConfig);
PREP(readWeaponDataFromConfig); PREP(readWeaponDataFromConfig);
PREP(handleFirePFH);
ADDON = true; ADDON = true;

View File

@ -8,29 +8,29 @@
* 1: temperature - degrees celcius <NUMBER> * 1: temperature - degrees celcius <NUMBER>
* *
* Return Value: * Return Value:
* 0: muzzle velocity shift - m/s <NUMBER> * muzzle velocity shift - m/s <NUMBER>
* *
* Return value: * Public: No
* None
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_muzzleVelocityShiftTable", "_temperature", "_muzzleVelocityShift", "_temperatureIndexA", "_temperatureIndexB", "_temperatureRatio"]; private ["_muzzleVelocityShiftTableUpperLimit", "_temperatureIndexFunction",
_muzzleVelocityShiftTable = _this select 0; "_temperatureIndexA", "_temperatureIndexB", "_interpolationRatio"];
_temperature = _this select 1; params["_muzzleVelocityShiftTable", "_temperature"];
if (count _muzzleVelocityShiftTable != 11) exitWith { 0 }; // Check if muzzleVelocityShiftTable is Larger Than 11 Entrys
_muzzleVelocityShiftTableUpperLimit = _muzzleVelocityShiftTable select 10;
if (isNil "_muzzleVelocityShiftTableUpperLimit") exitWith { 0 };
_temperatureIndexA = floor((_temperature + 15) / 5); // Find exact data index required for given temperature
_temperatureIndexA = 0 max _temperatureIndexA; _temperatureIndexFunction = (_temperature + 15) / 5;
_temperatureIndexA = _temperatureIndexA min 10;
_temperatureIndexB = ceil((_temperature + 15) / 5); // lower and upper data index used for interpolation
_temperatureIndexB = 0 max _temperatureIndexB; _temperatureIndexA = (0 max (floor(_temperatureIndexFunction))) min 10;
_temperatureIndexB = _temperatureIndexB min 10; _temperatureIndexB = (0 max (ceil(_temperatureIndexFunction))) min 10;
_temperatureRatio = ((_temperature + 15) / 5) - floor((_temperature + 15) / 5); // Interpolation ratio
_interpolationRatio = _temperatureIndexFunction - floor(_temperatureIndexFunction);
_muzzleVelocityShift = (_muzzleVelocityShiftTable select _temperatureIndexA) * (1 - _temperatureRatio) + (_muzzleVelocityShiftTable select _temperatureIndexB) * _temperatureRatio; // Interpolation
(_muzzleVelocityShiftTable select _temperatureIndexA) * (1 - _interpolationRatio) + (_muzzleVelocityShiftTable select _temperatureIndexB) * _interpolationRatio // Return
_muzzleVelocityShift

View File

@ -17,12 +17,9 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_ballisticCoefficient", "_temperature", "_pressure", "_relativeHumidity", "_atmosphereModel", "_airDensity"]; private "_airDensity";
_ballisticCoefficient = _this select 0;
_temperature = _this select 1; // in C params ["_ballisticCoefficient", "_temperature"/*in C*/, "_pressure"/*in hPa*/, "_relativeHumidity"/*as ratio 0-1*/, "_atmosphereModel"/*"ICAO" or "ASM"*/];
_pressure = _this select 2; // in hPa
_relativeHumidity = _this select 3; // as ratio 0-1
_atmosphereModel = _this select 4; // "ICAO" or "ASM"
_airDensity = [_temperature, _pressure, _relativeHumidity] call EFUNC(weather,calculateAirDensity); _airDensity = [_temperature, _pressure, _relativeHumidity] call EFUNC(weather,calculateAirDensity);

View File

@ -1,5 +1,5 @@
/* /*
* Author: Ruthberg * Author: Ruthberg, MikeMatrix, joko // Jonas
* *
* Calculates the muzzle velocity shift caused by different barrel lengths * Calculates the muzzle velocity shift caused by different barrel lengths
* *
@ -10,46 +10,61 @@
* 3: muzzle velocity - m/s <NUMBER> * 3: muzzle velocity - m/s <NUMBER>
* *
* Return Value: * Return Value:
* 0: muzzle velocity shift - m/s <NUMBER> * muzzle velocity shift - m/s <NUMBER>
* *
* Return value: * Public: No
* None
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_barrelLength", "_muzzleVelocityTable", "_barrelLengthTable", "_muzzleVelocity", "_lowerIndex", "_upperIndex", "_barrelLengthRatio", "_muzzleVelocityNew"]; scopeName "main";
_barrelLength = _this select 0;
_muzzleVelocityTable = _this select 1;
_barrelLengthTable = _this select 2;
_muzzleVelocity = _this select 3;
private ["_muzzleVelocityTableCount", "_barrelLengthTableCount", "_lowerDataIndex",
"_upperDataIndex", "_lowerBarrelLength", "_upperBarrelLength", "_lowerMuzzleVelocity",
"_upperMuzzleVelocity", "_interpolationRatio"];
params ["_barrelLength", "_muzzleVelocityTable", "_barrelLengthTable", "_muzzleVelocity"];
// If barrel length is not defined, then there is no point in calculating muzzle velocity
if (_barrelLength == 0) exitWith { 0 }; if (_barrelLength == 0) exitWith { 0 };
if (count _muzzleVelocityTable != count _barrelLengthTable) exitWith { 0 };
if (count _muzzleVelocityTable == 0 || count _barrelLengthTable == 0) exitWith { 0 };
if (count _muzzleVelocityTable == 1) exitWith { (_muzzleVelocityTable select 0) - _muzzleVelocity };
_lowerIndex = 0; _muzzleVelocityTableCount = count _muzzleVelocityTable;
_upperIndex = (count _barrelLengthTable) - 1; _barrelLengthTableCount = count _barrelLengthTable;
if (_barrelLength <= (_barrelLengthTable select _lowerIndex)) exitWith { (_muzzleVelocityTable select _lowerIndex) - _muzzleVelocity }; // Exit if tables are different sizes, have no elements or have only one element
if (_barrelLength >= (_barrelLengthTable select _upperIndex)) exitWith { (_muzzleVelocityTable select _upperIndex) - _muzzleVelocity }; if (_muzzleVelocityTableCount != _barrelLengthTableCount || _muzzleVelocityTableCount == 0 || _barrelLengthTableCount == 0) exitWith { 0 };
if (_muzzleVelocityTableCount == 1) exitWith { (_muzzleVelocityTable select 0) - _muzzleVelocity };
for "_i" from 0 to (count _barrelLengthTable) - 1 do { // If we have the precise barrel length value, return result immediately
if (_barrelLength >= _barrelLengthTable select _i) then { if (_barrelLength in _barrelLengthTable) exitWith {
_lowerIndex = _i; (_muzzleVelocityTable select (_barrelLengthTable find _barrelLength)) - _muzzleVelocity
};
};
for "_i" from (count _barrelLengthTable) - 1 to 0 step -1 do {
if (_barrelLength <= _barrelLengthTable select _i) then {
_upperIndex = _i;
};
}; };
_barrelLengthRatio = 0; // Limit values to lower and upper bound of data we have available
if ((_barrelLengthTable select _upperIndex) - (_barrelLengthTable select _lowerIndex) > 0) then { if (_barrelLength <= (_barrelLengthTable select 0)) exitWith { (_muzzleVelocityTable select 0) - _muzzleVelocity };
_barrelLengthRatio = ((_barrelLengthTable select _upperIndex) - _barrelLength) / ((_barrelLengthTable select _upperIndex) - (_barrelLengthTable select _lowerIndex)); if (_barrelLength >= (_barrelLengthTable select _barrelLengthTableCount - 1)) exitWith { (_muzzleVelocityTable select _barrelLengthTableCount - 1) - _muzzleVelocity };
// Find closest bordering values for barrel length
{
if (_barrelLength <= _x) then {
_upperDataIndex = _forEachIndex;
_lowerDataIndex = _upperDataIndex - 1;
breakTo "main";
};
} forEach _barrelLengthTable;
// Worst case scenario
if (isNil "_lowerDataIndex" || isNil "_upperDataIndex") exitWith {0};
_lowerBarrelLength = _barrelLengthTable select _lowerDataIndex;
_upperBarrelLength = _barrelLengthTable select _upperDataIndex;
_lowerMuzzleVelocity = _muzzleVelocityTable select _lowerDataIndex;
_upperMuzzleVelocity = _muzzleVelocityTable select _upperDataIndex;
// Calculate interpolation ratio
_interpolationRatio = if (abs (_lowerBarrelLength - _upperBarrelLength) > 0) then {
(_upperBarrelLength - _barrelLength) / (_upperBarrelLength - _lowerBarrelLength)
} else {
0
}; };
_muzzleVelocityNew = (_muzzleVelocityTable select _lowerIndex) + ((_muzzleVelocityTable select _upperIndex) - (_muzzleVelocityTable select _lowerIndex)) * (1 - _barrelLengthRatio); // Calculate interpolated muzzle velocity shift
(_lowerMuzzleVelocity + ((_upperMuzzleVelocity - _lowerMuzzleVelocity) * (1 - _interpolationRatio))) - _muzzleVelocity // Return
_muzzleVelocityNew - _muzzleVelocity

View File

@ -4,142 +4,129 @@
* Calculates the retardation of the bullet * Calculates the retardation of the bullet
* *
* Arguments: * Arguments:
* 0: drag model - 1-7 <integer> * 0: drag model - integer 1-7 <NUMBER>
* 1: drag coefficient - bc <NUMBER> * 1: drag coefficient - bc <NUMBER>
* 2: velocity - m/s <NUMBER> * 2: velocity - m/s <NUMBER>
* *
* Return Value: * Return Value:
* 0: retardation - m/(s^2) <NUMBER> * retardation - m/(s^2) <NUMBER>
* *
* Return value: * Public: No
* None
*/ */
#include "script_component.hpp" #include "script_component.hpp"
// Source: GNU Exterior Ballistics // Source: GNU Exterior Ballistics
private ["_dragModel", "_dragCoefficient", "_velocity", "_A", "_M", "_result"]; private ["_A", "_M"];
_dragModel = _this select 0; params ["_dragModel", "_dragCoefficient", "_velocity"];
_dragCoefficient = _this select 1; _velocity = _velocity * 3.2808399;
_velocity = (_this select 2) * 3.2808399;
_A = -1;
_M = -1;
_result = 0;
switch _dragModel do { switch _dragModel do {
case 1: case 1: {
{ call {
switch true do { if (_velocity > 4230) exitWith { _A = 0.0001477404177730177; _M = 1.9565; };
case (_velocity > 4230) : { _A = 0.0001477404177730177; _M = 1.9565; }; if (_velocity > 3680) exitWith { _A = 0.0001920339268755614; _M = 1.925; };
case (_velocity > 3680) : { _A = 0.0001920339268755614; _M = 1.925 ; }; if (_velocity > 3450) exitWith { _A = 0.0002894751026819746; _M = 1.875; };
case (_velocity > 3450) : { _A = 0.0002894751026819746; _M = 1.875 ; }; if (_velocity > 3295) exitWith { _A = 0.0004349905111115636; _M = 1.825; };
case (_velocity > 3295) : { _A = 0.0004349905111115636; _M = 1.825 ; }; if (_velocity > 3130) exitWith { _A = 0.0006520421871892662; _M = 1.775; };
case (_velocity > 3130) : { _A = 0.0006520421871892662; _M = 1.775 ; }; if (_velocity > 2960) exitWith { _A = 0.0009748073694078696; _M = 1.725; };
case (_velocity > 2960) : { _A = 0.0009748073694078696; _M = 1.725 ; }; if (_velocity > 2830) exitWith { _A = 0.001453721560187286; _M = 1.675; };
case (_velocity > 2830) : { _A = 0.001453721560187286; _M = 1.675 ; }; if (_velocity > 2680) exitWith { _A = 0.002162887202930376; _M = 1.625; };
case (_velocity > 2680) : { _A = 0.002162887202930376; _M = 1.625 ; }; if (_velocity > 2460) exitWith { _A = 0.003209559783129881; _M = 1.575; };
case (_velocity > 2460) : { _A = 0.003209559783129881; _M = 1.575 ; }; if (_velocity > 2225) exitWith { _A = 0.003904368218691249; _M = 1.55; };
case (_velocity > 2225) : { _A = 0.003904368218691249; _M = 1.55 ; }; if (_velocity > 2015) exitWith { _A = 0.003222942271262336; _M = 1.575; };
case (_velocity > 2015) : { _A = 0.003222942271262336; _M = 1.575 ; }; if (_velocity > 1890) exitWith { _A = 0.002203329542297809; _M = 1.625; };
case (_velocity > 1890) : { _A = 0.002203329542297809; _M = 1.625 ; }; if (_velocity > 1810) exitWith { _A = 0.001511001028891904; _M = 1.675; };
case (_velocity > 1810) : { _A = 0.001511001028891904; _M = 1.675 ; }; if (_velocity > 1730) exitWith { _A = 0.0008609957592468259; _M = 1.75; };
case (_velocity > 1730) : { _A = 0.0008609957592468259; _M = 1.75 ; }; if (_velocity > 1595) exitWith { _A = 0.0004086146797305117; _M = 1.85; };
case (_velocity > 1595) : { _A = 0.0004086146797305117; _M = 1.85 ; }; if (_velocity > 1520) exitWith { _A = 0.0001954473210037398; _M = 1.95; };
case (_velocity > 1520) : { _A = 0.0001954473210037398; _M = 1.95 ; }; if (_velocity > 1420) exitWith { _A = 0.00005431896266462351; _M = 2.125; };
case (_velocity > 1420) : { _A = 0.00005431896266462351; _M = 2.125 ; }; if (_velocity > 1360) exitWith { _A = 0.000008847742581674416; _M = 2.375; };
case (_velocity > 1360) : { _A = 0.000008847742581674416; _M = 2.375 ; }; if (_velocity > 1315) exitWith { _A = 0.000001456922328720298; _M = 2.625; };
case (_velocity > 1315) : { _A = 0.000001456922328720298; _M = 2.625 ; }; if (_velocity > 1280) exitWith { _A = 0.0000002419485191895565; _M = 2.875; };
case (_velocity > 1280) : { _A = 0.0000002419485191895565; _M = 2.875 ; }; if (_velocity > 1220) exitWith { _A = 0.00000001657956321067612; _M = 3.25; };
case (_velocity > 1220) : { _A = 0.00000001657956321067612; _M = 3.25 ; }; if (_velocity > 1185) exitWith { _A = 0.0000000004745469537157371; _M = 3.75; };
case (_velocity > 1185) : { _A = 0.0000000004745469537157371; _M = 3.75 ; }; if (_velocity > 1150) exitWith { _A = 0.00000000001379746590025088; _M = 4.25; };
case (_velocity > 1150) : { _A = 0.00000000001379746590025088; _M = 4.25 ; }; if (_velocity > 1100) exitWith { _A = 0.0000000000004070157961147882; _M = 4.75; };
case (_velocity > 1100) : { _A = 0.0000000000004070157961147882; _M = 4.75 ; }; if (_velocity > 1060) exitWith { _A = 0.00000000000002938236954847331; _M = 5.125; };
case (_velocity > 1060) : { _A = 0.00000000000002938236954847331; _M = 5.125 ; }; if (_velocity > 1025) exitWith { _A = 0.00000000000001228597370774746; _M = 5.25; };
case (_velocity > 1025) : { _A = 0.00000000000001228597370774746; _M = 5.25 ; }; if (_velocity > 980) exitWith { _A = 0.00000000000002916938264100495; _M = 5.125; };
case (_velocity > 980) : { _A = 0.00000000000002916938264100495; _M = 5.125 ; }; if (_velocity > 945) exitWith { _A = 0.0000000000003855099424807451; _M = 4.75; };
case (_velocity > 945) : { _A = 0.0000000000003855099424807451; _M = 4.75 ; }; if (_velocity > 905) exitWith { _A = 0.00000000001185097045689854; _M = 4.25; };
case (_velocity > 905) : { _A = 0.00000000001185097045689854; _M = 4.25 ; }; if (_velocity > 860) exitWith { _A = 0.0000000003566129470974951; _M = 3.75; };
case (_velocity > 860) : { _A = 0.0000000003566129470974951; _M = 3.75 ; }; if (_velocity > 810) exitWith { _A = 0.00000001045513263966272; _M = 3.25; };
case (_velocity > 810) : { _A = 0.00000001045513263966272; _M = 3.25 ; }; if (_velocity > 780) exitWith { _A = 0.0000001291159200846216; _M = 2.875; };
case (_velocity > 780) : { _A = 0.0000001291159200846216; _M = 2.875 ; }; if (_velocity > 750) exitWith { _A = 0.0000006824429329105383; _M = 2.625; };
case (_velocity > 750) : { _A = 0.0000006824429329105383; _M = 2.625 ; }; if (_velocity > 700) exitWith { _A = 0.000003569169672385163; _M = 2.375; };
case (_velocity > 700) : { _A = 0.000003569169672385163; _M = 2.375 ; }; if (_velocity > 640) exitWith { _A = 0.00001839015095899579; _M = 2.125; };
case (_velocity > 640) : { _A = 0.00001839015095899579; _M = 2.125 ; }; if (_velocity > 600) exitWith { _A = 0.00005711174688734240; _M = 1.950; };
case (_velocity > 600) : { _A = 0.00005711174688734240; _M = 1.950 ; }; if (_velocity > 550) exitWith { _A = 0.00009226557091973427; _M = 1.875; };
case (_velocity > 550) : { _A = 0.00009226557091973427; _M = 1.875 ; }; if (_velocity > 250) exitWith { _A = 0.00009337991957131389; _M = 1.875; };
case (_velocity > 250) : { _A = 0.00009337991957131389; _M = 1.875 ; }; if (_velocity > 100) exitWith { _A = 0.00007225247327590413; _M = 1.925; };
case (_velocity > 100) : { _A = 0.00007225247327590413; _M = 1.925 ; }; if (_velocity > 65) exitWith { _A = 0.00005792684957074546; _M = 1.975; };
case (_velocity > 65) : { _A = 0.00005792684957074546; _M = 1.975 ; }; if (_velocity > 0) exitWith { _A = 0.00005206214107320588; _M = 2.000; };
case (_velocity > 0) : { _A = 0.00005206214107320588; _M = 2.000 ; };
}; };
}; };
case 2: case 2: {
{ call {
switch true do { if (_velocity > 1674) exitWith { _A = 0.0079470052136733; _M = 1.36999902851493; };
case (_velocity > 1674) : { _A = 0.0079470052136733; _M = 1.36999902851493; }; if (_velocity > 1172) exitWith { _A = 0.00100419763721974; _M = 1.65392237010294; };
case (_velocity > 1172) : { _A = 0.00100419763721974; _M = 1.65392237010294; }; if (_velocity > 1060) exitWith { _A = 0.0000000000000000000000715571228255369; _M = 7.91913562392361; };
case (_velocity > 1060) : { _A = 0.0000000000000000000000715571228255369; _M = 7.91913562392361; }; if (_velocity > 949) exitWith { _A = 0.000000000139589807205091; _M = 3.81439537623717; };
case (_velocity > 949) : { _A = 0.000000000139589807205091; _M = 3.81439537623717; }; if (_velocity > 670) exitWith { _A = 0.000234364342818625; _M = 1.71869536324748; };
case (_velocity > 670) : { _A = 0.000234364342818625; _M = 1.71869536324748; }; if (_velocity > 335) exitWith { _A = 0.000177962438921838; _M = 1.76877550388679; };
case (_velocity > 335) : { _A = 0.000177962438921838; _M = 1.76877550388679; }; if (_velocity > 0) exitWith { _A = 0.0000518033561289704; _M = 1.98160270524632; };
case (_velocity > 0) : { _A = 0.0000518033561289704; _M = 1.98160270524632; };
}; };
}; };
case 5: case 5: {
{ call {
switch true do { if (_velocity > 1730) exitWith { _A = 0.00724854775171929; _M = 1.41538574492812; };
case (_velocity > 1730) : { _A = 0.00724854775171929; _M = 1.41538574492812; }; if (_velocity > 1228) exitWith { _A = 0.0000350563361516117; _M = 2.13077307854948; };
case (_velocity > 1228) : { _A = 0.0000350563361516117; _M = 2.13077307854948; }; if (_velocity > 1116) exitWith { _A = 0.000000000000184029481181151; _M = 4.81927320350395; };
case (_velocity > 1116) : { _A = 0.000000000000184029481181151; _M = 4.81927320350395; }; if (_velocity > 1004) exitWith { _A = 0.000000000000000000000134713064017409; _M = 7.8100555281422; };
case (_velocity > 1004) : { _A = 0.000000000000000000000134713064017409; _M = 7.8100555281422 ; }; if (_velocity > 837) exitWith { _A = 0.000000103965974081168; _M = 2.84204791809926; };
case (_velocity > 837) : { _A = 0.000000103965974081168; _M = 2.84204791809926; }; if (_velocity > 335) exitWith { _A = 0.0001093015938698234; _M = 1.81096361579504; };
case (_velocity > 335) : { _A = 0.0001093015938698234; _M = 1.81096361579504; }; if (_velocity > 0) exitWith { _A = 0.0000351963178524273; _M = 2.00477856801111; };
case (_velocity > 0) : { _A = 0.0000351963178524273; _M = 2.00477856801111; };
}; };
}; };
case 6: case 6: {
{ call {
switch true do { if (_velocity > 3236) exitWith { _A = 0.0455384883480781; _M = 1.15997674041274; };
case (_velocity > 3236) : { _A = 0.0455384883480781; _M = 1.15997674041274; }; if (_velocity > 2065) exitWith { _A = 0.07167261849653769; _M = 1.10704436538885; };
case (_velocity > 2065) : { _A = 0.07167261849653769; _M = 1.10704436538885; }; if (_velocity > 1311) exitWith { _A = 0.00166676386084348; _M = 1.60085100195952; };
case (_velocity > 1311) : { _A = 0.00166676386084348; _M = 1.60085100195952; }; if (_velocity > 1144) exitWith { _A = 0.000000101482730119215; _M = 2.9569674731838; };
case (_velocity > 1144) : { _A = 0.000000101482730119215; _M = 2.9569674731838 ; }; if (_velocity > 1004) exitWith { _A = 0.00000000000000000431542773103552; _M = 6.34106317069757; };
case (_velocity > 1004) : { _A = 0.00000000000000000431542773103552; _M = 6.34106317069757; }; if (_velocity > 670) exitWith { _A = 0.0000204835650496866; _M = 2.11688446325998; };
case (_velocity > 670) : { _A = 0.0000204835650496866; _M = 2.11688446325998; }; if (_velocity > 0) exitWith { _A = 0.0000750912466084823; _M = 1.92031057847052; };
case (_velocity > 0) : { _A = 0.0000750912466084823; _M = 1.92031057847052; };
}; };
}; };
case 7: case 7: {
{ call {
switch true do { if (_velocity > 4200) exitWith { _A = 0.00000000129081656775919; _M = 3.24121295355962; };
case (_velocity > 4200) : { _A = 0.00000000129081656775919; _M = 3.24121295355962; }; if (_velocity > 3000) exitWith { _A = 0.0171422231434847; _M = 1.27907168025204; };
case (_velocity > 3000) : { _A = 0.0171422231434847; _M = 1.27907168025204; }; if (_velocity > 1470) exitWith { _A = 0.00233355948302505; _M = 1.52693913274526; };
case (_velocity > 1470) : { _A = 0.00233355948302505; _M = 1.52693913274526; }; if (_velocity > 1260) exitWith { _A = 0.000797592111627665; _M = 1.67688974440324; };
case (_velocity > 1260) : { _A = 0.000797592111627665; _M = 1.67688974440324; }; if (_velocity > 1110) exitWith { _A = 0.00000000000571086414289273; _M = 4.3212826264889; };
case (_velocity > 1110) : { _A = 0.00000000000571086414289273; _M = 4.3212826264889 ; }; if (_velocity > 960) exitWith { _A = 0.0000000000000000302865108244904; _M = 5.99074203776707; };
case (_velocity > 960) : { _A = 0.0000000000000000302865108244904; _M = 5.99074203776707; }; if (_velocity > 670) exitWith { _A = 0.00000752285155782535; _M = 2.1738019851075; };
case (_velocity > 670) : { _A = 0.00000752285155782535; _M = 2.1738019851075 ; }; if (_velocity > 540) exitWith { _A = 0.0000131766281225189; _M = 2.08774690257991; };
case (_velocity > 540) : { _A = 0.0000131766281225189; _M = 2.08774690257991; }; if (_velocity > 0) exitWith { _A = 0.0000134504843776525; _M = 2.08702306738884; };
case (_velocity > 0) : { _A = 0.0000134504843776525; _M = 2.08702306738884; };
}; };
}; };
case 8: case 8: {
{ call {
switch true do { if (_velocity > 3571) exitWith { _A = 0.0112263766252305; _M = 1.33207346655961; };
case (_velocity > 3571) : { _A = 0.0112263766252305; _M = 1.33207346655961; }; if (_velocity > 1841) exitWith { _A = 0.0167252613732636; _M = 1.28662041261785; };
case (_velocity > 1841) : { _A = 0.0167252613732636; _M = 1.28662041261785; }; if (_velocity > 1120) exitWith { _A = 0.00220172456619625; _M = 1.55636358091189; };
case (_velocity > 1120) : { _A = 0.00220172456619625; _M = 1.55636358091189; }; if (_velocity > 1088) exitWith { _A = 0.00000000000000020538037167098; _M = 5.80410776994789; };
case (_velocity > 1088) : { _A = 0.00000000000000020538037167098; _M = 5.80410776994789; }; if (_velocity > 976) exitWith { _A = 0.00000000000592182174254121; _M = 4.29275576134191; };
case (_velocity > 976) : { _A = 0.00000000000592182174254121; _M = 4.29275576134191; }; if (_velocity > 0) exitWith { _A = 0.000043917343795117; _M = 1.99978116283334; };
case (_velocity > 0) : { _A = 0.000043917343795117; _M = 1.99978116283334; };
}; };
}; };
}; };
if (_A != -1 && _M != -1 && _velocity > 0 && _velocity < 10000) then { if (!isNil "_A" && !isNil "_M" && _velocity > 0 && _velocity < 10000) then {
_result = _A * (_velocity ^ _M) / _dragCoefficient; (_A * (_velocity ^ _M) / _dragCoefficient) / 3.2808399
_result = _result / 3.2808399; } else {
0
}; };
_result

View File

@ -13,33 +13,23 @@
* 6: barometric Pressure - hPA <NUMBER> * 6: barometric Pressure - hPA <NUMBER>
* *
* Return Value: * Return Value:
* 0: stability factor <NUMBER> * stability factor <NUMBER>
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_caliber", "_bulletLength", "_bulletMass", "_barrelTwist", "_muzzleVelocity", "_temperature", "_barometricPressure", "_l", "_t", "_stabilityFactor"]; private ["_twist", "_length", "_stabilityFactor"];
_caliber = _this select 0; params ["_caliber", "_bulletLength", "_bulletMass", "_barrelTwist", "_muzzleVelocity", "_temperature", "_barometricPressure"];
_bulletLength = _this select 1;
_bulletMass = _this select 2;
_barrelTwist = _this select 3;
_muzzleVelocity = _this select 4;
_temperature = _this select 5;
_barometricPressure = _this select 6;
// Source: http://www.jbmballistics.com/ballistics/bibliography/articles/miller_stability_1.pdf // Source: http://www.jbmballistics.com/ballistics/bibliography/articles/miller_stability_1.pdf
_t = _barrelTwist / _caliber; _twist = _barrelTwist / _caliber;
_l = _bulletLength / _caliber; _length = _bulletLength / _caliber;
_stabilityFactor = 7587000 * _bulletMass / (_t^2 * _caliber^3 * _l * (1 + _l^2)); _stabilityFactor = 7587000 * _bulletMass / (_twist^2 * _caliber^3 * _length * (1 + _length^2));
if (_muzzleVelocity > 341.376) then { if (_muzzleVelocity > 341.376) then {
_stabilityFactor = _stabilityFactor * (_muzzleVelocity / 853.44) ^ (1/3); (_stabilityFactor * (_muzzleVelocity / 853.44) ^ (1/3)) * KELVIN(_temperature) / KELVIN(15) * 1013.25 / _barometricPressure
} else { } else {
_stabilityFactor = _stabilityFactor * (_muzzleVelocity / 341.376) ^ (1/3); (_stabilityFactor * (_muzzleVelocity / 341.376) ^ (1/3)) * KELVIN(_temperature) / KELVIN(15) * 1013.25 / _barometricPressure
}; };
_stabilityFactor = _stabilityFactor * KELVIN(_temperature) / KELVIN(15) * 1013.25 / _barometricPressure;
_stabilityFactor

View File

@ -8,6 +8,8 @@
* *
* Return value: * Return value:
* None * None
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
@ -15,8 +17,6 @@
#define __ctrl1 (__dsp displayCtrl 132950) #define __ctrl1 (__dsp displayCtrl 132950)
#define __ctrl2 (__dsp displayCtrl 132951) #define __ctrl2 (__dsp displayCtrl 132951)
private ["_inclinationAngle", "_refPosition"];
if (GVAR(Protractor)) exitWith { if (GVAR(Protractor)) exitWith {
GVAR(Protractor) = false; GVAR(Protractor) = false;
1 cutText ["", "PLAIN"]; 1 cutText ["", "PLAIN"];
@ -32,17 +32,13 @@ EGVAR(weather,WindInfo) = false;
GVAR(Protractor) = true; GVAR(Protractor) = true;
[{ [{
params ["","_idPFH"];
if !(GVAR(Protractor) && !(weaponLowered ACE_player) && currentWeapon ACE_player == primaryWeapon ACE_player) exitWith { if !(GVAR(Protractor) && !(weaponLowered ACE_player) && currentWeapon ACE_player == primaryWeapon ACE_player) exitWith {
GVAR(Protractor) = false; GVAR(Protractor) = false;
1 cutText ["", "PLAIN"]; 1 cutText ["", "PLAIN"];
[_this select 1] call cba_fnc_removePerFrameHandler; [_idPFH] call cba_fnc_removePerFrameHandler;
}; };
_refPosition = [SafeZoneX + 0.001, SafeZoneY + 0.001, 0.2, 0.2 * 4/3];
_inclinationAngle = asin((ACE_player weaponDirection currentWeapon ACE_player) select 2);
_inclinationAngle = -58 max _inclinationAngle min 58;
1 cutRsc ["RscProtractor", "PLAIN", 1, false]; 1 cutRsc ["RscProtractor", "PLAIN", 1, false];
__ctrl1 ctrlSetScale 1; __ctrl1 ctrlSetScale 1;
@ -51,7 +47,7 @@ GVAR(Protractor) = true;
__ctrl1 ctrlSetTextColor [1, 1, 1, 1]; __ctrl1 ctrlSetTextColor [1, 1, 1, 1];
__ctrl2 ctrlSetScale 1; __ctrl2 ctrlSetScale 1;
__ctrl2 ctrlSetPosition [(_refPosition select 0), (_refPosition select 1) - 0.0012 * _inclinationAngle, (_refPosition select 2), (_refPosition select 3)]; __ctrl2 ctrlSetPosition [SafeZoneX + 0.001, SafeZoneY + 0.001 - 0.0012 * (-58 max (asin((ACE_player weaponDirection currentWeapon ACE_player) select 2)) min 58), 0.2, 0.2 * 4/3];
__ctrl2 ctrlCommit 0; __ctrl2 ctrlCommit 0;
__ctrl2 ctrlSetText QUOTE(PATHTOF(UI\protractor_marker.paa)); __ctrl2 ctrlSetText QUOTE(PATHTOF(UI\protractor_marker.paa));
__ctrl2 ctrlSetTextColor [1, 1, 1, 1]; __ctrl2 ctrlSetTextColor [1, 1, 1, 1];

View File

@ -0,0 +1,47 @@
/*
* Author: Glowbal, Ruthberg, joko // Jonas
* Handle the PFH for Bullets
*
* Arguments:
* None
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
private "_deleted";
_deleted = 0;
{
private ["_bulletVelocity", "_bulletPosition", "_bulletSpeed"];
_x params["_bullet","_caliber","_bulletTraceVisible","_index"];
_bulletVelocity = velocity _bullet;
_bulletSpeed = vectorMagnitude _bulletVelocity;
if (!alive _bullet || _bulletSpeed < 100) exitWith {
GVAR(allBullets) deleteAt (_forEachIndex - _deleted);
_deleted = _deleted + 1;
};
_bulletPosition = getPosASL _bullet;
if (_bulletTraceVisible && _bulletSpeed > 500) then {
drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.02*_caliber,0.01*_caliber],[[0,0,0,0.65],[0,0,0,0.2]],[1,0],0,0,"","",""];
};
_aceTimeSecond = floor ACE_time;
call compile ("ace_advanced_ballistics" callExtension format["simulate:%1:%2:%3:%4:%5:%6:%7", _index, _bulletVelocity, _bulletPosition, ACE_wind, ASLToATL(_bulletPosition) select 2, _aceTimeSecond, ACE_time - _aceTimeSecond]);
} forEach GVAR(allBullets);
if (GVAR(allBullets) isEqualTo []) then {
[_this select 1] call CBA_fnc_removePerFrameHandler;
GVAR(BulletPFH) = nil;
};

View File

@ -13,28 +13,28 @@
* 6: projectile - Object of the projectile that was shot <OBJECT> * 6: projectile - Object of the projectile that was shot <OBJECT>
* *
* Return Value: * Return Value:
* Nothing * None
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_weapon", "_mode", "_ammo", "_magazine", "_caliber", "_bullet", "_abort", "_AmmoCacheEntry", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_bulletMass", "_bulletLength", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_barrelTwist", "_stabilityFactor"]; // Early Quiting
_unit = _this select 0; if (!hasInterface) exitWith {};
_weapon = _this select 1; if (!GVAR(enabled)) exitWith {};
_mode = _this select 3;
_ammo = _this select 4; // Parameterization
_magazine = _this select 5; private ["_abort", "_AmmoCacheEntry", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_bulletMass", "_bulletLength", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_barrelTwist", "_stabilityFactor"];
_bullet = _this select 6; params ["_unit", "_weapon", "", "_mode", "_ammo", "_magazine", "_bullet"];
_abort = false; _abort = false;
if (!hasInterface) exitWith {};
if (!alive _bullet) exitWith {};
if (!GVAR(enabled)) exitWith {};
if (!([_unit] call EFUNC(common,isPlayer))) exitWith {};
if (underwater _unit) exitWith {};
if (!(_ammo isKindOf "BulletBase")) exitWith {}; if (!(_ammo isKindOf "BulletBase")) exitWith {};
if (!alive _bullet) exitWith {};
if (!([_unit] call EFUNC(common,isPlayer))) exitWith {};
if (_unit distance ACE_player > GVAR(simulationRadius)) exitWith {}; if (_unit distance ACE_player > GVAR(simulationRadius)) exitWith {};
if (underwater _unit) exitWith {};
if (!GVAR(simulateForEveryone) && !(local _unit)) then { if (!GVAR(simulateForEveryone) && !(local _unit)) then {
// The shooter is non local // The shooter is non local
_abort = true; _abort = true;
@ -53,39 +53,44 @@ if (!GVAR(simulateForEveryone) && !(local _unit)) then {
if (GVAR(disabledInFullAutoMode) && getNumber(configFile >> "CfgWeapons" >> _weapon >> _mode >> "autoFire") == 1) then { _abort = true; }; if (GVAR(disabledInFullAutoMode) && getNumber(configFile >> "CfgWeapons" >> _weapon >> _mode >> "autoFire") == 1) then { _abort = true; };
if (_abort || !(GVAR(extensionAvailable))) exitWith { if (_abort || !(GVAR(extensionAvailable))) exitWith {
if (missionNamespace getVariable [QEGVAR(windDeflection,enabled), false]) then { [_bullet, getNumber(configFile >> "CfgAmmo" >> _ammo >> "airFriction")] call EFUNC(winddeflection,updateTrajectoryPFH);
EGVAR(windDeflection,trackedBullets) pushBack [_bullet, getNumber(configFile >> "cfgAmmo" >> _ammo >> "airFriction")];
};
}; };
// Get Weapon and Ammo Configurations
_AmmoCacheEntry = uiNamespace getVariable format[QGVAR(%1), _ammo]; _AmmoCacheEntry = uiNamespace getVariable format[QGVAR(%1), _ammo];
if (isNil {_AmmoCacheEntry}) then { if (isNil "_AmmoCacheEntry") then {
_AmmoCacheEntry = _ammo call FUNC(readAmmoDataFromConfig); _AmmoCacheEntry = _ammo call FUNC(readAmmoDataFromConfig);
}; };
_WeaponCacheEntry = uiNamespace getVariable format[QGVAR(%1), _weapon]; _WeaponCacheEntry = uiNamespace getVariable format[QGVAR(%1), _weapon];
if (isNil {_WeaponCacheEntry}) then { if (isNil "_WeaponCacheEntry") then {
_WeaponCacheEntry = _weapon call FUNC(readWeaponDataFromConfig); _WeaponCacheEntry = _weapon call FUNC(readWeaponDataFromConfig);
}; };
_AmmoCacheEntry params ["_airFriction", "_caliber", "_bulletLength", "_bulletMass", "_transonicStabilityCoef", "_dragModel", "_ballisticCoefficients", "_velocityBoundaries", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable"];
_WeaponCacheEntry params ["_barrelTwist", "_twistDirection", "_barrelLength"];
_bulletVelocity = velocity _bullet; _bulletVelocity = velocity _bullet;
_muzzleVelocity = vectorMagnitude _bulletVelocity; _muzzleVelocity = vectorMagnitude _bulletVelocity;
if (GVAR(barrelLengthInfluenceEnabled)) then { if (GVAR(barrelLengthInfluenceEnabled)) then {
_muzzleVelocityShift = [_WeaponCacheEntry select 2, _AmmoCacheEntry select 10, _AmmoCacheEntry select 11, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift); _barrelVelocityShift = uiNamespace getVariable [format [QGVAR(%1_muzzleVelocityShift),_weapon],nil];
if (_muzzleVelocityShift != 0) then { if (isNil "_barrelVelocityShift") then {
_bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift)); _barrelVelocityShift = [_barrelLength, _muzzleVelocityTable, _barrelLengthTable, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift);
_bullet setVelocity _bulletVelocity; uiNamespace setVariable [format [QGVAR(%1_muzzleVelocityShift),_weapon],_muzzleVelocityShift];
_muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift;
}; };
}; };
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);
_muzzleVelocityShift = [_AmmoCacheEntry select 9, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift); _temperatureVelocityShift = ([_ammoTempMuzzleVelocityShifts, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift));
};
if (GVAR(ammoTemperatureEnabled) || GVAR(barrelLengthInfluenceEnabled)) then {
if (_muzzleVelocityShift != 0) then { if (_muzzleVelocityShift != 0) then {
_muzzleVelocity = _muzzleVelocity + (_barrelVelocityShift + _ammoTemperatureVelocityShift);
_bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift)); _bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift));
_bullet setVelocity _bulletVelocity; _bullet setVelocity _bulletVelocity;
_muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift;
}; };
}; };
@ -102,43 +107,22 @@ if (GVAR(bulletTraceEnabled) && cameraView == "GUNNER") then {
}; };
}; };
_caliber = _AmmoCacheEntry select 1;
_bulletLength = _AmmoCacheEntry select 2;
_bulletMass = _AmmoCacheEntry select 3;
_barrelTwist = _WeaponCacheEntry select 0;
_stabilityFactor = 1.5; _stabilityFactor = 1.5;
if (_caliber > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then { if (_caliber > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then {
if (isNil "_temperature") then {
_temperature = ((getPosASL _unit) select 2) call EFUNC(weather,calculateTemperatureAtHeight); _temperature = ((getPosASL _unit) select 2) call EFUNC(weather,calculateTemperatureAtHeight);
};
_barometricPressure = ((getPosASL _bullet) select 2) call EFUNC(weather,calculateBarometricPressure); _barometricPressure = ((getPosASL _bullet) select 2) call EFUNC(weather,calculateBarometricPressure);
_stabilityFactor = [_caliber, _bulletLength, _bulletMass, _barrelTwist, _muzzleVelocity, _temperature, _barometricPressure] call FUNC(calculateStabilityFactor); _stabilityFactor = [_caliber, _bulletLength, _bulletMass, _barrelTwist, _muzzleVelocity, _temperature, _barometricPressure] call FUNC(calculateStabilityFactor);
}; };
GVAR(currentbulletID) = (GVAR(currentbulletID) + 1) % 10000; GVAR(currentbulletID) = (GVAR(currentbulletID) + 1) % 10000;
"ace_advanced_ballistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:%18", GVAR(currentbulletID), _AmmoCacheEntry select 0, _AmmoCacheEntry select 6, _AmmoCacheEntry select 7, _AmmoCacheEntry select 8, _AmmoCacheEntry select 5, _stabilityFactor, _WeaponCacheEntry select 1, _muzzleVelocity, _AmmoCacheEntry select 4, getPosASL _bullet, EGVAR(common,mapLatitude), EGVAR(weather,currentTemperature), EGVAR(common,mapAltitude), EGVAR(weather,currentHumidity), overcast, floor(ACE_time), ACE_time - floor(ACE_time)]; _aceTimeSecond = floor ACE_time;
"ace_advanced_ballistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:%18", GVAR(currentbulletID), _airFriction, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _dragModel, _stabilityFactor, _twistDirection, _muzzleVelocity, _transonicStabilityCoef, getPosASL _bullet, EGVAR(common,mapLatitude), EGVAR(weather,currentTemperature), EGVAR(common,mapAltitude), EGVAR(weather,currentHumidity), overcast, _aceTimeSecond, ACE_time - _aceTimeSecond];
[{ GVAR(allBullets) pushBack [_bullet, _caliber, _bulletTraceVisible, GVAR(currentbulletID)];
private ["_args", "_index", "_bullet", "_caliber", "_bulletTraceVisible", "_bulletVelocity", "_bulletPosition"];
_args = _this select 0;
_bullet = _args select 0;
_caliber = _args select 1;
_bulletTraceVisible = _args select 2;
_index = _args select 3;
_bulletVelocity = velocity _bullet; if (isNil QGVAR(BulletPFH)) then {
_bulletPosition = getPosASL _bullet; GVAR(BulletPFH) = [FUNC(handleFirePFH), GVAR(simulationInterval), []] call CBA_fnc_addPerFrameHandler;
_bulletSpeed = vectorMagnitude _bulletVelocity;
if (!alive _bullet || _bulletSpeed < 100) exitWith {
[_this select 1] call cba_fnc_removePerFrameHandler;
}; };
if (_bulletTraceVisible && _bulletSpeed > 500) then {
drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.02*_caliber,0.01*_caliber],[[0,0,0,0.65],[0,0,0,0.2]],[1,0],0,0,"","",""];
};
call compile ("ace_advanced_ballistics" callExtension format["simulate:%1:%2:%3:%4:%5:%6:%7", _index, _bulletVelocity, _bulletPosition, ACE_wind, ASLToATL(_bulletPosition) select 2, floor(ACE_time), ACE_time - floor(ACE_time)]);
}, GVAR(simulationInterval), [_bullet, _caliber, _bulletTraceVisible, GVAR(currentbulletID)]] call CBA_fnc_addPerFrameHandler;

View File

@ -8,17 +8,13 @@
* 2: activated <BOOL> * 2: activated <BOOL>
* *
* Return Value: * Return Value:
* None <NIL> * None
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_logic", "_units", "_activated"]; params ["_logic","_units", "_activated"];
_logic = _this select 0;
_units = _this select 1;
_activated = _this select 2;
if !(_activated) exitWith {}; if !(_activated) exitWith {};

View File

@ -3,10 +3,10 @@
* Initializes the advanced ballistics dll extension with terrain data * Initializes the advanced ballistics dll extension with terrain data
* *
* Arguments: * Arguments:
* Nothing * None
* *
* Return Value: * Return Value:
* Nothing * None
* *
* Public: No * Public: No
*/ */
@ -22,9 +22,9 @@ _initStartTime = ACE_time;
_mapSize = getNumber (configFile >> "CfgWorlds" >> worldName >> "MapSize"); _mapSize = getNumber (configFile >> "CfgWorlds" >> worldName >> "MapSize");
if (("ace_advanced_ballistics" callExtension format["init:%1:%2", worldName, _mapSize]) == "Terrain already initialized") exitWith { if (("ace_advanced_ballistics" callExtension format["init:%1:%2", worldName, _mapSize]) == "Terrain already initialized") exitWith {
if (GVAR(initMessageEnabled)) then { #ifdef DEBUG_MODE_FULL
systemChat "AdvancedBallistics: Terrain already initialized"; systemChat "AdvancedBallistics: Terrain already initialized";
}; #endIf
}; };
_mapGrids = ceil(_mapSize / 50) + 1; _mapGrids = ceil(_mapSize / 50) + 1;
@ -33,17 +33,14 @@ _gridCells = _mapGrids * _mapGrids;
GVAR(currentGrid) = 0; GVAR(currentGrid) = 0;
[{ [{
private ["_args", "_mapGrids", "_gridCells", "_initStartTime"]; params ["_args","_idPFH"];
_args = _this select 0; _args params ["_mapGrids", "_gridCells", "_initStartTime"];
_mapGrids = _args select 0;
_gridCells = _args select 1;
_initStartTime = _args select 2;
if (GVAR(currentGrid) >= _gridCells) exitWith { if (GVAR(currentGrid) >= _gridCells) exitWith {
if (GVAR(initMessageEnabled)) then { #ifdef DEBUG_MODE_FULL
systemChat format["AdvancedBallistics: Finished terrain initialization in %1 seconds", ceil(ACE_time - _initStartTime)]; systemChat format["AdvancedBallistics: Finished terrain initialization in %1 seconds", ceil(ACE_time - _initStartTime)];
}; #endif
[_this select 1] call cba_fnc_removePerFrameHandler; [_idPFH] call cba_fnc_removePerFrameHandler;
}; };
for "_i" from 1 to 50 do { for "_i" from 1 to 50 do {

View File

@ -4,61 +4,53 @@
* Reads the ammo class config and updates the config cache * Reads the ammo class config and updates the config cache
* *
* Arguments: * Arguments:
* 0: ammo - classname <string> * ammo - classname <STRING>
* *
* Return Value: * Return Value:
* 0: [_airFriction, _caliber, _bulletLength, _bulletMass, _transonicStabilityCoef, _dragModel, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _ammoTempMuzzleVelocityShifts, _muzzleVelocityTable, _barrelLengthTable] <ARRAY> * 0: _airFriction
* 1: _caliber
* 2: _bulletLength
* 3: _bulletMass
* 4: _transonicStabilityCoef
* 5: _dragModel
* 6: _ballisticCoefficients
* 7: _velocityBoundaries
* 8: _atmosphereModel
* 9: _ammoTempMuzzleVelocityShifts
* 10: _muzzleVelocityTable
* 11: _barrelLengthTable
* *
* Return value: * Public: No
* None
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_ammo", "_airFriction", "_caliber", "_bulletLength", "_bulletMass", "_transonicStabilityCoef", "_dragModel", "_ballisticCoefficients", "_velocityBoundaries", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable", "_result"]; private ["_ammo", "_airFriction", "_caliber", "_bulletLength", "_bulletMass", "_transonicStabilityCoef", "_dragModel", "_ballisticCoefficients", "_velocityBoundaries", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable", "_result"];
_ammo = _this; _ammoConfig = configFile >> "CfgAmmo" >> _this;
_airFriction = getNumber(configFile >> "CfgAmmo" >> _ammo >> "airFriction"); _airFriction = getNumber(_ammoConfig >> "airFriction");
_caliber = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_caliber"); _caliber = getNumber(_ammoConfig >> "ACE_caliber");
_bulletLength = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_bulletLength"); _bulletLength = getNumber(_ammoConfig >> "ACE_bulletLength");
_bulletMass = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_bulletMass"); _bulletMass = getNumber(_ammoConfig >> "ACE_bulletMass");
_transonicStabilityCoef = getNumber(_ammoConfig >> "ACE_transonicStabilityCoef");
if (_transonicStabilityCoef == 0) then {
_transonicStabilityCoef = 0.5; _transonicStabilityCoef = 0.5;
if (isNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_transonicStabilityCoef")) then {
_transonicStabilityCoef = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_transonicStabilityCoef");
}; };
_dragModel = getNumber(_ammoConfig >> "ACE_dragModel");
if (_dragModel == 0 || !(_dragModel in [1, 2, 5, 6, 7, 8])) then {
_dragModel = 1; _dragModel = 1;
_ballisticCoefficients = []; };
_velocityBoundaries = []; _ballisticCoefficients = getArray(_ammoConfig >> "ACE_ballisticCoefficients");
_velocityBoundaries = getArray(_ammoConfig >> "ACE_velocityBoundaries");
_atmosphereModel = getText(_ammoConfig >> "ACE_standardAtmosphere");
if (_atmosphereModel isEqualTo "") then {
_atmosphereModel = "ICAO"; _atmosphereModel = "ICAO";
if (isNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_dragModel")) then {
_dragModel = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_dragModel");
if (!(_dragModel in [1, 2, 5, 6, 7, 8])) then {
_dragModel = 1;
};
};
if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ballisticCoefficients")) then {
_ballisticCoefficients = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ballisticCoefficients");
};
if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_velocityBoundaries")) then {
_velocityBoundaries = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_velocityBoundaries");
};
if (isText(configFile >> "CfgAmmo" >> _ammo >> "ACE_standardAtmosphere")) then {
_atmosphereModel = getText(configFile >> "CfgAmmo" >> _ammo >> "ACE_standardAtmosphere");
};
_ammoTempMuzzleVelocityShifts = [];
if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ammoTempMuzzleVelocityShifts")) then {
_ammoTempMuzzleVelocityShifts = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ammoTempMuzzleVelocityShifts");
};
_muzzleVelocityTable = [];
_barrelLengthTable = [];
if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_muzzleVelocities")) then {
_muzzleVelocityTable = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_muzzleVelocities");
};
if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_barrelLengths")) then {
_barrelLengthTable = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_barrelLengths");
}; };
_ammoTempMuzzleVelocityShifts = getArray(_ammoConfig >> "ACE_ammoTempMuzzleVelocityShifts");
_muzzleVelocityTable = getArray(_ammoConfig >> "ACE_muzzleVelocities");
_barrelLengthTable = getArray(_ammoConfig >> "ACE_barrelLengths");
_result = [_airFriction, _caliber, _bulletLength, _bulletMass, _transonicStabilityCoef, _dragModel, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _ammoTempMuzzleVelocityShifts, _muzzleVelocityTable, _barrelLengthTable]; _result = [_airFriction, _caliber, _bulletLength, _bulletMass, _transonicStabilityCoef, _dragModel, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _ammoTempMuzzleVelocityShifts, _muzzleVelocityTable, _barrelLengthTable];
uiNamespace setVariable [format[QGVAR(%1), _ammo], _result]; uiNamespace setVariable [format[QGVAR(%1), _this], _result];
_result _result

View File

@ -4,28 +4,28 @@
* Reads the weapon class config and updates the config cache * Reads the weapon class config and updates the config cache
* *
* Arguments: * Arguments:
* 0: weapon - classname <string> * weapon - classname <STRING>
* *
* Return Value: * Return Value:
* 0: [_barrelTwist, _twistDirection, _barrelLength] <ARRAY> * 0: _barrelTwist
* 1: _twistDirection
* 2: _barrelLength
* *
* Return value: * Public: No
* None
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_weapon", "_barrelTwist", "_twistDirection", "_barrelLength", "_result"]; private ["_weaponConfig", "_barrelTwist", "_twistDirection", "_barrelLength", "_result"];
_weapon = _this; _weaponConfig = (configFile >> "CfgWeapons" >> _this);
_barrelTwist = getNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_barrelTwist"); _barrelTwist = getNumber(_weaponConfig >> "ACE_barrelTwist");
_twistDirection = 1; _twistDirection = 1;
if (isNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_twistDirection")) then { _twistDirection = getNumber(_weaponConfig >> "ACE_twistDirection");
_twistDirection = getNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_twistDirection"); if !(_twistDirection in [-1, 0, 1]) then {
if (_twistDirection != -1 && _twistDirection != 0 && _twistDirection != 1) then {
_twistDirection = 1; _twistDirection = 1;
}; };
};
_barrelLength = getNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_barrelLength"); _barrelLength = getNumber(_weaponConfig >> "ACE_barrelLength");
_result = [_barrelTwist, _twistDirection, _barrelLength]; _result = [_barrelTwist, _twistDirection, _barrelLength];

View File

@ -32,6 +32,7 @@
<German>Erweiterte Ballistik</German> <German>Erweiterte Ballistik</German>
<Czech>Pokročilá balistika</Czech> <Czech>Pokročilá balistika</Czech>
<Portuguese>Balística avançada</Portuguese> <Portuguese>Balística avançada</Portuguese>
<Hungarian>Fejlett ballisztika</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Advanced_Ballistics_enabled_DisplayName"> <Key ID="STR_ACE_Advanced_Ballistics_enabled_DisplayName">
<English>Advanced Ballistics</English> <English>Advanced Ballistics</English>
@ -40,6 +41,7 @@
<German>Erweiterte Ballistik</German> <German>Erweiterte Ballistik</German>
<Czech>Pokročilá balistika</Czech> <Czech>Pokročilá balistika</Czech>
<Portuguese>Balística avançada</Portuguese> <Portuguese>Balística avançada</Portuguese>
<Hungarian>Fejlett ballisztika</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Advanced_Ballistics_enabled_Description"> <Key ID="STR_ACE_Advanced_Ballistics_enabled_Description">
<English>Enables advanced ballistics</English> <English>Enables advanced ballistics</English>
@ -48,6 +50,7 @@
<German>Aktiviert die erweiterte Ballistik</German> <German>Aktiviert die erweiterte Ballistik</German>
<Czech>Aktivuje pokročilou balistiku</Czech> <Czech>Aktivuje pokročilou balistiku</Czech>
<Portuguese>Ativa balística avançada</Portuguese> <Portuguese>Ativa balística avançada</Portuguese>
<Hungarian>Engedélyezi a fejlett ballisztikát</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Advanced_Ballistics_simulateForSnipers_DisplayName"> <Key ID="STR_ACE_Advanced_Ballistics_simulateForSnipers_DisplayName">
<English>Enabled For Snipers</English> <English>Enabled For Snipers</English>
@ -56,6 +59,7 @@
<German>Für Scharfschützen aktiviert</German> <German>Für Scharfschützen aktiviert</German>
<Czech>Povoleno pro odstřelovače</Czech> <Czech>Povoleno pro odstřelovače</Czech>
<Portuguese>Ativar para caçadores</Portuguese> <Portuguese>Ativar para caçadores</Portuguese>
<Hungarian>Mesterlövészeknek engedélyezve</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Advanced_Ballistics_simulateForSnipers_Description"> <Key ID="STR_ACE_Advanced_Ballistics_simulateForSnipers_Description">
<English>Enables advanced ballistics for non local snipers (when using high power optics)</English> <English>Enables advanced ballistics for non local snipers (when using high power optics)</English>
@ -64,6 +68,7 @@
<German>Aktiviert die erweiterte Ballistik für nicht lokale Scharfschützen (bei Benutzung von Optiken mit starker Vergrößerung)</German> <German>Aktiviert die erweiterte Ballistik für nicht lokale Scharfschützen (bei Benutzung von Optiken mit starker Vergrößerung)</German>
<Czech>Aktivuje pokročilou balistiku pro nelokální odstřelovače (když používá výkonnou optiku)</Czech> <Czech>Aktivuje pokročilou balistiku pro nelokální odstřelovače (když používá výkonnou optiku)</Czech>
<Portuguese>Ativa balística avançada para caçadores não locais (quando usando miras telescópicas)</Portuguese> <Portuguese>Ativa balística avançada para caçadores não locais (quando usando miras telescópicas)</Portuguese>
<Hungarian>Engedélyezi a fejlett ballisztikát nem-helyi mesterlövészeknek (nagy-teljesítményű optika használatakor)</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Advanced_Ballistics_simulateForGroupMembers_DisplayName"> <Key ID="STR_ACE_Advanced_Ballistics_simulateForGroupMembers_DisplayName">
<English>Enabled For Group Members</English> <English>Enabled For Group Members</English>
@ -72,6 +77,7 @@
<German>Für Gruppenmitglieder aktiviert</German> <German>Für Gruppenmitglieder aktiviert</German>
<Czech>Povoleno pro členy skupiny</Czech> <Czech>Povoleno pro členy skupiny</Czech>
<Portuguese>Ativada para membros do grupo</Portuguese> <Portuguese>Ativada para membros do grupo</Portuguese>
<Hungarian>Csoporttagoknak engedélyezve</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Advanced_Ballistics_simulateForGroupMembers_Description"> <Key ID="STR_ACE_Advanced_Ballistics_simulateForGroupMembers_Description">
<English>Enables advanced ballistics for non local group members</English> <English>Enables advanced ballistics for non local group members</English>
@ -80,6 +86,7 @@
<German>Aktiviert die erweiterte Ballistik für nicht lokale Gruppenmitglieder</German> <German>Aktiviert die erweiterte Ballistik für nicht lokale Gruppenmitglieder</German>
<Czech>Aktivuje pokročilou balistiku pro nelokální členy skupiny</Czech> <Czech>Aktivuje pokročilou balistiku pro nelokální členy skupiny</Czech>
<Portuguese>Ativa balística avançada para membros de grupo não locais</Portuguese> <Portuguese>Ativa balística avançada para membros de grupo não locais</Portuguese>
<Hungarian>Engedélyezi a fejlett ballisztikát nem-helyi csoporttagoknak</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Advanced_Ballistics_simulateForEveryone_DisplayName"> <Key ID="STR_ACE_Advanced_Ballistics_simulateForEveryone_DisplayName">
<English>Enabled For Everyone</English> <English>Enabled For Everyone</English>
@ -88,6 +95,7 @@
<German>Für jeden aktiviert</German> <German>Für jeden aktiviert</German>
<Czech>Povoleno pro všechny</Czech> <Czech>Povoleno pro všechny</Czech>
<Portuguese>Ativada para todos</Portuguese> <Portuguese>Ativada para todos</Portuguese>
<Hungarian>Mindenkinek engedélyezve</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Advanced_Ballistics_simulateForEveryone_Description"> <Key ID="STR_ACE_Advanced_Ballistics_simulateForEveryone_Description">
<English>Enables advanced ballistics for all non local players (enabling this may degrade performance during heavy firefights in multiplayer)</English> <English>Enables advanced ballistics for all non local players (enabling this may degrade performance during heavy firefights in multiplayer)</English>
@ -96,6 +104,7 @@
<German>Aktiviert die erweiterte Ballistik für alle nicht lokalen Spieler (das Aktivieren dieser Funktion kann zur Beeinträchtigung des Spielerlebnisses im Multiplayer führen)</German> <German>Aktiviert die erweiterte Ballistik für alle nicht lokalen Spieler (das Aktivieren dieser Funktion kann zur Beeinträchtigung des Spielerlebnisses im Multiplayer führen)</German>
<Czech>Aktivovat pokročilou balistiku pro všechny nelokální hráče (aktivace této možnosti způsobuje pokles snímu za sekundu během těžké přestřelky v multiplayeru)</Czech> <Czech>Aktivovat pokročilou balistiku pro všechny nelokální hráče (aktivace této možnosti způsobuje pokles snímu za sekundu během těžké přestřelky v multiplayeru)</Czech>
<Portuguese>Ativa balística avançada para todos os jogadores não locais (ativando isso pode degradar a performance durante troca de tiros intensas no multiplayer)</Portuguese> <Portuguese>Ativa balística avançada para todos os jogadores não locais (ativando isso pode degradar a performance durante troca de tiros intensas no multiplayer)</Portuguese>
<Hungarian>Engedélyezi a fejlett ballisztikát az összes nem-helyi játékosnak (ez a funkció leronthatja a teljesítményt intenzív többjátékos tűzharcok alatt)</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Advanced_Ballistics_alwaysSimulateForGroupMembers_DisplayName"> <Key ID="STR_ACE_Advanced_Ballistics_alwaysSimulateForGroupMembers_DisplayName">
<English>Always Enabled For Group Members</English> <English>Always Enabled For Group Members</English>
@ -104,6 +113,7 @@
<German>Für Gruppenmitglieder immer aktiviert</German> <German>Für Gruppenmitglieder immer aktiviert</German>
<Czech>Vždy povoleno pro členy skupiny</Czech> <Czech>Vždy povoleno pro členy skupiny</Czech>
<Portuguese>Sempre ativada para membros do grupo</Portuguese> <Portuguese>Sempre ativada para membros do grupo</Portuguese>
<Hungarian>Mindig engedélyezve csoporttagoknak</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Advanced_Ballistics_alwaysSimulateForGroupMembers_Description"> <Key ID="STR_ACE_Advanced_Ballistics_alwaysSimulateForGroupMembers_Description">
<English>Always enables advanced ballistics when a group member fires</English> <English>Always enables advanced ballistics when a group member fires</English>
@ -112,6 +122,7 @@
<German>Aktiviert die erweiterte Ballistik immer, wenn ein Gruppenmitglied schießt</German> <German>Aktiviert die erweiterte Ballistik immer, wenn ein Gruppenmitglied schießt</German>
<Czech>Aktivuje pokročilou balistiku pro členy skupiny</Czech> <Czech>Aktivuje pokročilou balistiku pro členy skupiny</Czech>
<Portuguese>Sempre ative balística avançada quando um membro do grupo disparar</Portuguese> <Portuguese>Sempre ative balística avançada quando um membro do grupo disparar</Portuguese>
<Hungarian>Mindig engedélyezi a fejlett ballisztikát, ha egy csoporttag tüzel</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Advanced_Ballistics_disabledInFullAutoMod_DisplayName"> <Key ID="STR_ACE_Advanced_Ballistics_disabledInFullAutoMod_DisplayName">
<English>Disabled In FullAuto Mode</English> <English>Disabled In FullAuto Mode</English>
@ -120,6 +131,7 @@
<German>Beim vollautomatischen Feuern deaktiviert</German> <German>Beim vollautomatischen Feuern deaktiviert</German>
<Czech>Zakázáno v automatickém režimu střelby</Czech> <Czech>Zakázáno v automatickém režimu střelby</Czech>
<Portuguese>Desabilitar no modo automático</Portuguese> <Portuguese>Desabilitar no modo automático</Portuguese>
<Hungarian>Automata módban letiltva</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Advanced_Ballistics_disabledInFullAutoMod_Description"> <Key ID="STR_ACE_Advanced_Ballistics_disabledInFullAutoMod_Description">
<English>Disables the advanced ballistics during full auto fire</English> <English>Disables the advanced ballistics during full auto fire</English>
@ -128,6 +140,7 @@
<German>Deaktiviert die erweiterte Ballistik beim vollautomatischen Feuern</German> <German>Deaktiviert die erweiterte Ballistik beim vollautomatischen Feuern</German>
<Czech>Zákáže pokročilou balistiku během střelby v režimu automat</Czech> <Czech>Zákáže pokročilou balistiku během střelby v režimu automat</Czech>
<Portuguese>Desabilitar a balística avançada durante fogo automático</Portuguese> <Portuguese>Desabilitar a balística avançada durante fogo automático</Portuguese>
<Hungarian>Letiltja a fejlett ballisztikát automata tüzelés folyamán</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Advanced_Ballistics_ammoTemperatureEnabled_DisplayName"> <Key ID="STR_ACE_Advanced_Ballistics_ammoTemperatureEnabled_DisplayName">
<English>Enable Ammo Temperature Simulation</English> <English>Enable Ammo Temperature Simulation</English>
@ -136,6 +149,7 @@
<German>Simulation der Munitionstemperatur aktivieren</German> <German>Simulation der Munitionstemperatur aktivieren</German>
<Czech>Povolit simulaci teploty munice</Czech> <Czech>Povolit simulaci teploty munice</Czech>
<Portuguese>Ativar simulação de temperatura de munição</Portuguese> <Portuguese>Ativar simulação de temperatura de munição</Portuguese>
<Hungarian>Lőszer-hő szimuláció engedélyezése</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Advanced_Ballistics_ammoTemperatureEnabled_Description"> <Key ID="STR_ACE_Advanced_Ballistics_ammoTemperatureEnabled_Description">
<English>Muzzle velocity varies with ammo temperature</English> <English>Muzzle velocity varies with ammo temperature</English>
@ -144,6 +158,7 @@
<German>Munitionstemperatur hat Einfluss auf die Mündungsgeschwindigkeit</German> <German>Munitionstemperatur hat Einfluss auf die Mündungsgeschwindigkeit</German>
<Czech>Úsťová rychlost je závislá na teplotě munice</Czech> <Czech>Úsťová rychlost je závislá na teplotě munice</Czech>
<Portuguese>A velocidade de saída varia com a temperatura da munição</Portuguese> <Portuguese>A velocidade de saída varia com a temperatura da munição</Portuguese>
<Hungarian>A kezdősebesség a lőszer hőmérsékletétől függően változó</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Advanced_Ballistics_barrelLengthInfluenceEnabled_DisplayName"> <Key ID="STR_ACE_Advanced_Ballistics_barrelLengthInfluenceEnabled_DisplayName">
<English>Enable Barrel Length Simulation</English> <English>Enable Barrel Length Simulation</English>
@ -152,6 +167,7 @@
<German>Simulation der Lauflänge aktivieren</German> <German>Simulation der Lauflänge aktivieren</German>
<Czech>Povolit simulaci délky hlavně</Czech> <Czech>Povolit simulaci délky hlavně</Czech>
<Portuguese>Ativar a simulação de comprimento do cano</Portuguese> <Portuguese>Ativar a simulação de comprimento do cano</Portuguese>
<Hungarian>Csőhossz-szimuláció engedélyezése</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Advanced_Ballistics_barrelLengthInfluenceEnabled_Description"> <Key ID="STR_ACE_Advanced_Ballistics_barrelLengthInfluenceEnabled_Description">
<English>Muzzle velocity varies with barrel length</English> <English>Muzzle velocity varies with barrel length</English>
@ -160,6 +176,7 @@
<German>Lauflänge beeinflusst Mündungsgeschwindigkeit</German> <German>Lauflänge beeinflusst Mündungsgeschwindigkeit</German>
<Czech>Úsťová rychlost je závislá na délce hlavně</Czech> <Czech>Úsťová rychlost je závislá na délce hlavně</Czech>
<Portuguese>A velocidade de saída caria com o comprimento do cano</Portuguese> <Portuguese>A velocidade de saída caria com o comprimento do cano</Portuguese>
<Hungarian>A kezdősebesség a cső hosszától függően változó</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Advanced_Ballistics_bulletTraceEnabled_DisplayName"> <Key ID="STR_ACE_Advanced_Ballistics_bulletTraceEnabled_DisplayName">
<English>Enable Bullet Trace Effect</English> <English>Enable Bullet Trace Effect</English>
@ -168,6 +185,7 @@
<German>Geschossspureffekt aktivieren</German> <German>Geschossspureffekt aktivieren</German>
<Czech>Povolit efekt trasírek</Czech> <Czech>Povolit efekt trasírek</Czech>
<Portuguese>Ativa efeito traçante de projétil</Portuguese> <Portuguese>Ativa efeito traçante de projétil</Portuguese>
<Hungarian>Nyomkövető-effekt engedélyezése</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Advanced_Ballistics_bulletTraceEnabled_Description"> <Key ID="STR_ACE_Advanced_Ballistics_bulletTraceEnabled_Description">
<English>Enables a bullet trace effect to high caliber bullets (only visible when looking through high power optics)</English> <English>Enables a bullet trace effect to high caliber bullets (only visible when looking through high power optics)</English>
@ -176,6 +194,7 @@
<German>Aktiviere Geschossspureffekt für hohe Kaliber (bei Benutzung von Optiken mit starker Vergrößerung)</German> <German>Aktiviere Geschossspureffekt für hohe Kaliber (bei Benutzung von Optiken mit starker Vergrößerung)</German>
<Czech>Aktivuje efekt trasírek z vysokokaliberních zbraní (viditelné pouze skrze výkonnou optiku)</Czech> <Czech>Aktivuje efekt trasírek z vysokokaliberních zbraní (viditelné pouze skrze výkonnou optiku)</Czech>
<Portuguese>Ativa o efeito traçante de projétil para projéteis de alto calibre (somente visível quando observado por miras telescópicas)</Portuguese> <Portuguese>Ativa o efeito traçante de projétil para projéteis de alto calibre (somente visível quando observado por miras telescópicas)</Portuguese>
<Hungarian>Engedélyezi a nagy kaliberű lövedékek nyomának vizuális követését (csak nagy teljesítményű optikán keresztül látható)</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Advanced_Ballistics_simulationInterval_DisplayName"> <Key ID="STR_ACE_Advanced_Ballistics_simulationInterval_DisplayName">
<English>Simulation Interval</English> <English>Simulation Interval</English>
@ -184,6 +203,7 @@
<German>Simulationsintervall</German> <German>Simulationsintervall</German>
<Czech>Interval simulace</Czech> <Czech>Interval simulace</Czech>
<Portuguese>Intervalo da simulação</Portuguese> <Portuguese>Intervalo da simulação</Portuguese>
<Hungarian>Szimuláció intervalluma</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Advanced_Ballistics_simulationInterval_Description"> <Key ID="STR_ACE_Advanced_Ballistics_simulationInterval_Description">
<English>Defines the interval between every calculation step</English> <English>Defines the interval between every calculation step</English>
@ -192,6 +212,7 @@
<German>Legt das Intervall zwischen den Berechnungsschritten fest</German> <German>Legt das Intervall zwischen den Berechnungsschritten fest</German>
<Czech>Určuje interval mezi každým výpočtem</Czech> <Czech>Určuje interval mezi každým výpočtem</Czech>
<Portuguese>Define o intervalo entre cada cálculo</Portuguese> <Portuguese>Define o intervalo entre cada cálculo</Portuguese>
<Hungarian>Meghatározza a számítási lépések közötti időintervallumot</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Advanced_Ballistics_simulationRadius_DisplayName"> <Key ID="STR_ACE_Advanced_Ballistics_simulationRadius_DisplayName">
<English>Simulation Radius</English> <English>Simulation Radius</English>
@ -200,6 +221,7 @@
<German>Simulationsradius</German> <German>Simulationsradius</German>
<Czech>Rozsah simulace</Czech> <Czech>Rozsah simulace</Czech>
<Portuguese>Raio de simulação</Portuguese> <Portuguese>Raio de simulação</Portuguese>
<Hungarian>Szimuláció hatóköre</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Advanced_Ballistics_simulationRadius_Description"> <Key ID="STR_ACE_Advanced_Ballistics_simulationRadius_Description">
<English>Defines the radius around the player (in meters) at which advanced ballistics are applied to projectiles</English> <English>Defines the radius around the player (in meters) at which advanced ballistics are applied to projectiles</English>
@ -208,12 +230,14 @@
<German>Gibt den Radius (in Metern) um den Spieler an, bei dem die erweiterte Ballistik auf Geschosse angewendet wird</German> <German>Gibt den Radius (in Metern) um den Spieler an, bei dem die erweiterte Ballistik auf Geschosse angewendet wird</German>
<Czech>Určuje oblast kolem hráče (v metrech), kde je pokročilá balistika použita na projektil</Czech> <Czech>Určuje oblast kolem hráče (v metrech), kde je pokročilá balistika použita na projektil</Czech>
<Portuguese>Define o raio ao redor do jogador (em metros) onde a balística avançada será aplicada aos projéteis</Portuguese> <Portuguese>Define o raio ao redor do jogador (em metros) onde a balística avançada será aplicada aos projéteis</Portuguese>
<Hungarian>Meghatározza a játékos körüli hatókört (méterben), ahol a lövedékek fejlett ballisztikát használnak</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Advanced_Ballistics_Description"> <Key ID="STR_ACE_Advanced_Ballistics_Description">
<English>This module enables advanced ballistics simulation - meaning the trajectory of projectiles is influenced by variables like air temperature, atmospheric pressure, humidity, gravity, the type of ammunition and the weapon from which it was fired.</English> <English>This module enables advanced ballistics simulation - meaning the trajectory of projectiles is influenced by variables like air temperature, atmospheric pressure, humidity, gravity, the type of ammunition and the weapon from which it was fired.</English>
<Polish>Moduł ten pozwala aktywować zaawansowaną balistykę biorącą przy obliczeniach trajektorii lotu pocisku pod uwagę takie rzeczy jak temperatura powietrza, ciśnienie atmosferyczne, wilgotność powietrza, siły Coriolisa i Eotvosa, grawitację a także broń z jakiej wykonywany jest strzał oraz rodzaj amunicji. Wszystko to sprowadza się na bardzo dokładne odwzorowanie balistyki.</Polish> <Polish>Moduł ten pozwala aktywować zaawansowaną balistykę biorącą przy obliczeniach trajektorii lotu pocisku pod uwagę takie rzeczy jak temperatura powietrza, ciśnienie atmosferyczne, wilgotność powietrza, siły Coriolisa i Eotvosa, grawitację a także broń z jakiej wykonywany jest strzał oraz rodzaj amunicji. Wszystko to sprowadza się na bardzo dokładne odwzorowanie balistyki.</Polish>
<Czech>Tento modul umožňuje aktivovat pokročilou balistiku, která vypočítává trajektorii kulky a bere do úvahy věci jako je teplota vzduchu, atmosférický tlak, vlhkost vzduchu, gravitaci, typ munice a zbraň, ze které je náboj vystřelen. To vše přispívá k velmi přesné balistice.</Czech> <Czech>Tento modul umožňuje aktivovat pokročilou balistiku, která vypočítává trajektorii kulky a bere do úvahy věci jako je teplota vzduchu, atmosférický tlak, vlhkost vzduchu, gravitaci, typ munice a zbraň, ze které je náboj vystřelen. To vše přispívá k velmi přesné balistice.</Czech>
<Portuguese>Este módulo permite que você ative cálculos de balística avançada, fazendo a trajetória do projétil levar em consideração coisas como temperatura do ar, pressão atmosférica, umidade, força de Coriolis, a gravidade, o modelo da arma no qual o disparo é realizado e o tipo de munição. Tudo isso acrescenta-se a um balística muito precisa.</Portuguese> <Portuguese>Este módulo permite que você ative cálculos de balística avançada, fazendo a trajetória do projétil levar em consideração coisas como temperatura do ar, pressão atmosférica, umidade, força de Coriolis, a gravidade, o modelo da arma no qual o disparo é realizado e o tipo de munição. Tudo isso acrescenta-se a um balística muito precisa.</Portuguese>
<Hungarian>Ez a modul engedélyezi a fejlett ballisztikai szimulációt - a lövedékek röppályáját befolyásolni fogja a levegő hőmérséklete, légnyomás, páratartalom, gravitáció, a lövedék fajtája, valamint a fegyver, amiből kilőtték a lövedéket.</Hungarian>
</Key> </Key>
</Package> </Package>
</Project> </Project>

View File

@ -8,3 +8,24 @@ class Extended_PostInit_EventHandlers {
clientInit = QUOTE( call COMPILE_FILE(XEH_clientInit) ); clientInit = QUOTE( call COMPILE_FILE(XEH_clientInit) );
}; };
}; };
class Extended_GetIn_EventHandlers {
class All {
class ADDON {
getIn = QUOTE(_this call FUNC(handleGetIn));
};
};
};
class Extended_GetOut_EventHandlers {
class All {
class ADDON {
getOut = QUOTE(_this call FUNC(handleGetOut));
};
};
};
class Extended_Killed_EventHandlers {
class All {
class ADDON {
killed = QUOTE(_this call FUNC(handleKilled));
};
};
};

View File

@ -7,6 +7,9 @@ PREP(canAttach);
PREP(canDetach); PREP(canDetach);
PREP(detach); PREP(detach);
PREP(getChildrenAttachActions); PREP(getChildrenAttachActions);
PREP(handleGetIn);
PREP(handleGetOut);
PREP(handleKilled);
PREP(placeApprove); PREP(placeApprove);
ADDON = true; ADDON = true;

View File

@ -17,15 +17,14 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_itemVehClass", "_onAtachText", "_selfAttachPosition", "_attachedItem", "_tempObject", "_actionID", "_model"]; params ["_attachToVehicle","_unit","_args", ["_silentScripted", false]];
params ["_attachToVehicle","_unit","_args"];
_args params [["_itemClassname","", [""]]]; _args params [["_itemClassname","", [""]]];
TRACE_3("params",_attachToVehicle,_unit,_itemClassname); TRACE_4("params",_attachToVehicle,_unit,_itemClassname,_silentScripted);
private ["_itemVehClass", "_onAtachText", "_selfAttachPosition", "_attachedItem", "_tempObject", "_actionID", "_model"];
//Sanity Check (_unit has item in inventory, not over attach limit) //Sanity Check (_unit has item in inventory, not over attach limit)
if ((_itemClassname == "") || {!(_this call FUNC(canAttach))}) exitWith {ERROR("Tried to attach, but check failed");}; if ((_itemClassname == "") || {(!_silentScripted) && {!(_this call FUNC(canAttach))}}) exitWith {ERROR("Tried to attach, but check failed");};
_selfAttachPosition = [_unit, [-0.05, 0, 0.12], "rightshoulder"];
_itemVehClass = getText (configFile >> "CfgWeapons" >> _itemClassname >> "ACE_Attachable"); _itemVehClass = getText (configFile >> "CfgWeapons" >> _itemClassname >> "ACE_Attachable");
_onAtachText = getText (configFile >> "CfgWeapons" >> _itemClassname >> "displayName"); _onAtachText = getText (configFile >> "CfgWeapons" >> _itemClassname >> "displayName");
@ -40,12 +39,13 @@ if (_itemVehClass == "") exitWith {ERROR("no ACE_Attachable for Item");};
_onAtachText = format [localize LSTRING(Item_Attached), _onAtachText]; _onAtachText = format [localize LSTRING(Item_Attached), _onAtachText];
if (_unit == _attachToVehicle) then { //Self Attachment if (_unit == _attachToVehicle) then { //Self Attachment
_unit removeItem _itemClassname; // Remove item
_attachedItem = _itemVehClass createVehicle [0,0,0]; _attachedItem = _itemVehClass createVehicle [0,0,0];
_attachedItem attachTo _selfAttachPosition; _attachedItem attachTo [_unit, [-0.05, 0, 0.12], "rightshoulder"];
if (!_silentScripted) then {
_unit removeItem _itemClassname; // Remove item
[_onAtachText] call EFUNC(common,displayTextStructured); [_onAtachText] call EFUNC(common,displayTextStructured);
_attachToVehicle setVariable [QGVAR(Objects), [_attachedItem], true]; };
_attachToVehicle setVariable [QGVAR(ItemNames), [_itemClassname], true]; _unit setVariable [QGVAR(attached), [[_attachedItem, _itemClassname]], true];
} else { } else {
GVAR(placeAction) = PLACE_WAITING; GVAR(placeAction) = PLACE_WAITING;

View File

@ -17,14 +17,17 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_attachLimit", "_attachedObjects","_playerPos"];
params ["_attachToVehicle","_player","_args"]; params ["_attachToVehicle","_player","_args"];
_args params [["_itemClassname","", [""]]]; _args params [["_itemClassname","", [""]]];
TRACE_3("params",_attachToVehicle,_unit,_itemClassname); TRACE_3("params",_attachToVehicle,_player,_itemClassname);
private ["_attachLimit", "_attachedObjects"];
_attachLimit = [6, 1] select (_player == _attachToVehicle); _attachLimit = [6, 1] select (_player == _attachToVehicle);
_attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; _attachedObjects = _attachToVehicle getVariable [QGVAR(attached), []];
_playerPos = (ACE_player modelToWorldVisual (ACE_player selectionPosition "pilot")); ((_player == _attachToVehicle) || {canStand _player}) &&
{(_attachToVehicle distance _player) < 7} &&
(canStand _player) && {(_attachToVehicle distance _player) < 7} && {alive _attachToVehicle} && {(count _attachedObjects) < _attachLimit} && {_itemClassname in ((itemsWithMagazines _player) + [""])}; {alive _attachToVehicle} &&
{(count _attachedObjects) < _attachLimit} &&
{_itemClassname in ((itemsWithMagazines _player) + [""])};

View File

@ -16,25 +16,25 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_attachedObjects", "_inRange"];
params ["_attachToVehicle", "_unit"]; params ["_attachToVehicle", "_unit"];
TRACE_2("params",_attachToVehicle,_unit); TRACE_2("params",_attachToVehicle,_unit);
_attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; _attachedList = _attachToVehicle getVariable [QGVAR(attached), []];
if ((count _attachedList) == 0) exitWith {false};
private ["_inRange"];
_inRange = false; _inRange = false;
if (_unit == _attachToVehicle) then {
_inRange = count _attachedObjects > 0;
} else {
//Scan if unit is within range (using 2d distance)
private ["_unitPos", "_objectPos"];
_unitPos = getPos _unit;
_unitPos set [2,0];
{ {
_objectPos = getPos _x; _x params ["_xObject"];
_objectPos set [2, 0]; if (isNull _xObject) exitWith {
if (_objectPos distance _unitPos < 4) exitWith {_inRange = true}; TRACE_1("Null attached",_x);
} forEach _attachedObjects; _attachedList deleteAt _forEachIndex;
_attachToVehicle setVariable [QGVAR(attached), _attachedList, true];
}; };
if (((getPos _unit) distance2d (getPos _xObject)) < 4) exitWith {_inRange = true};
} forEach _attachedList;
canStand _unit && {_inRange} && {alive _attachToVehicle} _inRange &&
{(_unit == _attachToVehicle) || {canStand _unit}} &&
{alive _attachToVehicle}

View File

@ -16,15 +16,12 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_attachedObjects", "_attachedItems", "_itemDisplayName",
"_attachedObject", "_attachedIndex", "_itemName", "_minDistance",
"_unitPos", "_objectPos"
];
params ["_attachToVehicle","_unit"], params ["_attachToVehicle","_unit"],
TRACE_2("params",_attachToVehicle,_unit); TRACE_2("params",_attachToVehicle,_unit);
_attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; private ["_attachedList", "_itemDisplayName", "_attachedObject", "_attachedIndex", "_itemName", "_minDistance"];
_attachedItems = _attachToVehicle getVariable [QGVAR(ItemNames), []];
_attachedList = _attachToVehicle getVariable [QGVAR(attached), []];
_attachedObject = objNull; _attachedObject = objNull;
_attachedIndex = -1; _attachedIndex = -1;
@ -32,18 +29,17 @@ _itemName = "";
//Find closest attached object //Find closest attached object
_minDistance = 1000; _minDistance = 1000;
_unitPos = getPos _unit;
_unitPos set [2,0];
{ {
_objectPos = getPos _x; _x params ["_xObject", "_xItemName"];
_objectPos set [2, 0];
if (_objectPos distance _unitPos < _minDistance) then { if (((getPos _unit) distance2d (getPos _xObject)) < _minDistance) then {
_minDistance = _objectPos distance _unitPos; _minDistance = ((getPos _unit) distance2d (getPos _xObject));
_attachedObject = _x; _attachedObject = _xObject;
_itemName = _attachedItems select _forEachIndex; _itemName = _xItemName;
_attachedIndex = _forEachIndex; _attachedIndex = _forEachIndex;
}; };
} forEach _attachedObjects; } forEach _attachedList;
// Check if unit has an attached item // Check if unit has an attached item
if (isNull _attachedObject || {_itemName == ""}) exitWith {ERROR("Could not find attached object")}; if (isNull _attachedObject || {_itemName == ""}) exitWith {ERROR("Could not find attached object")};
@ -68,10 +64,8 @@ if (toLower _itemName in ["b_ir_grenade", "o_ir_grenade", "i_ir_grenade"]) then
}; };
// Reset unit variables // Reset unit variables
_attachedObjects deleteAt _attachedIndex; _attachedList deleteAt _attachedIndex;
_attachedItems deleteAt _attachedIndex; _attachToVehicle setVariable [QGVAR(attached), _attachedList, true];
_attachToVehicle setVariable [QGVAR(Objects), _attachedObjects, true];
_attachToVehicle setVariable [QGVAR(ItemNames), _attachedItems, true];
// Display message // Display message
_itemDisplayName = getText (configFile >> "CfgWeapons" >> _itemName >> "displayName"); _itemDisplayName = getText (configFile >> "CfgWeapons" >> _itemName >> "displayName");

View File

@ -0,0 +1,38 @@
/*
* Author: PabstMirror
* Handles when a unit gets in to a vehicle.
*
* Arguments:
* 0: vehicle <OBJECT>
* 1: dunno <OBJECT>
* 2: unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [car2, x, player] call ACE_attach_fnc_handleGetIn
*
* Public: No
*/
#include "script_component.hpp"
if (!isServer) exitWith {};
params ["", "", "_unit"];
TRACE_1("params",_unit);
private ["_attachedList"];
_attachedList = _unit getVariable [QGVAR(attached), []];
if ((count _attachedList) == 0) exitWith {};
(_attachedList select 0) params ["_xObject"];
if (!isNull _xObject) then {
detach _xObject;
_xObject setPos ((getPos _unit) vectorAdd [0, 0, -1000]);
[{deleteVehicle (_this select 0)}, [_xObject], 2] call EFUNC(common,waitAndExecute);
(_attachedList select 0) set [0, objNull];
};
_unit setVariable [QGVAR(attached), _attachedList, true];

View File

@ -0,0 +1,35 @@
/*
* Author: PabstMirror
* Handles when a unit gets in to a vehicle.
*
* Arguments:
* 0: vehicle <OBJECT>
* 1: dunno <OBJECT>
* 2: unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [car2, x, player] call ACE_attach_fnc_handleGetOut
*
* Public: No
*/
#include "script_component.hpp"
if (!isServer) exitWith {};
params ["", "", "_unit"];
TRACE_1("params",_unit);
private ["_attachedList"];
_attachedList = _unit getVariable [QGVAR(attached), []];
if ((count _attachedList) == 0) exitWith {};
(_attachedList select 0) params ["_xObject", "_xItemName"];
if (isNull _xObject) then {
TRACE_1("null attached when exiting vehicle, scripted reattach",_xItemName);
_unit setVariable [QGVAR(attached), [], true];
[_unit, _unit, _xItemName, true] call FUNC(attach);
};

View File

@ -0,0 +1,39 @@
/*
* Author: PabstMirror
* Handles when vehicle or man is killed.
* Note: Runs where unit is local.
*
* Arguments:
* 0: DeadVehicle <OBJECT>
*
* Return Value:
* None
*
* Example:
* [bob1] call ACE_attach_fnc_handleKilled
*
* Public: No
*/
#include "script_component.hpp"
params ["_deadUnit"];
TRACE_1("params",_deadUnit);
private ["_attachedList"];
_attachedList = _deadUnit getVariable [QGVAR(attached), []];
if ((count _attachedList) == 0) exitWith {};
{
_x params ["_xObject"];
TRACE_2("detaching",_xObject,_deadUnit);
detach _xObject;
//If it's a vehicle, also delete the attached
if (!(_deadUnit isKindOf "CAManBase")) then {
_xObject setPos ((getPos _deadUnit) vectorAdd [0, 0, -1000]);
[{deleteVehicle (_this select 0)}, [_xObject], 2] call EFUNC(common,waitAndExecute);
};
} forEach _attachedList;
_deadUnit setVariable [QGVAR(attached), nil, true];

View File

@ -25,7 +25,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_startingOffset", "_startDistanceFromCenter", "_closeInUnitVector", "_closeInMax", "_closeInMin", "_closeInDistance", "_endPosTestOffset", "_endPosTest", "_doesIntersect", "_startingPosShifted", "_startASL", "_endPosShifted", "_endASL", "_attachedObject", "_currentObjects", "_currentItemNames"]; private ["_startingOffset", "_startDistanceFromCenter", "_closeInUnitVector", "_closeInMax", "_closeInMin", "_closeInDistance", "_endPosTestOffset", "_endPosTest", "_doesIntersect", "_startingPosShifted", "_startASL", "_endPosShifted", "_endASL", "_attachedObject", "_attachList"];
params ["_unit", "_attachToVehicle", "_itemClassname", "_itemVehClass", "_onAtachText", "_startingPosition"]; params ["_unit", "_attachToVehicle", "_itemClassname", "_itemVehClass", "_onAtachText", "_startingPosition"];
TRACE_6("params",_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_startingPosition); TRACE_6("params",_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_startingPosition);
@ -87,12 +87,9 @@ _attachedObject attachTo [_attachToVehicle, _endPosTestOffset];
//Remove Item from inventory //Remove Item from inventory
_unit removeItem _itemClassname; _unit removeItem _itemClassname;
//Add Object to ACE_AttachedObjects and ACE_AttachedItemNames //Add Object to attached array
_currentObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; _attachList = _attachToVehicle getVariable [QGVAR(attached), []];
_currentObjects pushBack _attachedObject; _attachList pushBack [_attachedObject, _itemClassname];
_attachToVehicle setVariable [QGVAR(Objects), _currentObjects, true]; _attachToVehicle setVariable [QGVAR(attached), _attachList, true];
_currentItemNames = _attachToVehicle getVariable [QGVAR(ItemNames), []];
_currentItemNames pushBack _itemClassname;
_attachToVehicle setVariable [QGVAR(ItemNames), _currentItemNames, true];
[_onAtachText] call EFUNC(common,displayTextStructured); [_onAtachText] call EFUNC(common,displayTextStructured);

View File

@ -3,7 +3,6 @@
ADDON = false; ADDON = false;
PREP(backpackOpened); PREP(backpackOpened);
PREP(getBackpackAssignedUnit);
PREP(isBackpack); PREP(isBackpack);
PREP(onOpenInventory); PREP(onOpenInventory);

View File

@ -1,22 +0,0 @@
/*
* Author: commy2
*
* Returns the unit that has the given backpack object equipped.
*
* Argument:
* 0: Executing Unit (Object)
* 1: A backpack object (Object)
*
* Return value:
* Unit that has the backpack equipped. (Object)
*/
#include "script_component.hpp"
scopeName "main";
params ["_unit","_backpack"];
_target = objNull;
{
if (backpackContainer _x == _backpack) then {_target = _x; breakTo "main"};
} count nearestObjects [_unit, ["Man"], 5];
if (isNull _target) exitWith {ACE_Player};
_target

View File

@ -1,7 +1,7 @@
/* /*
* Author: commy2 * Author: commy2
* *
* Handle the open inventory event. Display message on traget client. * Handle the open inventory event. Display message on target client.
* *
* Argument: * Argument:
* Input from "InventoryOpened" eventhandler * Input from "InventoryOpened" eventhandler
@ -11,16 +11,17 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private "_target"; params ["_unit","_backpack"];
params ["","_backpack"];
// exit if the target is not a backpack // exit if the target is not a real backpack, i.e. parachute, static weapon bag etc.
if !([_backpack] call FUNC(isBackpack)) exitWith {}; if !([_backpack] call FUNC(isBackpack)) exitWith {false};
// get the unit that wears the backpack object // get the unit that wears the backpack object
_target = _this call FUNC(getBackpackAssignedUnit); private "_target";
_target = objectParent _backpack;
if (isNull _target) exitWith {false}; if (isNull _target) exitWith {false};
// raise event on target unit // raise event on target unit
["backpackOpened", _target, [_target, _backpack]] call EFUNC(common,targetEvent); ["backpackOpened", _target, [_target, _backpack]] call EFUNC(common,targetEvent);

View File

@ -1599,6 +1599,7 @@
<German>[ACE] Munitionskiste</German> <German>[ACE] Munitionskiste</German>
<Czech>[ACE] Bedna s municí</Czech> <Czech>[ACE] Bedna s municí</Czech>
<Portuguese>[ACE] Caixa com suprimentos de munição</Portuguese> <Portuguese>[ACE] Caixa com suprimentos de munição</Portuguese>
<Hungarian>[ACE] Lőszeres láda</Hungarian>
</Key> </Key>
</Package> </Package>
</Project> </Project>

View File

@ -18,6 +18,11 @@ class CfgMovesBasic {
default = "ACE_AmovPercMstpSsurWnonDnon"; default = "ACE_AmovPercMstpSsurWnonDnon";
PutDown = ""; PutDown = "";
}; };
class ACE_CivilHandCuffedFFVActions: ACE_CivilStandHandcuffedActions {
stop = "ACE_HandcuffedFFV";
StopRelaxed = "ACE_HandcuffedFFV";
default = "ACE_HandcuffedFFV";
};
}; };
}; };
@ -30,6 +35,12 @@ class CfgMovesMaleSdr: CfgMovesBasic {
class CutSceneAnimationBase; class CutSceneAnimationBase;
#define MACRO_ANIMATION \
head = "headDefault"; \
aimingBody = "aimingNo"; \
forceAim = 1; \
static = 1;
//Handcuffed Anims: //Handcuffed Anims:
class ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon: CutSceneAnimationBase { class ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon: CutSceneAnimationBase {
actions = "ACE_CivilStandHandcuffedActions"; actions = "ACE_CivilStandHandcuffedActions";
@ -40,6 +51,7 @@ class CfgMovesMaleSdr: CfgMovesBasic {
ConnectTo[] = {"ACE_AmovPercMstpScapWnonDnon",0.1}; ConnectTo[] = {"ACE_AmovPercMstpScapWnonDnon",0.1};
InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1}; InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1};
canReload = 0; canReload = 0;
MACRO_ANIMATION
}; };
class ACE_AmovPercMstpScapWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon { class ACE_AmovPercMstpScapWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon {
file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\AmovPercMstpSnonWnonDnon_Ease"; file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\AmovPercMstpSnonWnonDnon_Ease";
@ -47,14 +59,25 @@ class CfgMovesMaleSdr: CfgMovesBasic {
ConnectTo[] = {"ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1}; ConnectTo[] = {"ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1};
InterpolateTo[] = {"Unconscious",0.01}; InterpolateTo[] = {"Unconscious",0.01};
looped = 1; looped = 1;
MACRO_ANIMATION
}; };
class ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon { class ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon {
actions = "CivilStandActions"; actions = "CivilStandActions";
file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\amovpercmstpsnonwnondnon_easeout"; file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\amovpercmstpsnonwnondnon_easeout";
ConnectTo[] = {"AmovPercMstpSnonWnonDnon",0.1}; ConnectTo[] = {"AmovPercMstpSnonWnonDnon",0.1};
InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon",0.1}; InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon",0.1};
MACRO_ANIMATION
}; };
//Handcuffed-FFV:
class ACE_HandcuffedFFV: ACE_AmovPercMstpScapWnonDnon {
file = "\A3\cargoposes_F_heli\anim\passenger_flatground_3idleunarmed.rtm";
actions = "ACE_CivilHandCuffedFFVActions";
ConnectTo[] = {};
MACRO_ANIMATION
};
//Surrender Anims: //Surrender Anims:
class ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon: CutSceneAnimationBase { class ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon: CutSceneAnimationBase {
actions = "ACE_CivilStandSurrenderActions"; actions = "ACE_CivilStandSurrenderActions";
@ -65,6 +88,7 @@ class CfgMovesMaleSdr: CfgMovesBasic {
ConnectTo[] = {"ACE_AmovPercMstpSsurWnonDnon",0.1}; ConnectTo[] = {"ACE_AmovPercMstpSsurWnonDnon",0.1};
InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon",0.1}; InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon",0.1};
canReload = 0; canReload = 0;
MACRO_ANIMATION
}; };
class ACE_AmovPercMstpSsurWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon { class ACE_AmovPercMstpSsurWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon {
file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\sur\non\AmovPercMstpSsurWnonDnon"; file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\sur\non\AmovPercMstpSsurWnonDnon";
@ -72,6 +96,7 @@ class CfgMovesMaleSdr: CfgMovesBasic {
looped = 1; looped = 1;
ConnectTo[] = {"ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon",0.1}; ConnectTo[] = {"ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon",0.1};
InterpolateTo[] = {"Unconscious",0.01}; InterpolateTo[] = {"Unconscious",0.01};
MACRO_ANIMATION
}; };
class ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon { class ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon {
speed = 0.5; //for gameplay reasons, slow this down speed = 0.5; //for gameplay reasons, slow this down
@ -79,6 +104,7 @@ class CfgMovesMaleSdr: CfgMovesBasic {
file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\sur\non\AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon"; file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\sur\non\AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon";
ConnectTo[] = {"AmovPercMstpSnonWnonDnon",0.1}; ConnectTo[] = {"AmovPercMstpSnonWnonDnon",0.1};
InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon",0.1}; InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon",0.1};
MACRO_ANIMATION
}; };
}; };
}; };

View File

@ -12,6 +12,8 @@ class CfgVehicles {
exceptions[] = {}; exceptions[] = {};
icon = QUOTE(PATHTOF(UI\handcuff_ca.paa)); icon = QUOTE(PATHTOF(UI\handcuff_ca.paa));
}; };
class ACE_MainActions {
class ACE_RemoveHandcuffs { class ACE_RemoveHandcuffs {
displayName = CSTRING(ReleaseCaptive); displayName = CSTRING(ReleaseCaptive);
selection = "righthand"; selection = "righthand";
@ -21,8 +23,6 @@ class CfgVehicles {
exceptions[] = {}; exceptions[] = {};
icon = QUOTE(PATHTOF(UI\handcuff_ca.paa)); icon = QUOTE(PATHTOF(UI\handcuff_ca.paa));
}; };
class ACE_MainActions {
class ACE_EscortCaptive { class ACE_EscortCaptive {
displayName = CSTRING(EscortCaptive); displayName = CSTRING(EscortCaptive);
distance = 4; distance = 4;
@ -97,7 +97,7 @@ class CfgVehicles {
}; };
}; };
#define MACRO_LOADUNLOADCAPTIVE \ #define MACRO_LOADCAPTIVE \
class ACE_Actions { \ class ACE_Actions { \
class ACE_MainActions { \ class ACE_MainActions { \
class GVAR(LoadCaptive) { \ class GVAR(LoadCaptive) { \
@ -113,27 +113,27 @@ class CfgVehicles {
class LandVehicle; class LandVehicle;
class Car: LandVehicle { class Car: LandVehicle {
MACRO_LOADUNLOADCAPTIVE MACRO_LOADCAPTIVE
}; };
class Tank: LandVehicle { class Tank: LandVehicle {
MACRO_LOADUNLOADCAPTIVE MACRO_LOADCAPTIVE
}; };
class Air; class Air;
class Helicopter: Air { class Helicopter: Air {
MACRO_LOADUNLOADCAPTIVE MACRO_LOADCAPTIVE
}; };
class Plane: Air { class Plane: Air {
MACRO_LOADUNLOADCAPTIVE MACRO_LOADCAPTIVE
}; };
class Ship; class Ship;
class Ship_F: Ship { class Ship_F: Ship {
MACRO_LOADUNLOADCAPTIVE MACRO_LOADCAPTIVE
}; };
class StaticWeapon: LandVehicle { class StaticWeapon: LandVehicle {
MACRO_LOADUNLOADCAPTIVE MACRO_LOADCAPTIVE
}; };
class Box_NATO_Support_F; class Box_NATO_Support_F;

View File

@ -6,12 +6,11 @@
if (isServer) then { if (isServer) then {
addMissionEventHandler ["HandleDisconnect", { addMissionEventHandler ["HandleDisconnect", {
PARAMS_1(_disconnectedPlayer); params ["_disconnectedPlayer"];
private "_escortedUnit"; private "_escortedUnit";
_escortedUnit = _disconnectedPlayer getVariable [QGVAR(escortedUnit), objNull]; _escortedUnit = _disconnectedPlayer getVariable [QGVAR(escortedUnit), objNull];
if ((!isNull _escortedUnit) && {(attachedTo _escortedUnit) == _disconnectedPlayer}) then { if ((!isNull _escortedUnit) && {(attachedTo _escortedUnit) == _disconnectedPlayer}) then {
detach _escortedUnit; detach _escortedUnit;
//systemChat "debug: DC detach";
}; };
if (_disconnectedPlayer getVariable [QGVAR(isEscorting), false]) then { if (_disconnectedPlayer getVariable [QGVAR(isEscorting), false]) then {
_disconnectedPlayer setVariable [QGVAR(isEscorting), false, true]; _disconnectedPlayer setVariable [QGVAR(isEscorting), false, true];

View File

@ -16,6 +16,7 @@ PREP(doFriskPerson);
PREP(doLoadCaptive); PREP(doLoadCaptive);
PREP(doRemoveHandcuffs); PREP(doRemoveHandcuffs);
PREP(doUnloadCaptive); PREP(doUnloadCaptive);
PREP(findEmptyNonFFVCargoSeat);
PREP(handleGetIn); PREP(handleGetIn);
PREP(handleGetOut); PREP(handleGetOut);
PREP(handleKilled); PREP(handleKilled);

View File

@ -11,28 +11,36 @@
* The return value <BOOL> * The return value <BOOL>
* *
* Example: * Example:
* [player, bob] call ACE_captives_fnc_canLoadCaptive * [player, bob, car] call ACE_captives_fnc_canLoadCaptive
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_objects"];
params ["_unit", "_target","_vehicle"]; params ["_unit", "_target","_vehicle"];
if (isNull _target) then { if ((isNull _target) && {_unit getVariable [QGVAR(isEscorting), false]}) then {
_objects = attachedObjects _unit; //Looking at a vehicle while escorting, get target from attached objects:
_objects = [_objects, {_this getVariable [QGVAR(isHandcuffed), false]}] call EFUNC(common,filter); {
if ((count _objects) > 0) then {_target = _objects select 0;}; if (_x getVariable [QGVAR(isHandcuffed), false]) exitWith {
_target = _x;
}; };
} forEach (attachedObjects _unit);
};
if ((isNull _target) || {(vehicle _target) != _target} || {!(_target getVariable [QGVAR(isHandcuffed), false])}) exitWith {false};
if (isNull _vehicle) then { if (isNull _vehicle) then {
_objects = nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship"], 10]; //Looking at a captive unit, search for nearby vehicles with valid seats:
if ((count _objects) > 0) then {_vehicle = _objects select 0;}; {
if ((_x emptyPositions "cargo") > 0) exitWith {
_vehicle = _x;
};
} forEach (nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship"], 10]);
} else {
//We have a vehicle picked, make sure it has empty seats:
if ((_vehicle emptyPositions "cargo") == 0) then {
_vehicle = objNull;
};
}; };
(!isNull _target) (!isNull _vehicle)
&& {!isNull _vehicle}
&& {_unit getVariable [QGVAR(isEscorting), false]}
&& {_target getVariable [QGVAR(isHandcuffed), false]}
&& {_vehicle emptyPositions "cargo" > 0}

View File

@ -20,4 +20,5 @@ params ["_unit", "_target"];
//Unit is handcuffed and not currently being escorted //Unit is handcuffed and not currently being escorted
_target getVariable [QGVAR(isHandcuffed), false] && _target getVariable [QGVAR(isHandcuffed), false] &&
{isNull (attachedTo _target)} {isNull (attachedTo _target)} &&
{(vehicle _target) == _target}

View File

@ -35,7 +35,9 @@ if (_state) then {
nil, 20, false, true, "", QUOTE(!isNull (GETVAR(_target,QGVAR(escortedUnit),objNull)))]; nil, 20, false, true, "", QUOTE(!isNull (GETVAR(_target,QGVAR(escortedUnit),objNull)))];
[{ [{
EXPLODE_3_PVT((_this select 0),_unit,_target,_actionID); params ["_args", "_pfID"];
_args params ["_unit", "_target", "_actionID"];
if (_unit getVariable [QGVAR(isEscorting), false]) then { if (_unit getVariable [QGVAR(isEscorting), false]) then {
if (!alive _target || {!alive _unit} || {!canStand _target} || {!canStand _unit} || {_target getVariable ["ACE_isUnconscious", false]} || {_unit getVariable ["ACE_isUnconscious", false]} || {!isNull (attachedTo _unit)}) then { if (!alive _target || {!alive _unit} || {!canStand _target} || {!canStand _unit} || {_target getVariable ["ACE_isUnconscious", false]} || {_unit getVariable ["ACE_isUnconscious", false]} || {!isNull (attachedTo _unit)}) then {
_unit setVariable [QGVAR(isEscorting), false, true]; _unit setVariable [QGVAR(isEscorting), false, true];

View File

@ -18,7 +18,6 @@
private ["_weapon", "_listedItemClasses", "_actions", "_allGear"]; private ["_weapon", "_listedItemClasses", "_actions", "_allGear"];
PARAMS_2(_player,_unit);
params ["_player", "_unit"]; params ["_player", "_unit"];
_weapon = currentWeapon _player; _weapon = currentWeapon _player;

View File

@ -1,6 +1,6 @@
/* /*
* Author: commy2 * Author: commy2
* Unit loads the target object into a vehicle. * Unit loads the target object into a vehicle. (logic same as canLoadCaptive)
* *
* Arguments: * Arguments:
* 0: Unit that wants to load a captive <OBJECT> * 0: Unit that wants to load a captive <OBJECT>
@ -17,24 +17,34 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private "_objects";
params ["_unit", "_target","_vehicle"]; params ["_unit", "_target","_vehicle"];
if (isNull _target) then { if ((isNull _target) && {_unit getVariable [QGVAR(isEscorting), false]}) then {
_objects = attachedObjects _unit; //Looking at a vehicle while escorting, get target from attached objects:
_objects = [_objects, {_this getVariable [QGVAR(isHandcuffed), false]}] call EFUNC(common,filter); {
if ((count _objects) > 0) then {_target = _objects select 0;}; if (_x getVariable [QGVAR(isHandcuffed), false]) exitWith {
_target = _x;
}; };
if (isNull _target) exitWith {}; } forEach (attachedObjects _unit);
};
if ((isNull _target) || {(vehicle _target) != _target} || {!(_target getVariable [QGVAR(isHandcuffed), false])}) exitWith {ERROR("");};
if (isNull _vehicle) then { if (isNull _vehicle) then {
_objects = nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship"], 10]; //Looking at a captive unit, search for nearby vehicles with valid seats:
if ((count _objects) > 0) then {_vehicle = _objects select 0;}; {
// if (([_x] call FUNC(findEmptyNonFFVCargoSeat)) != -1) exitWith {
if ((_x emptyPositions "cargo") > 0) exitWith {
_vehicle = _x;
};
} forEach (nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship"], 10]);
} else {
// if (([_vehicle] call FUNC(findEmptyNonFFVCargoSeat)) == -1) then {
if ((_vehicle emptyPositions "cargo") == 0) then {
_vehicle = objNull;
};
}; };
if (isNull _vehicle) exitWith {};
if ((!isNil "_target") && {!isNil "_vehicle"}) then { if (isNull _vehicle) exitWith {ERROR("");};
_unit setVariable [QGVAR(isEscorting), false, true]; _unit setVariable [QGVAR(isEscorting), false, true];
["MoveInCaptive", [_target], [_target, _vehicle]] call EFUNC(common,targetEvent); ["MoveInCaptive", [_target], [_target, _vehicle]] call EFUNC(common,targetEvent);
};

View File

@ -0,0 +1,67 @@
/*
* Author: PabstMirror
* Finds a free cargo seat, searching non FFV first
*
* Arguments:
* 0: The Vehicle <OBJECT>
*
* Return Value:
* ARRAY [seat index <NUMBER>, is FFV <BOOL>]
*
* Example:
* [car1] call ACE_captives_fnc_findEmptyNonFFVCargoSeat
*
* Public: No
*/
#include "script_component.hpp"
params ["_vehicle"];
TRACE_1("params", _vehicle);
_vehicleConfig = configFile >> "CfgVehicles" >> (typeOf _vehicle);
_proxyOrder = getArray (_vehicleConfig >> "getInProxyOrder");
_transportSoldier = getNumber (_vehicleConfig >> "transportSoldier");
_realCargoCount = if (isArray (_vehicleConfig >> "getInProxyOrder")) then {count _proxyOrder} else {_transportSoldier};
//Find FFV turrets:
_ffvCargoIndexes = [];
{
_turretConfig = [_vehicleConfig, _x] call EFUNC(common,getTurretConfigPath);
_isCargoProxy = ((getText (_turretConfig >> "proxyType")) == "CPCargo") && {isNumber (_turretConfig >> "proxyIndex")};
if (_isCargoProxy) then {
_proxyCargoIndex = getNumber (_turretConfig >> "proxyIndex");
_cargoIndex = _proxyOrder find _proxyCargoIndex;
_ffvCargoIndexes pushBack _cargoIndex;
};
} forEach (allTurrets [_vehicle, true]);
//Find Empty Seats:
_occupiedSeats = [];
{
_x params ["", "", "_xIndex"];
if (_xIndex > -1) then {_occupiedSeats pushBack _xIndex;};
} forEach (fullCrew _vehicle);
TRACE_3("Searching for empty seat",_realCargoCount,_ffvCargoIndexes,_occupiedSeats);
_emptyCargoSeatReturn = [-1, false];
//First seach for non-ffv seats:
for "_index" from 0 to (_realCargoCount - 1) do {
if ((!(_index in _ffvCargoIndexes)) && {!(_index in _occupiedSeats)}) exitWith {
_emptyCargoSeatReturn = [_index, false];
};
};
//Only use FFV if none found:
if (_emptyCargoSeatReturn isEqualTo [-1, false]) then {
for "_index" from 0 to (_realCargoCount - 1) do {
if (!(_index in _occupiedSeats)) exitWith {
_emptyCargoSeatReturn = [_index, true];
};
};
};
_emptyCargoSeatReturn

View File

@ -4,8 +4,8 @@
* *
* Arguments: * Arguments:
* 0: _vehicle <OBJECT> * 0: _vehicle <OBJECT>
* 2: dunno <OBJECT> * 1: dunno <OBJECT>
* 1: _unit <OBJECT> * 2: _unit <OBJECT>
* *
* Return Value: * Return Value:
* The return value <BOOL> * The return value <BOOL>
@ -17,7 +17,8 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_vehicle", "_dontcare","_unit"]; params ["_vehicle", "","_unit"];
TRACE_2("params",_vehicle,_unit);
if (local _unit) then { if (local _unit) then {
if (_unit getVariable [QGVAR(isEscorting), false]) then { if (_unit getVariable [QGVAR(isEscorting), false]) then {
@ -27,4 +28,18 @@ if (local _unit) then {
if (_unit getVariable [QGVAR(isSurrendering), false]) then { if (_unit getVariable [QGVAR(isSurrendering), false]) then {
[_unit, false] call FUNC(setSurrender); [_unit, false] call FUNC(setSurrender);
}; };
if (_unit getVariable [QGVAR(isHandcuffed), false]) then {
//Need to force animation for FFV turrets
_turretPath = [];
{
_x params ["_xUnit", "", "", "_xTurretPath"];
if (_unit == _xUnit) exitWith {_turretPath = _xTurretPath};
} forEach (fullCrew (vehicle _unit));
if (!(_turretPath isEqualTo [])) then {
TRACE_1("Setting FFV Handcuffed Animation",_turretPath);
[_unit, "ACE_HandcuffedFFV", 2] call EFUNC(common,doAnimation);
[_unit, "ACE_HandcuffedFFV", 1] call EFUNC(common,doAnimation);
};
};
}; };

View File

@ -4,8 +4,8 @@
* *
* Arguments: * Arguments:
* 0: _vehicle <OBJECT> * 0: _vehicle <OBJECT>
* 2: dunno <OBJECT> * 1: dunno <OBJECT>
* 1: _unit <OBJECT> * 2: _unit <OBJECT>
* *
* Return Value: * Return Value:
* The return value <BOOL> * The return value <BOOL>
@ -17,17 +17,21 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_vehicle", "_dontcare","_unit"]; params ["_vehicle", "", "_unit"];
TRACE_2("params",_vehicle,_unit);
if ((local _unit) && {_unit getVariable [QGVAR(isHandcuffed), false]}) then { if ((local _unit) && {_unit getVariable [QGVAR(isHandcuffed), false]}) then {
private ["_cargoIndex"]; private ["_cargoIndex"];
_cargoIndex = _unit getVariable [QGVAR(CargoIndex), -1]; _cargoIndex = _unit getVariable [QGVAR(CargoIndex), -1];
if (_cargoIndex != -1) then {
//If captive was not "unloaded", then move them back into the vehicle. //If captive was not "unloaded", then move them back into the vehicle.
if (_cargoIndex != -1) exitWith { TRACE_1("forcing back into vehicle",_cargoIndex);
_unit moveInCargo [_vehicle, _cargoIndex]; _unit moveInCargo [_vehicle, _cargoIndex];
}; } else {
//Getting out of vehicle:
[_unit, "ACE_AmovPercMstpScapWnonDnon", 2] call EFUNC(common,doAnimation); [_unit, "ACE_AmovPercMstpScapWnonDnon", 2] call EFUNC(common,doAnimation);
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
};
}; };

View File

@ -18,7 +18,7 @@
params ["_unit"]; params ["_unit"];
// prevent players from throwing grenades (added to all units) // prevent players from throwing grenades (added to all units)
[_unit, "Throw", {((_this select 1) getVariable [QGVAR(isHandcuffed), false]) || {(_this select 1) getVariable [QGVAR(isSurrendering), false]}}, {}] call EFUNC(common,addActionEventhandler); // [_unit, "Throw", {systemChat "a"; ((_this select 1) getVariable [QGVAR(isHandcuffed), false]) || {(_this select 1) getVariable [QGVAR(isSurrendering), false]}; true}, {systemChat "b";}] call EFUNC(common,addActionEventhandler);
if (local _unit) then { if (local _unit) then {
// reset status on mission start // reset status on mission start

View File

@ -26,11 +26,11 @@ if (!_activated) exitWith {};
if (local _logic) then { 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_1(_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, 0.05]call EFUNC(common,waitAndExecute); }, [_units], 0.05]call EFUNC(common,waitAndExecute);
deleteVehicle _logic; deleteVehicle _logic;
}; };

View File

@ -17,6 +17,7 @@
#include "script_component.hpp" #include "script_component.hpp"
params ["_unit","_state"]; params ["_unit","_state"];
TRACE_2("params",_unit,_state);
if (!local _unit) exitwith { if (!local _unit) exitwith {
ERROR("running setHandcuffed on remote unit"); ERROR("running setHandcuffed on remote unit");
@ -43,24 +44,47 @@ if (_state) then {
// fix anim on mission start (should work on dedicated servers) // fix anim on mission start (should work on dedicated servers)
[{ [{
params ["_unit"]; params ["_unit"];
if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then { if (!(_unit getVariable [QGVAR(isHandcuffed), false])) exitWith {};
if ((vehicle _unit) == _unit) then {
[_unit] call EFUNC(common,fixLoweredRifleAnimation); [_unit] call EFUNC(common,fixLoweredRifleAnimation);
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
} else {
[_unit, "ACE_HandcuffedFFV", 2] call EFUNC(common,doAnimation);
[_unit, "ACE_HandcuffedFFV", 1] call EFUNC(common,doAnimation);
};
//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";
_animChangedEHID = _unit addEventHandler ["AnimChanged", { _animChangedEHID = _unit addEventHandler ["AnimChanged", {
PARAMS_2(_unit,_newAnimation); params ["_unit", "_newAnimation"];
TRACE_2("AnimChanged",_unit,_newAnimation);
if (_unit == (vehicle _unit)) then {
if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then {
TRACE_1("Handcuff animation interrupted",_newAnimation); TRACE_1("Handcuff animation interrupted",_newAnimation);
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
}; };
} else {
_turretPath = [];
{
_x params ["_xUnit", "", "", "_xTurretPath"];
if (_unit == _xUnit) exitWith {_turretPath = _xTurretPath};
} forEach (fullCrew (vehicle _unit));
TRACE_1("turret Path",_turretPath);
if (_turretPath isEqualTo []) exitWith {};
TRACE_1("Handcuff (FFV) animation interrupted",_newAnimation);
[_unit, "ACE_HandcuffedFFV", 2] call EFUNC(common,doAnimation);
[_unit, "ACE_HandcuffedFFV", 1] call EFUNC(common,doAnimation);
};
}]; }];
TRACE_2("Adding animChangedEH",_unit,_animChangedEHID);
_unit setVariable [QGVAR(handcuffAnimEHID), _animChangedEHID]; _unit setVariable [QGVAR(handcuffAnimEHID), _animChangedEHID];
}; }, [_unit], 0.01] call EFUNC(common,waitAndExecute);
}, [_unit], 0.01, 0] call EFUNC(common,waitAndExecute);
} else { } else {
_unit setVariable [QGVAR(isHandcuffed), false, true]; _unit setVariable [QGVAR(isHandcuffed), false, true];
[_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus); [_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus);
@ -68,6 +92,7 @@ if (_state) then {
//remove AnimChanged EH //remove AnimChanged EH
private "_animChangedEHID"; private "_animChangedEHID";
_animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1]; _animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1];
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

@ -17,6 +17,7 @@
#include "script_component.hpp" #include "script_component.hpp"
params ["_unit","_state"]; params ["_unit","_state"];
TRACE_2("params",_unit,_state);
if (!local _unit) exitwith { if (!local _unit) exitwith {
ERROR("running surrender on remote unit"); ERROR("running surrender on remote unit");
@ -43,13 +44,13 @@ if (_state) then {
// fix anim on mission start (should work on dedicated servers) // fix anim on mission start (should work on dedicated servers)
[{ [{
PARAMS_1(_unit); params ["_unit"];
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";
_animChangedEHID = _unit addEventHandler ["AnimChanged", { _animChangedEHID = _unit addEventHandler ["AnimChanged", {
PARAMS_2(_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 {
TRACE_1("Surrender animation interrupted",_newAnimation); TRACE_1("Surrender animation interrupted",_newAnimation);
[_unit, "ACE_AmovPercMstpSsurWnonDnon", 1] call EFUNC(common,doAnimation); [_unit, "ACE_AmovPercMstpSsurWnonDnon", 1] call EFUNC(common,doAnimation);
@ -57,7 +58,7 @@ if (_state) then {
}]; }];
_unit setVariable [QGVAR(surrenderAnimEHID), _animChangedEHID]; _unit setVariable [QGVAR(surrenderAnimEHID), _animChangedEHID];
}; };
}, [_unit], 0.01, 0] call EFUNC(common,waitAndExecute); }, [_unit], 0.01] call EFUNC(common,waitAndExecute);
} else { } else {
_unit setVariable [QGVAR(isSurrendering), false, true]; _unit setVariable [QGVAR(isSurrendering), false, true];
[_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus); [_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus);
@ -85,8 +86,8 @@ if (_state) then {
//spin up a PFEH, to watching animationState for the next 20 seconds to make sure we don't enter "hands up" //spin up a PFEH, to watching animationState for the next 20 seconds to make sure we don't enter "hands up"
//Handles long animation chains //Handles long animation chains
[{ [{
PARAMS_2(_args,_pfID); params ["_args", "_pfID"];
EXPLODE_2_PVT(_args,_unit,_maxTime); _args params ["_unit", "_maxTime"];
//If waited long enough or they re-surrendered or they are unconscious, exit loop //If waited long enough or they re-surrendered or they are unconscious, exit loop
if ((ACE_time > _maxTime) || {_unit getVariable [QGVAR(isSurrendering), false]} || {_unit getVariable ["ACE_isUnconscious", false]}) exitWith { if ((ACE_time > _maxTime) || {_unit getVariable [QGVAR(isSurrendering), false]} || {_unit getVariable ["ACE_isUnconscious", false]}) exitWith {
[_pfID] call CBA_fnc_removePerFrameHandler; [_pfID] call CBA_fnc_removePerFrameHandler;

View File

@ -16,11 +16,17 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_target","_vehicle"];
TRACE_2("params",_target,_vehicle);
private ["_cargoIndex"]; private ["_cargoIndex"];
params ["_target","_vehicle"]; _getSeat = [_vehicle] call FUNC(findEmptyNonFFVCargoSeat);
TRACE_1("free cargo seat",_getSeat);
_cargoIndex = _getSeat select 0;
if (_cargoIndex == -1) exitWith {ERROR("cargo index -1");};
_target moveInCargo [_vehicle, _cargoIndex];
_target assignAsCargoIndex [_vehicle, _cargoIndex];
_target moveInCargo _vehicle;
_target assignAsCargo _vehicle;
_cargoIndex = _vehicle getCargoIndex _target;
_target setVariable [QGVAR(CargoIndex), _cargoIndex, true]; _target setVariable [QGVAR(CargoIndex), _cargoIndex, true];

View File

@ -16,8 +16,11 @@
#include "script_component.hpp" #include "script_component.hpp"
params ["_unit"]; params ["_unit"];
TRACE_1("params",_unit);
_unit setVariable [QGVAR(CargoIndex), -1, true]; _unit setVariable [QGVAR(CargoIndex), -1, true];
moveOut _unit; moveOut _unit;
[_unit, "ACE_AmovPercMstpScapWnonDnon", 2] call EFUNC(common,doAnimation); [_unit, "ACE_AmovPercMstpScapWnonDnon", 2] call EFUNC(common,doAnimation);
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
unassignVehicle _unit; unassignVehicle _unit;

View File

@ -1,6 +1,8 @@
#define COMPONENT captives #define COMPONENT captives
#include "\z\ace\addons\main\script_mod.hpp" #include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
#ifdef DEBUG_ENABLED_CAPTIVES #ifdef DEBUG_ENABLED_CAPTIVES
#define DEBUG_MODE_FULL #define DEBUG_MODE_FULL
#endif #endif

View File

@ -164,6 +164,7 @@
<German>Einheit kapitulieren lassen</German> <German>Einheit kapitulieren lassen</German>
<Czech>Vzdávající se jednotka</Czech> <Czech>Vzdávající se jednotka</Czech>
<Portuguese>Fazer unidade se render</Portuguese> <Portuguese>Fazer unidade se render</Portuguese>
<Hungarian>Egység kapitulálása</Hungarian>
</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>
@ -172,6 +173,7 @@
<German>Einheit synchronisieren, um sie kapitulieren zu lassen.&lt;br /&gt;Quelle: ace_captives</German> <German>Einheit synchronisieren, um sie kapitulieren zu lassen.&lt;br /&gt;Quelle: ace_captives</German>
<Czech>Synchronizuj s jednotkou, která se má vzdát.&lt;br /&gt;Zdroj: ace_captives</Czech> <Czech>Synchronizuj s jednotkou, která se má vzdát.&lt;br /&gt;Zdroj: ace_captives</Czech>
<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>
<Hungarian>Egység szinkronizálása, hogy kapituláljon.&lt;br /&gt;Forrás: ace_captives</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Captives_ModuleSettings_DisplayName"> <Key ID="STR_ACE_Captives_ModuleSettings_DisplayName">
<English>Captives Settings</English> <English>Captives Settings</English>
@ -180,6 +182,7 @@
<Czech>Nastavení zajatce</Czech> <Czech>Nastavení zajatce</Czech>
<German>Gefangenen-Einstellungen</German> <German>Gefangenen-Einstellungen</German>
<Portuguese>Ajustes de prisioneiros</Portuguese> <Portuguese>Ajustes de prisioneiros</Portuguese>
<Hungarian>Fogoly-beállítások</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Captives_ModuleSettings_Description"> <Key ID="STR_ACE_Captives_ModuleSettings_Description">
<English>Controls settings for surrender and cable ties</English> <English>Controls settings for surrender and cable ties</English>
@ -188,6 +191,7 @@
<Czech>Toto kontroluje nastavení kapitulace a pout</Czech> <Czech>Toto kontroluje nastavení kapitulace a pout</Czech>
<German>Einstellungen zur Kapitulation und Kabelbindern</German> <German>Einstellungen zur Kapitulation und Kabelbindern</German>
<Portuguese>Controla as configurações de rendição e abraçadeiras</Portuguese> <Portuguese>Controla as configurações de rendição e abraçadeiras</Portuguese>
<Hungarian>Szabályozza a kapituláció és bilincselés beállításait</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Captives_ModuleSettings_handcuffSide_name"> <Key ID="STR_ACE_Captives_ModuleSettings_handcuffSide_name">
<English>Can handcuff own side</English> <English>Can handcuff own side</English>
@ -196,6 +200,7 @@
<Czech>Může spoutat spolubojovníky</Czech> <Czech>Může spoutat spolubojovníky</Czech>
<German>Kann Teamkollegen fesseln</German> <German>Kann Teamkollegen fesseln</German>
<Portuguese>Pode algemar o próprio lado</Portuguese> <Portuguese>Pode algemar o próprio lado</Portuguese>
<Hungarian>Saját oldal megbilincselhető</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Captives_ModuleSettings_handcuffSide_description"> <Key ID="STR_ACE_Captives_ModuleSettings_handcuffSide_description">
<English>Can players cabletie units on their own side</English> <English>Can players cabletie units on their own side</English>
@ -204,6 +209,7 @@
<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>Können Spieler eigene Einheiten fesseln</German>
<Portuguese>Os jogadores podem algemar unidades do seu lado</Portuguese> <Portuguese>Os jogadores podem algemar unidades do seu lado</Portuguese>
<Hungarian>A játékosok megkötözhetik-e a saját oldalukon lévő egységeket</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Captives_ModuleSettings_allowSurrender_name"> <Key ID="STR_ACE_Captives_ModuleSettings_allowSurrender_name">
<English>Allow surrendering</English> <English>Allow surrendering</English>
@ -212,6 +218,7 @@
<Czech>Povolit vzdávání</Czech> <Czech>Povolit vzdávání</Czech>
<German>Kapitulation erlauben</German> <German>Kapitulation erlauben</German>
<Portuguese>Permite rendição</Portuguese> <Portuguese>Permite rendição</Portuguese>
<Hungarian>Kapituláció engedélyezése</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Captives_ModuleSettings_allowSurrender_description"> <Key ID="STR_ACE_Captives_ModuleSettings_allowSurrender_description">
<English>Players can surrender after holstering their weapon</English> <English>Players can surrender after holstering their weapon</English>
@ -220,6 +227,7 @@
<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>
<Hungarian>A játékosok megadhatják magukat a fegyverük elrakása után</Hungarian>
</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>

View File

@ -4,6 +4,12 @@ class Extended_PreInit_EventHandlers {
}; };
}; };
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};
class Extended_Killed_EventHandlers { class Extended_Killed_EventHandlers {
class All { class All {
init = QUOTE(call FUNC(handleDestroyed)); init = QUOTE(call FUNC(handleDestroyed));

View File

@ -0,0 +1,5 @@
#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);

View File

@ -2,6 +2,7 @@
ADDON = false; ADDON = false;
PREP(addCargoItem);
PREP(canLoad); PREP(canLoad);
PREP(canLoadItemIn); PREP(canLoadItemIn);
PREP(canUnloadItem); PREP(canUnloadItem);
@ -21,8 +22,4 @@ PREP(validateCargoSpace);
GVAR(initializedItemClasses) = []; GVAR(initializedItemClasses) = [];
if (isServer) then {
["cargo_hideItem", {params ["_object", "_status"]; _object hideObjectGlobal _status;}] call EFUNC(common,addEventHandler);
};
ADDON = true; ADDON = true;

View File

@ -0,0 +1,38 @@
/*
* Author: Glowbal, Jonpas
* Adds a cargo item to the vehicle.
*
* Arguments:
* 0: Item Classname <STRING>
* 1: Vehicle <OBJECT>
* 2: Amount <NUMBER> (default: 1)
*
* Return Value:
* None
*
* Example:
* ["item", vehicle] call ace_cargo_fnc_addCargoItem
*
* Public: No
*/
#include "script_component.hpp"
private ["_position", "_item", "_i"];
params ["_itemClass", "_vehicle", ["_amount", 1]];
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 {
_item = createVehicle [_itemClass, _position, [], 0, "CAN_COLLIDE"];
// Load item or delete it if no space left
if !([_item, _vehicle] call FUNC(loadItem)) exitWith {
deleteVehicle _item;
};
// Invoke listenable event
["cargoAddedByClass", [_itemClass, _vehicle, _amount]] call EFUNC(common,globalEvent);
};

View File

@ -18,6 +18,8 @@
params ["_player", "_object"]; params ["_player", "_object"];
if (!([_player, _object, []] call EFUNC(common,canInteractWith))) exitWith {false};
private ["_nearestVehicle"]; private ["_nearestVehicle"];
_nearestVehicle = [_player] call FUNC(findNearestVehicle); _nearestVehicle = [_player] call FUNC(findNearestVehicle);

View File

@ -19,7 +19,7 @@ private "_config";
params ["_item"]; params ["_item"];
_config = (configFile >> "CfgVehicles" >> typeof _item >> QGVAR(size)); _config = (configFile >> "CfgVehicles" >> typeOf _item >> QGVAR(size));
if (isNumber (_config)) exitWith { if (isNumber (_config)) exitWith {
_item getVariable [QGVAR(size), getNumber (_config)] _item getVariable [QGVAR(size), getNumber (_config)]

View File

@ -1,6 +1,6 @@
/* /*
* Author: Glowbal * Author: Glowbal
* Initializes vehicle, adds open caro menu action if available. * Initializes vehicle, adds open cargo menu action if available.
* *
* Arguments: * Arguments:
* 0: Vehicle <OBJECT> * 0: Vehicle <OBJECT>
@ -25,20 +25,8 @@ _initializedClasses = GETMVAR(GVAR(initializedClasses),[]);
if (isServer) then { if (isServer) then {
{ {
if (isClass _x) then { if (isClass _x) then {
private ["_className", "_amount","_position","_object"]; ["AddCargoByClass", [getText (_x >> "type"), _vehicle, getNumber (_x >> "amount")]] call EFUNC(common,localEvent);
_className = getText (_x >> "type");
_amount = getNumber (_x >> "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 {
_object = createVehicle [_className, _position, [], 0, "CAN_COLLIDE"];
if !([_object, _vehicle] call FUNC(loadItem)) exitWith {
deleteVehicle _object;
}; };
};
};
nil
} count ("true" configClasses (configFile >> "CfgVehicles" >> _type >> "ACE_Cargo" >> "Cargo")); } count ("true" configClasses (configFile >> "CfgVehicles" >> _type >> "ACE_Cargo" >> "Cargo"));
}; };
@ -51,7 +39,10 @@ SETMVAR(GVAR(initializedClasses),_initializedClasses);
if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) != 1) exitWith {}; if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) != 1) exitWith {};
private ["_text", "_condition", "_statement", "_icon", "_action"]; private ["_text", "_condition", "_statement", "_icon", "_action"];
_condition = {GVAR(enable)}; _condition = {
params ["_target", "_player"];
GVAR(enable) && {[_player, _target, []] call EFUNC(common,canInteractWith)}
};
_text = localize LSTRING(openMenu); _text = localize LSTRING(openMenu);
_statement = {GVAR(interactionVehicle) = _target; createDialog QGVAR(menu);}; _statement = {GVAR(interactionVehicle) = _target; createDialog QGVAR(menu);};
_icon = ""; _icon = "";

View File

@ -32,6 +32,9 @@ _vehicle setVariable [QGVAR(space), _space - _itemSize, true];
detach _item; detach _item;
_item attachTo [_vehicle,[0,0,100]]; _item attachTo [_vehicle,[0,0,100]];
["cargo_hideItem", [_item, true]] call EFUNC(common,serverEvent); ["hideObjectGlobal", [_item, true]] call EFUNC(common,serverEvent);
// Invoke listenable event
["cargoLoaded", [_item, _vehicle]] call EFUNC(common,globalEvent);
true true

View File

@ -58,8 +58,11 @@ _vehicle setVariable [QGVAR(space), (_space + _itemSize), true];
detach _item; detach _item;
_item setPosASL (_emptyPos call EFUNC(common,PositiontoASL)); _item setPosASL (_emptyPos call EFUNC(common,PositiontoASL));
["cargo_hideItem", [_item, false]] call EFUNC(common,serverEvent); ["hideObjectGlobal", [_item, false]] call EFUNC(common,serverEvent);
// TOOO maybe drag/carry the unloaded item? // TOOO maybe drag/carry the unloaded item?
// Invoke listenable event
["cargoUnloaded", [_item, _vehicle]] call EFUNC(common,globalEvent);
true true

View File

@ -1,4 +1,6 @@
// ACE - Common // ACE - Common
// #define ENABLE_PERFORMANCE_COUNTERS
#include "script_component.hpp" #include "script_component.hpp"
//IGNORE_PRIVATE_WARNING("_handleNetEvent", "_handleRequestAllSyncedEvents", "_handleRequestSyncedEvent", "_handleSyncedEvent"); //IGNORE_PRIVATE_WARNING("_handleNetEvent", "_handleRequestAllSyncedEvents", "_handleRequestSyncedEvent", "_handleSyncedEvent");
@ -111,6 +113,7 @@ if(!isServer) then {
if (isServer) then { if (isServer) then {
[FUNC(syncedEventPFH), 0.5, []] call CBA_fnc_addPerFrameHandler; [FUNC(syncedEventPFH), 0.5, []] call CBA_fnc_addPerFrameHandler;
}; };
call FUNC(checkFiles); call FUNC(checkFiles);
@ -203,10 +206,12 @@ GVAR(OldCameraView) = cameraView;
GVAR(OldPlayerVehicle) = vehicle ACE_player; GVAR(OldPlayerVehicle) = vehicle ACE_player;
GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex); GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex);
GVAR(OldPlayerWeapon) = currentWeapon ACE_player; GVAR(OldPlayerWeapon) = currentWeapon ACE_player;
GVAR(OldVisibleMap) = false;
// PFH to raise varios events // PFH to raise varios events
[{ [{
private ["_newCameraView", "_newInventoryDisplayIsOpen", "_newPlayerInventory", "_newPlayerTurret", "_newPlayerVehicle", "_newPlayerVisionMode", "_newPlayerWeapon", "_newZeusDisplayIsOpen"]; BEGIN_COUNTER(stateChecker);
private ["_newCameraView", "_newInventoryDisplayIsOpen", "_newPlayerInventory", "_newPlayerTurret", "_newPlayerVehicle", "_newPlayerVisionMode", "_newPlayerWeapon", "_newZeusDisplayIsOpen", "_newVisibleMap"];
// "playerInventoryChanged" event // "playerInventoryChanged" event
_newPlayerInventory = [ACE_player] call FUNC(getAllGear); _newPlayerInventory = [ACE_player] call FUNC(getAllGear);
if !(_newPlayerInventory isEqualTo GVAR(OldPlayerInventory)) then { if !(_newPlayerInventory isEqualTo GVAR(OldPlayerInventory)) then {
@ -271,25 +276,26 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player;
["playerWeaponChanged", [ACE_player, _newPlayerWeapon]] call FUNC(localEvent); ["playerWeaponChanged", [ACE_player, _newPlayerWeapon]] call FUNC(localEvent);
}; };
// "visibleMapChanged" event
_newVisibleMap = visibleMap;
if (!_newVisibleMap isEqualTo GVAR(OldVisibleMap)) then {
// Raise ACE event locally
GVAR(OldVisibleMap) = _newVisibleMap;
["visibleMapChanged", [ACE_player, _newVisibleMap]] call FUNC(localEvent);
};
END_COUNTER(stateChecker);
}, 0, []] call CBA_fnc_addPerFrameHandler; }, 0, []] call CBA_fnc_addPerFrameHandler;
// PFH to raise camera created event. Only works on these cams by BI.
#define ALL_CAMERAS [ \
missionNamespace getVariable ["BIS_DEBUG_CAM", objNull], \
missionNamespace getVariable ["BIS_fnc_camera_cam", objNull], \
uiNamespace getVariable ["BIS_fnc_arsenal_cam", objNull], \
uiNamespace getVariable ["BIS_fnc_animViewer_cam", objNull], \
missionNamespace getVariable ["BIS_fnc_establishingShot_fakeUAV", objNull] \
]
GVAR(OldIsCamera) = false; GVAR(OldIsCamera) = false;
[{ [{
// "activeCameraChanged" event // "activeCameraChanged" event
private ["_isCamera"]; private ["_isCamera"];
_isCamera = {!isNull _x} count ALL_CAMERAS > 0; _isCamera = call FUNC(isfeatureCameraActive);
if !(_isCamera isEqualTo GVAR(OldIsCamera)) then { if !(_isCamera isEqualTo GVAR(OldIsCamera)) then {
// Raise ACE event locally // Raise ACE event locally
GVAR(OldIsCamera) = _isCamera; GVAR(OldIsCamera) = _isCamera;
@ -317,7 +323,7 @@ GVAR(OldIsCamera) = false;
// Lastly, do JIP events // Lastly, do JIP events
// JIP Detection and event trigger. Run this at the very end, just in case anything uses it // JIP Detection and event trigger. Run this at the very end, just in case anything uses it
if(isMultiplayer && { ACE_time > 0 || isNull player } ) then { if (didJip) then {
// We are jipping! Get ready and wait, and throw the event // We are jipping! Get ready and wait, and throw the event
[{ [{
if(!(isNull player)) then { if(!(isNull player)) then {
@ -371,5 +377,4 @@ GVAR(deviceKeyCurrentIndex) = -1;
{false}, {false},
[0xC7, [true, false, false]], false] call cba_fnc_addKeybind; //SHIFT + Home Key [0xC7, [true, false, false]], false] call cba_fnc_addKeybind; //SHIFT + Home Key
GVAR(commonPostInited) = true; GVAR(commonPostInited) = true;

View File

@ -20,7 +20,9 @@ _version = getText (configFile >> "CfgPatches" >> "ace_main" >> "versionStr");
diag_log text format ["[ACE]: ACE is version %1.", _version]; diag_log text format ["[ACE]: ACE is version %1.", _version];
private "_addons"; private "_addons";
_addons = activatedAddons; //_addons = activatedAddons; // broken with High-Command module, see #2134
_addons = "true" configClasses (configFile >> "CfgPatches");//
_addons = [_addons, {toLower configName _this}] call FUNC(map);//
_addons = [_addons, {_this find "ace_" == 0}] call FUNC(filter); _addons = [_addons, {_this find "ace_" == 0}] call FUNC(filter);
{ {
@ -80,7 +82,7 @@ if (isMultiplayer) then {
diag_log text format ["[ACE] ERROR: %1", _errorMsg]; diag_log text format ["[ACE] ERROR: %1", _errorMsg];
if (hasInterface) then {diag_log str "1"; if (hasInterface) then {
["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); ["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage);
}; };
}; };
@ -91,7 +93,7 @@ if (isMultiplayer) then {
diag_log text format ["[ACE] ERROR: %1", _errorMsg]; diag_log text format ["[ACE] ERROR: %1", _errorMsg];
if (hasInterface) then {diag_log str "1"; if (hasInterface) then {
["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); ["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage);
}; };
}; };

View File

@ -477,6 +477,7 @@
<German>Überprüfe PBOs</German> <German>Überprüfe PBOs</German>
<Czech>Zkontrolovat PBO</Czech> <Czech>Zkontrolovat PBO</Czech>
<Portuguese>Verificar PBOs</Portuguese> <Portuguese>Verificar PBOs</Portuguese>
<Hungarian>PBO-k ellenőrzése</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Common_CheckPBO_Description"> <Key ID="STR_ACE_Common_CheckPBO_Description">
<Polish>Sprawdzaj spójność addonów z serwerem</Polish> <Polish>Sprawdzaj spójność addonów z serwerem</Polish>
@ -492,6 +493,7 @@
<German>Aktion</German> <German>Aktion</German>
<Czech>Akce</Czech> <Czech>Akce</Czech>
<Portuguese>Ação</Portuguese> <Portuguese>Ação</Portuguese>
<Hungarian>Cselekvés</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Common_CheckPBO_Action_Description"> <Key ID="STR_ACE_Common_CheckPBO_Action_Description">
<English>What to do with people who do not have the right PBOs?</English> <English>What to do with people who do not have the right PBOs?</English>
@ -500,6 +502,7 @@
<German>Was soll mit Leuten passieren, die nicht die richtigen PBOs haben?</German> <German>Was soll mit Leuten passieren, die nicht die richtigen PBOs haben?</German>
<Czech>Co udělat s lidmi, co nemají správné addony?</Czech> <Czech>Co udělat s lidmi, co nemají správné addony?</Czech>
<Portuguese>O que fazer com pessoas que não tem os PBOs corretos?</Portuguese> <Portuguese>O que fazer com pessoas que não tem os PBOs corretos?</Portuguese>
<Hungarian>Mi legyen azokkal a személyekkel, akiknek nincsenek meg a helyes PBO-k?</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Common_CheckPBO_Action_WarnOnce"> <Key ID="STR_ACE_Common_CheckPBO_Action_WarnOnce">
<English>Warn once</English> <English>Warn once</English>
@ -508,6 +511,7 @@
<German>Einmal verwarnen</German> <German>Einmal verwarnen</German>
<Czech>Upozornit jednou</Czech> <Czech>Upozornit jednou</Czech>
<Portuguese>Avisar uma vez</Portuguese> <Portuguese>Avisar uma vez</Portuguese>
<Hungarian>Egyszeri figyelmeztetés</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Common_CheckPBO_Action_WarnPerm"> <Key ID="STR_ACE_Common_CheckPBO_Action_WarnPerm">
<English>Warn (permanent)</English> <English>Warn (permanent)</English>
@ -516,6 +520,7 @@
<German>Immer verwarnen</German> <German>Immer verwarnen</German>
<Czech>Upozornit (permanentně)</Czech> <Czech>Upozornit (permanentně)</Czech>
<Portuguese>Avisar (permanente)</Portuguese> <Portuguese>Avisar (permanente)</Portuguese>
<Hungarian>Figyelmeztetés (tartós)</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Common_CheckPBO_Action_Kick"> <Key ID="STR_ACE_Common_CheckPBO_Action_Kick">
<English>Kick</English> <English>Kick</English>
@ -524,6 +529,7 @@
<German>Kicken</German> <German>Kicken</German>
<Czech>Vyhodit</Czech> <Czech>Vyhodit</Czech>
<Portuguese>Chutar</Portuguese> <Portuguese>Chutar</Portuguese>
<Hungarian>Kirúgás</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Common_CheckPBO_CheckAll_DisplayName"> <Key ID="STR_ACE_Common_CheckPBO_CheckAll_DisplayName">
<English>Check all addons</English> <English>Check all addons</English>
@ -532,6 +538,7 @@
<German>Alle Addons überprüfen</German> <German>Alle Addons überprüfen</German>
<Czech>Zkontrolovat všechny addony</Czech> <Czech>Zkontrolovat všechny addony</Czech>
<Portuguese>Verificar todos addons</Portuguese> <Portuguese>Verificar todos addons</Portuguese>
<Hungarian>Összes bővítmény ellenőrzése</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Common_CheckPBO_CheckAll_Description"> <Key ID="STR_ACE_Common_CheckPBO_CheckAll_Description">
<English>Check all addons instead of only those of ACE?</English> <English>Check all addons instead of only those of ACE?</English>
@ -540,6 +547,7 @@
<German>Alle Addons anstatt nur ACE überprüfen?</German> <German>Alle Addons anstatt nur ACE überprüfen?</German>
<Czech>Zkontrolovat všechny addony namísto jen těch od ACE?</Czech> <Czech>Zkontrolovat všechny addony namísto jen těch od ACE?</Czech>
<Portuguese>Verificar todos addons invés de só os do ACE?</Portuguese> <Portuguese>Verificar todos addons invés de só os do ACE?</Portuguese>
<Hungarian>Az összes bővítmény ellenőrzése, csak az ACE helyett?</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Common_CheckPBO_Whitelist_DisplayName"> <Key ID="STR_ACE_Common_CheckPBO_Whitelist_DisplayName">
<English>Whitelist</English> <English>Whitelist</English>
@ -548,6 +556,7 @@
<German>Whitelist</German> <German>Whitelist</German>
<Czech>Seznam povolených</Czech> <Czech>Seznam povolených</Czech>
<Portuguese>Lista branca</Portuguese> <Portuguese>Lista branca</Portuguese>
<Hungarian>Fehérlista</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Common_CheckPBO_Whitelist_Description"> <Key ID="STR_ACE_Common_CheckPBO_Whitelist_Description">
<English>What addons are allowed regardless?</English> <English>What addons are allowed regardless?</English>
@ -556,6 +565,7 @@
<German>Welche Addons werden dennoch erlaubt?</German> <German>Welche Addons werden dennoch erlaubt?</German>
<Czech>Jaké addony jsou povoleny?</Czech> <Czech>Jaké addony jsou povoleny?</Czech>
<Portuguese>Quais addons são permitidos de qualquer maneira?</Portuguese> <Portuguese>Quais addons são permitidos de qualquer maneira?</Portuguese>
<Hungarian>Milyen bővítmények vannak feltétlenül engedélyezve?</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Common_LSDVehicles_DisplayName"> <Key ID="STR_ACE_Common_LSDVehicles_DisplayName">
<English>LSD Vehicles</English> <English>LSD Vehicles</English>
@ -564,6 +574,7 @@
<German>LSD-Fahrzeuge</German> <German>LSD-Fahrzeuge</German>
<Czech>LSD vozidla</Czech> <Czech>LSD vozidla</Czech>
<Portuguese>Veículos LSD</Portuguese> <Portuguese>Veículos LSD</Portuguese>
<Hungarian>LSD járművek</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Common_LSDVehicles_Description"> <Key ID="STR_ACE_Common_LSDVehicles_Description">
<English>Adds LSD effect to synchronized vehicle</English> <English>Adds LSD effect to synchronized vehicle</English>
@ -572,6 +583,7 @@
<German>Fügt einen LSD-Effekt zum synchronisierten Fahrzeug hinzu</German> <German>Fügt einen LSD-Effekt zum synchronisierten Fahrzeug hinzu</German>
<Czech>Přidá LSD efekt pro synchronizované vozidla</Czech> <Czech>Přidá LSD efekt pro synchronizované vozidla</Czech>
<Portuguese>Adiciona efeito LSD ao veículo sincronizado</Portuguese> <Portuguese>Adiciona efeito LSD ao veículo sincronizado</Portuguese>
<Hungarian>LSD-effekt hozzáadása a szinkronizált járművekhez</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Common_toggleHandheldDevice"> <Key ID="STR_ACE_Common_toggleHandheldDevice">
<English>Toggle Handheld Device</English> <English>Toggle Handheld Device</English>
@ -580,6 +592,7 @@
<Portuguese>Ativa dispositivo de mão</Portuguese> <Portuguese>Ativa dispositivo de mão</Portuguese>
<Polish>Przełącz urządzenie podręczne</Polish> <Polish>Przełącz urządzenie podręczne</Polish>
<Czech>Přepnout ruční zařízení</Czech> <Czech>Přepnout ruční zařízení</Czech>
<Hungarian>Kézi eszköz kapcsolása</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Common_closeHandheldDevice"> <Key ID="STR_ACE_Common_closeHandheldDevice">
<English>Close Handheld Device</English> <English>Close Handheld Device</English>
@ -588,6 +601,7 @@
<Portuguese>Fecha dispositivo de mão</Portuguese> <Portuguese>Fecha dispositivo de mão</Portuguese>
<Polish>Zamknij urządzenie podręczne</Polish> <Polish>Zamknij urządzenie podręczne</Polish>
<Czech>Zavřít ruční zařízení</Czech> <Czech>Zavřít ruční zařízení</Czech>
<Hungarian>Kézi eszköz bezárása</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Common_cycleHandheldDevices"> <Key ID="STR_ACE_Common_cycleHandheldDevices">
<English>Cycle Handheld Devices</English> <English>Cycle Handheld Devices</English>
@ -596,6 +610,7 @@
<Portuguese>Troca dispositivos de mão</Portuguese> <Portuguese>Troca dispositivos de mão</Portuguese>
<Polish>Następne urządzenie podręczne</Polish> <Polish>Następne urządzenie podręczne</Polish>
<Czech>Procházet ruční zařízení</Czech> <Czech>Procházet ruční zařízení</Czech>
<Hungarian>Kézi eszköz váltása</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Common_Disabled"> <Key ID="STR_ACE_Common_Disabled">
<English>Disabled</English> <English>Disabled</English>

View File

@ -74,6 +74,7 @@ class CfgVehicles {
scope = 2; scope = 2;
displayName = $STR_ACE_CONCERTINA_WIRE; displayName = $STR_ACE_CONCERTINA_WIRE;
model = PATHTOF(data\ACE_ConcertinaWire.p3d); model = PATHTOF(data\ACE_ConcertinaWire.p3d);
EGVAR(logistics_wirecutter,isFence) = 1;
class ACE_Actions { class ACE_Actions {
class ACE_MainActions { class ACE_MainActions {
selection = ""; selection = "";

View File

@ -1,7 +1,7 @@
// by PabstMirror, commy2 // by PabstMirror, commy2
#include "script_component.hpp" #include "script_component.hpp"
[{_this call DFUNC(handleScrollWheel)}] call EFUNC(common,addScrollWheelEventHandler); [DFUNC(handleScrollWheel)] call EFUNC(common,addScrollWheelEventHandler);
if (isNil "ACE_maxWeightDrag") then { if (isNil "ACE_maxWeightDrag") then {
ACE_maxWeightDrag = 800; ACE_maxWeightDrag = 800;
@ -15,11 +15,11 @@ if (isNil "ACE_maxWeightCarry") then {
["isNotCarrying", {!((_this select 0) getVariable [QGVAR(isCarrying), false])}] call EFUNC(common,addCanInteractWithCondition); ["isNotCarrying", {!((_this select 0) getVariable [QGVAR(isCarrying), false])}] call EFUNC(common,addCanInteractWithCondition);
// release object on player change. This does work when returning to lobby, but not when hard disconnecting. // release object on player change. This does work when returning to lobby, but not when hard disconnecting.
["playerChanged", {_this call DFUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); ["playerChanged", DFUNC(handlePlayerChanged)] call EFUNC(common,addEventhandler);
["playerVehicleChanged", {[ACE_player, objNull] call DFUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); ["playerVehicleChanged", {[ACE_player, objNull] call DFUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
["playerWeaponChanged", {_this call DFUNC(handlePlayerWeaponChanged)}] call EFUNC(common,addEventhandler); ["playerWeaponChanged", DFUNC(handlePlayerWeaponChanged)] call EFUNC(common,addEventhandler);
// handle waking up dragged unit and falling unconscious while dragging // handle waking up dragged unit and falling unconscious while dragging
["medical_onUnconscious", {_this call DFUNC(handleUnconscious)}] call EFUNC(common,addEventhandler); ["medical_onUnconscious", DFUNC(handleUnconscious)] call EFUNC(common,addEventhandler);
//@todo Captivity? //@todo Captivity?

View File

@ -2,4 +2,4 @@
#include "script_component.hpp" #include "script_component.hpp"
// release object on hard disconnection. Function is identical to killed // release object on hard disconnection. Function is identical to killed
addMissionEventHandler ["HandleDisconnect", {_this call DFUNC(handleKilled)}]; addMissionEventHandler ["HandleDisconnect", DFUNC(handleKilled)];

View File

@ -3,19 +3,18 @@
* *
* Check if unit can carry the object. Doesn't check weight. * Check if unit can carry the object. Doesn't check weight.
* *
* Argument: * Arguments:
* 0: Unit that should do the carrying (Object) * 0: Unit that should do the carrying <OBJECT>
* 1: Object to carry (Object) * 1: Object to carry <OBJECT>
* *
* Return value: * Return Value:
* Can the unit carry the object? (Bool) * Can the unit carry the object? <BOOL>
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_target"]; params ["_unit", "_target"];
_unit = _this select 0;
_target = _this select 1;
if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false};

View File

@ -3,12 +3,14 @@
* *
* Check if unit can drag the object. Doesn't check weight. * Check if unit can drag the object. Doesn't check weight.
* *
* Argument: * Arguments:
* 0: Unit that should do the dragging (Object) * 0: Unit that should do the dragging <OBJECT>
* 1: Object to drag (Object) * 1: Object to drag <OBJECT>
* *
* Return value: * Return Value:
* Can the unit drag the object? (Bool) * Can the unit drag the object? <BOOL>
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"

View File

@ -3,19 +3,18 @@
* *
* Check if unit can drop the object. * Check if unit can drop the object.
* *
* Argument: * Arguments:
* 0: Unit that currently drags a object (Object) * 0: Unit that currently drags a object <OBJECT>
* 1: Object that is dragged (Object) * 1: Object that is dragged <OBJECT>
* *
* Return value: * Return Value:
* Can the unit drop the object? (Bool) * Can the unit drop the object? <BOOL>
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_target"]; params ["_unit", "_target"];
_unit = _this select 0;
_target = _this select 1;
if !([_unit, _target, ["isNotDragging"]] call EFUNC(common,canInteractWith)) exitWith {false}; if !([_unit, _target, ["isNotDragging"]] call EFUNC(common,canInteractWith)) exitWith {false};

View File

@ -3,19 +3,18 @@
* *
* Check if unit can drop the carried object. * Check if unit can drop the carried object.
* *
* Argument: * Arguments:
* 0: Unit that currently carries a object (Object) * 0: Unit that currently carries a object <OBJECT>
* 1: Object that is carried (Object) * 1: Object that is carried <OBJECT>
* *
* Return value: * Return Value:
* Can the unit drop the object? (Bool) * Can the unit drop the object? <BOOL>
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_target"]; params ["_unit", "_target"];
_unit = _this select 0;
_target = _this select 1;
if !([_unit, _target, ["isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith {false}; if !([_unit, _target, ["isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith {false};

View File

@ -3,19 +3,18 @@
* *
* Carry an object. * Carry an object.
* *
* Argument: * Arguments:
* 0: Unit that should do the carrying (Object) * 0: Unit that should do the carrying <OBJECT>
* 1: Object to carry (Object) * 1: Object to carry <OBJECT>
* *
* Return value: * Return Value:
* NONE. * None
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_target"]; params ["_unit", "_target"];
_unit = _this select 0;
_target = _this select 1;
// get attachTo offset and direction. // get attachTo offset and direction.
private ["_position", "_direction"]; private ["_position", "_direction"];

View File

@ -1,21 +1,31 @@
// by commy2 /*
* Author: commy2
*
* PFH for Carry Object
*
* Arguments:
* ?
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
#ifdef DEBUG_ENABLED_DRAGGING #ifdef DEBUG_ENABLED_DRAGGING
systemChat format ["%1 carryObjectPFH running", ACE_time]; systemChat format ["%1 carryObjectPFH running", ACE_time];
#endif #endif
private ["_unit", "_target"]; params ["_args", "_idPFH"];
_args params ["_unit","_target"];
_unit = _this select 0 select 0;
_target = _this select 0 select 1;
if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith { if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
}; };
// drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled)) // drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled))
if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then {
[_unit, _target] call FUNC(dropObject_carry); [_unit, _target] call FUNC(dropObject_carry);
[_this select 1] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
}; };

View File

@ -3,28 +3,25 @@
* *
* Drag an object. Called from ace_dragging_fnc_startDrag * Drag an object. Called from ace_dragging_fnc_startDrag
* *
* Argument: * Arguments:
* 0: Unit that should do the dragging (Object) * 0: Unit that should do the dragging <OBJECT>
* 1: Object to drag (Object) * 1: Object to drag <OBJECT>
* *
* Return value: * Return Value:
* NONE. * None
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_target"]; private ["_position", "_direction", "_offset", "_actionID"];
params ["_unit", "_target"];
_unit = _this select 0;
_target = _this select 1;
// get attachTo offset and direction. // get attachTo offset and direction.
private ["_position", "_direction"];
_position = _target getVariable [QGVAR(dragPosition), [0, 0, 0]]; _position = _target getVariable [QGVAR(dragPosition), [0, 0, 0]];
_direction = _target getVariable [QGVAR(dragDirection), 0]; _direction = _target getVariable [QGVAR(dragDirection), 0];
// add height offset of model // add height offset of model
private "_offset";
_offset = (_target modelToWorldVisual [0, 0, 0] select 2) - (_unit modelToWorldVisual [0, 0, 0] select 2); _offset = (_target modelToWorldVisual [0, 0, 0] select 2) - (_unit modelToWorldVisual [0, 0, 0] select 2);
_position = _position vectorAdd [0, 0, _offset]; _position = _position vectorAdd [0, 0, _offset];
@ -41,7 +38,6 @@ _unit setVariable [QGVAR(isDragging), true, true];
_unit setVariable [QGVAR(draggedObject), _target, true]; _unit setVariable [QGVAR(draggedObject), _target, true];
// add scrollwheel action to release object // add scrollwheel action to release object
private "_actionID";
_actionID = _unit getVariable [QGVAR(ReleaseActionID), -1]; _actionID = _unit getVariable [QGVAR(ReleaseActionID), -1];
if (_actionID != -1) then { if (_actionID != -1) then {

View File

@ -1,21 +1,31 @@
// by commy2 /*
* Author: commy2
*
* PFH for Drag Object
*
* Arguments:
* ?
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
#ifdef DEBUG_ENABLED_DRAGGING #ifdef DEBUG_ENABLED_DRAGGING
systemChat format ["%1 dragObjectPFH running", ACE_time]; systemChat format ["%1 dragObjectPFH running", ACE_time];
#endif #endif
private ["_unit", "_target"]; params ["_args", "_idPFH"];
_args params ["_unit", "_target"];
_unit = _this select 0 select 0;
_target = _this select 0 select 1;
if !(_unit getVariable [QGVAR(isDragging), false]) exitWith { if !(_unit getVariable [QGVAR(isDragging), false]) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
}; };
// drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled)) // drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled))
if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then {
[_unit, _target] call FUNC(dropObject); [_unit, _target] call FUNC(dropObject);
[_this select 1] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
}; };

View File

@ -3,19 +3,18 @@
* *
* Drop a dragged object. * Drop a dragged object.
* *
* Argument: * Arguments:
* 0: Unit that drags the other object (Object) * 0: Unit that drags the other object <OBJECT>
* 1: Dragged object to drop (Object) * 1: Dragged object to drop <OBJECT>
* *
* Return value: * Return Value:
* NONE. * None
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_target"]; params ["_unit", "_target"];
_unit = _this select 0;
_target = _this select 1;
// remove scroll wheel action // remove scroll wheel action
_unit removeAction (_unit getVariable [QGVAR(ReleaseActionID), -1]); _unit removeAction (_unit getVariable [QGVAR(ReleaseActionID), -1]);

View File

@ -3,19 +3,18 @@
* *
* Drop a carried object. * Drop a carried object.
* *
* Argument: * Arguments:
* 0: Unit that carries the other object (Object) * 0: Unit that carries the other object <OBJECT>
* 1: Carried object to drop (Object) * 1: Carried object to drop <OBJECT>
* *
* Return value: * Return Value:
* NONE. * None
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_target"]; params ["_unit", "_target"];
_unit = _this select 0;
_target = _this select 1;
// remove scroll wheel action // remove scroll wheel action
_unit removeAction (_unit getVariable [QGVAR(ReleaseActionID), -1]); _unit removeAction (_unit getVariable [QGVAR(ReleaseActionID), -1]);

View File

@ -1,54 +1,45 @@
/* /*
Name: AGM_Drag_fnc_GetWeight * Author: L-H, edited by commy2, rewritten by joko // Jonas
*
Author(s): * Returns the weight of a crate.
L-H, edited by commy2 *
* Arguments:
Description: * 0: Crate to get weight of <OBJECT>
Returns the weight of a crate. *
* Return Value:
Parameters: * Total Weight <NUMBER>
0: OBJECT - Crate to get weight of *
* Example:
Returns: * _weight = Crate1 call ace_dragging_fnc_getweight;
NUMBER - Weight *
* Public: No
Example:
_weight = Crate1 call AGM_Drag_fnc_GetWeight;
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private "_object"; private "_totalWeight";
params ["_object"];
_object = _this select 0; // Initialize the total weight.
private ["_totalWeight", "_fnc","_fnc_Extra"];
_totalWeight = 0; _totalWeight = 0;
_fnc_Extra = {
private ["_weight", "_items"]; // Cycle through all item types with their assigned config paths.
_items = _this select 0;
_weight = 0;
{ {
_weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> (_this select 2) >> "mass") * ((_items select 1) select _foreachIndex)); _x params["_items","_getConfigCode"];
} foreach (_items select 0); _items params ["_item", "_count"];
// Cycle through all items and read their mass out of the config.
_weight
};
_fnc = {
private ["_weight", "_items"];
_items = _this select 0;
_weight = 0;
{ {
_weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> "mass") * ((_items select 1) select _foreachIndex)); // Multiply mass with amount of items and add the mass to the total weight.
} foreach (_items select 0); _totalWeight = _totalWeight + (getNumber ((call _getConfigCode) >> "mass") * (_count select _forEachIndex));
} forEach _item;
true
} count [
[getMagazineCargo _object, {configFile >> "CfgMagazines" >> _x}],
[getBackpackCargo _object, {configFile >> "CfgVehicles" >> _x}],
[getItemCargo _object, {configFile >> "CfgWeapons" >> _x >> "ItemInfo"}],
[getWeaponCargo _object, {configFile >> "CfgWeapons" >> _x >> "WeaponSlotsInfo"}]
];
_weight // add Weight of create to totalWeight
}; _totalWeight = _totalWeight + (getNumber (configFile >> "CfgVehicles" >> typeof _object >> "mass"));
_totalWeight = ([getMagazineCargo _object, "CfgMagazines"] call _fnc);
_totalWeight = _totalWeight + ([getItemCargo _object, "CfgWeapons", "ItemInfo"] call _fnc_Extra);
_totalWeight = _totalWeight + ([getWeaponCargo _object, "CfgWeapons", "WeaponSlotsInfo"] call _fnc_Extra);
_totalWeight = _totalWeight + ([getBackpackCargo _object, "CfgVehicles"] call _fnc);
_totalWeight = _totalWeight * 0.5; // Mass in Arma isn't an exact amount but rather a volume/weight value. This attempts to work around that by making it a usable value. (sort of). // Mass in Arma isn't an exact amount but rather a volume/weight value. This attempts to work around that by making it a usable value. (sort of).
_totalWeight * 0.5
_totalWeight

View File

@ -1,4 +1,20 @@
// by commy2 /*
* Author: commy2
*
* Handle the animaion for a Unit for Dragging Module
*
* Arguments:
* 0: Unit <OBJECT>
* 1: animaion <STRING>
*
* Return Value:
* None
*
* Example:
* [_unit, "amovpercmstpsnonwnondnon"] call ace_dragging_fnc_handleAnimChanged;
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_anim"]; private ["_unit", "_anim"];

View File

@ -1,9 +1,22 @@
// by commy2 /*
* Author: commy2
*
* Handle death of the dragger
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [_unit] call ace_dragging_fnc_handleKilled;
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
private "_unit"; params ["_unit"];
_unit = _this select 0;
if (_unit getVariable [QGVAR(isDragging), false]) then { if (_unit getVariable [QGVAR(isDragging), false]) then {
private "_draggedObject"; private "_draggedObject";

View File

@ -1,10 +1,23 @@
// by commy2 /*
* Author: commy2
*
* Handle player changes.
*
* Arguments:
* 0: New Player Unit <OBJECT>
* 1: Old Player Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [_unitNew, _unitOld] call ace_dragging_fnc_handlePlayerChanged;
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
private ["_newPlayer", "_oldPlayer"]; params ["_newPlayer", "_oldPlayer"];
_newPlayer = _this select 0;
_oldPlayer = _this select 1;
{ {
if (_x getVariable [QGVAR(isDragging), false]) then { if (_x getVariable [QGVAR(isDragging), false]) then {

View File

@ -1,10 +1,23 @@
// by commy2 /*
* Author: commy2
*
* Handle the Weapon Changed Event
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Weapon <STRING>
*
* Return Value:
* None
*
* Example:
* [_unit, _currentWeapon] call ace_dragging_fnc_handlePlayerWeaponChanged;
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_weapon"]; params ["_unit", "_weapon"];
_unit = _this select 0;
_weapon = _this select 1;
if (_unit getVariable [QGVAR(isDragging), false]) then { if (_unit getVariable [QGVAR(isDragging), false]) then {

View File

@ -3,38 +3,38 @@
* *
* Handles raising and lowering the dragged weapon to be able to place it on top of objects. * Handles raising and lowering the dragged weapon to be able to place it on top of objects.
* *
* Argument: * Arguments:
* 0: Scroll amount (Number) * 0: Scroll amount <NUMBER>
* *
* Return value: * Return Value:
* Handled or not. (Bool) * Handled or not. <BOOL>
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
// requires modifier key to be hold down private ["_unit", "_carriedItem", "_position", "_maxHeight"];
if (GETMVAR(ACE_Modifier,0) == 0) exitWith {false};
params ["_scrollAmount"];
// requires modifier key to be hold down
if (missionNamespace getVariable ["ACE_Modifier", 0] == 0) exitWith {false};
private "_unit";
_unit = ACE_player; _unit = ACE_player;
// EH is always assigned. Exit and don't overwrite input if not carrying // EH is always assigned. Exit and don't overwrite input if not carrying
if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {false}; if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {false};
private "_scrollAmount";
_scrollAmount = _this select 0;
// move carried item 15 cm per scroll interval // move carried item 15 cm per scroll interval
_scrollAmount = _scrollAmount * 0.15; _scrollAmount = _scrollAmount * 0.15;
private "_carriedItem";
_carriedItem = _unit getVariable [QGVAR(carriedObject), objNull]; _carriedItem = _unit getVariable [QGVAR(carriedObject), objNull];
//disabled for persons //disabled for persons
if (_carriedItem isKindOf "CAManBase") exitWith {false}; if (_carriedItem isKindOf "CAManBase") exitWith {false};
private ["_position", "_maxHeight"];
_position = getPosATL _carriedItem; _position = getPosATL _carriedItem;
_maxHeight = (_unit modelToWorldVisual [0,0,0]) select 2; _maxHeight = (_unit modelToWorldVisual [0,0,0]) select 2;

View File

@ -1,17 +1,29 @@
// by commy2 /*
* Author: commy2
*
* Handle the Unconscious of a Unit while Dragging
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [_unit] call ace_dragging_fnc_handleUnconscious;
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_isUnconscious"]; private ["_player", "_draggedObject", "_carriedObject"];
_unit = _this select 0; params ["_unit"];
_isUnconscious = _this select 1;
private "_player";
_player = ACE_player; _player = ACE_player;
if (_player getVariable [QGVAR(isDragging), false]) then { if (_player getVariable [QGVAR(isDragging), false]) then {
private "_draggedObject";
_draggedObject = _player getVariable [QGVAR(draggedObject), objNull]; _draggedObject = _player getVariable [QGVAR(draggedObject), objNull];
// handle falling unconscious // handle falling unconscious
@ -28,7 +40,6 @@ if (_player getVariable [QGVAR(isDragging), false]) then {
if (_player getVariable [QGVAR(isCarrying), false]) then { if (_player getVariable [QGVAR(isCarrying), false]) then {
private "_carriedObject";
_carriedObject = _player getVariable [QGVAR(carriedObject), objNull]; _carriedObject = _player getVariable [QGVAR(carriedObject), objNull];
// handle falling unconscious // handle falling unconscious

View File

@ -4,23 +4,22 @@
* Initialize variables for drag or carryable objects. Called from init EH. * Initialize variables for drag or carryable objects. Called from init EH.
* *
* Argument: * Argument:
* 0: Any object (Object) * 0: Any object <OBJECT>
* *
* Return value: * Return Value:
* NONE. * None
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private "_object"; private ["_position", "_direction", "_config"];
_object = _this select 0; params ["_object"];
private "_config";
_config = configFile >> "CfgVehicles" >> typeOf _object; _config = configFile >> "CfgVehicles" >> typeOf _object;
if (getNumber (_config >> QGVAR(canDrag)) == 1) then { if (getNumber (_config >> QGVAR(canDrag)) == 1) then {
private ["_position", "_direction"];
_position = getArray (_config >> QGVAR(dragPosition)); _position = getArray (_config >> QGVAR(dragPosition));
_direction = getNumber (_config >> QGVAR(dragDirection)); _direction = getNumber (_config >> QGVAR(dragDirection));
@ -28,8 +27,6 @@ if (getNumber (_config >> QGVAR(canDrag)) == 1) then {
}; };
if (getNumber (_config >> QGVAR(canCarry)) == 1) then { if (getNumber (_config >> QGVAR(canCarry)) == 1) then {
private ["_position", "_direction"];
_position = getArray (_config >> QGVAR(carryPosition)); _position = getArray (_config >> QGVAR(carryPosition));
_direction = getNumber (_config >> QGVAR(carryDirection)); _direction = getNumber (_config >> QGVAR(carryDirection));

View File

@ -4,16 +4,16 @@
* Initialize variables for drag or carryable persons. Called from init EH. * Initialize variables for drag or carryable persons. Called from init EH.
* *
* Argument: * Argument:
* 0: Any Unit (Object) * 0: Unit <OBJECT>
* *
* Return value: * Return value:
* NONE. * None
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private "_unit"; params ["_unit"];
_unit = _this select 0;
[_unit, true, [0,1.1,0.092], 180] call FUNC(setDraggable); [_unit, true, [0,1.1,0.092], 180] call FUNC(setDraggable);
[_unit, true, [0.4,-0.1,-1.25], 195] call FUNC(setCarryable); // hard-coded selection: "LeftShoulder" [_unit, true, [0.4,-0.1,-1.25], 195] call FUNC(setCarryable); // hard-coded selection: "LeftShoulder"

View File

@ -1,6 +1,16 @@
// by commy2 /*
* Author: commy2
private "_object"; *
_object = _this select 0; * Check if Object is Overlapping
*
* Argument:
* 0: Object <OBJECT>
*
* Return value:
* <BOOL>
*
* Public: No
*/
params ["_object"];
(getPosATL _object select 2) - (getPos _object select 2) > 1E-5 (getPosATL _object select 2) - (getPos _object select 2) > 1E-5

View File

@ -4,25 +4,21 @@
* Enable the object to be carried. * Enable the object to be carried.
* *
* Argument: * Argument:
* 0: Any object (Object) * 0: Any object <OBJECT>
* 1: true to enable carrying, false to disable (Bool) * 1: true to enable carrying, false to disable <BOOL>
* 2: Position offset for attachTo command (Array, optinal; default: [0,1,1]) * 2: Position offset for attachTo command <ARRAY> (default: [0,1,1])
* 3: Direction in degree to rotate the object after attachTo (Number, optional; default: 0) * 3: Direction in degree to rotate the object after attachTo <NUMBER> (default: 0)
* *
* Return value: * Return Value:
* NONE. * None
*
* Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_carryAction", "_dropAction", "_object", "_enableCarry", "_position", "_direction"]; private ["_carryAction", "_dropAction", "_type", "_initializedClasses"];
//IGNORE_PRIVATE_WARNING("_player", "_target");
_this resize 4; params ["_object", "_enableCarry", "_position", "_direction"];
_object = _this select 0;
_enableCarry = _this select 1;
_position = _this select 2;
_direction = _this select 3;
if (isNil "_position") then { if (isNil "_position") then {
_position = _object getVariable [QGVAR(carryPosition), [0,1,1]]; _position = _object getVariable [QGVAR(carryPosition), [0,1,1]];
@ -38,8 +34,6 @@ _object setVariable [QGVAR(carryPosition), _position];
_object setVariable [QGVAR(carryDirection), _direction]; _object setVariable [QGVAR(carryDirection), _direction];
// add action to class if it is not already present // add action to class if it is not already present
private ["_type", "_initializedClasses"];
_type = typeOf _object; _type = typeOf _object;
_initializedClasses = GETGVAR(initializedClasses_carry,[]); _initializedClasses = GETGVAR(initializedClasses_carry,[]);

View File

@ -10,19 +10,15 @@
* 3: Direction in degree to rotate the object after attachTo (Number, optional; default: 0) * 3: Direction in degree to rotate the object after attachTo (Number, optional; default: 0)
* *
* Return value: * Return value:
* NONE. * None
*
* Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_dragAction", "_dropAction", "_object", "_enableDrag", "_position", "_direction"]; private ["_dragAction", "_dropAction", "_type", "_initializedClasses"];
//IGNORE_PRIVATE_WARNING("_player", "_target"); //IGNORE_PRIVATE_WARNING("_player", "_target");
params ["_object", "_enableDrag", "_position", "_direction"];
_this resize 4;
_object = _this select 0;
_enableDrag = _this select 1;
_position = _this select 2;
_direction = _this select 3;
if (isNil "_position") then { if (isNil "_position") then {
_position = _object getVariable [QGVAR(dragPosition), [0,0,0]]; _position = _object getVariable [QGVAR(dragPosition), [0,0,0]];
@ -38,8 +34,6 @@ _object setVariable [QGVAR(dragPosition), _position];
_object setVariable [QGVAR(dragDirection), _direction]; _object setVariable [QGVAR(dragDirection), _direction];
// add action to class if it is not already present // add action to class if it is not already present
private ["_type", "_initializedClasses"];
_type = typeOf _object; _type = typeOf _object;
_initializedClasses = GETGVAR(initializedClasses,[]); _initializedClasses = GETGVAR(initializedClasses,[]);

View File

@ -3,29 +3,28 @@
* *
* Start the carrying process. * Start the carrying process.
* *
* Argument: * Arguments:
* 0: Unit that should do the carrying (Object) * 0: Unit that should do the carrying <OBJECT>
* 1: Object to carry (Object) * 1: Object to carry <OBJECT>
* *
* Return value: * Return Value:
* NONE. * None
*
* Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_target"]; private ["_weight", "_timer"];
_unit = _this select 0; params ["_unit", "_target"];
_target = _this select 1;
// check weight // check weight
private "_weight";
_weight = [_target] call FUNC(getWeight); _weight = [_target] call FUNC(getWeight);
if (_weight > GETMVAR(ACE_maxWeightCarry,1E11)) exitWith { if (_weight > missionNamespace getVariable ["ACE_maxWeightCarry", 1E11]) exitWith {
[localize LSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured); [localize LSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured);
}; };
private "_timer";
_timer = ACE_time + 5; _timer = ACE_time + 5;
// handle objects vs persons // handle objects vs persons

View File

@ -1,25 +1,34 @@
// by commy2 /*
* Author: commy2
*
* Carry PFH
*
* Arguments:
* ?
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
#ifdef DEBUG_ENABLED_DRAGGING #ifdef DEBUG_ENABLED_DRAGGING
systemChat format ["%1 startCarryPFH running", ACE_time]; systemChat format ["%1 startCarryPFH running", ACE_time];
#endif #endif
private ["_unit", "_target", "_timeOut"]; params ["_args", "_idPFH"];
_args params ["_unit", "_target", "_timeOut"];
_unit = _this select 0 select 0;
_target = _this select 0 select 1;
_timeOut = _this select 0 select 2;
// handle aborting carry // handle aborting carry
if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith { if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
}; };
// same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled)) // same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled))
if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then {
[_unit, _target] call FUNC(dropObject); [_unit, _target] call FUNC(dropObject);
[_this select 1] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
}; };
// handle persons vs objects // handle persons vs objects
@ -27,11 +36,11 @@ if (_target isKindOf "CAManBase") then {
if (ACE_time > _timeOut) exitWith { if (ACE_time > _timeOut) exitWith {
[_unit, _target] call FUNC(carryObject); [_unit, _target] call FUNC(carryObject);
[_this select 1] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
}; };
} else { } else {
if (ACE_time > _timeOut) exitWith { if (ACE_time > _timeOut) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
// drop if in timeout // drop if in timeout
private "_draggedObject"; private "_draggedObject";
@ -43,7 +52,7 @@ if (_target isKindOf "CAManBase") then {
if (stance _unit == "STAND") exitWith { if (stance _unit == "STAND") exitWith {
[_unit, _target] call FUNC(carryObject); [_unit, _target] call FUNC(carryObject);
[_this select 1] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
}; };
}; };

View File

@ -4,24 +4,21 @@
* Start the dragging process. * Start the dragging process.
* *
* Argument: * Argument:
* 0: Unit that should do the dragging (Object) * 0: Unit that should do the dragging <OBJECT>
* 1: Object to drag (Object) * 1: Object to drag <OBJECT>
* *
* Return value: * Return value:
* NONE. * None
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_target"]; params ["_unit", "_target"];
_unit = _this select 0;
_target = _this select 1;
// check weight // check weight
private "_weight"; private "_weight";
_weight = [_target] call FUNC(getWeight); _weight = [_target] call FUNC(getWeight);
if (_weight > GETMVAR(ACE_maxWeightDrag,1E11)) exitWith { if (_weight > missionNamespace getVariable ["ACE_maxWeightDrag", 1E11]) exitWith {
[localize LSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured); [localize LSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured);
}; };

View File

@ -1,30 +1,39 @@
// by commy2 /*
* Author: commy2
*
* Drag PFH
*
* Arguments:
* ?
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp" #include "script_component.hpp"
#ifdef DEBUG_ENABLED_DRAGGING #ifdef DEBUG_ENABLED_DRAGGING
systemChat format ["%1 startDragPFH running", ACE_time]; systemChat format ["%1 startDragPFH running", ACE_time];
#endif #endif
private ["_unit", "_target", "_timeOut"]; params ["_args", "_idPFH"];
_args params ["_unit", "_target", "_timeOut"];
_unit = _this select 0 select 0;
_target = _this select 0 select 1;
_timeOut = _this select 0 select 2;
// handle aborting drag // handle aborting drag
if !(_unit getVariable [QGVAR(isDragging), false]) exitWith { if !(_unit getVariable [QGVAR(isDragging), false]) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
}; };
// same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled)) // same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled))
if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then {
[_unit, _target] call FUNC(dropObject); [_unit, _target] call FUNC(dropObject);
[_this select 1] 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 ACE_time.
if (ACE_time > _timeOut) exitWith { if (ACE_time > _timeOut) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
// drop if in timeout // drop if in timeout
private "_draggedObject"; private "_draggedObject";
@ -36,5 +45,5 @@ if (ACE_time > _timeOut) exitWith {
if (animationState _unit in DRAG_ANIMATIONS) exitWith { if (animationState _unit in DRAG_ANIMATIONS) exitWith {
[_unit, _target] call FUNC(dragObject); [_unit, _target] call FUNC(dragObject);
[_this select 1] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
}; };

View File

@ -492,7 +492,7 @@
<Czech>Spínač mrtvého muže</Czech> <Czech>Spínač mrtvého muže</Czech>
<Polish>Czuwak</Polish> <Polish>Czuwak</Polish>
<Spanish>Detonador de hombre muerto</Spanish> <Spanish>Detonador de hombre muerto</Spanish>
<Hungarian>Dead Man's Switch</Hungarian> <Hungarian>Halott ember kapcsolója</Hungarian>
<Portuguese>Detonador do homem morto</Portuguese> <Portuguese>Detonador do homem morto</Portuguese>
<Russian>Кнопка мертвеца</Russian> <Russian>Кнопка мертвеца</Russian>
<Italian>Detonatore a rilascio</Italian> <Italian>Detonatore a rilascio</Italian>
@ -528,6 +528,7 @@
<German>Sprengstoffsystem</German> <German>Sprengstoffsystem</German>
<Czech>Systém výbušnin</Czech> <Czech>Systém výbušnin</Czech>
<Portuguese>Sistema de explosivos</Portuguese> <Portuguese>Sistema de explosivos</Portuguese>
<Hungarian>Robbanóanyag-rendszer</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Explosives_RequireSpecialist_DisplayName"> <Key ID="STR_ACE_Explosives_RequireSpecialist_DisplayName">
<English>Require specialists?</English> <English>Require specialists?</English>
@ -536,6 +537,7 @@
<German>Benötigt Sprengstoffexperten?</German> <German>Benötigt Sprengstoffexperten?</German>
<Czech>Vyžadovat specialistu?</Czech> <Czech>Vyžadovat specialistu?</Czech>
<Portuguese>Requer especialista?</Portuguese> <Portuguese>Requer especialista?</Portuguese>
<Hungarian>Specialisták igénylése?</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Explosives_RequireSpecialist_Description"> <Key ID="STR_ACE_Explosives_RequireSpecialist_Description">
<English>Require explosive specialists to disable explosives? Default: No</English> <English>Require explosive specialists to disable explosives? Default: No</English>
@ -544,6 +546,7 @@
<German>Benötige Sprengstoffexperte um Sprengladungen zu entschärfen? Standard: Nein</German> <German>Benötige Sprengstoffexperte um Sprengladungen zu entschärfen? Standard: Nein</German>
<Czech>Vyžadovat specialistu na zneškodnění výbušniny? Výchozí: Ne</Czech> <Czech>Vyžadovat specialistu na zneškodnění výbušniny? Výchozí: Ne</Czech>
<Portuguese>Requer especialista em explosivos para desativar explosivos? Padrão: Não</Portuguese> <Portuguese>Requer especialista em explosivos para desativar explosivos? Padrão: Não</Portuguese>
<Hungarian>Szükséges-e egy specialista a robbanóanyagok hatástalanításához? Alapértelmezett: Nem</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Explosives_PunishNonSpecialists_DisplayName"> <Key ID="STR_ACE_Explosives_PunishNonSpecialists_DisplayName">
<English>Punish non-specialists?</English> <English>Punish non-specialists?</English>
@ -552,6 +555,7 @@
<German>Bestrafe Nicht-Sprengstoffexperten?</German> <German>Bestrafe Nicht-Sprengstoffexperten?</German>
<Czech>Potrestat, pokud není specialista?</Czech> <Czech>Potrestat, pokud není specialista?</Czech>
<Portuguese>Punir não especialistas?</Portuguese> <Portuguese>Punir não especialistas?</Portuguese>
<Hungarian>Nem-specialisták büntetése?</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Explosives_PunishNonSpecialists_Description"> <Key ID="STR_ACE_Explosives_PunishNonSpecialists_Description">
<English>Increase the time it takes to complete actions for non-specialists? Default: Yes</English> <English>Increase the time it takes to complete actions for non-specialists? Default: Yes</English>
@ -560,6 +564,7 @@
<German>Entschärfungszeit für Nicht-Sprengstoffexperten erhöhen? Standard: Ja</German> <German>Entschärfungszeit für Nicht-Sprengstoffexperten erhöhen? Standard: Ja</German>
<Czech>Zvýšit čas potřebný k dokončení akce pokud není specialista? Výchozí: Ano</Czech> <Czech>Zvýšit čas potřebný k dokončení akce pokud není specialista? Výchozí: Ano</Czech>
<Portuguese>Aumentar o tempo necessário para completar ações por não especialistas? Padrão: Sim</Portuguese> <Portuguese>Aumentar o tempo necessário para completar ações por não especialistas? Padrão: Sim</Portuguese>
<Hungarian>Nem-specialisták esetén több ideig tartson a cselekvés befejezése? Alapértelmezett: Igen</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Explosives_ExplodeOnDefuse_DisplayName"> <Key ID="STR_ACE_Explosives_ExplodeOnDefuse_DisplayName">
<English>Explode on defusal?</English> <English>Explode on defusal?</English>
@ -567,6 +572,7 @@
<Polish>Eksplozja przy rozbrajaniu?</Polish> <Polish>Eksplozja przy rozbrajaniu?</Polish>
<Czech>Explodovat při zneškodňování?</Czech> <Czech>Explodovat při zneškodňování?</Czech>
<Spanish>Explotar al desactivar?</Spanish> <Spanish>Explotar al desactivar?</Spanish>
<Hungarian>Robbanás hatástalanításkor?</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Explosives_ExplodeOnDefuse_Description"> <Key ID="STR_ACE_Explosives_ExplodeOnDefuse_Description">
<English>Enable certain explosives to explode on defusal? Default: Yes</English> <English>Enable certain explosives to explode on defusal? Default: Yes</English>
@ -574,6 +580,7 @@
<Polish>Spraw, aby niektóre ładunki wybuchowe eksplodowały przy próbie ich rozbrojenia? Domyślnie:Tak</Polish> <Polish>Spraw, aby niektóre ładunki wybuchowe eksplodowały przy próbie ich rozbrojenia? Domyślnie:Tak</Polish>
<Czech>Umožnit u některých výbušnin explozi při pokusu je zneškodnit? Výchozí: Ano</Czech> <Czech>Umožnit u některých výbušnin explozi při pokusu je zneškodnit? Výchozí: Ano</Czech>
<Spanish>¿Habilitar ciertos explosivos para estallar al desactivar? Por defecto: Sí</Spanish> <Spanish>¿Habilitar ciertos explosivos para estallar al desactivar? Por defecto: Sí</Spanish>
<Hungarian>Meghatározott robbanóanyagok felrobbanjanak-e hatástalanításkor? Alapértelmezett: Igen</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_Explosives_Module_Description"> <Key ID="STR_ACE_Explosives_Module_Description">
<English>This module adjusts the settings related to explosives.</English> <English>This module adjusts the settings related to explosives.</English>
@ -581,6 +588,7 @@
<German>Dieses Modul erlaubt die Einstellungen für Sprengstoffe zu verändern.</German> <German>Dieses Modul erlaubt die Einstellungen für Sprengstoffe zu verändern.</German>
<Czech>Tento modul umoňuje přizpůsobit nastavení týkajících se výbušnin.</Czech> <Czech>Tento modul umoňuje přizpůsobit nastavení týkajících se výbušnin.</Czech>
<Portuguese>Este módulo permite personalizar as definições relacionadas a explosivos.</Portuguese> <Portuguese>Este módulo permite personalizar as definições relacionadas a explosivos.</Portuguese>
<Hungarian>Ez a modul a robbanóanyagokhoz kötött beállításokat szabályozza.</Hungarian>
</Key> </Key>
</Package> </Package>
</Project> </Project>

View File

@ -41,7 +41,7 @@ _iconSize = BASE_SIZE * _fovCorrection;
_drawColor set [3, ((_drawColor select 3) * (_timeLeftToShow / 0.5))]; _drawColor set [3, ((_drawColor select 3) * (_timeLeftToShow / 0.5))];
}; };
drawIcon3D [QUOTE(PATHTOF(UI\fp_icon.paa)), _drawColor, _pos, _iconSize, _iconSize, 0, _name, 1, 0.03, "PuristaMedium"]; drawIcon3D [QUOTE(PATHTOF(UI\fp_icon2.paa)), _drawColor, _pos, _iconSize, _iconSize, 0, _name, 1, 0.03, "PuristaMedium"];
}; };
} count (GVAR(fingersHash) select 0); } count (GVAR(fingersHash) select 0);

View File

@ -5,46 +5,56 @@
<English>Show pointing indicator to self</English> <English>Show pointing indicator to self</English>
<Russian>Отображать пальце-индикатор для показывающего игрока</Russian> <Russian>Отображать пальце-индикатор для показывающего игрока</Russian>
<Polish>Pokaż indykator wskazywania palcem dla siebie</Polish> <Polish>Pokaż indykator wskazywania palcem dla siebie</Polish>
<Hungarian>Saját mutatási indikátor megjelenítése</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_finger_indicatorForSelf_description"> <Key ID="STR_ACE_finger_indicatorForSelf_description">
<English>Render the indicator for the pointing player. This option doesn't affect whether the other players would see the indicator</English> <English>Render the indicator for the pointing player. This option doesn't affect whether the other players would see the indicator</English>
<Russian>Отображать индикатор для показывающего игрока. Эта настройка не влияет на то, будутт ли другие игроки видеть индикатор</Russian> <Russian>Отображать индикатор для показывающего игрока. Эта настройка не влияет на то, будутт ли другие игроки видеть индикатор</Russian>
<Polish> Wyświetl indykator kiedy wskazujesz coś palcem. Ta opcja nie wpływa na to, czy inni gracze zobaczą ten indykator czy też nie.</Polish> <Polish> Wyświetl indykator kiedy wskazujesz coś palcem. Ta opcja nie wpływa na to, czy inni gracze zobaczą ten indykator czy też nie.</Polish>
<Hungarian>Az indikátor megjelenítése a mutató játékosnak. Ez a beállítás nem változtat azon, hogy más játékosok látják-e az indikátort.</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_finger_indicatorColor_name"> <Key ID="STR_ACE_finger_indicatorColor_name">
<English>Pointing indicator</English> <English>Pointing indicator</English>
<Russian>Пальце-индикатор</Russian> <Russian>Пальце-индикатор</Russian>
<Polish>Indykator palca</Polish> <Polish>Indykator palca</Polish>
<Hungarian>Ujj-indikátor</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_finger_indicatorColor_description"> <Key ID="STR_ACE_finger_indicatorColor_description">
<English>Color of the pointing indicator circle</English> <English>Color of the pointing indicator circle</English>
<Russian>Цвет индикатора пальце-указания</Russian> <Russian>Цвет индикатора пальце-указания</Russian>
<Polish>Kolor okręgu wyświetlanego przy wskazywaniu palcem</Polish> <Polish>Kolor okręgu wyświetlanego przy wskazywaniu palcem</Polish>
<Hungarian>Mutatási indikátor körének színe</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_finger_keyComb"> <Key ID="STR_ACE_finger_keyComb">
<English>Action "point a finger at"</English> <English>Action "point a finger at"</English>
<Russian>Действие "показать пальцем на"</Russian> <Russian>Действие "показать пальцем на"</Russian>
<Polish>Akcja "wskaż palcem"</Polish> <Polish>Akcja "wskaż palcem"</Polish>
<Hungarian>Cselekvés "ujj rámutatása"</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_finger_keyComb_description"> <Key ID="STR_ACE_finger_keyComb_description">
<English>Points, and shows a virtual marker of where you are looking to nearby units. Can be held down.</English> <English>Points, and shows a virtual marker of where you are looking to nearby units. Can be held down.</English>
<Polish>Wskazuje a także wyświetla wirtualny marker-okrąg w miejscu, w które patrzysz, dla wszystkich pobliskich jednostek. Może być przytrzymywany.</Polish> <Polish>Wskazuje a także wyświetla wirtualny marker-okrąg w miejscu, w które patrzysz, dla wszystkich pobliskich jednostek. Może być przytrzymywany.</Polish>
<Hungarian>Mutat, és elhelyez egy virtuális jelölőt a nézett területhez közeli egységekhez. Lenyomva tartható.</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_finger_moduleSettings_displayName"> <Key ID="STR_ACE_finger_moduleSettings_displayName">
<English>Pointing Settings</English> <English>Pointing Settings</English>
<Polish>Ustawienia wskazywania palcem</Polish> <Polish>Ustawienia wskazywania palcem</Polish>
<Hungarian>Ujj beállításai</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_finger_enabled_displayName"> <Key ID="STR_ACE_finger_enabled_displayName">
<English>Pointing Enabled</English> <English>Pointing Enabled</English>
<Polish>Aktywuj wskazywanie</Polish> <Polish>Aktywuj wskazywanie</Polish>
<Hungarian>Mutatás engedélyezése</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_finger_maxRange_displayName"> <Key ID="STR_ACE_finger_maxRange_displayName">
<English>Pointing Max Range</English> <English>Pointing Max Range</English>
<Polish>Maks. zasięg wskazywania</Polish> <Polish>Maks. zasięg wskazywania</Polish>
<Hungarian>Ujj maximum hatótávja</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_finger_maxRange_description"> <Key ID="STR_ACE_finger_maxRange_description">
<English>Max range between players to show the pointing indicator [default: 4 meters]</English> <English>Max range between players to show the pointing indicator [default: 4 meters]</English>
<Polish>Określ dystans na jakim można wskazywać coś palcem innym graczom. [domyślnie: 4m] </Polish> <Polish>Określ dystans na jakim można wskazywać coś palcem innym graczom. [domyślnie: 4m] </Polish>
<Hungarian>A maximális távolság, amelyben a közeli játékosoknak megjelenik az indikátor. [alapértelmezett: 4 méter]</Hungarian>
</Key> </Key>
</Package> </Package>
</Project> </Project>

Binary file not shown.

View File

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

View File

@ -0,0 +1,5 @@
class Extended_PostInit_EventHandlers {
class ADDON {
clientInit = QUOTE(call COMPILE_FILE(XEH_postInitClient) );
};
};

View File

@ -0,0 +1,7 @@
class CfgSounds {
class ACE_flashlights_flashlightClick {
name = "ACE_flashlights_flashlightClick";
sound[] = {"\a3\sounds_f\weapons\Other\dry4.wss", 0.2, 2};
titles[] = {};
};
};

View File

@ -0,0 +1,89 @@
class CfgVehicles {
class Man;
class CAManBase: Man {
class ACE_SelfActions {
//todo: add flashlight attach actions
};
};
class Item_Base_F;
class ACE_Flashlight_MX991Item: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = CSTRING(MX991_DisplayName);
author = ECSTRING(common,ACETeam);
vehicleClass = "WeaponAccessories";
class TransportItems {
class ACE_Flashlight_MX991 {
name = "ACE_Flashlight_MX991";
count = 1;
};
};
};
class ACE_Flashlight_KSF1Item: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = CSTRING(KSF1_DisplayName);
author = ECSTRING(common,ACETeam);
vehicleClass = "WeaponAccessories";
class TransportItems {
class ACE_Flashlight_KSF1 {
name = "ACE_Flashlight_KSF1";
count = 1;
};
};
};
class ACE_Flashlight_XL50Item: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = CSTRING(XL50_DisplayName);
author = ECSTRING(common,ACETeam);
vehicleClass = "WeaponAccessories";
class TransportItems {
class ACE_Flashlight_XL50 {
name = "ACE_Flashlight_XL50";
count = 1;
};
};
};
class NATO_Box_Base;
class EAST_Box_Base;
class IND_Box_Base;
class FIA_Box_Base_F;
class Box_NATO_Support_F: NATO_Box_Base {
class TransportItems {
MACRO_ADDITEM(ACE_Flashlight_MX991,12);
};
};
class Box_East_Support_F: EAST_Box_Base {
class TransportItems {
MACRO_ADDITEM(ACE_Flashlight_KSF1,12);
};
};
class Box_IND_Support_F: IND_Box_Base {
class TransportItems {
MACRO_ADDITEM(ACE_Flashlight_XL50,12);
};
};
class Box_FIA_Support_F: FIA_Box_Base_F {
class TransportItems {
MACRO_ADDITEM(ACE_Flashlight_MX991,12);
};
};
class ACE_Box_Misc: Box_NATO_Support_F {
class TransportItems {
MACRO_ADDITEM(ACE_Flashlight_MX991,12);
MACRO_ADDITEM(ACE_Flashlight_KSF1,12);
MACRO_ADDITEM(ACE_Flashlight_XL50,12);
};
};
};

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