mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge remote-tracking branch 'upstream/master'
- Sync fork with ACE3
This commit is contained in:
commit
a04aa31f21
@ -1,7 +1,7 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = crlf
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
@ -10,4 +10,3 @@ trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
|
55
.gibot.yml
Normal file
55
.gibot.yml
Normal file
@ -0,0 +1,55 @@
|
||||
stages:
|
||||
mark_for_closing:
|
||||
days: 30
|
||||
labels:
|
||||
- need more info
|
||||
- invalid
|
||||
- can't reproduce
|
||||
- wontfix
|
||||
- information required
|
||||
exclude:
|
||||
- marked for cleanup
|
||||
comment:
|
||||
- 'Hello @{author}! There has been no activity on this ticket for over a period of {days} days. I am automatically replying to let you know we will close this ticket within 1 week due to inactivity and consider this resolved.'
|
||||
- 'If you believe this in error, please reply with the requested information.'
|
||||
- 'Thank you. :robot:'
|
||||
action:
|
||||
close: false
|
||||
comment: true
|
||||
assign_label:
|
||||
- marked for cleanup
|
||||
clean_up:
|
||||
days: 7
|
||||
labels:
|
||||
- marked for cleanup
|
||||
comment:
|
||||
- 'Hello @{author}! We have detected no activity for {days} days on this ticket. We therefore assume that the original reporter has lost interest or the issue has been resolved.'
|
||||
- 'Since we have marked this ticket for deletion, we will be closing it.'
|
||||
- 'If this has been closed in error, please create a comment below and we can reopen this issue. Note that you may need to provide additional information that was requested.'
|
||||
- 'Thank you. :robot:'
|
||||
action:
|
||||
close: true
|
||||
comment: true
|
||||
assign_label:
|
||||
- closed by bot
|
||||
remove_label:
|
||||
- marked for cleanup
|
||||
remind_about_old_ticket:
|
||||
days: 130
|
||||
labels:
|
||||
- bug
|
||||
- critical bug
|
||||
exclude:
|
||||
- need more info
|
||||
- invalid
|
||||
- can't reproduce
|
||||
- wontfix
|
||||
- information required
|
||||
- marked for cleanup
|
||||
- inactive
|
||||
comment:
|
||||
- 'Hello @acemod/maintainers. This ticket has been open for over {days} days without any activity.'
|
||||
action:
|
||||
comment: true
|
||||
assign_label:
|
||||
- inactive
|
4
.gitattributes
vendored
Normal file
4
.gitattributes
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
* text=auto
|
||||
*.png binary
|
||||
*.jpg binary
|
||||
*.paa binary
|
10
.github/CONTRIBUTING.md
vendored
10
.github/CONTRIBUTING.md
vendored
@ -6,11 +6,9 @@ If you have found an issue with ACE3 please make sure that ACE3 really is the ca
|
||||
|
||||
Indicate if the issue appears on stable or development version. In case it is the development version, please also include the commit SHA-1 hash.
|
||||
|
||||
<div class="panel callout">
|
||||
<h5>Please note:</h5>
|
||||
<p>It's not a valid to simply remove <code>@ace</code> from the mod list to confirm that ACE3 is the culprit.</p>
|
||||
<p>If the error happens when using a <b>third-party mod</b> contact the author of the appropriate mod and report the issue there.</p>
|
||||
</div>
|
||||
**Please note:**
|
||||
- It's not a valid to simply remove <code>@ace</code> from the mod list to confirm that ACE3 is the culprit.
|
||||
- If the error happens when using a <b>third-party mod</b> contact the author of the appropriate mod and report the issue there.
|
||||
|
||||
## Reporting the issue
|
||||
|
||||
@ -26,6 +24,6 @@ ACE2, AGM and CSE had a lot of features implemented or planned. All of them are
|
||||
Please refrain from making requests for any planned or existing features from either ACE2, AGM or CSE. Most of them are already being or have been considered for porting or a rewrite.
|
||||
|
||||
## Requesting a feature
|
||||
In order to avoid duplicates and keep the issue tracker organized, we have created a common issue for [ACE3 Feature requests](https://github.com/acemod/ACE3/issues/414). Any and all relevant requests should be submitted there, where they will also get discussed and evaluated. Before adding a new one, make sure to check the previous entries from the thread and do a quick search for similar suggestions; please don't reiterate requests for features that had already been accepted for inclusion, or those which were disregarded earlier.
|
||||
In order to avoid duplicates and keep the issue tracker organized, we have created a common issue for [ACE3 Feature requests](https://github.com/acemod/ACE3/issues/3594). Any and all relevant requests should be submitted there, where they will also get discussed and evaluated. Before adding a new one, make sure to check the previous entries from the thread and do a quick search for similar suggestions; please don't reiterate requests for features that had already been accepted for inclusion, or those which were disregarded earlier.
|
||||
|
||||
Following their approval, feature requests may be moved by moderators to a separate issue for further discussion.
|
||||
|
28
.github/ISSUE_TEMPLATE.md
vendored
28
.github/ISSUE_TEMPLATE.md
vendored
@ -1,25 +1,23 @@
|
||||
**Arma 3 Version:** `x.xx`
|
||||
*(indicate if stable, rc or dev*)
|
||||
|
||||
**ACE3 Version:** `3.x.x`
|
||||
*(indicate if stable or dev, if dev indicate the commit the version is based on)*
|
||||
**Arma 3 Version:** `x.xx` (stable / rc / dev)
|
||||
**CBA Version:** `3.x.x` (stable / dev + commit hash)
|
||||
**ACE3 Version:** `3.x.x` (stable / dev + commit hash)
|
||||
|
||||
**Mods:**
|
||||
* `@CBA_A3`
|
||||
* `@ace`
|
||||
* ...
|
||||
|
||||
**Placed Modules:**
|
||||
* *Add the list of modules you have placed on the map. Use 'None' if the error occurs without using any modules.*
|
||||
- `@CBA_A3`
|
||||
- `@ace`
|
||||
|
||||
**Description:**
|
||||
* *Add a detailed description of the error. This makes it easier for us to fix the issue.*
|
||||
- Add a detailed description of the error. This makes it easier for us to fix the issue.
|
||||
|
||||
**Steps to reproduce:**
|
||||
* *Add the steps needed to reproduce the issue.*
|
||||
- Add the steps needed to reproduce the issue.
|
||||
|
||||
**Where did the issue occur?**
|
||||
* *A possible answer might be "Dedicated Server", "Local Multiplayer", "Editor", or "Singleplayer"*
|
||||
- Dedicated / Self-Hosted Multiplayer / Singleplayer / Editor (Singleplayer) / Editor (Multiplayer) / Virtual Arsenal
|
||||
|
||||
**Placed Modules:**
|
||||
- Add the list of modules you have placed on the map. Use 'None' if the error occurs without any modules.
|
||||
|
||||
**RPT log file:**
|
||||
* *Add a link (pastebin.com) to the client and/or server RPT file. An instruction to find your RPT files can be [found here](https://community.bistudio.com/wiki/Crash_Files#Arma_3)*
|
||||
- Add a link ([gist](https://gist.github.com) or [pastebin](http://pastebin.com)) to the client and/or server RPT file. An instruction to find your RPT files can be found [here](https://community.bistudio.com/wiki/Crash_Files#Arma_3).
|
||||
- If possible at the time the bug is encountered, go to ACE Options and select "Debug To Clipboard", this will print extensive debug information to the RPT file.
|
||||
|
15
.github/PULL_REQUEST_TEMPLATE.md
vendored
15
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -1,10 +1,5 @@
|
||||
### When merged this pull request will:
|
||||
|
||||
1. *Describe what this pull request will do*
|
||||
2. *Each change in a seperate line*
|
||||
|
||||
---
|
||||
*Delete this line and everything below*
|
||||
|
||||
- [Make sure to respect the file structure](http://ace3mod.com/wiki/development/modularity-and-pbo-structure.html)
|
||||
- [Make sure to respect the coding guidelines](http://ace3mod.com/wiki/development/coding-guidelines.html)
|
||||
**When merged this pull request will:**
|
||||
- Describe what this pull request will do
|
||||
- Each change in a separate line
|
||||
- Include documentation if applicable
|
||||
- Respect the [Development Guidelines](http://ace3mod.com/wiki/development/)
|
||||
|
17
.gitignore
vendored
17
.gitignore
vendored
@ -1,8 +1,9 @@
|
||||
release/*
|
||||
*.cache
|
||||
*.pbo
|
||||
texHeaders.bin
|
||||
*.swp
|
||||
*.swo
|
||||
*.biprivatekey
|
||||
Thumbs.db
|
||||
release/*
|
||||
tools/temp
|
||||
*.cache
|
||||
*.pbo
|
||||
texHeaders.bin
|
||||
*.swp
|
||||
*.swo
|
||||
*.biprivatekey
|
||||
Thumbs.db
|
||||
|
@ -12,12 +12,13 @@ before_script:
|
||||
fi
|
||||
script:
|
||||
- python3 tools/sqf_validator.py
|
||||
- python3 tools/config_style_checker.py
|
||||
- if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
|
||||
python3 tools/deploy.py;
|
||||
fi
|
||||
env:
|
||||
global:
|
||||
- secure: KcJQbknBOdC5lA4nFGKPXVRVIGLDXDRzC8XkHuXJCE9pIR/wbxbkvx8fHKcC6SC9eHgzneC3+o4m4+CjIbVvIwDgslRbJ8Y59i90ncONmdoRx1HUYHwuYWVZm9HJFjCsIbrEqhSyyKS+PB3WZVOLbErtNHsgS8f43PTh5Ujg7Vg=
|
||||
- secure: cdxkn5cAx+s1C9Ne5m+odEhde1uuSg6XGMDgepN4DwSAJwtMnUv3ZmDebd5YJC1raZJdep+n09Cj0GoTNICQRkco50DxHKHYNad41wetY0tn0cs9gmPYzyFE5q4vuWiQ47dlGhQQ7IJDyX0nU++gG5E50/PhlZfebdedGSprN/4=
|
||||
notifications:
|
||||
slack:
|
||||
rooms:
|
||||
|
@ -29,6 +29,7 @@ Walter Pearce <jaynus@gmail.com>
|
||||
# CONTRIBUTORS
|
||||
[BIG]Bull
|
||||
11RDP-LoupVert <loupvert@11rdp.fr>
|
||||
654wak654 <ozanegitmen@gmail.com>
|
||||
ACCtomeek <tomeek99@gmail.com>
|
||||
adam3adam <br.ada@seznam.cz>
|
||||
Adanteh
|
||||
@ -65,6 +66,7 @@ F3 Project <alanr@ferstaberinde.com>
|
||||
Falke75
|
||||
Ferenczi
|
||||
Ferenzi
|
||||
FFAAMOD <modffaa@gmail.com>
|
||||
Filip Basara <filip.basara93@googlemail.com>
|
||||
fr89k <kaschitoku@web.de>
|
||||
FreeZbe <freeseb@gmail.com>
|
||||
@ -74,6 +76,7 @@ Gianmarco Varriale (TeamNuke) <admin@forhost.org>
|
||||
GieNkoV <gienkov.grzegorz@gmail.com>
|
||||
GitHawk <githawk@gmx.net>
|
||||
gpgpgpgp
|
||||
Grey-Soldierman <gungamer101@hotmail.com>
|
||||
Grzegorz
|
||||
Hamburger SV
|
||||
Harakhti <shadowdragonphd@gmail.com>
|
||||
@ -86,6 +89,7 @@ Kllrt <kllrtik@gmail.com>
|
||||
legman <juicemelon@msn.com>
|
||||
Legolasindar "Viper" <legolasindar@gmail.com>
|
||||
licht-im-Norden87 <lichtimnorden87@gmail.com>
|
||||
looter <looter222@gmail.com>
|
||||
Macusercom <macusercom@gmail.com>
|
||||
MarcBook
|
||||
meat <p.humberdroz@gmail.com>
|
||||
@ -106,10 +110,12 @@ Riccardo Petricca <petriccarcc@gmail.com>
|
||||
Robert Boklahánics <bokirobi@gmail.com>
|
||||
ruPaladin <happyworm24@rambler.ru>
|
||||
simon84 <badguy360th@gmail.com>
|
||||
Skengman2
|
||||
Sniperwolf572 <tenga6@gmail.com>
|
||||
System98
|
||||
SzwedzikPL <szwedzikpl@gmail.com>
|
||||
Tachi <zaveruha007@gmail.com>
|
||||
Tessa Elieff <Fastroping Sound - CreativeCommons Attributions 3.0>
|
||||
Toaster <jonathan.pereira@gmail.com>
|
||||
Tonic
|
||||
Tourorist <tourorist@gmail.com>
|
||||
@ -118,4 +124,3 @@ voiper
|
||||
VyMajoris(W-Cephei)<vycanismajoriscsa@gmail.com>
|
||||
Winter <simon@agius-muscat.net>
|
||||
zGuba
|
||||
Grey-Soldierman <gungamer101@hotmail.com>
|
||||
|
2
LICENSE
2
LICENSE
@ -26,6 +26,8 @@ Some folders of this project may contain a separate LICENSE file. Should
|
||||
that be the case, everything in that folder and all subfolders is subject
|
||||
to that license instead.
|
||||
|
||||
- ARMA PUBLIC LICENSE (\addons\apl)
|
||||
- CreativeCommons Attributions 3.0 (\addons\fastroping\data\sounds)
|
||||
|
||||
============================================================================
|
||||
Full GNU General Public License Text
|
||||
|
10
README.md
10
README.md
@ -3,15 +3,15 @@
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/acemod/ACE3/releases">
|
||||
<img src="https://img.shields.io/badge/Version-3.4.2-blue.svg?style=flat-square" alt="ACE3 Version">
|
||||
</a>
|
||||
<a href="https://github.com/acemod/ACE3/releases/download/v3.4.2/ace3_3.4.2.zip">
|
||||
<img src="https://img.shields.io/badge/Download-72.6_MB-green.svg?style=flat-square" alt="ACE3 Download">
|
||||
<a href="https://github.com/acemod/ACE3/releases/latest">
|
||||
<img src="https://img.shields.io/badge/Version-3.8.1-blue.svg?style=flat-square" alt="ACE3 Version">
|
||||
</a>
|
||||
<a href="https://github.com/acemod/ACE3/issues">
|
||||
<img src="https://img.shields.io/github/issues-raw/acemod/ACE3.svg?style=flat-square&label=Issues" alt="ACE3 Issues">
|
||||
</a>
|
||||
<a href="https://github.com/acemod/ACE3/releases">
|
||||
<img src="https://img.shields.io/github/downloads/acemod/ACE3/total.svg?style=flat-square&label=Downloads" alt="ACE3 Downloads">
|
||||
</a>
|
||||
<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?style=flat-square" alt="BIF Thread">
|
||||
</a>
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
ace_fcs.dll
BIN
ace_fcs.dll
Binary file not shown.
BIN
ace_medical.dll
BIN
ace_medical.dll
Binary file not shown.
Binary file not shown.
@ -1,29 +1,34 @@
|
||||
class ACE_Settings {
|
||||
class GVAR(enabled) {
|
||||
category = CSTRING(DisplayName);
|
||||
displayName = CSTRING(enabled_DisplayName);
|
||||
description = CSTRING(enabled_Description);
|
||||
typeName = "BOOL";
|
||||
value = 0;
|
||||
};
|
||||
class GVAR(simulateForSnipers) {
|
||||
category = CSTRING(DisplayName);
|
||||
displayName = CSTRING(simulateForSnipers_DisplayName);
|
||||
description = CSTRING(simulateForSnipers_Description);
|
||||
typeName = "BOOL";
|
||||
value = 1;
|
||||
};
|
||||
class GVAR(simulateForGroupMembers) {
|
||||
category = CSTRING(DisplayName);
|
||||
displayName = CSTRING(simulateForGroupMembers_DisplayName);
|
||||
description = CSTRING(simulateForGroupMembers_Description);
|
||||
typeName = "BOOL";
|
||||
value = 0;
|
||||
};
|
||||
class GVAR(simulateForEveryone) {
|
||||
category = CSTRING(DisplayName);
|
||||
displayName = CSTRING(simulateForEveryone_DisplayName);
|
||||
description = CSTRING(simulateForEveryone_Description);
|
||||
typeName = "BOOL";
|
||||
value = 0;
|
||||
};
|
||||
class GVAR(disabledInFullAutoMode) {
|
||||
category = CSTRING(DisplayName);
|
||||
displayName = CSTRING(disabledInFullAutoMod_DisplayName);
|
||||
description = CSTRING(disabledInFullAutoMod_Description);
|
||||
typeName = "BOOL";
|
||||
@ -31,6 +36,7 @@ class ACE_Settings {
|
||||
};
|
||||
/* // TODO: We currently do not have firedEHs on vehicles
|
||||
class GVAR(vehicleGunnerEnabled) {
|
||||
category = CSTRING(DisplayName);
|
||||
displayName = "Enabled For Vehicle Gunners";
|
||||
description = "Enables advanced ballistics for vehicle gunners";
|
||||
typeName = "BOOL";
|
||||
@ -38,30 +44,35 @@ class ACE_Settings {
|
||||
};
|
||||
*/
|
||||
class GVAR(ammoTemperatureEnabled) {
|
||||
category = CSTRING(DisplayName);
|
||||
displayName = CSTRING(ammoTemperatureEnabled_DisplayName);
|
||||
description = CSTRING(ammoTemperatureEnabled_Description);
|
||||
typeName = "BOOL";
|
||||
value = 1;
|
||||
};
|
||||
class GVAR(barrelLengthInfluenceEnabled) {
|
||||
category = CSTRING(DisplayName);
|
||||
displayName = CSTRING(barrelLengthInfluenceEnabled_DisplayName);
|
||||
description = CSTRING(barrelLengthInfluenceEnabled_Description);
|
||||
typeName = "BOOL";
|
||||
value = 1;
|
||||
};
|
||||
class GVAR(bulletTraceEnabled) {
|
||||
category = CSTRING(DisplayName);
|
||||
displayName = CSTRING(bulletTraceEnabled_DisplayName);
|
||||
description = CSTRING(bulletTraceEnabled_Description);
|
||||
typeName = "BOOL";
|
||||
value = 1;
|
||||
};
|
||||
class GVAR(simulationInterval) {
|
||||
category = CSTRING(DisplayName);
|
||||
displayName = CSTRING(simulationInterval_DisplayName);
|
||||
description = CSTRING(simulationInterval_Description);
|
||||
typeName = "SCALAR";
|
||||
value = 0.0;
|
||||
};
|
||||
class GVAR(simulationRadius) {
|
||||
category = CSTRING(DisplayName);
|
||||
displayName = CSTRING(simulationRadius_DisplayName);
|
||||
description = CSTRING(simulationRadius_Description);
|
||||
typeName = "SCALAR";
|
||||
|
@ -3,7 +3,7 @@ class CfgVehicles {
|
||||
class GVAR(ModuleSettings): ACE_Module {
|
||||
scope = 2;
|
||||
displayName = CSTRING(DisplayName);
|
||||
icon = QUOTE(PATHTOF(UI\Icon_Module_Wind_ca.paa));
|
||||
icon = QPATHTOF(UI\Icon_Module_Wind_ca.paa);
|
||||
category = "ACE";
|
||||
function = QUOTE(DFUNC(initModuleSettings));
|
||||
functionPriority = 1;
|
||||
|
@ -5,7 +5,7 @@
|
||||
GVAR(currentbulletID) = -1;
|
||||
|
||||
GVAR(Protractor) = false;
|
||||
GVAR(ProtractorStart) = ACE_time;
|
||||
GVAR(ProtractorStart) = CBA_missionTime;
|
||||
GVAR(allBullets) = [];
|
||||
GVAR(currentGrid) = 0;
|
||||
|
||||
@ -21,19 +21,36 @@ if (!GVAR(extensionAvailable)) exitWith {
|
||||
};
|
||||
};
|
||||
*/
|
||||
[] call FUNC(initializeTerrainExtension);
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
["SettingsInitialized", {
|
||||
["ace_settingsInitialized", {
|
||||
//If not enabled, dont't add PFEH
|
||||
if (!GVAR(enabled)) exitWith {};
|
||||
|
||||
// Register fire event handler
|
||||
["firedPlayer", DFUNC(handleFired)] call EFUNC(common,addEventHandler);
|
||||
["firedPlayerNonLocal", DFUNC(handleFired)] call EFUNC(common,addEventHandler);
|
||||
//Run the terrain processor
|
||||
[] call FUNC(initializeTerrainExtension);
|
||||
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
// Register fire event handler
|
||||
["ace_firedPlayer", DFUNC(handleFired)] call CBA_fnc_addEventHandler;
|
||||
["ace_firedPlayerNonLocal", DFUNC(handleFired)] call CBA_fnc_addEventHandler;
|
||||
|
||||
//Add warnings for missing compat PBOs (only if AB is on)
|
||||
{
|
||||
_x params ["_modPBO", "_compatPBO"];
|
||||
if ((isClass (configFile >> "CfgPatches" >> _modPBO)) && {!isClass (configFile >> "CfgPatches" >> _compatPBO)}) then {
|
||||
WARNING_2("Weapon Mod [%1] missing ace compat pbo [%2] (from @ace\optionals)",_modPBO,_compatPBO);
|
||||
};
|
||||
} forEach [
|
||||
["RH_acc","ace_compat_rh_acc"],
|
||||
["RH_de_cfg","ace_compat_rh_de"],
|
||||
["RH_m4_cfg","ace_compat_rh_m4"],
|
||||
["RH_PDW","ace_compat_rh_pdw"],
|
||||
["RKSL_PMII","ace_compat_rksl_pm_ii"],
|
||||
["iansky_opt","ace_compat_sma3_iansky"],
|
||||
["R3F_Armes","ace_compat_r3f"]
|
||||
];
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
#ifdef DEBUG_MODE_FULL
|
||||
call FUNC(diagnoseWeapons);
|
||||
|
@ -2,12 +2,14 @@
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
name = COMPONENT_NAME;
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_ballistics", "ace_weather"};
|
||||
author[] = {"Ruthberg"};
|
||||
authorUrl = "https://github.com/ulteq";
|
||||
author = ECSTRING(common,ACETeam);
|
||||
authors[] = {"Ruthberg"};
|
||||
url = ECSTRING(main,URL);
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
@ -14,24 +14,22 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_muzzleVelocityShiftTableUpperLimit", "_temperatureIndexFunction",
|
||||
"_temperatureIndexA", "_temperatureIndexB", "_interpolationRatio"];
|
||||
params["_muzzleVelocityShiftTable", "_temperature"];
|
||||
params ["_muzzleVelocityShiftTable", "_temperature"];
|
||||
|
||||
// Check if muzzleVelocityShiftTable is Less Than 11 Entrys
|
||||
if ((count _muzzleVelocityShiftTable) < 11) exitWith {0};
|
||||
_muzzleVelocityShiftTableUpperLimit = _muzzleVelocityShiftTable select 10;
|
||||
private _muzzleVelocityShiftTableUpperLimit = _muzzleVelocityShiftTable select 10;
|
||||
if (isNil "_muzzleVelocityShiftTableUpperLimit") exitWith { 0 };
|
||||
|
||||
// Find exact data index required for given temperature
|
||||
_temperatureIndexFunction = (_temperature + 15) / 5;
|
||||
private _temperatureIndexFunction = (_temperature + 15) / 5;
|
||||
|
||||
// lower and upper data index used for interpolation
|
||||
_temperatureIndexA = (0 max (floor(_temperatureIndexFunction))) min 10;
|
||||
_temperatureIndexB = (0 max (ceil(_temperatureIndexFunction))) min 10;
|
||||
private _temperatureIndexA = (0 max (floor(_temperatureIndexFunction))) min 10;
|
||||
private _temperatureIndexB = (0 max (ceil(_temperatureIndexFunction))) min 10;
|
||||
|
||||
// Interpolation ratio
|
||||
_interpolationRatio = _temperatureIndexFunction - floor(_temperatureIndexFunction);
|
||||
private _interpolationRatio = _temperatureIndexFunction - floor(_temperatureIndexFunction);
|
||||
|
||||
// Interpolation
|
||||
(_muzzleVelocityShiftTable select _temperatureIndexA) * (1 - _interpolationRatio) + (_muzzleVelocityShiftTable select _temperatureIndexB) * _interpolationRatio // Return
|
||||
|
@ -17,11 +17,9 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private "_airDensity";
|
||||
|
||||
params ["_ballisticCoefficient", "_temperature"/*in C*/, "_pressure"/*in hPa*/, "_relativeHumidity"/*as ratio 0-1*/, "_atmosphereModel"/*"ICAO" or "ASM"*/];
|
||||
|
||||
_airDensity = [_temperature, _pressure, _relativeHumidity] call EFUNC(weather,calculateAirDensity);
|
||||
private _airDensity = [_temperature, _pressure, _relativeHumidity] call EFUNC(weather,calculateAirDensity);
|
||||
|
||||
if (_atmosphereModel == "ICAO") then {
|
||||
(STD_AIR_DENSITY_ICAO / _airDensity) * _ballisticCoefficient
|
||||
|
@ -19,14 +19,13 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_twist", "_length", "_stabilityFactor"];
|
||||
params ["_caliber", "_bulletLength", "_bulletMass", "_barrelTwist", "_muzzleVelocity", "_temperature", "_barometricPressure"];
|
||||
|
||||
// Source: http://www.jbmballistics.com/ballistics/bibliography/articles/miller_stability_1.pdf
|
||||
_twist = _barrelTwist / _caliber;
|
||||
_length = _bulletLength / _caliber;
|
||||
private _twist = _barrelTwist / _caliber;
|
||||
private _length = _bulletLength / _caliber;
|
||||
|
||||
_stabilityFactor = 7587000 * _bulletMass / (_twist^2 * _caliber^3 * _length * (1 + _length^2));
|
||||
private _stabilityFactor = 7587000 * _bulletMass / (_twist^2 * _caliber^3 * _length * (1 + _length^2));
|
||||
|
||||
if (_muzzleVelocity > 341.376) then {
|
||||
(_stabilityFactor * (_muzzleVelocity / 853.44) ^ (1/3)) * KELVIN(_temperature) / KELVIN(15) * 1013.25 / _barometricPressure
|
||||
|
@ -3,10 +3,10 @@
|
||||
*
|
||||
* Displays a protractor in the top left corner of the screen
|
||||
*
|
||||
* Argument:
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return value:
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
@ -43,13 +43,13 @@ GVAR(Protractor) = true;
|
||||
|
||||
__ctrl1 ctrlSetScale 1;
|
||||
__ctrl1 ctrlCommit 0;
|
||||
__ctrl1 ctrlSetText QUOTE(PATHTOF(UI\protractor.paa));
|
||||
__ctrl1 ctrlSetText QPATHTOF(UI\protractor.paa);
|
||||
__ctrl1 ctrlSetTextColor [1, 1, 1, 1];
|
||||
|
||||
__ctrl2 ctrlSetScale 1;
|
||||
__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 ctrlSetPosition [SafeZoneX + 0.001, SafeZoneY - 0.001 - 0.1074 * (-0.86 max ((ACE_player weaponDirection currentWeapon ACE_player) select 2) min 0.86), 0.2, 0.2 * 4/3];
|
||||
__ctrl2 ctrlCommit 0;
|
||||
__ctrl2 ctrlSetText QUOTE(PATHTOF(UI\protractor_marker.paa));
|
||||
__ctrl2 ctrlSetText QPATHTOF(UI\protractor_marker.paa);
|
||||
__ctrl2 ctrlSetTextColor [1, 1, 1, 1];
|
||||
|
||||
}, 0.1, []] call CBA_fnc_addPerFrameHandler;
|
||||
|
@ -12,26 +12,25 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private _aceTimeSecond = floor ACE_time;
|
||||
private _aceTimeSecond = floor CBA_missionTime;
|
||||
|
||||
{
|
||||
private ["_bulletVelocity", "_bulletPosition", "_bulletSpeed"];
|
||||
_x params["_bullet","_caliber","_bulletTraceVisible","_index"];
|
||||
_x params ["_bullet","_caliber","_bulletTraceVisible","_index"];
|
||||
|
||||
_bulletVelocity = velocity _bullet;
|
||||
private _bulletVelocity = velocity _bullet;
|
||||
|
||||
_bulletSpeed = vectorMagnitude _bulletVelocity;
|
||||
private _bulletSpeed = vectorMagnitude _bulletVelocity;
|
||||
|
||||
if (!alive _bullet || _bulletSpeed < 100) then {
|
||||
GVAR(allBullets) deleteAt (GVAR(allBullets) find _x);
|
||||
} else {
|
||||
_bulletPosition = getPosASL _bullet;
|
||||
private _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,"","",""];
|
||||
};
|
||||
|
||||
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]);
|
||||
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, CBA_missionTime - _aceTimeSecond]);
|
||||
};
|
||||
nil
|
||||
} count +GVAR(allBullets);
|
||||
|
@ -88,7 +88,7 @@ if (GVAR(ammoTemperatureEnabled) || GVAR(barrelLengthInfluenceEnabled)) then {
|
||||
|
||||
_bulletTraceVisible = false;
|
||||
if (GVAR(bulletTraceEnabled) && cameraView == "GUNNER") then {
|
||||
if (currentWeapon ACE_player in ["ACE_Vector", "Binocular", "Rangefinder", "Laserdesignator"]) then {
|
||||
if (currentWeapon ACE_player == binocular ACE_player) then {
|
||||
_bulletTraceVisible = true;
|
||||
} else {
|
||||
if (currentWeapon ACE_player == primaryWeapon ACE_player && count primaryWeaponItems ACE_player > 2) then {
|
||||
@ -110,8 +110,8 @@ if (_caliber > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) th
|
||||
|
||||
GVAR(currentbulletID) = (GVAR(currentbulletID) + 1) % 10000;
|
||||
|
||||
_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 _projectile, EGVAR(common,mapLatitude), EGVAR(weather,currentTemperature), EGVAR(common,mapAltitude), EGVAR(weather,currentHumidity), overcast, _aceTimeSecond, ACE_time - _aceTimeSecond];
|
||||
_aceTimeSecond = floor CBA_missionTime;
|
||||
"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 _projectile, EGVAR(common,mapLatitude), EGVAR(weather,currentTemperature), EGVAR(common,mapAltitude), EGVAR(weather,currentHumidity), overcast, _aceTimeSecond, CBA_missionTime - _aceTimeSecond];
|
||||
|
||||
GVAR(allBullets) pushBack [_projectile, _caliber, _bulletTraceVisible, GVAR(currentbulletID)];
|
||||
|
||||
|
@ -18,13 +18,14 @@ if (!GVAR(extensionAvailable)) exitWith {};
|
||||
|
||||
private ["_initStartTime", "_mapSize", "_mapGrids", "_gridCells", "_x", "_y", "_gridCenter", "_gridHeight", "_gridNumObjects", "_gridSurfaceIsWater"];
|
||||
|
||||
_initStartTime = ACE_time;
|
||||
_initStartTime = CBA_missionTime;
|
||||
_mapSize = getNumber (configFile >> "CfgWorlds" >> worldName >> "MapSize");
|
||||
|
||||
if (("ace_advanced_ballistics" callExtension format["init:%1:%2", worldName, _mapSize]) == "Terrain already initialized") exitWith {
|
||||
INFO_1("Terrain already initialized [world: %1]", worldName);
|
||||
#ifdef DEBUG_MODE_FULL
|
||||
systemChat "AdvancedBallistics: Terrain already initialized";
|
||||
#endIf
|
||||
#endif
|
||||
};
|
||||
|
||||
_mapGrids = ceil(_mapSize / 50) + 1;
|
||||
@ -32,13 +33,16 @@ _gridCells = _mapGrids * _mapGrids;
|
||||
|
||||
GVAR(currentGrid) = 0;
|
||||
|
||||
INFO_2("Starting Terrain Extension [cells: %1] [world: %2]", _gridCells, worldName);
|
||||
|
||||
[{
|
||||
params ["_args","_idPFH"];
|
||||
_args params ["_mapGrids", "_gridCells", "_initStartTime"];
|
||||
|
||||
if (GVAR(currentGrid) >= _gridCells) exitWith {
|
||||
INFO_2("Finished terrain initialization in %1 seconds [world: %2]", ceil(CBA_missionTime - _initStartTime), worldName);
|
||||
#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(CBA_missionTime - _initStartTime)];
|
||||
#endif
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
@ -59,7 +59,7 @@ if ((_typicalSpeed > 0) && {_typicalSpeed < 360}) then {
|
||||
if (_inheritedBarrelConfig || _inheritedTempConfig) then {
|
||||
private _parentConfig = inheritsFrom _ammoConfig;
|
||||
private _parentSpeed = getNumber (_parentConfig >> "typicalSpeed");
|
||||
ACE_LOGWARNING_4("Subsonic Ammo %1 (%2 m/s) missing `ACE_muzzleVelocities` or `ACE_ammoTempMuzzleVelocityShifts` configs, attempting to use parent %3 (%4m/s)",_this,_typicalSpeed,configName _parentConfig, _parentSpeed);
|
||||
WARNING_4("Subsonic Ammo %1 (%2 m/s) missing `ACE_muzzleVelocities` or `ACE_ammoTempMuzzleVelocityShifts` configs, attempting to use parent %3 (%4m/s)",_this,_typicalSpeed,configName _parentConfig, _parentSpeed);
|
||||
if (_parentSpeed <= 0) exitWith {//Handle weird or null parent
|
||||
_muzzleVelocityTable = [];
|
||||
_ammoTempMuzzleVelocityShifts = [];
|
||||
|
@ -15,11 +15,10 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_weaponConfig", "_barrelTwist", "_twistDirection", "_barrelLength", "_result"];
|
||||
_weaponConfig = (configFile >> "CfgWeapons" >> _this);
|
||||
private _weaponConfig = (configFile >> "CfgWeapons" >> _this);
|
||||
|
||||
_barrelTwist = getNumber(_weaponConfig >> "ACE_barrelTwist");
|
||||
_twistDirection = 1;
|
||||
private _barrelTwist = getNumber(_weaponConfig >> "ACE_barrelTwist");
|
||||
private _twistDirection = 1;
|
||||
if (isNumber (_weaponConfig >> "ACE_twistDirection")) then {
|
||||
_twistDirection = getNumber (_weaponConfig >> "ACE_twistDirection");
|
||||
if !(_twistDirection in [-1, 0, 1]) then {
|
||||
@ -27,9 +26,9 @@ if (isNumber (_weaponConfig >> "ACE_twistDirection")) then {
|
||||
};
|
||||
};
|
||||
|
||||
_barrelLength = getNumber(_weaponConfig >> "ACE_barrelLength");
|
||||
private _barrelLength = getNumber(_weaponConfig >> "ACE_barrelLength");
|
||||
|
||||
_result = [_barrelTwist, _twistDirection, _barrelLength];
|
||||
private _result = [_barrelTwist, _twistDirection, _barrelLength];
|
||||
|
||||
uiNamespace setVariable [format[QGVAR(%1), _weapon], _result];
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
#define COMPONENT advanced_ballistics
|
||||
#define COMPONENT_BEAUTIFIED Advanced Ballistics
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
// #define DEBUG_MODE_FULL
|
||||
// #define DISABLE_COMPILE_CACHE
|
||||
// #define CBA_DEBUG_SYNCHRONOUS
|
||||
// #define ENABLE_PERFORMANCE_COUNTERS
|
||||
|
||||
#ifdef DEBUG_ENABLED_ADVANCEDBALLISTICS
|
||||
|
@ -12,6 +12,7 @@
|
||||
<Hungarian>Széladatok mutatása</Hungarian>
|
||||
<Czech>Zobrazit údaje o větru</Czech>
|
||||
<Portuguese>Mostrar Informação do Vento</Portuguese>
|
||||
<Japanese>風の情報を表示</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Ballistics_ProtractorKey">
|
||||
<English>Show Protractor</English>
|
||||
@ -24,6 +25,7 @@
|
||||
<Hungarian>Szögmérő mutatása</Hungarian>
|
||||
<Czech>Zobrazit úhloměr</Czech>
|
||||
<Portuguese>Mostrar Transferidor</Portuguese>
|
||||
<Japanese>分度器を表示</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Ballistics_DisplayName">
|
||||
<English>Advanced Ballistics</English>
|
||||
@ -36,6 +38,7 @@
|
||||
<Hungarian>Fejlett ballisztika</Hungarian>
|
||||
<Russian>Продвинутая баллистика</Russian>
|
||||
<Italian>Balistica Avanzata</Italian>
|
||||
<Japanese>アドバンスド バリスティックス</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Ballistics_enabled_DisplayName">
|
||||
<English>Advanced Ballistics</English>
|
||||
@ -48,6 +51,7 @@
|
||||
<Hungarian>Fejlett ballisztika</Hungarian>
|
||||
<Russian>Продвинутая баллистика</Russian>
|
||||
<Italian>Balistica Avanzata</Italian>
|
||||
<Japanese>アドバンスド バリスティックス</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Ballistics_enabled_Description">
|
||||
<English>Enables advanced ballistics</English>
|
||||
@ -60,6 +64,7 @@
|
||||
<Hungarian>Engedélyezi a fejlett ballisztikát</Hungarian>
|
||||
<Russian>Включает продвинутую баллистику</Russian>
|
||||
<Italian>Abilita Balistica Avanzata</Italian>
|
||||
<Japanese>アドバンスド バリスティックスを有効化</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Ballistics_simulateForSnipers_DisplayName">
|
||||
<English>Enabled For Snipers</English>
|
||||
@ -68,10 +73,11 @@
|
||||
<German>Für Scharfschützen aktiviert</German>
|
||||
<Czech>Povoleno pro odstřelovače</Czech>
|
||||
<Portuguese>Ativar para caçadores</Portuguese>
|
||||
<French>Activer pour les snipers</French>
|
||||
<French>Activé pour les snipers</French>
|
||||
<Hungarian>Mesterlövészeknek engedélyezve</Hungarian>
|
||||
<Russian>Включена для снайперов</Russian>
|
||||
<Italian>Abilita per Tiratori Scelti</Italian>
|
||||
<Japanese>狙撃手へ有効化</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Ballistics_simulateForSnipers_Description">
|
||||
<English>Enables advanced ballistics for non local snipers (when using high power optics)</English>
|
||||
@ -84,6 +90,7 @@
|
||||
<Hungarian>Engedélyezi a fejlett ballisztikát nem-helyi mesterlövészeknek (nagy-teljesítményű optika használatakor)</Hungarian>
|
||||
<Russian>Включает продвинутую баллистику для нелокальных снайперов (при использовании мощной оптики)</Russian>
|
||||
<Italian>Abilita Balistica Avanzata per Tiratori Scelti non locali (con ottiche ad alto potenziale)</Italian>
|
||||
<Japanese>非ローカルの狙撃手 (高倍率スコープを使っている場合)へアドバンスド バリスティックスを有効化します</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Ballistics_simulateForGroupMembers_DisplayName">
|
||||
<English>Enabled For Group Members</English>
|
||||
@ -92,10 +99,11 @@
|
||||
<German>Für Gruppenmitglieder aktiviert</German>
|
||||
<Czech>Povoleno pro členy skupiny</Czech>
|
||||
<Portuguese>Ativada para membros do grupo</Portuguese>
|
||||
<French>Activer pour les membres groupés</French>
|
||||
<French>Activé pour les membres groupés</French>
|
||||
<Hungarian>Csoporttagoknak engedélyezve</Hungarian>
|
||||
<Russian>Включена для группы</Russian>
|
||||
<Italian>Abilita per Membri del Gruppo</Italian>
|
||||
<Japanese>グループ メンバーへ有効化</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Ballistics_simulateForGroupMembers_Description">
|
||||
<English>Enables advanced ballistics for non local group members</English>
|
||||
@ -104,10 +112,11 @@
|
||||
<German>Aktiviert die erweiterte Ballistik für nicht lokale Gruppenmitglieder</German>
|
||||
<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>
|
||||
<French>Active la balistique avancée pour les membres groupés non locaux</French>
|
||||
<French>Active la balistique avancée pour les membres du groupe non locaux</French>
|
||||
<Hungarian>Engedélyezi a fejlett ballisztikát nem-helyi csoporttagoknak</Hungarian>
|
||||
<Russian>Включает продвинутую баллистику для нелокальных членов группы</Russian>
|
||||
<Italian>Abilita Balistica Avanzata per Membri non locali del Gruppo</Italian>
|
||||
<Japanese>非ローカルのグループ メンバーへアドバンスド バリスティックスを有効化します</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Ballistics_simulateForEveryone_DisplayName">
|
||||
<English>Enabled For Everyone</English>
|
||||
@ -116,10 +125,11 @@
|
||||
<German>Für jeden aktiviert</German>
|
||||
<Czech>Povoleno pro všechny</Czech>
|
||||
<Portuguese>Ativada para todos</Portuguese>
|
||||
<French>Activer pour tout le monde</French>
|
||||
<French>Activé pour tout le monde</French>
|
||||
<Hungarian>Mindenkinek engedélyezve</Hungarian>
|
||||
<Russian>Включена для всех</Russian>
|
||||
<Italian>Abilita per tutti</Italian>
|
||||
<Japanese>全員に有効化</Japanese>
|
||||
</Key>
|
||||
<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>
|
||||
@ -128,10 +138,11 @@
|
||||
<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>Aktivuje pokročilou balistiku pro všechny nelokální hráče (aktivace této možnosti způsobuje pokles FPS během velké 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>
|
||||
<French>Active la balistique avancé pour tous les joueurs non locaux (activer cette option peut avoir un impact sur les performance en multi durant les grands échanges de tirs)</French>
|
||||
<French>Active la balistique avancée pour tous les joueurs non locaux (activer cette option peut avoir un impact sur les performance en multi durant les grands échanges de tirs)</French>
|
||||
<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>
|
||||
<Russian>Включает продвинутую баллистику для всех нелокальных игроков (включение этой опции может снизить производительность при массовых перестрелках в мультиплеере)</Russian>
|
||||
<Italian>Abilita Balistica Avanzata per tutti i giocatori non locali (abilitare questo parametro potrebbe degradare le prestazioni durante scontri intensi in multiplayer)</Italian>
|
||||
<Japanese>非ローカルの全プレイヤーへアドバンスド バリスティックスを有効化します (マルチプレイで大規模な銃撃戦がおこなわれると、動作の低下を招きます)</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Ballistics_alwaysSimulateForGroupMembers_DisplayName">
|
||||
<English>Always Enabled For Group Members</English>
|
||||
@ -140,10 +151,11 @@
|
||||
<German>Für Gruppenmitglieder immer aktiviert</German>
|
||||
<Czech>Vždy povoleno pro členy skupiny</Czech>
|
||||
<Portuguese>Sempre ativada para membros do grupo</Portuguese>
|
||||
<French>Toujours activer pour les membres groupés</French>
|
||||
<French>Toujours activer pour les membres du groupe</French>
|
||||
<Hungarian>Mindig engedélyezve csoporttagoknak</Hungarian>
|
||||
<Russian>Всегда включена для членов группы</Russian>
|
||||
<Italian>Sempre abilitato per Membri del Gruppo</Italian>
|
||||
<Japanese>常にグループ メンバーへ有効化</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Ballistics_alwaysSimulateForGroupMembers_Description">
|
||||
<English>Always enables advanced ballistics when a group member fires</English>
|
||||
@ -156,6 +168,7 @@
|
||||
<Hungarian>Mindig engedélyezi a fejlett ballisztikát, ha egy csoporttag tüzel</Hungarian>
|
||||
<Russian>Всегда включает продвинутую баллистику когда стреляет член группы</Russian>
|
||||
<Italian>Abilita sempre Balistica Avanzata quando un Membro del Gruppo spara</Italian>
|
||||
<Japanese>グループ メンバーが射撃した時、常にアドバンスド バリスティックスを有効化します</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Ballistics_disabledInFullAutoMod_DisplayName">
|
||||
<English>Disabled In FullAuto Mode</English>
|
||||
@ -164,10 +177,11 @@
|
||||
<German>Beim vollautomatischen Feuern deaktiviert</German>
|
||||
<Czech>Zakázáno v automatickém režimu střelby</Czech>
|
||||
<Portuguese>Desabilitar no modo automático</Portuguese>
|
||||
<French>Désactiver en mode rafale libre</French>
|
||||
<French>Désactiver en mode automatique</French>
|
||||
<Hungarian>Automata módban letiltva</Hungarian>
|
||||
<Russian>Выкл. для автомат. режима</Russian>
|
||||
<Italian>Disabilita in modalità di fuoco automatico</Italian>
|
||||
<Japanese>フルオートでは無効化</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Ballistics_disabledInFullAutoMod_Description">
|
||||
<English>Disables the advanced ballistics during full auto fire</English>
|
||||
@ -176,10 +190,11 @@
|
||||
<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>
|
||||
<Portuguese>Desabilitar a balística avançada durante fogo automático</Portuguese>
|
||||
<French>Désactive la balistique avancée pour les tirs en rafale libre</French>
|
||||
<French>Désactive la balistique avancée pour les tirs en automatique</French>
|
||||
<Hungarian>Letiltja a fejlett ballisztikát automata tüzelés folyamán</Hungarian>
|
||||
<Russian>Выключает продвинутую баллистику при стрельбе в полностью автоматическом режиме</Russian>
|
||||
<Italian>Disabilita Balistica Avanzata durante fuoco automatico</Italian>
|
||||
<Japanese>フルオートで射撃中ではアドバンスド バリスティックスを無効化します</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Ballistics_ammoTemperatureEnabled_DisplayName">
|
||||
<English>Enable Ammo Temperature Simulation</English>
|
||||
@ -188,10 +203,11 @@
|
||||
<German>Simulation der Munitionstemperatur aktivieren</German>
|
||||
<Czech>Povolit simulaci teploty munice</Czech>
|
||||
<Portuguese>Ativar simulação de temperatura de munição</Portuguese>
|
||||
<French>Activer la simulation de la température</French>
|
||||
<French>Active la simulation de la température</French>
|
||||
<Hungarian>Lőszer-hő szimuláció engedélyezése</Hungarian>
|
||||
<Russian>Симуляция температуры для боеприпасов</Russian>
|
||||
<Italian>Abilita simulazione della temperatura delle munizioni</Italian>
|
||||
<Japanese>弾薬の温度シミュレーションを有効化</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Ballistics_ammoTemperatureEnabled_Description">
|
||||
<English>Muzzle velocity varies with ammo temperature</English>
|
||||
@ -204,6 +220,7 @@
|
||||
<Hungarian>A kezdősebesség a lőszer hőmérsékletétől függően változó</Hungarian>
|
||||
<Russian>Начальная скорость пули зависит от температуры</Russian>
|
||||
<Italian>Velocità alla volata varia con la temperatura delle munizioni</Italian>
|
||||
<Japanese>弾薬の温度により初速値を変化させます</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Ballistics_barrelLengthInfluenceEnabled_DisplayName">
|
||||
<English>Enable Barrel Length Simulation</English>
|
||||
@ -216,6 +233,7 @@
|
||||
<Hungarian>Csőhossz-szimuláció engedélyezése</Hungarian>
|
||||
<Russian>Симуляция длины ствола</Russian>
|
||||
<Italian>Abilita simulazione della lunghezza della canna</Italian>
|
||||
<Japanese>銃身長のシミュレーションを有効化</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Ballistics_barrelLengthInfluenceEnabled_Description">
|
||||
<English>Muzzle velocity varies with barrel length</English>
|
||||
@ -228,6 +246,7 @@
|
||||
<Hungarian>A kezdősebesség a cső hosszától függően változó</Hungarian>
|
||||
<Russian>Начальная скорость пули зависит от длины ствола</Russian>
|
||||
<Italian>Velocità alla volata varia con la lunghezza della canna</Italian>
|
||||
<Japanese>銃身長により初速値を変化させます</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Ballistics_bulletTraceEnabled_DisplayName">
|
||||
<English>Enable Bullet Trace Effect</English>
|
||||
@ -236,10 +255,11 @@
|
||||
<German>Geschossspureffekt aktivieren</German>
|
||||
<Czech>Povolit efekt trasírek</Czech>
|
||||
<Portuguese>Ativa efeito traçante de projétil</Portuguese>
|
||||
<French>Activer l'effet traçante</French>
|
||||
<French>Activer l'effet balle traçante</French>
|
||||
<Hungarian>Nyomkövető-effekt engedélyezése</Hungarian>
|
||||
<Russian>Следы пуль</Russian>
|
||||
<Italian>Abilita effetto di tracciatura dei proiettili</Italian>
|
||||
<Japanese>弾丸の痕跡表示を有効化</Japanese>
|
||||
</Key>
|
||||
<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>
|
||||
@ -252,6 +272,7 @@
|
||||
<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>
|
||||
<Russian>Включает эффект следов пуль для больших калибров (видны только через мощную оптику)</Russian>
|
||||
<Italian>Abilita effetto di tracciatura per proiettili di alto calibro (visibile solo attraverso ottiche ad alto potenziale)</Italian>
|
||||
<Japanese>大口径の銃弾による弾丸の痕跡表示を有効化します (高倍率スコープを介してでしか見れません)</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Ballistics_simulationInterval_DisplayName">
|
||||
<English>Simulation Interval</English>
|
||||
@ -264,6 +285,7 @@
|
||||
<Hungarian>Szimuláció intervalluma</Hungarian>
|
||||
<Russian>Интервал симуляции</Russian>
|
||||
<Italian>Intervallo Simulazione</Italian>
|
||||
<Japanese>シミュレーション間隔</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Ballistics_simulationInterval_Description">
|
||||
<English>Defines the interval between every calculation step</English>
|
||||
@ -272,10 +294,11 @@
|
||||
<German>Legt das Intervall zwischen den Berechnungsschritten fest</German>
|
||||
<Czech>Určuje interval mezi každým výpočtem</Czech>
|
||||
<Portuguese>Define o intervalo entre cada cálculo</Portuguese>
|
||||
<French>Défini un intervalle de calcul entre deux simulations</French>
|
||||
<French>Définit un intervalle de calcul entre deux simulations</French>
|
||||
<Hungarian>Meghatározza a számítási lépések közötti időintervallumot</Hungarian>
|
||||
<Russian>Определяет временной интервал между вычислениями</Russian>
|
||||
<Italian>Definisce l'intervallo tra ogni step di calcolo</Italian>
|
||||
<Japanese>各計算ごとの間隔を定義します</Japanese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Ballistics_simulationRadius_DisplayName">
|
||||
<English>Simulation Radius</English>
|
||||
@ -288,6 +311,7 @@
|
||||
<Hungarian>Szimuláció hatóköre</Hungarian>
|
||||
<Russian>Радиус симуляции</Russian>
|
||||
<Italian>Raggio Simulazione</Italian>
|
||||
<Japanese>シミュレーションの適用範囲</Japanese>
|
||||
</Key>
|
||||
<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>
|
||||
@ -296,10 +320,11 @@
|
||||
<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>
|
||||
<Portuguese>Define o raio ao redor do jogador (em metros) onde a balística avançada será aplicada aos projéteis</Portuguese>
|
||||
<French>Défini le rayon autour du joueur (en mètres) d'application de la balistique avancée</French>
|
||||
<French>Définit le rayon autour du joueur (en mètres) d'application de la balistique avancée</French>
|
||||
<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>
|
||||
<Russian>Определяет радиус вокруг игрока (в метрах), в котором продвинутая баллистика применяется к снарядам</Russian>
|
||||
<Italian>Definisce il raggio attorno al giocatore (in metri) per cui la Balistica Avanzata è applicata ai proiettili</Italian>
|
||||
<Japanese>プレイヤーの周囲にアドバンスド バリスティックスによる弾道を適用させる範囲を半径で定義します (メートル)</Japanese>
|
||||
</Key>
|
||||
<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>
|
||||
@ -307,11 +332,12 @@
|
||||
<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>
|
||||
<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>
|
||||
<French>Ce module active la simulation de balistique avancée - ie les projectiles sont influencé par des varibles comme le vent, la température, la pression atmosphérique, l'humidité, la gravité, le type de munition et l'arme avec laquelles ils sont tirés.</French>
|
||||
<French>Ce module active la simulation de balistique avancée - les projectiles sont influencés par des variables comme le vent, la température, la pression atmosphérique, l'humidité, la gravité, le type de munition et l'arme avec laquelles ils sont tirés.</French>
|
||||
<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>
|
||||
<Russian>Этот модуль включает симуляцию продвинутой баллистики - при этом на траекторию полета снаряда влияют различные параметры, такие как температура воздуха, атмосферное давление, влажность, гравитация, тип боеприпаса и оружия, из которого произвели выстрел.</Russian>
|
||||
<Spanish>Este módulo permite la simulación balística avanzada - es decir, la trayectoria de los proyectiles está influenciada por variables como la temperatura del aire, la presión atmosférica, la humedad, la gravedad, el tipo de municiones y el arma desde el que fue disparada.</Spanish>
|
||||
<Italian>Questo modulo abilita la simulazione della Balistica Avanzata - cioè la traiettoria dei proiettili è influenzata da variabili come la temperatura dell'aria, pressione atmosferica, umidità, gravità, il tipo di munizione e l'arma da cui è sparata</Italian>
|
||||
<Japanese>このモジュールはアドバンスド バリスティックスを有効化します。弾道は気温や気圧、湿度、重力、弾薬の種類、発射する武器から影響を受けるようになります。</Japanese>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
1
addons/advanced_fatigue/$PBOPREFIX$
Normal file
1
addons/advanced_fatigue/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\advanced_fatigue
|
45
addons/advanced_fatigue/ACE_Settings.hpp
Normal file
45
addons/advanced_fatigue/ACE_Settings.hpp
Normal file
@ -0,0 +1,45 @@
|
||||
class ACE_Settings {
|
||||
class GVAR(enabled) {
|
||||
category = "Advanced Fatigue";
|
||||
displayName = CSTRING(Enabled);
|
||||
description = CSTRING(Enabled_Description);
|
||||
typeName = "BOOL";
|
||||
value = 1;
|
||||
};
|
||||
class GVAR(enableStaminaBar) {
|
||||
category = "Advanced Fatigue";
|
||||
displayName = CSTRING(EnableStaminaBar);
|
||||
description = CSTRING(EnableStaminaBar_Description);
|
||||
typeName = "BOOL";
|
||||
value = 1;
|
||||
isClientSettable = 1;
|
||||
};
|
||||
class GVAR(performanceFactor) {
|
||||
category = "Advanced Fatigue";
|
||||
displayName = CSTRING(PerformanceFactor);
|
||||
description = CSTRING(PerformanceFactor_Description);
|
||||
typeName = "SCALAR";
|
||||
value = 1;
|
||||
};
|
||||
class GVAR(recoveryFactor) {
|
||||
category = "Advanced Fatigue";
|
||||
displayName = CSTRING(RecoveryFactor);
|
||||
description = CSTRING(RecoveryFactor_Description);
|
||||
typeName = "SCALAR";
|
||||
value = 1;
|
||||
};
|
||||
class GVAR(loadFactor) {
|
||||
category = "Advanced Fatigue";
|
||||
displayName = CSTRING(LoadFactor);
|
||||
description = CSTRING(LoadFactor_Description);
|
||||
typeName = "SCALAR";
|
||||
value = 1;
|
||||
};
|
||||
class GVAR(terrainGradientFactor) {
|
||||
category = "Advanced Fatigue";
|
||||
displayName = CSTRING(TerrainGradientFactor);
|
||||
description = CSTRING(TerrainGradientFactor_Description);
|
||||
typeName = "SCALAR";
|
||||
value = 1;
|
||||
};
|
||||
};
|
28
addons/advanced_fatigue/CfgEden.hpp
Normal file
28
addons/advanced_fatigue/CfgEden.hpp
Normal file
@ -0,0 +1,28 @@
|
||||
class Cfg3DEN {
|
||||
class Attributes {
|
||||
class Slider;
|
||||
class GVAR(slider): Slider {
|
||||
attributeLoad = "params [""_ctrlGroup""]; private _slider = _ctrlGroup controlsGroupCtrl 100; private _edit = _ctrlGroup controlsGroupCtrl 101; _slider sliderSetPosition _value; _edit ctrlSetText ([_value, 1, 1] call CBA_fnc_formatNumber); ";
|
||||
attributeSave = "params [""_ctrlGroup""]; sliderPosition (_ctrlGroup controlsGroupCtrl 100); ";
|
||||
onLoad = "params [""_ctrlGroup""]; private _slider = _ctrlGroup controlsGroupCtrl 100; private _edit = _ctrlGroup controlsGroupCtrl 101; _slider sliderSetRange [0, 2]; _slider ctrlAddEventHandler [""SliderPosChanged"", { params [""_slider""]; private _edit = (ctrlParentControlsGroup _slider) controlsGroupCtrl 101; private _value = sliderPosition _slider; _edit ctrlSetText ([_value, 1, 1] call CBA_fnc_formatNumber); }]; _edit ctrlAddEventHandler [""KillFocus"", { params [""_edit""]; private _slider = (ctrlParentControlsGroup _edit) controlsGroupCtrl 100; private _value = ((parseNumber ctrlText _edit) min 2) max 0; _slider sliderSetPosition _value; _edit ctrlSetText str _value; }];";
|
||||
};
|
||||
};
|
||||
class Object {
|
||||
class AttributeCategories {
|
||||
class ace_attributes {
|
||||
class Attributes {
|
||||
class GVAR(performanceFactor) {
|
||||
property = QGVAR(performanceFactor);
|
||||
control = QGVAR(slider);
|
||||
displayName = CSTRING(PerformanceFactor);
|
||||
tooltip = CSTRING(PerformanceFactor_EdenDescription);
|
||||
expression = QUOTE(_this setVariable [ARR_3(QQGVAR(performanceFactor),_value,true)]);
|
||||
typeName = "NUMBER";
|
||||
condition = "objectControllable";
|
||||
defaultValue = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
23
addons/advanced_fatigue/CfgEventHandlers.hpp
Normal file
23
addons/advanced_fatigue/CfgEventHandlers.hpp
Normal file
@ -0,0 +1,23 @@
|
||||
class Extended_PreStart_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preStart));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_DisplayLoad_EventHandlers {
|
||||
class RscDisplayMission {
|
||||
ADDON = QUOTE(call FUNC(createStaminaBar));
|
||||
};
|
||||
};
|
62
addons/advanced_fatigue/CfgMovesMaleSdr.hpp
Normal file
62
addons/advanced_fatigue/CfgMovesMaleSdr.hpp
Normal file
@ -0,0 +1,62 @@
|
||||
class CfgMovesBasic;
|
||||
class CfgMovesMaleSdr: CfgMovesBasic {
|
||||
class States {
|
||||
// Jog speed adjustment: 12km/h
|
||||
class AmovPercMstpSlowWrflDnon;
|
||||
class AmovPercMrunSlowWrflDf: AmovPercMstpSlowWrflDnon {
|
||||
speed = 0.634570;
|
||||
};
|
||||
class AmovPercMrunSlowWrflDfl: AmovPercMrunSlowWrflDf {
|
||||
speed = 0.634570;
|
||||
};
|
||||
class AmovPercMrunSlowWrflDl: AmovPercMrunSlowWrflDfl {
|
||||
speed = 0.691626;
|
||||
};
|
||||
class AmovPercMrunSlowWrflDr: AmovPercMrunSlowWrflDfl {
|
||||
speed = 0.727404;
|
||||
};
|
||||
|
||||
// Jog + raised weapon speed adjustment: 13km/h
|
||||
class AmovPercMstpSrasWrflDnon;
|
||||
class AmovPercMrunSrasWrflDf: AmovPercMstpSrasWrflDnon {
|
||||
speed = 0.677068;
|
||||
};
|
||||
|
||||
// Tactical Jog animation replacement and speed adjustment: 10km/h
|
||||
class AmovPercMwlkSlowWrflDf_ver2;
|
||||
class AmovPercMwlkSlowWrflDfl_ver2;
|
||||
class AmovPercMtacSlowWrflDf_ver2: AmovPercMwlkSlowWrflDf_ver2 {
|
||||
speed = 0.528808;
|
||||
file = "\A3\anims_f\Data\Anim\Sdr\Mov\Erc\run\low\Rfl\AmovPercMrunSlowWrflDf";
|
||||
};
|
||||
class AmovPercMtacSlowWrflDfl_ver2: AmovPercMwlkSlowWrflDfl_ver2 {
|
||||
speed = 0.528808;
|
||||
file = "\A3\anims_f\Data\Anim\Sdr\Mov\Erc\run\low\Rfl\AmovPercMrunSlowWrflDfl";
|
||||
};
|
||||
class AmovPercMtacSlowWrflDfr_ver2: AmovPercMtacSlowWrflDf_ver2 {
|
||||
speed = 0.528808;
|
||||
file = "\A3\anims_f\Data\Anim\Sdr\Mov\Erc\run\low\Rfl\AmovPercMrunSlowWrflDfr";
|
||||
};
|
||||
class AmovPercMtacSlowWrflDr_ver2: AmovPercMtacSlowWrflDf_ver2 {
|
||||
speed = 0.528808;
|
||||
file = "\A3\anims_f\Data\Anim\Sdr\Mov\Erc\run\low\Rfl\AmovPercMrunSlowWrflDr";
|
||||
};
|
||||
class AmovPercMtacSlowWrflDl_ver2: AmovPercMtacSlowWrflDf_ver2 {
|
||||
speed = 0.528808;
|
||||
file = "\A3\anims_f\Data\Anim\Sdr\Mov\Erc\run\low\Rfl\AmovPercMrunSlowWrflDl";
|
||||
};
|
||||
class AmovPercMtacSlowWrflDb_ver2: AmovPercMtacSlowWrflDf_ver2 {
|
||||
speed = 0.684541;
|
||||
file = "\A3\anims_f\Data\Anim\Sdr\Mov\Erc\run\low\Rfl\AmovPercMrunSlowWrflDb";
|
||||
soundEdge[] = {0.25,0.5,0.75,1};
|
||||
};
|
||||
class AmovPercMtacSlowWrflDbl_ver2: AmovPercMtacSlowWrflDb_ver2 {
|
||||
speed = 0.684541;
|
||||
file = "\A3\anims_f\Data\Anim\Sdr\Mov\Erc\run\low\Rfl\AmovPercMrunSlowWrflDbl";
|
||||
};
|
||||
class AmovPercMtacSlowWrflDbr_ver2: AmovPercMtacSlowWrflDb_ver2 {
|
||||
speed = 0.684541;
|
||||
file = "\A3\anims_f\Data\Anim\Sdr\Mov\Erc\run\low\Rfl\AmovPercMrunSlowWrflDbr";
|
||||
};
|
||||
};
|
||||
};
|
76
addons/advanced_fatigue/CfgSounds.hpp
Normal file
76
addons/advanced_fatigue/CfgSounds.hpp
Normal file
@ -0,0 +1,76 @@
|
||||
class CfgSounds {
|
||||
class GVAR(breathLow0) {
|
||||
sound[] = {"A3\sounds_f\characters\human-sfx\P04\Breath_Low_1", 0.6, 1, 7};
|
||||
titles[] = {};
|
||||
};
|
||||
class GVAR(breathLow1) {
|
||||
sound[] = {"A3\sounds_f\characters\human-sfx\P04\Breath_Low_2", 0.6, 1, 7};
|
||||
titles[] = {};
|
||||
};
|
||||
class GVAR(breathLow2) {
|
||||
sound[] = {"A3\sounds_f\characters\human-sfx\P04\Breath_Low_3", 0.6, 1, 7};
|
||||
titles[] = {};
|
||||
};
|
||||
class GVAR(breathLow3) {
|
||||
sound[] = {"A3\sounds_f\characters\human-sfx\P04\Breath_Low_4", 0.6, 1, 7};
|
||||
titles[] = {};
|
||||
};
|
||||
class GVAR(breathLow4) {
|
||||
sound[] = {"A3\sounds_f\characters\human-sfx\P04\Breath_Low_5", 0.6, 1, 7};
|
||||
titles[] = {};
|
||||
};
|
||||
class GVAR(breathLow5) {
|
||||
sound[] = {"A3\sounds_f\characters\human-sfx\P04\Breath_Low_6", 0.6, 1, 7};
|
||||
titles[] = {};
|
||||
};
|
||||
|
||||
class GVAR(breathMid0) {
|
||||
sound[] = {"A3\sounds_f\characters\human-sfx\P04\Breath_Mid_1", 0.8, 1, 13};
|
||||
titles[] = {};
|
||||
};
|
||||
class GVAR(breathMid1) {
|
||||
sound[] = {"A3\sounds_f\characters\human-sfx\P04\Breath_Mid_2", 0.8, 1, 13};
|
||||
titles[] = {};
|
||||
};
|
||||
class GVAR(breathMid2) {
|
||||
sound[] = {"A3\sounds_f\characters\human-sfx\P04\Breath_Mid_3", 0.8, 1, 13};
|
||||
titles[] = {};
|
||||
};
|
||||
class GVAR(breathMid3) {
|
||||
sound[] = {"A3\sounds_f\characters\human-sfx\P04\Breath_Mid_4", 0.8, 1, 13};
|
||||
titles[] = {};
|
||||
};
|
||||
class GVAR(breathMid4) {
|
||||
sound[] = {"A3\sounds_f\characters\human-sfx\P04\Breath_Mid_5", 0.8, 1, 13};
|
||||
titles[] = {};
|
||||
};
|
||||
class GVAR(breathMid5) {
|
||||
sound[] = {"A3\sounds_f\characters\human-sfx\P04\Breath_Mid_6", 0.8, 1, 13};
|
||||
titles[] = {};
|
||||
};
|
||||
|
||||
class GVAR(breathMax0) {
|
||||
sound[] = {"A3\sounds_f\characters\human-sfx\P04\Breath_Max_1", 1, 1, 17};
|
||||
titles[] = {};
|
||||
};
|
||||
class GVAR(breathMax1) {
|
||||
sound[] = {"A3\sounds_f\characters\human-sfx\P04\Breath_Max_2", 1, 1, 17};
|
||||
titles[] = {};
|
||||
};
|
||||
class GVAR(breathMax2) {
|
||||
sound[] = {"A3\sounds_f\characters\human-sfx\P04\Breath_Max_3", 1, 1, 17};
|
||||
titles[] = {};
|
||||
};
|
||||
class GVAR(breathMax3) {
|
||||
sound[] = {"A3\sounds_f\characters\human-sfx\P04\Breath_Max_4", 1, 1, 17};
|
||||
titles[] = {};
|
||||
};
|
||||
class GVAR(breathMax4) {
|
||||
sound[] = {"A3\sounds_f\characters\human-sfx\P04\Breath_Max_5", 1, 1, 17};
|
||||
titles[] = {};
|
||||
};
|
||||
class GVAR(breathMax5) {
|
||||
sound[] = {"A3\sounds_f\characters\human-sfx\P04\Breath_Max_6", 1, 1, 17};
|
||||
titles[] = {};
|
||||
};
|
||||
};
|
45
addons/advanced_fatigue/CfgVehicles.hpp
Normal file
45
addons/advanced_fatigue/CfgVehicles.hpp
Normal file
@ -0,0 +1,45 @@
|
||||
class CfgVehicles {
|
||||
class ACE_Module;
|
||||
class GVAR(moduleSettings): ACE_Module {
|
||||
author = ECSTRING(common,ACETeam);
|
||||
category = "ACE";
|
||||
displayName = "Advanced Fatigue";
|
||||
function = QFUNC(moduleSettings);
|
||||
scope = 2;
|
||||
isGlobal = 1;
|
||||
isTriggerActivated = 0;
|
||||
icon = QPATHTOF(UI\Icon_Module.paa);
|
||||
class Arguments {
|
||||
class Enabled {
|
||||
displayName = CSTRING(Enabled);
|
||||
description = CSTRING(Enabled_Description);
|
||||
typeName = "BOOL";
|
||||
defaultValue = 1;
|
||||
};
|
||||
class PerformanceFactor {
|
||||
displayName = CSTRING(PerformanceFactor);
|
||||
description = CSTRING(PerformanceFactor_Description);
|
||||
typeName = "NUMBER";
|
||||
defaultValue = 1;
|
||||
};
|
||||
class RecoveryFactor {
|
||||
displayName = CSTRING(RecoveryFactor);
|
||||
description = CSTRING(RecoveryFactor_Description);
|
||||
typeName = "NUMBER";
|
||||
defaultValue = 1;
|
||||
};
|
||||
class LoadFactor {
|
||||
displayName = CSTRING(LoadFactor);
|
||||
description = CSTRING(LoadFactor_Description);
|
||||
typeName = "NUMBER";
|
||||
defaultValue = 1;
|
||||
};
|
||||
class TerrainGradientFactor {
|
||||
displayName = CSTRING(TerrainGradientFactor);
|
||||
description = CSTRING(TerrainGradientFactor_Description);
|
||||
typeName = "NUMBER";
|
||||
defaultValue = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
20
addons/advanced_fatigue/Dialog.hpp
Normal file
20
addons/advanced_fatigue/Dialog.hpp
Normal file
@ -0,0 +1,20 @@
|
||||
class RscControlsGroupNoScrollbars;
|
||||
class RscPicture;
|
||||
|
||||
class GVAR(StaminaBarContainer): RscControlsGroupNoScrollbars {
|
||||
x = "(profilenamespace getvariable [""IGUI_GRID_STAMINA_X"", ((safezoneX + safezoneW) - (10 * (((safezoneW / safezoneH) min 1.2) / 40)) - 4.3 * (((safezoneW / safezoneH) min 1.2) / 40))])";
|
||||
y = "(profilenamespace getvariable [""IGUI_GRID_STAMINA_Y"", (safezoneY + 4.05 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))])";
|
||||
w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "0.15 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
|
||||
class Controls {
|
||||
class StaminaBar: RscPicture {
|
||||
idc = 10;
|
||||
x = 0;
|
||||
y = 0;
|
||||
w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "0.15 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
text = "\A3\Ui_f\data\IGUI\RscIngameUI\RscUnitInfo\stamina_ca.paa";
|
||||
};
|
||||
};
|
||||
};
|
10
addons/advanced_fatigue/README.md
Normal file
10
addons/advanced_fatigue/README.md
Normal file
@ -0,0 +1,10 @@
|
||||
ace_advanced_fatigue
|
||||
==========
|
||||
|
||||
An in depth stamina and fatigue simulation.
|
||||
|
||||
## Maintainers
|
||||
|
||||
The people responsible for merging changes to this component or answering potential questions.
|
||||
|
||||
- [BaerMitUmlaut](https://github.com/BaerMitUmlaut)
|
BIN
addons/advanced_fatigue/UI/Icon_Module.paa
Normal file
BIN
addons/advanced_fatigue/UI/Icon_Module.paa
Normal file
Binary file not shown.
10
addons/advanced_fatigue/XEH_PREP.hpp
Normal file
10
addons/advanced_fatigue/XEH_PREP.hpp
Normal file
@ -0,0 +1,10 @@
|
||||
PREP(addDutyFactor);
|
||||
PREP(createStaminaBar);
|
||||
PREP(getAnimDuty);
|
||||
PREP(getMetabolicCosts);
|
||||
PREP(handleEffects);
|
||||
PREP(handlePlayerChanged);
|
||||
PREP(handleStaminaBar);
|
||||
PREP(mainLoop);
|
||||
PREP(moduleSettings);
|
||||
PREP(removeDutyFactor);
|
52
addons/advanced_fatigue/XEH_postInit.sqf
Normal file
52
addons/advanced_fatigue/XEH_postInit.sqf
Normal file
@ -0,0 +1,52 @@
|
||||
#include "script_component.hpp"
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
["ace_settingsInitialized", {
|
||||
if (!GVAR(enabled)) exitWith {};
|
||||
|
||||
// - Post process effect ------------------------------------------------------
|
||||
GVAR(ppeBlackout) = ppEffectCreate ["ColorCorrections", 4220];
|
||||
GVAR(ppeBlackout) ppEffectEnable true;
|
||||
GVAR(ppeBlackout) ppEffectForceInNVG true;
|
||||
GVAR(ppeBlackout) ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[10,10,0,0,0,0.1,0.5]];
|
||||
GVAR(ppeBlackout) ppEffectCommit 0.4;
|
||||
|
||||
// - GVAR updating and initialization -----------------------------------------
|
||||
if !(isNull ACE_player) then {
|
||||
[ACE_player, objNull] call FUNC(handlePlayerChanged);
|
||||
};
|
||||
["unit", FUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler;
|
||||
|
||||
// - Duty factors -------------------------------------------------------------
|
||||
if (["ACE_Medical"] call EFUNC(common,isModLoaded)) then {
|
||||
[QEGVAR(medical,pain), { // 0->1.0, 0.5->1.05, 1->1.1
|
||||
linearConversion [0, 1, (_this getVariable [QEGVAR(medical,pain), 0]), 1, 1.1, true];
|
||||
}] call FUNC(addDutyFactor);
|
||||
[QEGVAR(medical,bloodVolume), { // 100->1.0, 90->1.1, 80->1.2
|
||||
linearConversion [100, 0, (_this getVariable [QEGVAR(medical,bloodVolume), 100]), 1, 2, true];
|
||||
}] call FUNC(addDutyFactor);
|
||||
};
|
||||
if (["ACE_Dragging"] call EFUNC(common,isModLoaded)) then {
|
||||
[QEGVAR(dragging,isCarrying), {
|
||||
[1, 3] select (_this getVariable [QEGVAR(dragging,isCarrying), false]);
|
||||
}] call FUNC(addDutyFactor);
|
||||
};
|
||||
if (["ACE_Weather"] call EFUNC(common,isModLoaded)) then {
|
||||
[QEGVAR(weather,temperature), { // 35->1, 45->2
|
||||
linearConversion [35, 45, (missionNamespace getVariable [QEGVAR(weather,currentTemperature), 25]), 1, 2, true];
|
||||
}] call FUNC(addDutyFactor);
|
||||
};
|
||||
|
||||
// - Add main loop at 1 second interval -------------------------------------------------------------
|
||||
[FUNC(mainLoop), [], 1] call CBA_fnc_waitAndExecute;
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
["ace_settingChanged", {
|
||||
params ["_name", "_value"];
|
||||
|
||||
if (_name == QGVAR(enableStaminaBar) && {!_value}) then {
|
||||
private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull];
|
||||
_staminaBarContainer ctrlSetFade 1;
|
||||
_staminaBarContainer ctrlCommit 0;
|
||||
};
|
||||
}] call CBA_fnc_addEventHandler;
|
11
addons/advanced_fatigue/XEH_preInit.sqf
Normal file
11
addons/advanced_fatigue/XEH_preInit.sqf
Normal file
@ -0,0 +1,11 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
ADDON = false;
|
||||
|
||||
#include "XEH_PREP.hpp"
|
||||
//#include "initSettings.sqf"
|
||||
|
||||
GVAR(staminaBarWidth) = 10 * (((safezoneW / safezoneH) min 1.2) / 40);
|
||||
GVAR(dutyList) = [[], []];
|
||||
|
||||
ADDON = true;
|
23
addons/advanced_fatigue/config.cpp
Normal file
23
addons/advanced_fatigue/config.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
name = COMPONENT_NAME;
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author = ECSTRING(common,ACETeam);
|
||||
authors[] = {"BaerMitUmlaut"};
|
||||
url = ECSTRING(main,URL);
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "ACE_Settings.hpp"
|
||||
#include "CfgEden.hpp"
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgMovesMaleSdr.hpp"
|
||||
#include "CfgSounds.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
#include "Dialog.hpp"
|
18
addons/advanced_fatigue/functions/fnc_addDutyFactor.sqf
Normal file
18
addons/advanced_fatigue/functions/fnc_addDutyFactor.sqf
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Author: BaerMitUmlaut
|
||||
* Adds a duty factor.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Factor ID <STRING>
|
||||
* 1: Factor <NUMBER> or <CODE>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
params [["_id", "", [""]], ["_factor", 1, [0, {}]]];
|
||||
if (_id == "" || {_factor isEqualTo 1}) exitWith {};
|
||||
|
||||
GVAR(dutyList) params ["_idList", "_factorList"];
|
||||
_idList pushBack _id;
|
||||
_factorList pushBack _factor,
|
18
addons/advanced_fatigue/functions/fnc_createStaminaBar.sqf
Normal file
18
addons/advanced_fatigue/functions/fnc_createStaminaBar.sqf
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Author: BaerMitUmlaut
|
||||
* Creates the stamina bar.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Display <DISPLAY>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
params ["_display"];
|
||||
|
||||
private _staminaBar = _display ctrlCreate [QGVAR(StaminaBarContainer), -1];
|
||||
uiNamespace setVariable [QGVAR(staminaBarContainer), _staminaBar];
|
||||
|
||||
_staminaBar ctrlSetFade 1;
|
||||
_staminaBar ctrlCommit 0;
|
56
addons/advanced_fatigue/functions/fnc_getAnimDuty.sqf
Normal file
56
addons/advanced_fatigue/functions/fnc_getAnimDuty.sqf
Normal file
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Author: BaerMitUmlaut
|
||||
* Calculates the duty of the current animation.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
* 1: Animation name <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* Duty <NUMBER>
|
||||
*
|
||||
* Example:
|
||||
* [player, "AidlPercMstpSlowWrflDnon_G05"] call ace_advanced_fatigue_fnc_getAnimDuty
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
params ["_unit", "_animName"];
|
||||
|
||||
private _duty = 1;
|
||||
private _animType = _animName select [1, 3];
|
||||
|
||||
GVAR(isSwimming) = false;
|
||||
|
||||
if (_animType in ["idl", "mov"]) then {
|
||||
switch (_animName select [5, 3]) do {
|
||||
case ("knl"): {
|
||||
_duty = 1.5;
|
||||
};
|
||||
case ("pne"): {
|
||||
_duty = 12;
|
||||
};
|
||||
default {
|
||||
_duty = 1;
|
||||
};
|
||||
};
|
||||
|
||||
if (currentWeapon _unit != handgunWeapon _unit) then {
|
||||
if (_animName select [13, 3] == "ras") then {
|
||||
// low ready jog
|
||||
_duty = _duty * 1.2;
|
||||
if (_animName select [9, 3] == "tac") then {
|
||||
// high ready jog/walk
|
||||
_duty = _duty * 1.5;
|
||||
};
|
||||
};
|
||||
};
|
||||
} else {
|
||||
// swimming and diving
|
||||
if (_animType in ["swm", "ssw", "bsw", "dve", "sdv", "bdv"]) then {
|
||||
_duty = 5;
|
||||
GVAR(isSwimming) = true;
|
||||
};
|
||||
};
|
||||
|
||||
_duty
|
61
addons/advanced_fatigue/functions/fnc_getMetabolicCosts.sqf
Normal file
61
addons/advanced_fatigue/functions/fnc_getMetabolicCosts.sqf
Normal file
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Author: BaerMitUmlaut
|
||||
* Calculates the current metabolic costs for a unit.
|
||||
* Calculation is done according to the Pandolf/Wojtowicz formulas.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
* 1: Speed <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* Metabolic cost <NUMBER>
|
||||
*
|
||||
* Example:
|
||||
* [player, 3.3] call ace_advanced_fatigue_fnc_getMetabolicCosts
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
params ["_unit", "_velocity"];
|
||||
|
||||
private _virtualLoad = 0;
|
||||
{
|
||||
_virtualLoad = _virtualLoad + (_x getVariable [QEGVAR(movement,vLoad), 0]);
|
||||
} forEach [
|
||||
_unit,
|
||||
uniformContainer _unit,
|
||||
vestContainer _unit,
|
||||
backpackContainer _unit
|
||||
];
|
||||
|
||||
private _gearMass = ((loadAbs _unit + _virtualLoad) * 0.1 / 2.2046) * GVAR(loadFactor);
|
||||
private _terrainFactor = 1;
|
||||
private _terrainAngle = asin (1 - ((surfaceNormal getPosASL _unit) select 2));
|
||||
private _terrainGradient = (_terrainAngle / 45 min 1) * 5 * GVAR(terrainGradientFactor);
|
||||
private _duty = GVAR(animDuty);
|
||||
|
||||
{
|
||||
if (_x isEqualType 0) then {
|
||||
_duty = _duty * _x;
|
||||
} else {
|
||||
_duty = _duty * (_unit call _x);
|
||||
};
|
||||
} forEach (GVAR(dutyList) select 1);
|
||||
|
||||
if (GVAR(isSwimming)) then {
|
||||
_terrainGradient = 0;
|
||||
};
|
||||
|
||||
if (_velocity > 2) then {
|
||||
(
|
||||
2.10 * SIM_BODYMASS
|
||||
+ 4 * (SIM_BODYMASS + _gearMass) * ((_gearMass / SIM_BODYMASS) ^ 2)
|
||||
+ _terrainFactor * (SIM_BODYMASS + _gearMass) * (0.90 * (_velocity ^ 2) + 0.66 * _velocity * _terrainGradient)
|
||||
) * 0.23 * _duty
|
||||
} else {
|
||||
(
|
||||
1.05 * SIM_BODYMASS
|
||||
+ 4 * (SIM_BODYMASS + _gearMass) * ((_gearMass / SIM_BODYMASS) ^ 2)
|
||||
+ _terrainFactor * (SIM_BODYMASS + _gearMass) * (1.15 * (_velocity ^ 2) + 0.66 * _velocity * _terrainGradient)
|
||||
) * 0.23 * _duty
|
||||
};
|
93
addons/advanced_fatigue/functions/fnc_handleEffects.sqf
Normal file
93
addons/advanced_fatigue/functions/fnc_handleEffects.sqf
Normal file
@ -0,0 +1,93 @@
|
||||
/*
|
||||
* Author: BaerMitUmlaut
|
||||
* Handles any audible, visual and physical effects of fatigue.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
* 1: Fatigue <NUMBER>
|
||||
* 2: Speed <NUMBER>
|
||||
* 3: Overexhausted <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [_player, 0.5, 3.3, true] call ace_advanced_fatigue_fnc_handleEffects
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
params ["_unit", "_fatigue", "_speed", "_overexhausted"];
|
||||
|
||||
#ifdef DEBUG_MODE_FULL
|
||||
systemChat str _fatigue;
|
||||
systemChat str vectorMagnitude velocity _unit;
|
||||
#endif
|
||||
|
||||
// - Audible effects ----------------------------------------------------------
|
||||
GVAR(lastBreath) = GVAR(lastBreath) + 1;
|
||||
if (_fatigue > 0.4 && {GVAR(lastBreath) > (_fatigue * -10 + 9)} && {!underwater _unit}) then {
|
||||
switch (true) do {
|
||||
case (_fatigue < 0.6): {
|
||||
playSound (QGVAR(breathLow) + str(floor random 6));
|
||||
};
|
||||
case (_fatigue < 0.85): {
|
||||
playSound (QGVAR(breathMid) + str(floor random 6));
|
||||
};
|
||||
default {
|
||||
playSound (QGVAR(breathMax) + str(floor random 6));
|
||||
};
|
||||
};
|
||||
GVAR(lastBreath) = 0;
|
||||
};
|
||||
|
||||
// - Visual effects -----------------------------------------------------------
|
||||
GVAR(ppeBlackoutLast) = GVAR(ppeBlackoutLast) + 1;
|
||||
if (GVAR(ppeBlackoutLast) == 1) then {
|
||||
GVAR(ppeBlackout) ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[10,10,0,0,0,0.1,0.5]];
|
||||
GVAR(ppeBlackout) ppEffectCommit 1;
|
||||
} else {
|
||||
if (_fatigue > 0.85) then {
|
||||
if (GVAR(ppeBlackoutLast) > (100 - _fatigue * 100) / 3) then {
|
||||
GVAR(ppeBlackout) ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[2,2,0,0,0,0.1,0.5]];
|
||||
GVAR(ppeBlackout) ppEffectCommit 1;
|
||||
GVAR(ppeBlackoutLast) = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
// - Physical effects ---------------------------------------------------------
|
||||
if (GVAR(isSwimming)) exitWith {
|
||||
_unit setAnimSpeedCoef (1 - _fatigue / 3);
|
||||
};
|
||||
if ((getAnimSpeedCoef _unit) != 1) then {
|
||||
_unit setAnimSpeedCoef 1;
|
||||
};
|
||||
|
||||
if (_overexhausted) then {
|
||||
[_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set);
|
||||
} else {
|
||||
if (isForcedWalk _unit && {_fatigue < 0.7}) then {
|
||||
[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set);
|
||||
} else {
|
||||
if ((isSprintAllowed _unit) && {_fatigue > 0.7}) then {
|
||||
[_unit, "blockSprint", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set);
|
||||
} else {
|
||||
if ((!isSprintAllowed _unit) && {_fatigue < 0.6}) then {
|
||||
[_unit, "blockSprint", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set);
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
switch (stance _unit) do {
|
||||
case ("CROUCH"): {
|
||||
_unit setCustomAimCoef (1.0 + _fatigue ^ 2 * 0.1);
|
||||
};
|
||||
case ("PRONE"): {
|
||||
_unit setCustomAimCoef (1.0 + _fatigue ^ 2 * 2.0);
|
||||
};
|
||||
default {
|
||||
_unit setCustomAimCoef (1.5 + _fatigue ^ 2 * 3.0);
|
||||
};
|
||||
};
|
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Author: BaerMitUmlaut
|
||||
* Handles switching units (once on init and afterwards via Zeus).
|
||||
*
|
||||
* Arguments:
|
||||
* 0: New Unit <OBJECT>
|
||||
* 1: Old Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
params ["_newUnit", "_oldUnit"];
|
||||
|
||||
if !(isNull _oldUnit) then {
|
||||
_oldUnit enableStamina true;
|
||||
_oldUnit removeEventHandler ["AnimChanged", _oldUnit getVariable [QGVAR(animHandler), -1]];
|
||||
|
||||
_oldUnit setVariable [QGVAR(ae1Reserve), GVAR(ae1Reserve)];
|
||||
_oldUnit setVariable [QGVAR(ae2Reserve), GVAR(ae2Reserve)];
|
||||
_oldUnit setVariable [QGVAR(anReserve), GVAR(anReserve)];
|
||||
_oldUnit setVariable [QGVAR(anFatigue), GVAR(anFatigue)];
|
||||
_oldUnit setVariable [QGVAR(muscleDamage), GVAR(muscleDamage)];
|
||||
};
|
||||
|
||||
_newUnit enableStamina false;
|
||||
|
||||
// Don't add a new EH if the unit respawned
|
||||
if (_newUnit getVariable [QGVAR(animHandler), -1] == -1) then {
|
||||
private _animHandler = _newUnit addEventHandler ["AnimChanged", {
|
||||
GVAR(animDuty) = _this call FUNC(getAnimDuty);
|
||||
}];
|
||||
_newUnit setVariable [QGVAR(animHandler), _animHandler];
|
||||
};
|
||||
|
||||
GVAR(ae1Reserve) = _newUnit getVariable [QGVAR(ae1Reserve), AE1_MAXRESERVE];
|
||||
GVAR(ae2Reserve) = _newUnit getVariable [QGVAR(ae2Reserve), AE2_MAXRESERVE];
|
||||
GVAR(anReserve) = _newUnit getVariable [QGVAR(anReserve), AN_MAXRESERVE];
|
||||
GVAR(anFatigue) = _newUnit getVariable [QGVAR(anFatigue), 0];
|
||||
GVAR(muscleDamage) = _newUnit getVariable [QGVAR(muscleDamage), 0];
|
||||
|
||||
// Clean variables for respawning units
|
||||
{
|
||||
_newUnit setVariable [_x, nil];
|
||||
} forEach [QGVAR(ae1Reserve), QGVAR(ae2Reserve), QGVAR(anReserve), QGVAR(anFatigue), QGVAR(muscleDamage)];
|
||||
|
||||
GVAR(VO2Max) = 35 + 20 * (_newUnit getVariable [QGVAR(performanceFactor), GVAR(performanceFactor)]);
|
||||
GVAR(VO2MaxPower) = GVAR(VO2Max) * SIM_BODYMASS * 0.23 * JOULES_PER_ML_O2 / 60;
|
||||
GVAR(peakPower) = VO2MAX_STRENGTH * GVAR(VO2MaxPower);
|
||||
|
||||
GVAR(ae1PathwayPower) = GVAR(peakPower) / (13.3 + 16.7 + 113.3) * 13.3 * ANTPERCENT ^ 1.28 * 1.362;
|
||||
GVAR(ae2PathwayPower) = GVAR(peakPower) / (13.3 + 16.7 + 113.3) * 16.7 * ANTPERCENT ^ 1.28 * 1.362;
|
||||
GVAR(anPathwayPower) = GVAR(peakPower) - _ae1PathwayPower - _ae2PathwayPower;
|
||||
|
||||
GVAR(ppeBlackoutLast) = 100;
|
||||
GVAR(lastBreath) = 0;
|
||||
GVAR(animDuty) = [_newUnit, animationState _newUnit] call FUNC(getAnimDuty);
|
44
addons/advanced_fatigue/functions/fnc_handleStaminaBar.sqf
Normal file
44
addons/advanced_fatigue/functions/fnc_handleStaminaBar.sqf
Normal file
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Author: BaerMitUmlaut
|
||||
* Handles visual changes of the stamina bar.
|
||||
*
|
||||
* Arguments:
|
||||
* Percent of stamina remaining <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
params ["_stamina"];
|
||||
|
||||
private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull];
|
||||
|
||||
// - Size ---------------------------------------------------------------------
|
||||
// Shrink the container to cut off the image (other wise it would just get stretched)
|
||||
private _posAndSize = ctrlPosition _staminaBarContainer;
|
||||
_posAndSize set [2, _stamina * GVAR(staminaBarWidth)];
|
||||
_staminaBarContainer ctrlSetPosition _posAndSize;
|
||||
|
||||
// - Opacity ------------------------------------------------------------------
|
||||
if (_stamina >= 0.8) then {
|
||||
_staminaBarContainer ctrlSetFade (0.9 + 0.1 * (_stamina - 0.8) / 0.2);
|
||||
} else {
|
||||
_staminaBarContainer ctrlSetFade (0.9 * _stamina / 0.8);
|
||||
};
|
||||
|
||||
// - Color --------------------------------------------------------------------
|
||||
// 1.0 - 0.8: White
|
||||
// 0.6 - 0.4: Orange
|
||||
// 0.4 - 0.2: Red
|
||||
private _color = [1, 1, 1];
|
||||
if (_stamina < 0.6) then {
|
||||
if (_stamina < 0.4) then {
|
||||
_color = [1, 0, 0] vectorAdd ([0, 0.65, 0] vectorMultiply ((_stamina - 0.2) / 0.2));
|
||||
} else {
|
||||
_color = [1, 0.65, 0] vectorAdd ([0, 0.35, 1] vectorMultiply ((_stamina - 0.4) / 0.2));
|
||||
};
|
||||
};
|
||||
_color pushBack 1;
|
||||
(_staminaBarContainer controlsGroupCtrl 10) ctrlSetTextColor _color;
|
||||
|
||||
_staminaBarContainer ctrlCommit 1;
|
73
addons/advanced_fatigue/functions/fnc_mainLoop.sqf
Normal file
73
addons/advanced_fatigue/functions/fnc_mainLoop.sqf
Normal file
@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Author: BaerMitUmlaut
|
||||
* Main looping function that updates fatigue values.
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
if (!alive ACE_player) exitWith { // Dead people don't breath, Will also handle null (Map intros)
|
||||
[FUNC(mainLoop), [], 1] call CBA_fnc_waitAndExecute;
|
||||
};
|
||||
|
||||
private _currentWork = REE;
|
||||
private _currentSpeed = (vectorMagnitude (velocity ACE_player)) min 6;
|
||||
|
||||
// fix #4481. Diving to the ground is recorded as PRONE stance with running speed velocity. Cap maximum speed to fix.
|
||||
if (stance ACE_player == "PRONE") then {
|
||||
_currentSpeed = _currentSpeed min 1.5;
|
||||
};
|
||||
|
||||
if ((vehicle ACE_player == ACE_player) && {_currentSpeed > 0.1} && {isTouchingGround ACE_player || {underwater ACE_player}}) then {
|
||||
_currentWork = [ACE_player, _currentSpeed] call FUNC(getMetabolicCosts);
|
||||
_currentWork = _currentWork max REE;
|
||||
};
|
||||
|
||||
// Calculate muscle damage increase
|
||||
// Note: Muscle damage recovery is ignored as it takes multiple days
|
||||
GVAR(muscleDamage) = GVAR(muscleDamage) + (_currentWork / GVAR(peakPower)) ^ 3.2 * 0.00004;
|
||||
private _muscleIntegrity = 1 - GVAR(muscleDamage);
|
||||
|
||||
// Calculate available power
|
||||
private _ae1PathwayPowerFatigued = GVAR(ae1PathwayPower) * sqrt (GVAR(ae1Reserve) / AE1_MAXRESERVE) * OXYGEN * sqrt _muscleIntegrity;
|
||||
private _ae2PathwayPowerFatigued = GVAR(ae2PathwayPower) * sqrt (GVAR(ae2Reserve) / AE2_MAXRESERVE) * OXYGEN * sqrt _muscleIntegrity;
|
||||
|
||||
// Calculate how much power is consumed from each reserve
|
||||
private _ae1Power = _currentWork min _ae1PathwayPowerFatigued;
|
||||
private _ae2Power = ((_currentWork - _ae1Power) max 0) min _ae2PathwayPowerFatigued;
|
||||
private _anPower = (_currentWork - _ae1Power - _ae2Power) max 0;
|
||||
|
||||
// Remove ATP from reserves for current work
|
||||
GVAR(ae1Reserve) = GVAR(ae1Reserve) - _ae1Power / WATTSPERATP;
|
||||
GVAR(ae2Reserve) = GVAR(ae2Reserve) - _ae2Power / WATTSPERATP;
|
||||
GVAR(anReserve) = GVAR(anReserve) - _anPower / WATTSPERATP;
|
||||
// Increase anearobic fatigue
|
||||
GVAR(anFatigue) = GVAR(anFatigue) + _anPower * (0.057 / GVAR(peakPower)) * 1.1;
|
||||
|
||||
// Aerobic ATP reserve recovery
|
||||
GVAR(ae1Reserve) = ((GVAR(ae1Reserve) + OXYGEN * 6.60 * (GVAR(ae1PathwayPower) - _ae1Power) / GVAR(ae1PathwayPower) * GVAR(recoveryFactor)) min AE1_MAXRESERVE) max 0;
|
||||
GVAR(ae2Reserve) = ((GVAR(ae2Reserve) + OXYGEN * 5.83 * (GVAR(ae2PathwayPower) - _ae2Power) / GVAR(ae2PathwayPower) * GVAR(recoveryFactor)) min AE2_MAXRESERVE) max 0;
|
||||
|
||||
// Anaerobic ATP reserver and fatigue recovery
|
||||
GVAR(anReserve) = ((GVAR(anReserve)
|
||||
+ (_ae1PathwayPowerFatigued + _ae2PathwayPowerFatigued - _ae1Power - _ae2Power) / GVAR(VO2MaxPower) * 56.7 * GVAR(anFatigue) ^ 2 * GVAR(recoveryFactor)
|
||||
) min AN_MAXRESERVE) max 0;
|
||||
|
||||
GVAR(anFatigue) = ((GVAR(anFatigue)
|
||||
- (_ae1PathwayPowerFatigued + _ae2PathwayPowerFatigued - _ae1Power - _ae2Power) * (0.057 / GVAR(peakPower)) * GVAR(anFatigue) ^ 2 * GVAR(recoveryFactor)
|
||||
) min 1) max 0;
|
||||
|
||||
private _aeReservePercentage = (GVAR(ae1Reserve) / AE1_MAXRESERVE + GVAR(ae2Reserve) / AE2_MAXRESERVE) / 2;
|
||||
private _anReservePercentage = GVAR(anReserve) / AN_MAXRESERVE;
|
||||
private _perceivedFatigue = 1 - (_anReservePercentage min _aeReservePercentage);
|
||||
|
||||
[ACE_player, _perceivedFatigue, _currentSpeed, GVAR(anReserve) == 0] call FUNC(handleEffects);
|
||||
|
||||
if (GVAR(enableStaminaBar)) then {
|
||||
[GVAR(anReserve) / AN_MAXRESERVE] call FUNC(handleStaminaBar);
|
||||
};
|
||||
|
||||
[FUNC(mainLoop), [], 1] call CBA_fnc_waitAndExecute;
|
18
addons/advanced_fatigue/functions/fnc_moduleSettings.sqf
Normal file
18
addons/advanced_fatigue/functions/fnc_moduleSettings.sqf
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Author: BaerMitUmlaut
|
||||
* Initializes the module settings.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Module <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
params ["_logic"];
|
||||
|
||||
[_logic, QGVAR(enabled), "Enabled"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(performanceFactor), "PerformanceFactor"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(recoveryFactor), "RecoveryFactor"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(loadFactor), "LoadFactor"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(terrainGradientFactor), "TerrainGradientFactor"] call EFUNC(common,readSettingFromModule);
|
20
addons/advanced_fatigue/functions/fnc_removeDutyFactor.sqf
Normal file
20
addons/advanced_fatigue/functions/fnc_removeDutyFactor.sqf
Normal file
@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Author: BaerMitUmlaut
|
||||
* Removes a duty factor.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Factor ID <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
params [["_id", "", [""]]];
|
||||
|
||||
GVAR(dutyList) params ["_idList", "_factorList"];
|
||||
private _index = _idList find _id;
|
||||
|
||||
if (_index != -1) then {
|
||||
_idList deleteAt _index;
|
||||
_factorList deleteAt _index;
|
||||
};
|
1
addons/advanced_fatigue/functions/script_component.hpp
Normal file
1
addons/advanced_fatigue/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
||||
#include "\z\ace\addons\advanced_fatigue\script_component.hpp"
|
59
addons/advanced_fatigue/initSettings.sqf
Normal file
59
addons/advanced_fatigue/initSettings.sqf
Normal file
@ -0,0 +1,59 @@
|
||||
[
|
||||
QGVAR(enabled),
|
||||
"CHECKBOX",
|
||||
[LSTRING(Enabled), LSTRING(Enabled_Description)],
|
||||
"ACE3 Advanced Fatigue",
|
||||
true,
|
||||
true
|
||||
] call CBA_Settings_fnc_init;
|
||||
|
||||
[
|
||||
QGVAR(enableStaminaBar),
|
||||
"CHECKBOX",
|
||||
[LSTRING(EnableStaminaBar), LSTRING(EnableStaminaBar_Description)],
|
||||
"ACE3 Advanced Fatigue",
|
||||
true,
|
||||
true, {
|
||||
if (!_this) then {
|
||||
private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull];
|
||||
_staminaBarContainer ctrlSetFade 1;
|
||||
_staminaBarContainer ctrlCommit 0;
|
||||
};
|
||||
}
|
||||
] call CBA_Settings_fnc_init;
|
||||
|
||||
[
|
||||
QGVAR(performanceFactor),
|
||||
"SLIDER",
|
||||
[LSTRING(PerformanceFactor), LSTRING(PerformanceFactor_Description)],
|
||||
"ACE3 Advanced Fatigue",
|
||||
[0, 2, 1, 1],
|
||||
true
|
||||
] call CBA_Settings_fnc_init;
|
||||
|
||||
[
|
||||
QGVAR(recoveryFactor),
|
||||
"SLIDER",
|
||||
[LSTRING(RecoveryFactor), LSTRING(RecoveryFactor_Description)],
|
||||
"ACE3 Advanced Fatigue",
|
||||
[0, 2, 1, 1],
|
||||
true
|
||||
] call CBA_Settings_fnc_init;
|
||||
|
||||
[
|
||||
QGVAR(loadFactor),
|
||||
"SLIDER",
|
||||
[LSTRING(LoadFactor), LSTRING(LoadFactor_Description)],
|
||||
"ACE3 Advanced Fatigue",
|
||||
[0, 2, 1, 1],
|
||||
true
|
||||
] call CBA_Settings_fnc_init;
|
||||
|
||||
[
|
||||
QGVAR(terrainGradientFactor),
|
||||
"SLIDER",
|
||||
[LSTRING(TerrainGradientFactor), LSTRING(TerrainGradientFactor_Description)],
|
||||
"ACE3 Advanced Fatigue",
|
||||
[0, 2, 1, 1],
|
||||
true
|
||||
] call CBA_Settings_fnc_init;
|
29
addons/advanced_fatigue/script_component.hpp
Normal file
29
addons/advanced_fatigue/script_component.hpp
Normal file
@ -0,0 +1,29 @@
|
||||
#define COMPONENT advanced_fatigue
|
||||
#define COMPONENT_BEAUTIFIED Advanced Fatigue
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
// #define DEBUG_MODE_FULL
|
||||
// #define DISABLE_COMPILE_CACHE
|
||||
// #define ENABLE_PERFORMANCE_COUNTERS
|
||||
|
||||
#ifdef DEBUG_ENABLED_ADVANCED_FATIGUE
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SETTINGS_ADVANCED_FATIGUE
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_ADVANCED_FATIGUE
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
|
||||
#define ANTPERCENT 0.8
|
||||
#define SIM_BODYMASS 70
|
||||
#define JOULES_PER_ML_O2 20.9
|
||||
#define VO2MAX_STRENGTH 4.1
|
||||
#define REE 18.83 //((0.5617 * SIM_BODYMASS + 42.57) * 0.23)
|
||||
#define OXYGEN 0.9
|
||||
#define WATTSPERATP 7
|
||||
|
||||
#define AE1_MAXRESERVE 4000000
|
||||
#define AE2_MAXRESERVE 84000
|
||||
#define AN_MAXRESERVE 2300
|
83
addons/advanced_fatigue/stringtable.xml
Normal file
83
addons/advanced_fatigue/stringtable.xml
Normal file
@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project name="ACE">
|
||||
<Package name="Advanced_Fatigue">
|
||||
<Key ID="STR_ACE_Advanced_Fatigue_PerformanceFactor">
|
||||
<English>Performance Factor</English>
|
||||
<German>Leistungsfaktor</German>
|
||||
<Japanese>パフォーマンス要因</Japanese>
|
||||
<Polish>Współczynnik wydolności</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Fatigue_PerformanceFactor_Description">
|
||||
<English>Influences the overall performance of all players with no custom factor. Higher means better.</English>
|
||||
<German>Beinflusst die Leistungsfähigkeit aller Spieler ohne eigenen Leistungsfaktor. Ein höherer Wert bedeutet bessere Leistung.</German>
|
||||
<Japanese>非カスタム要因をもつ全プレイヤーへ全体的に動作を影響させます。高いほど影響がでます。</Japanese>
|
||||
<Polish>Wpływa na ogólną wydolność organizmu u wszystkich graczy bez ustawionego niestandardowego współczynnika. Więcej znaczy lepiej.</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Fatigue_PerformanceFactor_EdenDescription">
|
||||
<English>Influences the overall performance of this unit. Higher means better.</English>
|
||||
<German>Beinflusst die Leistungsfähigkeit dieser Einheit. Ein höherer Wert bedeutet bessere Leistung.</German>
|
||||
<Japanese>非カスタム要因をもつ全プレイヤーへ全体的に動作を影響させます。高いほど影響がでます。</Japanese>
|
||||
<Polish>Wpływa na ogólną wydolność tej jednostki. Więcej znaczy lepiej.</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Fatigue_RecoveryFactor">
|
||||
<English>Recovery Factor</English>
|
||||
<German>Erholungsfaktor</German>
|
||||
<Japanese>回復要因</Japanese>
|
||||
<Polish>Współczynnik regeneracji</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Fatigue_RecoveryFactor_Description">
|
||||
<English>Changes how fast the player recovers when resting. Higher is faster.</English>
|
||||
<German>Ändert, wie schnell ein Spieler Ausdauer regeneriert. Ein höherer Wert bedeutet eine schnellere Regeneration.</German>
|
||||
<Japanese>休憩時は、プレイヤーが早く回復します。高いほど早くなります。</Japanese>
|
||||
<Polish>Wpływa na czas regeneracji podczas postoju. Więcej znaczy szybciej.</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Fatigue_LoadFactor">
|
||||
<English>Load Factor</English>
|
||||
<German>Gewichtsfaktor</German>
|
||||
<Japanese>負荷要因</Japanese>
|
||||
<Polish>Współczynnik masy ekwipunku</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Fatigue_LoadFactor_Description">
|
||||
<English>Increases or decreases how much weight influences the players performance. Zero means equipment weight has no performance influence.</English>
|
||||
<German>Erhöht oder verringert, wie viel Einfluss das Ausrüstungsgewicht auf die Leistung hat. Null heißt, dass es keinen Einfluss hat.</German>
|
||||
<Japanese>重量によりプレイヤーの動作への影響下増加したり、低下します。装備を持っていない場合、影響はしません。</Japanese>
|
||||
<Polish>Zmniejsza lub zwiększa wpływ ciężaru ekwipunku na wydolność gracza. Zero oznacza kompletny brak wpływu na wydolność.</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Fatigue_TerrainGradientFactor">
|
||||
<English>Terrain Gradient Factor</English>
|
||||
<German>Terrainsteigungsfaktor</German>
|
||||
<Japanese>地形の勾配による要因</Japanese>
|
||||
<Polish>Współczynnik terenu</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Fatigue_TerrainGradientFactor_Description">
|
||||
<English>Sets how much steep terrain increases stamina loss. Higher means higher stamina loss.</English>
|
||||
<German>Beeinflusst, wie stark Steigungen den Ausdauerverbrauch erhöhen. Ein höherer Wert erhöht den Ausdauerverbrauch.</German>
|
||||
<Japanese>地形によって影響する体力の消費量を決定します。高数値ではより体力を消費します。</Japanese>
|
||||
<Polish>Wpływa na to w jakim stopniu stromy teren wpływa na utratę wytrzymałości. Więcej oznacza szybszą utratę wytrzymałości.</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Fatigue_Enabled">
|
||||
<English>Enabled</English>
|
||||
<German>Aktiv</German>
|
||||
<Japanese>有効化</Japanese>
|
||||
<Polish>Włączone</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Fatigue_Enabled_Description">
|
||||
<English>Enables/disables Advanced Fatigue.</English>
|
||||
<German>Aktiviert/deaktiviert Advanced Fatigue.</German>
|
||||
<Japanese>アドバンスド疲労の有効化と無効化</Japanese>
|
||||
<Polish>Włącza/wyłącza zaawansowaną wytrzymałość</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Fatigue_EnableStaminaBar">
|
||||
<English>Show stamina bar</English>
|
||||
<German>Zeige Ausdauerleiste</German>
|
||||
<Japanese>体力バーを表示</Japanese>
|
||||
<Polish>Pokaż pasek wytrzymałości</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Fatigue_EnableStaminaBar_Description">
|
||||
<English>Shows the stamina bar.</English>
|
||||
<German>Zeigt die Ausdauerleiste an.</German>
|
||||
<Japanese>体力バーを表示します。</Japanese>
|
||||
<Polish>Pokazuje pasek wytrzymałości.</Polish>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
1
addons/advanced_throwing/$PBOPREFIX$
Normal file
1
addons/advanced_throwing/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\advanced_throwing
|
40
addons/advanced_throwing/ACE_Settings.hpp
Normal file
40
addons/advanced_throwing/ACE_Settings.hpp
Normal file
@ -0,0 +1,40 @@
|
||||
class ACE_Settings {
|
||||
class GVAR(enabled) {
|
||||
category = CSTRING(Category);
|
||||
displayName = CSTRING(Enable_DisplayName);
|
||||
description = CSTRING(Enable_Description);
|
||||
typeName = "BOOL";
|
||||
value = 1;
|
||||
isClientSettable = 1;
|
||||
};
|
||||
class GVAR(showThrowArc) {
|
||||
category = CSTRING(Category);
|
||||
displayName = CSTRING(ShowThrowArc_DisplayName);
|
||||
description = CSTRING(ShowThrowArc_Description);
|
||||
typeName = "BOOL";
|
||||
value = 1;
|
||||
isClientSettable = 1;
|
||||
};
|
||||
class GVAR(showMouseControls) {
|
||||
category = CSTRING(Category);
|
||||
displayName = CSTRING(ShowMouseControls_DisplayName);
|
||||
description = CSTRING(ShowMouseControls_Description);
|
||||
typeName = "BOOL";
|
||||
value = 1;
|
||||
isClientSettable = 1;
|
||||
};
|
||||
class GVAR(enablePickUp) {
|
||||
category = CSTRING(Category);
|
||||
displayName = CSTRING(EnablePickUp_DisplayName);
|
||||
description = CSTRING(EnablePickUp_Description);
|
||||
typeName = "BOOL";
|
||||
value = 1;
|
||||
};
|
||||
class GVAR(enablePickUpAttached) {
|
||||
category = CSTRING(Category);
|
||||
displayName = CSTRING(EnablePickUpAttached_DisplayName);
|
||||
description = CSTRING(EnablePickUpAttached_Description);
|
||||
typeName = "BOOL";
|
||||
value = 1;
|
||||
};
|
||||
};
|
17
addons/advanced_throwing/CfgEventHandlers.hpp
Normal file
17
addons/advanced_throwing/CfgEventHandlers.hpp
Normal file
@ -0,0 +1,17 @@
|
||||
class Extended_PreStart_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preStart));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||
};
|
||||
};
|
72
addons/advanced_throwing/CfgVehicles.hpp
Normal file
72
addons/advanced_throwing/CfgVehicles.hpp
Normal file
@ -0,0 +1,72 @@
|
||||
class CBA_Extended_EventHandlers;
|
||||
|
||||
class CfgVehicles {
|
||||
class ACE_Module;
|
||||
class GVAR(Module): ACE_Module {
|
||||
author = ECSTRING(common,ACETeam);
|
||||
category = "ACE";
|
||||
displayName = CSTRING(Category);
|
||||
function = QFUNC(moduleInit);
|
||||
scope = 2;
|
||||
isGlobal = 1;
|
||||
icon = QPATHTOF(UI\Icon_Module_AdvancedThrowing_ca.paa);
|
||||
class Arguments {
|
||||
class enabled {
|
||||
displayName = CSTRING(Enable_DisplayName);
|
||||
description = CSTRING(Enable_Description);
|
||||
typeName = "BOOL";
|
||||
defaultValue = 1;
|
||||
};
|
||||
class showThrowArc {
|
||||
displayName = CSTRING(ShowThrowArc_DisplayName);
|
||||
description = CSTRING(ShowThrowArc_Description);
|
||||
typeName = "BOOL";
|
||||
defaultValue = 1;
|
||||
};
|
||||
class showMouseControls {
|
||||
displayName = CSTRING(ShowMouseControls_DisplayName);
|
||||
description = CSTRING(ShowMouseControls_Description);
|
||||
typeName = "BOOL";
|
||||
defaultValue = 1;
|
||||
};
|
||||
class enablePickUp {
|
||||
displayName = CSTRING(EnablePickUp_DisplayName);
|
||||
description = CSTRING(EnablePickUp_Description);
|
||||
typeName = "BOOL";
|
||||
defaultValue = 1;
|
||||
};
|
||||
class enablePickUpAttached {
|
||||
displayName = CSTRING(EnablePickUpAttached_DisplayName);
|
||||
description = CSTRING(EnablePickUpAttached_Description);
|
||||
typeName = "BOOL";
|
||||
defaultValue = 1;
|
||||
};
|
||||
};
|
||||
class ModuleDescription {
|
||||
description = CSTRING(Module_Description);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
class Items_base_F;
|
||||
class GVAR(pickUpHelper): Items_base_F {
|
||||
author = ECSTRING(common,ACETeam);
|
||||
displayName = "ACE Throwable Pick Up Helper";
|
||||
model = "\a3\weapons_f\dummyweapon.p3d";
|
||||
scope = 1;
|
||||
|
||||
class ACE_Actions {
|
||||
class GVAR(pickUp) {
|
||||
displayName = CSTRING(PickUp);
|
||||
condition = QUOTE([ARR_2(_player,true)] call FUNC(canPrepare));
|
||||
statement = QUOTE(_this call FUNC(pickUp));
|
||||
distance = 1.8; // Requires >1.7 to work when standing with weapon on back
|
||||
icon = "\a3\ui_f\data\igui\cfg\actions\obsolete\ui_action_takemine_ca.paa";
|
||||
};
|
||||
};
|
||||
|
||||
class EventHandlers {
|
||||
class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {};
|
||||
};
|
||||
};
|
||||
};
|
11
addons/advanced_throwing/README.md
Normal file
11
addons/advanced_throwing/README.md
Normal file
@ -0,0 +1,11 @@
|
||||
ace_advanced_throwing
|
||||
===================
|
||||
|
||||
Integrates advanced throwing by [Dslyecxi](https://github.com/dslyecxi).
|
||||
|
||||
|
||||
## Maintainers
|
||||
|
||||
The people responsible for merging changes to this component or answering potential questions.
|
||||
|
||||
- [Jonpas](https://github.com/jonpas)
|
BIN
addons/advanced_throwing/UI/Icon_Module_AdvancedThrowing_ca.paa
Normal file
BIN
addons/advanced_throwing/UI/Icon_Module_AdvancedThrowing_ca.paa
Normal file
Binary file not shown.
17
addons/advanced_throwing/XEH_PREP.hpp
Normal file
17
addons/advanced_throwing/XEH_PREP.hpp
Normal file
@ -0,0 +1,17 @@
|
||||
PREP(canPrepare);
|
||||
PREP(canThrow);
|
||||
PREP(drawArc);
|
||||
PREP(drawThrowable);
|
||||
PREP(exitThrowMode);
|
||||
PREP(getMuzzle);
|
||||
PREP(moduleInit);
|
||||
PREP(onKeyDown);
|
||||
PREP(onMouseButtonDown);
|
||||
PREP(onMouseScroll);
|
||||
PREP(pickUp);
|
||||
PREP(prepare);
|
||||
PREP(prime);
|
||||
PREP(renderPickUpInteraction);
|
||||
PREP(throw);
|
||||
PREP(throwFiredXEH);
|
||||
PREP(updateControlsHint);
|
121
addons/advanced_throwing/XEH_postInit.sqf
Normal file
121
addons/advanced_throwing/XEH_postInit.sqf
Normal file
@ -0,0 +1,121 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
// Fired XEH
|
||||
[QGVAR(throwFiredXEH), FUNC(throwFiredXEH)] call CBA_fnc_addEventHandler;
|
||||
|
||||
// Exit on HC
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
// Ammo/Magazines look-up hash for correctness of initSpeed
|
||||
GVAR(ammoMagLookup) = call CBA_fnc_createNamespace;
|
||||
{
|
||||
{
|
||||
private _ammo = getText (configFile >> "CfgMagazines" >> _x >> "ammo");
|
||||
GVAR(ammoMagLookup) setVariable [_ammo, _x];
|
||||
} count (getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines"));
|
||||
nil
|
||||
} count getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles");
|
||||
|
||||
|
||||
// Add keybinds
|
||||
["ACE3 Weapons", QGVAR(prepare), localize LSTRING(Prepare), {
|
||||
// Condition
|
||||
if (!([ACE_player] call FUNC(canPrepare))) exitWith {false};
|
||||
|
||||
// Statement
|
||||
[ACE_player] call FUNC(prepare);
|
||||
|
||||
true
|
||||
}, {false}, [34, [true, false, false]], false] call CBA_fnc_addKeybind; // Shift + G
|
||||
|
||||
["ACE3 Weapons", QGVAR(dropModeToggle), localize LSTRING(DropModeToggle), {
|
||||
// Condition
|
||||
if !(ACE_player getVariable [QGVAR(inHand), false]) exitWith {false};
|
||||
|
||||
// Statement
|
||||
private _currentDropMode = ACE_player getVariable [QGVAR(dropMode), false];
|
||||
ACE_player setVariable [QGVAR(dropMode), !_currentDropMode];
|
||||
|
||||
ACE_player setVariable [QGVAR(throwType), THROW_TYPE_DEFAULT]; // Reset for consistency when opening
|
||||
call FUNC(updateControlsHint); // Change controls hint for MMB
|
||||
true
|
||||
}, {false}, [34, [false, true, false]], false] call CBA_fnc_addKeybind; // Ctrl + G
|
||||
|
||||
["ACE3 Weapons", QGVAR(dropModeHold), localize LSTRING(DropModeHold), {
|
||||
// Condition
|
||||
if !(ACE_player getVariable [QGVAR(inHand), false]) exitWith {false};
|
||||
|
||||
// Statement
|
||||
ACE_player setVariable [QGVAR(dropMode), true];
|
||||
ACE_player setVariable [QGVAR(throwType), THROW_TYPE_DEFAULT]; // Reset for consistency when opening
|
||||
call FUNC(updateControlsHint); // Change controls hint for MMB
|
||||
true
|
||||
}, {
|
||||
// Condition
|
||||
if !(ACE_player getVariable [QGVAR(inHand), false]) exitWith {false};
|
||||
|
||||
// Statement
|
||||
ACE_player setVariable [QGVAR(dropMode), false];
|
||||
call FUNC(updateControlsHint); // Change controls hint for MMB
|
||||
true
|
||||
}, [0, [false, false, false]], false] call CBA_fnc_addKeybind; // Empty
|
||||
|
||||
|
||||
// Event handlers
|
||||
["unit", {
|
||||
[_this select 1, "Player changed"] call FUNC(exitThrowMode);
|
||||
}] call CBA_fnc_addPlayerEventhandler;
|
||||
|
||||
["visibleMap", {
|
||||
if (visibleMap && {ACE_player getVariable [QGVAR(inHand), false]}) then {
|
||||
[ACE_player, "Opened Map"] call FUNC(exitThrowMode);
|
||||
};
|
||||
}] call CBA_fnc_addPlayerEventhandler;
|
||||
|
||||
|
||||
["ace_interactMenuOpened", {
|
||||
// Exit if advanced throwing is disabled (pick up only supports advanced throwing)
|
||||
if (!GVAR(enabled)) exitWith {};
|
||||
|
||||
if (ACE_player getVariable [QGVAR(inHand), false]) then {
|
||||
[ACE_player, "Interact menu opened"] call FUNC(exitThrowMode);
|
||||
} else {
|
||||
params ["_interactionType"];
|
||||
// Ignore self-interaction menu, when in vehicle and when pick up is disabled
|
||||
if (GVAR(enablePickUp) && {_interactionType == 0} && {vehicle ACE_player == ACE_player}) then {
|
||||
// Show pick up actions on CfgAmmo's
|
||||
call FUNC(renderPickUpInteraction);
|
||||
};
|
||||
};
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
|
||||
// Set last thrown time on Vanilla Throwing and Advanced Throwing
|
||||
["ace_firedPlayer", {
|
||||
if (_weapon == "Throw") then {
|
||||
_unit setVariable [QGVAR(lastThrownTime), CBA_missionTime];
|
||||
};
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
|
||||
// Display handlers
|
||||
["KeyDown", {_this call FUNC(onKeyDown)}] call CBA_fnc_addDisplayHandler;
|
||||
["MouseButtonDown", {_this call FUNC(onMouseButtonDown)}] call CBA_fnc_addDisplayHandler;
|
||||
["MouseZChanged", {_this call FUNC(onMouseScroll)}] call CBA_fnc_addDisplayHandler;
|
||||
|
||||
|
||||
#ifdef DRAW_THROW_PATH
|
||||
GVAR(predictedPath) = [];
|
||||
GVAR(flightPath) = [];
|
||||
|
||||
addMissionEventHandler ["Draw3D", { // Blue is predicted before throw, red is real
|
||||
{
|
||||
_x params ["", "_newTrajAGL"];
|
||||
drawIcon3D ["\a3\ui_f\data\gui\cfg\hints\icon_text\group_1_ca.paa", [0,0,1,1], _newTrajAGL, 1, 1, 0, "", 2];
|
||||
} forEach GVAR(predictedPath);
|
||||
{
|
||||
_newTrajAGL = _x;
|
||||
drawIcon3D ["\a3\ui_f\data\gui\cfg\hints\icon_text\group_1_ca.paa", [1,0,0,1], _newTrajAGL, 1, 1, 0, "", 2];
|
||||
} forEach GVAR(flightPath)
|
||||
}];
|
||||
#endif
|
7
addons/advanced_throwing/XEH_preInit.sqf
Normal file
7
addons/advanced_throwing/XEH_preInit.sqf
Normal file
@ -0,0 +1,7 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
ADDON = false;
|
||||
|
||||
#include "XEH_PREP.hpp"
|
||||
|
||||
ADDON = true;
|
19
addons/advanced_throwing/config.cpp
Normal file
19
addons/advanced_throwing/config.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
name = COMPONENT_NAME;
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common", "ace_weaponselect"};
|
||||
author = ECSTRING(common,ACETeam);
|
||||
authors[] = {"Jonpas", "Dslyecxi", "Zapat"};
|
||||
url = ECSTRING(main,URL);
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "ACE_Settings.hpp"
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgVehicles.hpp"
|
37
addons/advanced_throwing/functions/fnc_canPrepare.sqf
Normal file
37
addons/advanced_throwing/functions/fnc_canPrepare.sqf
Normal file
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Author: Jonpas
|
||||
* Checks if a throwable can be prepared.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
* 1: Ignore Last Thrown Time <BOOL> (default: false)
|
||||
*
|
||||
* Return Value:
|
||||
* Can Prepare <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [unit] call ace_advanced_throwing_fnc_canPrepare
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit", ["_ignoreLastThrownTime", false]];
|
||||
|
||||
// Don't delay when picking up
|
||||
if (_ignoreLastThrownTime) then {
|
||||
_unit setVariable [QGVAR(lastThrownTime), -1];
|
||||
};
|
||||
|
||||
GVAR(enabled) &&
|
||||
|
||||
#ifdef ALLOW_QUICK_THROW
|
||||
{true} &&
|
||||
#else
|
||||
{_unit getVariable [QGVAR(lastThrownTime), CBA_missionTime - 3] < CBA_missionTime - 2} && // Prevent throwing in quick succession
|
||||
#endif
|
||||
|
||||
{!(call EFUNC(common,isFeatureCameraActive))} &&
|
||||
{!EGVAR(common,isReloading)} &&
|
||||
{[_unit, objNull, ["isNotInside", "isNotSitting"/*, "isNotOnLadder"*/]] call EFUNC(common,canInteractWith)} && // Ladder needs positioning fixes on throw
|
||||
{_unit call CBA_fnc_canUseWeapon} // Disable in non-FFV seats due to surface detection issues
|
31
addons/advanced_throwing/functions/fnc_canThrow.sqf
Normal file
31
addons/advanced_throwing/functions/fnc_canThrow.sqf
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Author: Jonpas
|
||||
* Checks if a throwable can be thrown.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Can Throw <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [unit] call ace_advanced_throwing_fnc_canThrow
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
if !(_unit getVariable [QGVAR(inHand), false]) exitWith {false};
|
||||
|
||||
if (vehicle _unit != _unit) exitWith {
|
||||
private _startPos = eyePos _unit;
|
||||
private _aimLinePos = AGLToASL (positionCameraToWorld [0, 0, 1]);
|
||||
private _intersections = lineIntersectsSurfaces [_startPos, _aimLinePos, _unit, objNull, false];
|
||||
//TRACE_1("Intersections",_intersections);
|
||||
|
||||
(_intersections select {(vehicle _unit) in (_x select 3)}) isEqualTo []
|
||||
};
|
||||
|
||||
true
|
92
addons/advanced_throwing/functions/fnc_drawArc.sqf
Normal file
92
addons/advanced_throwing/functions/fnc_drawArc.sqf
Normal file
@ -0,0 +1,92 @@
|
||||
/*
|
||||
* Author: Zapat, Dslyecxi, Jonpas
|
||||
* Draws throw arc.
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* Flight path (just for debug) <ARRAY>
|
||||
*
|
||||
* Example:
|
||||
* call ace_advanced_throwing_fnc_drawArc
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
// Disable drawing when intersecting with the vehicle
|
||||
if !([ACE_player] call FUNC(canThrow)) exitWith {
|
||||
drawIcon3D ["\a3\ui_f\data\igui\cfg\actions\obsolete\ui_action_cancel_manualfire_ca.paa", [1, 0, 0, 1], positionCameraToWorld [0, 0, 1], 1, 1, 0, "", 1];
|
||||
};
|
||||
|
||||
private _activeThrowable = ACE_player getVariable [QGVAR(activeThrowable), objNull];
|
||||
|
||||
// Exit during switches and similar where object can be null for a very short amount of time
|
||||
if (isNull _activeThrowable) exitWith {};
|
||||
|
||||
private _dropMode = ACE_player getVariable [QGVAR(dropMode), false];
|
||||
private _throwType = ACE_player getVariable [QGVAR(throwType), THROW_TYPE_DEFAULT];
|
||||
private _throwSpeed = ACE_player getVariable [QGVAR(throwSpeed), THROW_SPEED_DEFAULT];
|
||||
|
||||
private _direction = [THROWSTYLE_NORMAL_DIR, THROWSTYLE_HIGH_DIR] select (_throwType == "high" || {_dropMode});
|
||||
private _velocity = [_throwSpeed, _throwSpeed / THROWSTYLE_HIGH_VEL_COEF / 1.25] select (_throwType == "high");
|
||||
_velocity = [_velocity, THROWSTYLE_DROP_VEL] select _dropMode;
|
||||
|
||||
private _viewStart = AGLToASL (positionCameraToWorld [0, 0, 0]);
|
||||
private _viewEnd = AGLToASL (positionCameraToWorld _direction);
|
||||
|
||||
private _initialVelocity = (vectorNormalized (_viewEnd vectorDiff _viewStart)) vectorMultiply (_velocity);
|
||||
private _prevTrajASL = getPosASLVisual _activeThrowable;
|
||||
|
||||
private _pathData = [];
|
||||
|
||||
for "_i" from 0.05 to 1.45 step 0.1 do {
|
||||
private _newTrajASL = (getPosASLVisual _activeThrowable) vectorAdd (_initialVelocity vectorMultiply _i) vectorAdd ([0, 0, -4.9] vectorMultiply (_i * _i));
|
||||
private _cross = 0;
|
||||
|
||||
if (_newTrajASL distance (getPosASLVisual ACE_player) <= 20) then {
|
||||
if ((ASLToATL _newTrajASL) select 2 <= 0) then {
|
||||
_cross = 1; // 1: Distance Limit (Green)
|
||||
} else {
|
||||
// Even vanilla throwables go through glass, only "GEOM" LOD will stop it but that will also stop it when there is glass in a window
|
||||
if (lineIntersects [_prevTrajASL, _newTrajASL]) then { // Checks the "VIEW" LOD
|
||||
_cross = 2; // 2: View LOD Block (Red)
|
||||
} else {
|
||||
if (!((lineIntersectsSurfaces [_prevTrajASL, _newTrajASL, _activeThrowable, ACE_player, true, 1, "GEOM", "FIRE"]) isEqualTo [])) then {
|
||||
_cross = 3; // 3: GEOM/FIRE LOD Block (Yellow) - pass a3 bulding glass, but blocked on some CUP glass
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
private _iDim = linearConversion [20, 0, _newTrajASL distance (getPosASLVisual ACE_player), 0.3, 2.5, true];
|
||||
private _alpha = linearConversion [20, 0, _newTrajASL distance (getPosASLVisual ACE_player), 0.05, 0.7, true];
|
||||
private _movePerc = linearConversion [3, 0, vectorMagnitude (velocity ACE_player), 0, 1, true];
|
||||
_alpha = _alpha * _movePerc;
|
||||
|
||||
private _col = [ [1, 1, 1, _alpha], [0, 1, 0, _alpha], [1, 0, 0, _alpha], [1, 1, 0, _alpha] ] select _cross;
|
||||
|
||||
if (_cross != 2 && {lineIntersects [eyePos ACE_player, _newTrajASL]}) then {
|
||||
_col set [3, 0.1]
|
||||
};
|
||||
|
||||
_pathData pushBack [_col, ASLToAGL _newTrajASL, _iDim];
|
||||
};
|
||||
|
||||
if (_cross > 0) exitWith {};
|
||||
|
||||
_prevTrajASL = _newTrajASL;
|
||||
};
|
||||
|
||||
reverse _pathData;
|
||||
// To get the sort order correct from our POV, particularly when using outlined dots
|
||||
{
|
||||
_x params ["_col", "_newTrajAGL", "_iDim"];
|
||||
drawIcon3D ["\a3\ui_f\data\gui\cfg\hints\icon_text\group_1_ca.paa", _col, _newTrajAGL, _iDim, _iDim, 0, "", 2];
|
||||
|
||||
#ifdef DRAW_THROW_PATH
|
||||
drawIcon3D ["", _col, _newTrajAGL, _iDim, _iDim, 0, str (ACE_player distance _newTrajAGL), 2, 0.05, "RobotoCondensed"];
|
||||
#endif
|
||||
} forEach _pathData;
|
||||
|
||||
_pathData
|
149
addons/advanced_throwing/functions/fnc_drawThrowable.sqf
Normal file
149
addons/advanced_throwing/functions/fnc_drawThrowable.sqf
Normal file
@ -0,0 +1,149 @@
|
||||
/*
|
||||
* Author: Dslyecxi, Jonpas, SilentSpike
|
||||
* Handles drawing the currently selected or cooked throwable.
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call ace_advanced_throwing_fnc_drawThrowable
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (dialog || {!(ACE_player getVariable [QGVAR(inHand), false])} || {!([ACE_player, true] call FUNC(canPrepare))}) exitWith {
|
||||
[ACE_player, "In dialog or no throwable in hand or cannot prepare throwable"] call FUNC(exitThrowMode);
|
||||
};
|
||||
|
||||
private _primed = ACE_player getVariable [QGVAR(primed), false];
|
||||
private _activeThrowable = ACE_player getVariable [QGVAR(activeThrowable), objNull];
|
||||
|
||||
// Exit if throwable died primed in hand
|
||||
if (isNull _activeThrowable && {_primed}) exitWith {
|
||||
[ACE_player, "Throwable died primed in hand"] call FUNC(exitThrowMode);
|
||||
};
|
||||
|
||||
private _throwable = currentThrowable ACE_player;
|
||||
|
||||
// Inventory check
|
||||
if (_throwable isEqualTo [] && {!_primed}) exitWith {
|
||||
[ACE_player, "No valid throwables"] call FUNC(exitThrowMode);
|
||||
};
|
||||
|
||||
private _throwableMag = _throwable param [0, "#none"];
|
||||
|
||||
// Get correct throw power for primed grenade
|
||||
if (_primed) then {
|
||||
private _ammoType = typeOf _activeThrowable;
|
||||
_throwableMag = GVAR(ammoMagLookup) getVariable _ammoType;
|
||||
if (isNil "_throwableMag") then {
|
||||
// What we're trying to throw must not be a normal throwable because it is not in our lookup hash (e.g. 40mm smoke)
|
||||
// Just use HandGrenade as it has an average initSpeed value
|
||||
_throwableMag = "HandGrenade";
|
||||
};
|
||||
};
|
||||
|
||||
// Some throwables have different classname for magazine and ammo
|
||||
// Primed magazine may be different, read speed before checking primed magazine!
|
||||
private _throwSpeed = getNumber (configFile >> "CfgMagazines" >> _throwableMag >> "initSpeed");
|
||||
|
||||
// Reduce power of throw over shoulder and to sides
|
||||
private _unitDirVisual = getDirVisual ACE_player;
|
||||
private _cameraDir = getCameraViewDirection ACE_player;
|
||||
_cameraDir = (_cameraDir select 0) atan2 (_cameraDir select 1);
|
||||
|
||||
private _phi = abs (_cameraDir - _unitDirVisual) % 360;
|
||||
_phi = [_phi, 360 - _phi] select (_phi > 180);
|
||||
|
||||
private _power = linearConversion [0, 180, _phi - 30, 1, 0.3, true];
|
||||
ACE_player setVariable [QGVAR(throwSpeed), _throwSpeed * _power];
|
||||
|
||||
#ifdef DEBUG_MODE_FULL
|
||||
hintSilent format ["Heading: %1\nPower: %2\nSpeed: %3\nThrowMag: %4\nMuzzle: %5", _phi, _power, _throwSpeed * _power, _throwableMag, ACE_player getVariable [QGVAR(activeMuzzle), ""]];
|
||||
#endif
|
||||
|
||||
private _throwableType = getText (configFile >> "CfgMagazines" >> _throwableMag >> "ammo");
|
||||
|
||||
if (!([ACE_player] call FUNC(canThrow)) && {!_primed}) exitWith {
|
||||
if (!isNull _activeThrowable) then {
|
||||
deleteVehicle _activeThrowable;
|
||||
// Restore muzzle ammo (setAmmo 1 has no impact if no appliccable throwable in inventory)
|
||||
ACE_player setAmmo [ACE_player getVariable [QGVAR(activeMuzzle), ""], 1];
|
||||
};
|
||||
};
|
||||
|
||||
if (isNull _activeThrowable || {(_throwableType != typeOf _activeThrowable) && {!_primed}}) then {
|
||||
if (!isNull _activeThrowable) then {
|
||||
deleteVehicle _activeThrowable;
|
||||
// Restore muzzle ammo (setAmmo 1 has no impact if no appliccable throwable in inventory)
|
||||
ACE_player setAmmo [ACE_player getVariable [QGVAR(activeMuzzle), ""], 1];
|
||||
};
|
||||
_activeThrowable = _throwableType createVehicleLocal [0, 0, 0];
|
||||
_activeThrowable enableSimulation false;
|
||||
ACE_player setVariable [QGVAR(activeThrowable), _activeThrowable];
|
||||
|
||||
// Set muzzle ammo to 0 to block vanilla throwing (can only be 0 or 1)
|
||||
private _muzzle = _throwableMag call FUNC(getMuzzle);
|
||||
ACE_player setAmmo [_muzzle, 0];
|
||||
ACE_player setVariable [QGVAR(activeMuzzle), _muzzle];
|
||||
};
|
||||
|
||||
// Exit in case of explosion in hand
|
||||
if (isNull _activeThrowable) exitWith {
|
||||
[ACE_player, "No active throwable (explosion in hand)"] call FUNC(exitThrowMode);
|
||||
};
|
||||
|
||||
// Exit if locality changed (someone took the throwable from hand)
|
||||
if (!local _activeThrowable && {ACE_player getVariable [QGVAR(localityChanged), true]}) exitWith {
|
||||
[ACE_player, "Throwable locality changed"] call FUNC(exitThrowMode);
|
||||
};
|
||||
|
||||
// Set position
|
||||
private _posHeadRel = ACE_player selectionPosition "head";
|
||||
|
||||
private _leanCoef = (_posHeadRel select 0) - 0.15; // 0.15 counters the base offset
|
||||
// Don't take leaning into account when weapon is lowered due to jiggling when walking side-ways (bandaid)
|
||||
if (abs _leanCoef < 0.15 || {vehicle ACE_player != ACE_player} || {weaponLowered ACE_player}) then {
|
||||
_leanCoef = 0;
|
||||
};
|
||||
|
||||
private _posCameraWorld = AGLToASL (positionCameraToWorld [0, 0, 0]);
|
||||
_posHeadRel = _posHeadRel vectorAdd [-0.03, 0.01, 0.15]; // Bring closer to eyePos value
|
||||
private _posFin = AGLToASL (ACE_player modelToWorldVisual _posHeadRel);
|
||||
|
||||
private _throwType = ACE_player getVariable [QGVAR(throwType), THROW_TYPE_DEFAULT];
|
||||
|
||||
// Orient it nicely, point towards player
|
||||
_activeThrowable setDir (_unitDirVisual + 90);
|
||||
|
||||
private _pitch = [-30, -90] select (_throwType == "high");
|
||||
[_activeThrowable, _pitch, 0] call BIS_fnc_setPitchBank;
|
||||
|
||||
|
||||
if (ACE_player getVariable [QGVAR(dropMode), false]) then {
|
||||
_posFin = _posFin vectorAdd (AGLToASL (positionCameraToWorld [_leanCoef, 0, ACE_player getVariable [QGVAR(dropDistance), DROP_DISTANCE_DEFAULT]]));
|
||||
|
||||
// Even vanilla throwables go through glass, only "GEOM" LOD will stop it but that will also stop it when there is no glass in a window
|
||||
if (lineIntersects [_posCameraWorld, _posFin vectorDiff _posCameraWorld]) then {
|
||||
ACE_player setVariable [QGVAR(dropDistance), ((ACE_player getVariable [QGVAR(dropDistance), DROP_DISTANCE_DEFAULT]) - 0.1) max DROP_DISTANCE_DEFAULT];
|
||||
};
|
||||
} else {
|
||||
private _xAdjustBonus = [0, -0.075] select (_throwType == "high");
|
||||
private _yAdjustBonus = [0, 0.1] select (_throwType == "high");
|
||||
private _cameraOffset = [_leanCoef, 0, 0.3] vectorAdd [-0.1, -0.15, -0.03] vectorAdd [_xAdjustBonus, _yAdjustBonus, 0];
|
||||
|
||||
_posFin = _posFin vectorAdd (AGLToASL (positionCameraToWorld _cameraOffset));
|
||||
|
||||
if (vehicle ACE_player != ACE_player) then {
|
||||
// Counteract vehicle velocity including acceleration
|
||||
private _vectorDiff = (velocity (vehicle ACE_player)) vectorMultiply (time - (ACE_player getVariable [QGVAR(lastTick), time]) + 0.01);
|
||||
_posFin = _posFin vectorAdd _vectorDiff;
|
||||
ACE_player setVariable [QGVAR(lastTick), time];
|
||||
};
|
||||
};
|
||||
|
||||
_activeThrowable setPosASL (_posFin vectorDiff _posCameraWorld);
|
59
addons/advanced_throwing/functions/fnc_exitThrowMode.sqf
Normal file
59
addons/advanced_throwing/functions/fnc_exitThrowMode.sqf
Normal file
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Author: Dslyecxi, Jonpas
|
||||
* Exits throw mode.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
* 1: Reason <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [unit, "reason"] call ace_advanced_throwing_fnc_exitThrowMode
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit", "_reason"];
|
||||
TRACE_2("params",_unit,_reason);
|
||||
|
||||
if !(_unit getVariable [QGVAR(inHand), false]) exitWith {};
|
||||
|
||||
#ifdef DEBUG_MODE_FULL
|
||||
systemChat format ["Exit Throw Mode: %1", _reason];
|
||||
#endif
|
||||
|
||||
private _activeThrowable = _unit getVariable [QGVAR(activeThrowable), objNull];
|
||||
if !(_unit getVariable [QGVAR(primed), false]) then {
|
||||
deleteVehicle _activeThrowable;
|
||||
} else {
|
||||
_unit setVariable [QGVAR(lastThrownTime), CBA_missionTime];
|
||||
// Fix floating for throwables without proper physics (eg. IR Grenade)
|
||||
_activeThrowable setVelocity [0, 0, -0.1];
|
||||
};
|
||||
|
||||
// Restore muzzle ammo (setAmmo 1 has no impact if no appliccable throwable in inventory)
|
||||
_unit setAmmo [_unit getVariable [QGVAR(activeMuzzle), ""], 1];
|
||||
|
||||
_unit setVariable [QGVAR(inHand), false];
|
||||
_unit setVariable [QGVAR(primed), false];
|
||||
_unit setVariable [QGVAR(activeThrowable), objNull];
|
||||
_unit setVariable [QGVAR(activeMuzzle), ""];
|
||||
_unit setVariable [QGVAR(throwType), THROW_TYPE_DEFAULT];
|
||||
_unit setVariable [QGVAR(throwSpeed), THROW_SPEED_DEFAULT];
|
||||
_unit setVariable [QGVAR(dropMode), false];
|
||||
_unit setVariable [QGVAR(dropDistance), DROP_DISTANCE_DEFAULT];
|
||||
|
||||
// Remove controls hint (check if ever enabled is inside the function)
|
||||
call EFUNC(interaction,hideMouseHint);
|
||||
|
||||
// Remove throw action
|
||||
[_unit, "DefaultAction", _unit getVariable [QGVAR(throwAction), -1]] call EFUNC(common,removeActionEventHandler);
|
||||
|
||||
// Remove throw arc draw
|
||||
if (!isNil QGVAR(draw3DHandle)) then {
|
||||
removeMissionEventHandler ["Draw3D", GVAR(draw3DHandle)];
|
||||
GVAR(draw3DHandle) = nil;
|
||||
};
|
25
addons/advanced_throwing/functions/fnc_getMuzzle.sqf
Normal file
25
addons/advanced_throwing/functions/fnc_getMuzzle.sqf
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
* Retrieve muzzle name from config.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Magazine Classname <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* "magazine" call ace_advanced_throwing_fnc_getMuzzle
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_magazineClassname"];
|
||||
|
||||
_magazineClassname = toLower _magazineClassname;
|
||||
private _throwMuzzles = getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles");
|
||||
|
||||
_throwMuzzles = _throwMuzzles select {_magazineClassname in ((getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines")) apply {toLower _x})};
|
||||
|
||||
[_throwMuzzles select 0, ""] select (_throwMuzzles isEqualTo [])
|
33
addons/advanced_throwing/functions/fnc_moduleInit.sqf
Normal file
33
addons/advanced_throwing/functions/fnc_moduleInit.sqf
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Author: Jonpas
|
||||
* Initializes the Advanced Throwing module.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Logic <OBJECT>
|
||||
* 1: Synchronized Units <ARRAY>
|
||||
* 2: Module Activated <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [logic, [unit1, unit2], true] call ace_advanced_throwing_fnc_moduleInit
|
||||
*
|
||||
* Public:
|
||||
* No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (!isServer) exitWith {};
|
||||
|
||||
params ["_logic", "_units", "_activated"];
|
||||
|
||||
if (!_activated) exitWith {};
|
||||
|
||||
[_logic, QGVAR(enabled), "enabled"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(showThrowArc), "showThrowArc"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(showMouseControls), "showMouseControls"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(enablePickUp), "enablePickUp"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(enablePickUpAttached), "enablePickUpAttached"] call EFUNC(common,readSettingFromModule);
|
||||
|
||||
INFO_1("Advanced Throwing Module Initialized. Enabled: %1",GVAR(enabled));
|
45
addons/advanced_throwing/functions/fnc_onKeyDown.sqf
Normal file
45
addons/advanced_throwing/functions/fnc_onKeyDown.sqf
Normal file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Author: Dslyecxi, Jonpas
|
||||
* Key down event.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Control <CONTROL>
|
||||
* 1: Key <NUMBER>
|
||||
* 2: Shift <BOOL>
|
||||
* 3: Ctrl <BOOL>
|
||||
* 4: Alt <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [control, 5, false, true, false] call ace_advanced_throwing_fnc_onKeyDown
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if !(ACE_player getVariable [QGVAR(inHand), false]) exitWith {false};
|
||||
|
||||
params ["", "_key", "_shift", "_ctrl", "_alt"];
|
||||
|
||||
// Exit if any of the action keys is pressed
|
||||
{
|
||||
if (_key in _x) exitWith {
|
||||
[ACE_player, "Pressed a key that cycles us out of throwables"] call FUNC(exitThrowMode);
|
||||
};
|
||||
} forEach [
|
||||
actionKeys "ReloadMagazine",
|
||||
actionKeys "Handgun",
|
||||
actionKeys "Binoculars",
|
||||
actionKeys "SwitchWeapon",
|
||||
actionKeys "Optics",
|
||||
actionKeys "NextWeapon",
|
||||
actionKeys "PrevWeapon",
|
||||
actionKeys "OpticsTemp",
|
||||
actionKeys "SwitchPrimary",
|
||||
actionKeys "SwitchHandgun",
|
||||
actionKeys "SwitchSecondary"
|
||||
];
|
||||
|
||||
false
|
46
addons/advanced_throwing/functions/fnc_onMouseButtonDown.sqf
Normal file
46
addons/advanced_throwing/functions/fnc_onMouseButtonDown.sqf
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Author: Dslyecxi, Jonpas
|
||||
* Mouse button down event.
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_advanced_throwing_fnc_onMouseButtonDown
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if !(ACE_player getVariable [QGVAR(inHand), false]) exitWith {};
|
||||
|
||||
params ["", "_key"];
|
||||
|
||||
// Left mouse button
|
||||
// "DefaultAction" doesn't get executed when in driver seat or in FFV seat with weapon lowered
|
||||
if (_key == 0) exitWith {
|
||||
if (!isNull (ACE_player getVariable [QGVAR(activeThrowable), objNull])) then {
|
||||
// Look gets automatically pointed at weapon direction on first LMB press when in FFV seat, require weapon to be up if in vehicle
|
||||
private _inVehicle = vehicle ACE_player != ACE_player;
|
||||
if (!_inVehicle || {_inVehicle && {!weaponLowered ACE_player}}) then {
|
||||
[ACE_player] call FUNC(throw);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
private _primed = ACE_player getVariable [QGVAR(primed), false];
|
||||
|
||||
// Right mouse button
|
||||
if (_key == 1) exitWith {
|
||||
if (!_primed) then {
|
||||
[ACE_player, "Storing throwable"] call FUNC(exitThrowMode);
|
||||
};
|
||||
};
|
||||
|
||||
// Middle mouse button
|
||||
if (_key == 2 && {!_primed}) exitWith {
|
||||
[ACE_player, true] call FUNC(prime);
|
||||
};
|
48
addons/advanced_throwing/functions/fnc_onMouseScroll.sqf
Normal file
48
addons/advanced_throwing/functions/fnc_onMouseScroll.sqf
Normal file
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Author: Dslyecxi, Jonpas
|
||||
* Mouse scroll wheel changed event.
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_advanced_throwing_fnc_onMouseScroll
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if !(ACE_player getVariable [QGVAR(inHand), false]) exitWith {};
|
||||
|
||||
params ["", "_amount"];
|
||||
|
||||
if (ACE_player getVariable [QGVAR(dropMode), false]) then {
|
||||
private _dropDistance = ACE_player getVariable [QGVAR(dropDistance), DROP_DISTANCE_DEFAULT];
|
||||
if (_amount < 0) then {
|
||||
// Move closer
|
||||
ACE_player setVariable [QGVAR(dropDistance), (_dropDistance - 0.1) max DROP_DISTANCE_DEFAULT];
|
||||
} else {
|
||||
// Move further
|
||||
ACE_player setVariable [QGVAR(dropDistance), (_dropDistance + 0.1) min 1];
|
||||
};
|
||||
|
||||
// Limit distance in vehicle
|
||||
if (vehicle ACE_player != ACE_player) then {
|
||||
ACE_player setVariable [QGVAR(dropDistance), (ACE_player getVariable [QGVAR(dropDistance), DROP_DISTANCE_DEFAULT]) min 0.5];
|
||||
};
|
||||
} else {
|
||||
private _throwType = ACE_player getVariable [QGVAR(throwType), THROW_TYPE_DEFAULT];
|
||||
if (_amount < 0) then {
|
||||
if (_throwType == "high") then {
|
||||
ACE_player setVariable [QGVAR(throwType), THROW_TYPE_DEFAULT];
|
||||
};
|
||||
} else {
|
||||
if (_throwType == "normal") then {
|
||||
ACE_player setVariable [QGVAR(throwType), "high"];
|
||||
};
|
||||
};
|
||||
TRACE_2("Change Throw Type",_amount,ACE_player getVariable QGVAR(throwType));
|
||||
};
|
61
addons/advanced_throwing/functions/fnc_pickUp.sqf
Normal file
61
addons/advanced_throwing/functions/fnc_pickUp.sqf
Normal file
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Author: Jonpas
|
||||
* Picks up a throwable from the ground.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Pick Up Helper <OBJECT>
|
||||
* 1: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [helper, player] call ace_advanced_throwing_fnc_pickUp
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_helper", "_unit"];
|
||||
TRACE_2("params",_helper,_unit);
|
||||
|
||||
private _activeThrowable = _helper getVariable [QGVAR(throwable), objNull];
|
||||
|
||||
if (isNull _activeThrowable) exitWith {TRACE_2("throwable is null",_helper,_activeThrowable);};
|
||||
|
||||
// Detach if attached (to vehicle for example or another player)
|
||||
private _attachedTo = attachedTo _activeThrowable;
|
||||
if (!isNull _attachedTo) then {
|
||||
private _attachedList = _attachedTo getVariable [QEGVAR(attach,attached), []];
|
||||
{
|
||||
_x params ["_xObject"];
|
||||
if (_activeThrowable == _xObject) exitWith {
|
||||
TRACE_2("removing from ace_attach",_attachedTo,_attachedList);
|
||||
_attachedList deleteAt _forEachIndex;
|
||||
_attachedTo setVariable [QEGVAR(attach,attached), _attachedList, true];
|
||||
};
|
||||
} forEach _attachedList;
|
||||
detach _activeThrowable;
|
||||
};
|
||||
|
||||
// Change locality for manipulation (some commands require local object, such as setVelocity)
|
||||
if (!local _activeThrowable) then {
|
||||
["ace_setOwner", [_activeThrowable, CBA_clientID]] call CBA_fnc_serverEvent;
|
||||
|
||||
// Mark when it's safe to exit throw mode (locality change has delay)
|
||||
_unit setVariable [QGVAR(localityChanged), false];
|
||||
[{
|
||||
// Becomes local or times out
|
||||
local (_this select 0) || {(_this select 1) + 5 < CBA_missionTime}
|
||||
}, {
|
||||
(_this select 2) setVariable [QGVAR(localityChanged), true];
|
||||
}, [_activeThrowable, CBA_missionTime, _unit]] call CBA_fnc_waitUntilAndExecute;
|
||||
};
|
||||
|
||||
// Invoke listenable event
|
||||
["ace_throwablePickedUp", [_activeThrowable, _unit, _attachedTo]] call CBA_fnc_localEvent;
|
||||
|
||||
_unit setVariable [QGVAR(primed), true];
|
||||
_unit setVariable [QGVAR(activeThrowable), _activeThrowable];
|
||||
|
||||
_unit call FUNC(prepare);
|
53
addons/advanced_throwing/functions/fnc_prepare.sqf
Normal file
53
addons/advanced_throwing/functions/fnc_prepare.sqf
Normal file
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Author: Dslyecxi, Jonpas
|
||||
* Prepares throwable or selects the next.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [unit] call ace_advanced_throwing_fnc_prepare
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
TRACE_1("params",_unit);
|
||||
|
||||
// Select next throwable if one already in hand
|
||||
if (_unit getVariable [QGVAR(inHand), false]) exitWith {
|
||||
TRACE_1("inHand",_unit);
|
||||
if (!(_unit getVariable [QGVAR(primed), false])) then {
|
||||
TRACE_1("not primed",_unit);
|
||||
// Restore muzzle ammo (setAmmo 1 has no impact if no appliccable throwable in inventory)
|
||||
// selectNextGrenade relies on muzzles array (setAmmo 0 removes the muzzle from the array and current can't be found, cycles between 0 and 1 muzzles)
|
||||
ACE_player setAmmo [ACE_player getVariable [QGVAR(activeMuzzle), ""], 1];
|
||||
[_unit] call EFUNC(weaponselect,selectNextGrenade);
|
||||
};
|
||||
};
|
||||
|
||||
// Try selecting next throwable if none currently selected
|
||||
if (isNull (_unit getVariable [QGVAR(activeThrowable), objNull]) && {(currentThrowable _unit) isEqualTo []} && {!([_unit] call EFUNC(weaponselect,selectNextGrenade))}) exitWith {
|
||||
TRACE_1("no throwables",_unit);
|
||||
};
|
||||
|
||||
|
||||
_unit setVariable [QGVAR(inHand), true];
|
||||
|
||||
// Add controls hint
|
||||
call FUNC(updateControlsHint);
|
||||
|
||||
// Add throw action to suppress weapon firing (not possible to suppress mouseButtonDown event)
|
||||
_unit setVariable [QGVAR(throwAction), [_unit, "DefaultAction", {true}, {true}] call EFUNC(common,addActionEventHandler)];
|
||||
|
||||
// Draw throwable and throw arc if enabled
|
||||
GVAR(draw3DHandle) = addMissionEventHandler ["Draw3D", {
|
||||
call FUNC(drawThrowable);
|
||||
if (GVAR(showThrowArc)) then {
|
||||
call FUNC(drawArc);
|
||||
};
|
||||
}];
|
66
addons/advanced_throwing/functions/fnc_prime.sqf
Normal file
66
addons/advanced_throwing/functions/fnc_prime.sqf
Normal file
@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Author: Dslyecxi, Jonpas
|
||||
* Primes the throwable, creates global throwable vehicle and throws Fired XEH.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
* 1: Show Hint <BOOL> (default: false)
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [unit] call ace_advanced_throwing_fnc_prime
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit", ["_showHint", false]];
|
||||
TRACE_2("params",_unit,_showHint);
|
||||
|
||||
_unit setVariable [QGVAR(primed), true];
|
||||
|
||||
// Remove item before cooking to prevent weaponselect showing more throwables than there actually are in inventory
|
||||
private _throwableMag = (currentThrowable _unit) select 0;
|
||||
_unit removeItem _throwableMag;
|
||||
|
||||
private _throwableType = getText (configFile >> "CfgMagazines" >> _throwableMag >> "ammo");
|
||||
private _muzzle = _unit getVariable [QGVAR(activeMuzzle), ""];
|
||||
|
||||
// Set muzzle ammo to 0 to block vanilla throwing (can only be 0 or 1), removeItem above resets it
|
||||
_unit setAmmo [_muzzle, 0];
|
||||
|
||||
// Handle weird scripted grenades (RHS) which could cause unexpected behaviour
|
||||
private _nonInheritedCfg = configProperties [configFile >> "CfgAmmo" >> _throwableType, 'configName _x == QGVAR(replaceWith)', false];
|
||||
if ((count _nonInheritedCfg) == 1) then {
|
||||
_throwableType = getText (_nonInheritedCfg select 0);
|
||||
};
|
||||
|
||||
// Create actual throwable globally
|
||||
private _activeThrowableOld = _unit getVariable [QGVAR(activeThrowable), objNull];
|
||||
private _activeThrowable = createVehicle [_throwableType, _activeThrowableOld, [], 0, "CAN_COLLIDE"];
|
||||
_unit setVariable [QGVAR(activeThrowable), _activeThrowable];
|
||||
deleteVehicle _activeThrowableOld;
|
||||
|
||||
// Throw Fired XEH
|
||||
[QGVAR(throwFiredXEH), [
|
||||
_unit, // unit
|
||||
"Throw", // weapon
|
||||
_muzzle, // muzzle
|
||||
_muzzle, // mode
|
||||
_throwableType, // ammo
|
||||
_throwableMag, // magazine
|
||||
_activeThrowable // projectile
|
||||
]] call CBA_fnc_globalEvent;
|
||||
|
||||
if (_showHint) then {
|
||||
// Show primed hint
|
||||
private _displayNameShort = getText (configFile >> "CfgMagazines" >> _throwableMag >> "displayNameShort");
|
||||
private _picture = getText (configFile >> "CfgMagazines" >> _throwableMag >> "picture");
|
||||
|
||||
[[_displayNameShort, localize LSTRING(Primed)] joinString " ", _picture] call EFUNC(common,displayTextPicture);
|
||||
|
||||
// Change controls hint for RMB
|
||||
call FUNC(updateControlsHint);
|
||||
};
|
@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Author: PabstMirror, Jonpas
|
||||
* When interact_menu starts rendering (from "interact_keyDown" event).
|
||||
* Add pick up helpers to all nearby throwables and keep setting them to their position (setVariable and attachTo does not work on CfgAmmo).
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* call ace_advanced_throwing_fnc_renderPickUpInteraction
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
[{
|
||||
params ["_args", "_idPFH"];
|
||||
_args params ["_setPosition", "_addedPickUpHelpers", "_throwablesHelped", "_nearThrowables"];
|
||||
|
||||
// isNull is necessarry to prevent rare error when ending mission with interact key down
|
||||
if (EGVAR(interact_menu,keyDown) && {!isNull ACE_player}) then {
|
||||
// Rescan when player moved >5 meters from last pos, nearObjects can be costly with a lot of objects around
|
||||
if ((getPosASL ACE_player) distance _setPosition > 5) then {
|
||||
// Grenades inherit from GrenadeHand, IR throwbles from IRStrobeBase, IR Chemlights are special snowflakes
|
||||
// nearEntities does not see throwables
|
||||
_nearThrowables = ACE_player nearObjects ["GrenadeHand", PICK_UP_DISTANCE];
|
||||
_nearThrowables append (ACE_player nearObjects ["IRStrobeBase", PICK_UP_DISTANCE]);
|
||||
_nearThrowables append (ACE_player nearObjects ["ACE_Chemlight_IR_Dummy", PICK_UP_DISTANCE]);
|
||||
|
||||
{
|
||||
if (!(_x in _throwablesHelped) &&
|
||||
{!(_x isKindOf "SmokeShellArty")} && {!(_x isKindOf "G_40mm_Smoke")} && // All smokes inherit from "GrenadeHand" >> "SmokeShell"
|
||||
{GVAR(enablePickUpAttached) || {!GVAR(enablePickUpAttached) && {isNull (attachedTo _x)}}}
|
||||
) then {
|
||||
TRACE_2("Making PickUp Helper",_x,typeOf _x);
|
||||
private _pickUpHelper = QGVAR(pickUpHelper) createVehicleLocal [0, 0, 0];
|
||||
|
||||
_pickUpHelper attachTo [_x, [0, 0, 0]];
|
||||
_pickUpHelper setVariable [QGVAR(throwable), _x];
|
||||
|
||||
_addedPickUpHelpers pushBack _pickUpHelper;
|
||||
_throwablesHelped pushBack _x;
|
||||
};
|
||||
nil
|
||||
} count _nearThrowables;
|
||||
|
||||
_args set [0, getPosASL ACE_player];
|
||||
_args set [3, _nearThrowables];
|
||||
};
|
||||
|
||||
// Make sure helper is on correct location as it will not automatically move
|
||||
// attachTo is not supported with CfgAmmo, it is only used to get location
|
||||
{
|
||||
// Only handling with attachTo works nicely
|
||||
_x attachTo [_x getVariable [QGVAR(throwable), objNull], [0, 0, 0]];
|
||||
nil
|
||||
} count _addedPickUpHelpers;
|
||||
} else {
|
||||
TRACE_1("Cleaning Pick Up Helpers",count _addedPickUpHelpers);
|
||||
{deleteVehicle _x} count _addedPickUpHelpers;
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
}, 0, [(getPosASL ACE_player) vectorAdd [-100, 0, 0], [], [], []]] call CBA_fnc_addPerFrameHandler;
|
83
addons/advanced_throwing/functions/fnc_throw.sqf
Normal file
83
addons/advanced_throwing/functions/fnc_throw.sqf
Normal file
@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Author: Dslyecxi, Jonpas
|
||||
* Throw selected throwable.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* unit call ace_advanced_throwing_fnc_throw
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
TRACE_1("params",_unit);
|
||||
|
||||
// Prime the throwable if it hasn't been cooking already
|
||||
// Next to proper simulation this also has to happen before delay for orientation of the throwable to be set
|
||||
if (!(_unit getVariable [QGVAR(primed), false])) then {
|
||||
[_unit] call FUNC(prime);
|
||||
};
|
||||
|
||||
[_unit, "ThrowGrenade"] call EFUNC(common,doGesture);
|
||||
|
||||
// Pass position to reset later because animation may change it in certain stances
|
||||
[{
|
||||
params ["_unit", "_activeThrowable", "_posThrown", "_throwType", "_throwSpeed", "_dropMode"];
|
||||
TRACE_6("delayParams",_unit,_activeThrowable,_posThrown,_throwType,_throwSpeed,_dropMode);
|
||||
|
||||
// Reset position in case animation changed it
|
||||
_activeThrowable setPosASL _posThrown;
|
||||
|
||||
// Launch actual throwable
|
||||
private _direction = [THROWSTYLE_NORMAL_DIR, THROWSTYLE_HIGH_DIR] select (_throwType == "high" || {_dropMode});
|
||||
private _velocity = [_throwSpeed, _throwSpeed / THROWSTYLE_HIGH_VEL_COEF / 1.25] select (_throwType == "high");
|
||||
_velocity = [_velocity, THROWSTYLE_DROP_VEL] select _dropMode;
|
||||
|
||||
private _p2 = (eyePos _unit) vectorAdd (AGLToASL (positionCameraToWorld _direction)) vectorDiff (AGLToASL (positionCameraToWorld [0, 0, 0]));
|
||||
private _p1 = AGLtoASL (_activeThrowable modelToWorldVisual [0, 0, 0]);
|
||||
|
||||
private _newVelocity = (_p1 vectorFromTo _p2) vectorMultiply _velocity;
|
||||
|
||||
// Adjust for throwing from inside vehicles, where we have a vehicle-based velocity that can't be compensated for by a human
|
||||
if (vehicle _unit != _unit) then {
|
||||
_newVelocity = _newVelocity vectorAdd (velocity (vehicle _unit));
|
||||
};
|
||||
|
||||
// Drop if unit dies during throw process
|
||||
if (alive _unit) then {
|
||||
_activeThrowable setVelocity _newVelocity;
|
||||
};
|
||||
|
||||
// Invoke listenable event
|
||||
["ace_throwableThrown", [_unit, _activeThrowable]] call CBA_fnc_localEvent;
|
||||
}, [
|
||||
_unit,
|
||||
_unit getVariable [QGVAR(activeThrowable), objNull],
|
||||
getPosASLVisual (_unit getVariable [QGVAR(activeThrowable), objNull]),
|
||||
_unit getVariable [QGVAR(throwType), THROW_TYPE_DEFAULT],
|
||||
_unit getVariable [QGVAR(throwSpeed), THROW_SPEED_DEFAULT],
|
||||
_unit getVariable [QGVAR(dropMode), false]
|
||||
], 0.3] call CBA_fnc_waitAndExecute;
|
||||
|
||||
|
||||
#ifdef DRAW_THROW_PATH
|
||||
GVAR(predictedPath) = call FUNC(drawArc); // save the current throw arc
|
||||
GVAR(flightPath) = [];
|
||||
[_unit getVariable QGVAR(activeThrowable)] spawn {
|
||||
params ["_grenade"];
|
||||
while {!isNull _grenade} do {
|
||||
GVAR(flightPath) pushBack ASLtoAGL getPosASL _grenade;
|
||||
sleep 0.05;
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
// Stop rendering arc and doing rendering magic while throw is happening
|
||||
[_unit, "Completed a throw fully"] call FUNC(exitThrowMode);
|
28
addons/advanced_throwing/functions/fnc_throwFiredXEH.sqf
Normal file
28
addons/advanced_throwing/functions/fnc_throwFiredXEH.sqf
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Author: CBA Team
|
||||
* Throws Fired XEH.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: unit - Object the event handler is assigned to <OBJECT>
|
||||
* 1: weapon - Fired weapon <STRING>
|
||||
* 2: muzzle - Muzzle that was used <STRING>
|
||||
* 3: mode - Current mode of the fired weapon <STRING>
|
||||
* 4: ammo - Ammo used <STRING>
|
||||
* 5: magazine - magazine name which was used <STRING>
|
||||
* 6: projectile - Object of the projectile that was shot <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [unit, "weapon", "muzle", "mode", "ammo", "magazine", projectile] call ace_advanced_throwing_fnc_throwFiredXEH
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
TRACE_1("Fired",_this);
|
||||
|
||||
{
|
||||
_this call _x;
|
||||
} forEach ((_this select 0) getVariable "cba_xeh_fired");
|
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Author: Jonpas
|
||||
* Updates controls hints based on current state.
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call ace_advanced_throwing_fnc_updateControlsHint
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (!GVAR(showMouseControls)) exitWith {};
|
||||
|
||||
private _primed = ACE_player getVariable [QGVAR(primed), false];
|
||||
|
||||
private _mmb = [localize LSTRING(ChangeMode), localize LSTRING(Extend)] select (ACE_player getVariable [QGVAR(dropMode), false]);
|
||||
|
||||
if (!_primed) then {
|
||||
_mmb = [_mmb, localize LSTRING(Cook)] joinString " / ";
|
||||
};
|
||||
|
||||
[
|
||||
localize LSTRING(Throw),
|
||||
[localize ELSTRING(common,Cancel), ""] select _primed,
|
||||
_mmb
|
||||
] call EFUNC(interaction,showMouseHint);
|
1
addons/advanced_throwing/functions/script_component.hpp
Normal file
1
addons/advanced_throwing/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
||||
#include "\z\ace\addons\advanced_throwing\script_component.hpp"
|
31
addons/advanced_throwing/script_component.hpp
Normal file
31
addons/advanced_throwing/script_component.hpp
Normal file
@ -0,0 +1,31 @@
|
||||
#define COMPONENT advanced_throwing
|
||||
#define COMPONENT_BEAUTIFIED Advanced Throwing
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
// #define DRAW_THROW_PATH
|
||||
// #define ALLOW_QUICK_THROW
|
||||
// #define DEBUG_MODE_FULL
|
||||
// #define DISABLE_COMPILE_CACHE
|
||||
// #define ENABLE_PERFORMANCE_COUNTERS
|
||||
|
||||
#ifdef DEBUG_ENABLED_ADVANCED_THROWING
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SETTINGS_ADVANCED_THROWING
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_ADVANCED_THROWING
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
|
||||
|
||||
#define THROWSTYLE_NORMAL_DIR [0, 70, 500]
|
||||
#define THROWSTYLE_HIGH_DIR [0, 200, 500]
|
||||
#define THROWSTYLE_HIGH_VEL_COEF 2
|
||||
#define THROWSTYLE_DROP_VEL 2
|
||||
|
||||
#define THROW_TYPE_DEFAULT "normal"
|
||||
#define THROW_SPEED_DEFAULT 18
|
||||
#define DROP_DISTANCE_DEFAULT 0.2
|
||||
|
||||
#define PICK_UP_DISTANCE 10
|
131
addons/advanced_throwing/stringtable.xml
Normal file
131
addons/advanced_throwing/stringtable.xml
Normal file
@ -0,0 +1,131 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project name="ACE">
|
||||
<Package name="Advanced_Throwing">
|
||||
<Key ID="STR_ACE_Advanced_Throwing_Category">
|
||||
<English>Advanced Throwing</English>
|
||||
<Russian>Улучшенный бросок гранат</Russian>
|
||||
<Japanese>アドバンスド投てき</Japanese>
|
||||
<Polish>Zaawansowane rzucanie</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Throwing_Module_Description">
|
||||
<English>Allows changing advanced throwing behaviour.</English>
|
||||
<Russian>Позволяет настраивать поведение улучшенного броска гранат.</Russian>
|
||||
<Japanese>アドバンスド投てきの挙動変更を許可します。</Japanese>
|
||||
<Polish>Zezwala na zmianę zachowania zaawansowanego trybu rzucania.</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Throwing_Enable_DisplayName">
|
||||
<English>Enable Advanced Throwing</English>
|
||||
<Russian>Включить улучшенный бросок</Russian>
|
||||
<Japanese>アドバンスド投てきを有効化</Japanese>
|
||||
<Polish>Aktywuj zaawansowane rzucanie</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Throwing_Enable_Description">
|
||||
<English>Enables advanced throwing system.</English>
|
||||
<Russian>Включает систему улучшенного броска.</Russian>
|
||||
<Japanese>アドバンスド投てきシステムを有効化</Japanese>
|
||||
<Polish>Aktywuje system zaawansowanego rzucania.</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Throwing_ShowThrowArc_DisplayName">
|
||||
<English>Show Throw Arc</English>
|
||||
<Russian>Показать траекторию броска</Russian>
|
||||
<Japanese>軌道を表示</Japanese>
|
||||
<Polish>Pokaż trasę lotu</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Throwing_ShowThrowArc_Description">
|
||||
<English>Enables visualization of the throw arc (where throwable will fly).</English>
|
||||
<Russian>Включает визуализацию траектории броска (как полетит граната).</Russian>
|
||||
<Japanese>投てき物の予測軌道の表示を有効化します。</Japanese>
|
||||
<Polish>Wyświetla wizualizację trasy przelotu granatu.</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Throwing_ShowMouseControls_DisplayName">
|
||||
<English>Show Throwing Mouse Controls</English>
|
||||
<Russian>Показывать управление мышью</Russian>
|
||||
<Japanese>投てきのマウス操作を表示</Japanese>
|
||||
<Polish>Pokaż podpowiedzi sterowania myszą</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Throwing_ShowMouseControls_Description">
|
||||
<English>Enables visual cues for mouse controls when throwable is prepared.</English>
|
||||
<Russian>Включает отображение подсказок по управлению мышью, когда граната подготовлена.</Russian>
|
||||
<Japanese>投てき物を投げるとき、マウス操作の説明表示を有効化します。</Japanese>
|
||||
<Polish>Wyświetla podpowiedzi sterowania myszą kiedy obiekt miotany jest w ręku.</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Throwing_EnablePickUp_DisplayName">
|
||||
<English>Enable Throwables Pick Up</English>
|
||||
<Russian>Включить подбор гранат</Russian>
|
||||
<Japanese>投てき物の拾い上げを有効化</Japanese>
|
||||
<Polish>Zezwól na podnoszenie obiektów miotanych</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Throwing_EnablePickUp_Description">
|
||||
<English>Enables ability to pick up throwables from the ground.</English>
|
||||
<Russian>Включает возможность подбирать гранаты с земли.</Russian>
|
||||
<Japanese>地面に落ちている投てき物の拾い上げ動作を有効化します。</Japanese>
|
||||
<Polish>Umożliwia podnoszenie obiektów miotanych z ziemi.</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Throwing_EnablePickUpAttached_DisplayName">
|
||||
<English>Enable Attached Throwables Pick Up</English>
|
||||
<Russian>Включить подбор прикрепленных гранат</Russian>
|
||||
<Japanese>拾い上げた投てき物の取り付けを有効化</Japanese>
|
||||
<Polish>Zezwól na podnoszenie przyczepionych obiektów miotanych</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Throwing_EnablePickUpAttached_Description">
|
||||
<English>Enables ability to pick up throwables from attached objects.</English>
|
||||
<Russian>Включает возможность подбирать гранаты, прикрепленные к объектам.</Russian>
|
||||
<Japanese>オブジェクトに取り付けられていた投てき物を拾い上げられるようにします。</Japanese>
|
||||
<Polish>Umożliwia podnoszenie obiektów miotanych przyczepionych do innych obiektów.</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Throwing_Prepare">
|
||||
<English>Prepare/Change Throwable</English>
|
||||
<Russian>Подготовить/заменить гранату</Russian>
|
||||
<Japanese>機能の起動/変更</Japanese>
|
||||
<Polish>Przygotuj/zmień ob. miotany</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Throwing_dropModeHold">
|
||||
<English>Throwable Drop Mode (Hold)</English>
|
||||
<Russian>Режим броска гранаты (удерживать)</Russian>
|
||||
<Japanese>投てきモード (押しっぱ)</Japanese>
|
||||
<Polish>Tryb upuszczania ob. miotanego (przytrzymaj)</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Throwing_DropModeToggle">
|
||||
<English>Throwable Drop Mode (Toggle)</English>
|
||||
<Russian>Режим броска гранаты (переключить)</Russian>
|
||||
<Japanese>投てきモード (トグル)</Japanese>
|
||||
<Polish>Tryb upuszczania ob. miotanego (przełącz)</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Throwing_Primed">
|
||||
<English>Primed</English>
|
||||
<Russian>Подготовлена</Russian>
|
||||
<Japanese>起動した</Japanese>
|
||||
<Polish>Odbezpieczony</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Throwing_Throw">
|
||||
<English>Throw</English>
|
||||
<Russian>Бросить</Russian>
|
||||
<Japanese>投げる</Japanese>
|
||||
<Polish>Rzuć</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Throwing_ChangeMode">
|
||||
<English>(Scroll) Change Mode</English>
|
||||
<Russian>(Скролл) Изменить режим</Russian>
|
||||
<Japanese>(スクロール) モード変更</Japanese>
|
||||
<Polish>(Kółko m.) zmień tryb</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Throwing_Extend">
|
||||
<English>(Scroll) Extend</English>
|
||||
<Russian>(Скролл) Увеличить</Russian>
|
||||
<Japanese>(スクロール) 遠くに</Japanese>
|
||||
<Polish>(Kółko m.) przedłuż</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Throwing_Cook">
|
||||
<English>(Click) Cook</English>
|
||||
<Russian>(Клик) Подготовить</Russian>
|
||||
<Japanese>(クリック) 起爆</Japanese>
|
||||
<Polish>(Kliknięcie) Odbezpiecz</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Advanced_Throwing_PickUp">
|
||||
<English>Pick Up</English>
|
||||
<Russian>Подобрать</Russian>
|
||||
<Japanese>拾い上げる</Japanese>
|
||||
<Polish>Podnieś</Polish>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
@ -2,8 +2,6 @@
|
||||
// weapon config changes, by commy2
|
||||
|
||||
/* documentation:
|
||||
aiDispersionCoefX = 1.0 Dispersion multiplier for AI units (axis X - left to right).
|
||||
aiDispersionCoefY = 1.0 Dispersion multiplier for AI units (axis Y - top-down).
|
||||
aiRateOfFire = 5.0 Delay between shots at given aiRateOfFireDistance.
|
||||
aiRateOfFireDistance = 500 At shorter distance delay (aiRateOfFire) goes linearly to zero.
|
||||
*/
|
||||
@ -15,19 +13,12 @@ class Mode_FullAuto;
|
||||
class CfgWeapons {
|
||||
|
||||
// rifles
|
||||
class RifleCore;
|
||||
class Rifle: RifleCore {
|
||||
aiDispersionCoefX = 6;
|
||||
aiDispersionCoefY = 6;
|
||||
};
|
||||
|
||||
class Rifle_Base_F: Rifle {};
|
||||
class Rifle_Long_Base_F: Rifle_Base_F {};
|
||||
class Rifle_Base_F;
|
||||
class Rifle_Short_Base_F;
|
||||
class Rifle_Long_Base_F;
|
||||
|
||||
// MX
|
||||
class arifle_MX_Base_F: Rifle_Base_F {
|
||||
aiDispersionCoefY = 18.0;
|
||||
aiDispersionCoefX = 12.0;
|
||||
modes[] += {"ACE_Burst_far"};
|
||||
|
||||
class Single: Mode_SemiAuto {
|
||||
@ -70,8 +61,6 @@ class CfgWeapons {
|
||||
|
||||
// MX carbine
|
||||
class arifle_MXC_F: arifle_MX_Base_F {
|
||||
aiDispersionCoefY = 18.0;
|
||||
aiDispersionCoefX = 12.0;
|
||||
|
||||
class Single: Single {
|
||||
minRange = 120; // 2;
|
||||
@ -143,8 +132,6 @@ class CfgWeapons {
|
||||
|
||||
// MX machine gun
|
||||
class arifle_MX_SW_F: arifle_MX_Base_F {
|
||||
aiDispersionCoefY = 24.0;
|
||||
aiDispersionCoefX = 21.0;
|
||||
// Shit is still broken
|
||||
//modes[] += {"ACE_Burst_far"};
|
||||
modes[] = {"Single","manual","close","short","medium","far_optic1","far_optic2","ACE_Burst_far"};
|
||||
@ -180,8 +167,6 @@ class CfgWeapons {
|
||||
|
||||
// Katiba
|
||||
class arifle_Katiba_Base_F: Rifle_Base_F {
|
||||
aiDispersionCoefY = 18.0;
|
||||
aiDispersionCoefX = 12.0;
|
||||
modes[] += {"ACE_Burst_far"};
|
||||
|
||||
class Single: Mode_SemiAuto {
|
||||
@ -224,8 +209,6 @@ class CfgWeapons {
|
||||
|
||||
// Katiba carbine
|
||||
class arifle_Katiba_C_F: arifle_Katiba_Base_F {
|
||||
aiDispersionCoefY = 18.0;
|
||||
aiDispersionCoefX = 12.0;
|
||||
|
||||
class Single: Single {
|
||||
minRange = 120; // 2;
|
||||
@ -268,8 +251,6 @@ class CfgWeapons {
|
||||
|
||||
// F2002
|
||||
class mk20_base_F: Rifle_Base_F {
|
||||
aiDispersionCoefY = 18.0;
|
||||
aiDispersionCoefX = 12.0;
|
||||
modes[] += {"ACE_Burst_far"};
|
||||
|
||||
class Single: Mode_SemiAuto {
|
||||
@ -316,8 +297,6 @@ class CfgWeapons {
|
||||
|
||||
// F2002 carbine
|
||||
class arifle_Mk20C_F: mk20_base_F {
|
||||
aiDispersionCoefY = 18.0;
|
||||
aiDispersionCoefX = 12.0;
|
||||
|
||||
class Single: Single {
|
||||
minRange = 120; // 2;
|
||||
@ -358,8 +337,6 @@ class CfgWeapons {
|
||||
|
||||
// TAR-20
|
||||
class Tavor_base_F: Rifle_Base_F {
|
||||
aiDispersionCoefY = 18.0;
|
||||
aiDispersionCoefX = 12.0;
|
||||
modes[] += {"ACE_Burst_far"};
|
||||
|
||||
class Single: Mode_SemiAuto {
|
||||
@ -407,8 +384,6 @@ class CfgWeapons {
|
||||
|
||||
// TAR-21
|
||||
class arifle_TRG21_F: Tavor_base_F {
|
||||
aiDispersionCoefY = 18.0;
|
||||
aiDispersionCoefX = 12.0;
|
||||
|
||||
class Single: Single {
|
||||
minRange = 120; // 2;
|
||||
@ -457,8 +432,6 @@ class CfgWeapons {
|
||||
|
||||
// SDAR
|
||||
class SDAR_base_F: Rifle_Base_F {
|
||||
aiDispersionCoefY = 28.0;
|
||||
aiDispersionCoefX = 20.0;
|
||||
|
||||
class Single: Mode_SemiAuto {
|
||||
minRange = 10; //2;
|
||||
@ -470,9 +443,7 @@ class CfgWeapons {
|
||||
};
|
||||
|
||||
// PD2000
|
||||
class pdw2000_base_F: Rifle_Base_F {
|
||||
aiDispersionCoefY = 18.0;
|
||||
aiDispersionCoefX = 12.0;
|
||||
class pdw2000_base_F: Rifle_Short_Base_F {
|
||||
|
||||
class Single: Mode_SemiAuto {
|
||||
minRange = 100; //2;
|
||||
@ -484,9 +455,7 @@ class CfgWeapons {
|
||||
};
|
||||
|
||||
// Vector
|
||||
class SMG_01_Base: Rifle_Base_F {
|
||||
aiDispersionCoefY = 18.0;
|
||||
aiDispersionCoefX = 12.0;
|
||||
class SMG_01_Base: Rifle_Short_Base_F {
|
||||
|
||||
class Single: Mode_SemiAuto {
|
||||
minRange = 50; //2;
|
||||
@ -499,8 +468,6 @@ class CfgWeapons {
|
||||
|
||||
// Scorpion EVO
|
||||
class SMG_02_base_F: Rifle_Base_F {
|
||||
aiDispersionCoefY = 18.0;
|
||||
aiDispersionCoefX = 12.0;
|
||||
|
||||
class Single: Mode_SemiAuto {
|
||||
minRange = 50; //2;
|
||||
@ -515,8 +482,6 @@ class CfgWeapons {
|
||||
|
||||
// Stoner
|
||||
class LMG_Mk200_F: Rifle_Long_Base_F {
|
||||
aiDispersionCoefY = 24.0;
|
||||
aiDispersionCoefX = 21.0;
|
||||
modes[] += {"ACE_Burst_far"};
|
||||
|
||||
class medium;
|
||||
@ -544,8 +509,6 @@ class CfgWeapons {
|
||||
|
||||
// Negev
|
||||
class LMG_Zafir_F: Rifle_Long_Base_F {
|
||||
aiDispersionCoefY = 23.0;
|
||||
aiDispersionCoefX = 19.0;
|
||||
modes[] += {"ACE_Burst_far"};
|
||||
|
||||
class Single: Mode_SemiAuto {
|
||||
@ -719,8 +682,6 @@ class CfgWeapons {
|
||||
|
||||
// marksmen medium mg
|
||||
class MMG_01_base_F: Rifle_Long_Base_F {
|
||||
aiDispersionCoefY = 25.0;
|
||||
aiDispersionCoefX = 20.0;
|
||||
modes[] += {"ACE_Burst_far"};
|
||||
|
||||
class manual;
|
||||
@ -745,8 +706,6 @@ class CfgWeapons {
|
||||
};
|
||||
|
||||
class MMG_02_base_F: Rifle_Long_Base_F {
|
||||
aiDispersionCoefY = 20.0;
|
||||
aiDispersionCoefX = 15.0;
|
||||
modes[] += {"ACE_Burst_far"};
|
||||
|
||||
class manual;
|
||||
|
@ -2,12 +2,14 @@
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
name = COMPONENT_NAME;
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author[] = {"KoffeinFlummi","commy2"};
|
||||
authorUrl = "https://github.com/KoffeinFlummi/";
|
||||
author = ECSTRING(common,ACETeam);
|
||||
authors[] = {"KoffeinFlummi","commy2"};
|
||||
url = ECSTRING(main,URL);
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
@ -1,9 +1,9 @@
|
||||
#define COMPONENT ai
|
||||
#define COMPONENT_BEAUTIFIED AI
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
// #define DEBUG_MODE_FULL
|
||||
// #define DISABLE_COMPILE_CACHE
|
||||
// #define CBA_DEBUG_SYNCHRONOUS
|
||||
// #define ENABLE_PERFORMANCE_COUNTERS
|
||||
|
||||
#ifdef DEBUG_ENABLED_AI
|
||||
@ -14,4 +14,4 @@
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_AI
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
|
@ -11,7 +11,7 @@ class CfgAmmo {
|
||||
explosive = 1.8;
|
||||
tracersEvery = 3;
|
||||
tracerEndTime = 3.5;
|
||||
|
||||
|
||||
CraterEffects = "ExploAmmoCrater";
|
||||
explosionEffects = "ExploAmmoExplosion";
|
||||
model = "\A3\Weapons_f\Data\bullettracer\tracer_red";
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -2,13 +2,18 @@
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
name = COMPONENT_NAME;
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author[] = {"KoffeinFlummi","Crusty","commy2","jaynus","Kimi"};
|
||||
authorUrl = "https://github.com/KoffeinFlummi/";
|
||||
author = ECSTRING(common,ACETeam);
|
||||
authors[] = {"KoffeinFlummi","Crusty","commy2","jaynus","Kimi"};
|
||||
url = ECSTRING(main,URL);
|
||||
VERSION_CONFIG;
|
||||
|
||||
// this prevents any patched class from requiring this addon
|
||||
addonRootClass = "A3_Characters_F";
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -20,4 +20,3 @@ envelope[] = {0,0,0.75,2.4,3.6,3.8,3.7,3.2,2.2,1.7,0.9};
|
||||
thrustCoef[] = {1,1.2,1.3,1.25,1.06,1.01,1,0.92,0.75,0.65,0.5,0.25,0};
|
||||
acceleration = 265;
|
||||
landingSpeed = 220;
|
||||
gunAimDown = 0.087266463;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user