Skip to content

Commit 2fc4055

Browse files
OverlordZornjonpas
andauthored
Attenuate - Add forceSoundAttenuation to vehicle config (#1402)
CI - Only binarize with HEMTT on main repo Co-authored-by: jonpas <jonpas33@gmail.com>
1 parent 0d366cf commit 2fc4055

File tree

3 files changed

+54
-10
lines changed

3 files changed

+54
-10
lines changed

.github/workflows/arma.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,14 @@ jobs:
3636

3737
build:
3838
runs-on: ubuntu-latest
39+
env:
40+
FPT_SERVER: ${{ secrets.FTP_SERVER }}
3941
steps:
4042
- name: Checkout the source code
4143
uses: actions/checkout@v6
4244
- name: Setup Arma 3 Tools
4345
uses: arma-actions/arma3-tools@master
46+
if: ${{ env.FTP_SERVER != '' }} # Avoid binarizing on forks (exposed secrets)
4447
with:
4548
toolsUrl: ${{ secrets.FTP_SERVER }}/tools/arma3tools.zip
4649
- name: Setup HEMTT

addons/sys_attenuate/fnc_getAttenuationEffectType.sqf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (_turret in [[], [-1]]) exitWith {_effectType};
2727

2828
private _config = [_vehicle, _turret] call CBA_fnc_getTurret;
2929

30-
if ((getNumber (_config >> "disableSoundAttenuation")) isEqualTo 1) exitWith {""};
30+
if (getNumber (configOf _vehicle >> "ACRE" >> "attenuation" >> "forceSoundAttenuation") isEqualTo 0 && {getNumber (_config >> "disableSoundAttenuation") isEqualTo 1}) exitWith {""};
3131

3232
if (isText (_config >> "soundAttenuationTurret")) then {
3333
_effectType = getText (_config >> "soundAttenuationTurret");

docs/wiki/frameworks/vehicle-attenuation.md

Lines changed: 50 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,25 @@ class CfgVehicles {
3939
class ACRE {
4040
// Attenuation between players inside (turned in) separate in compartments
4141
class attenuation {
42-
class Compartment1 {
42+
class Compartment1 {
4343
Compartment1 = 0;
4444
Compartment2 = 0;
4545
Compartment3 = 0;
4646
Compartment4 = 0;
4747
};
48-
class Compartment2 {
48+
class Compartment2 {
4949
Compartment1 = 0;
5050
Compartment2 = 0;
5151
Compartment3 = 0;
5252
Compartment4 = 0;
5353
};
54-
class Compartment3 {
54+
class Compartment3 {
5555
Compartment1 = 0;
5656
Compartment2 = 0;
5757
Compartment3 = 0;
5858
Compartment4 = 0;
5959
};
60-
class Compartment4 {
60+
class Compartment4 {
6161
Compartment1 = 0;
6262
Compartment2 = 0;
6363
Compartment3 = 0;
@@ -67,25 +67,25 @@ class CfgVehicles {
6767

6868
// Attenuation between a turned out player and turned in player sitting in separate compartments
6969
class attenuationTurnedOut {
70-
class Compartment1 {
70+
class Compartment1 {
7171
Compartment1 = 0;
7272
Compartment2 = 0;
7373
Compartment3 = 0;
7474
Compartment4 = 0;
7575
};
76-
class Compartment2 {
76+
class Compartment2 {
7777
Compartment1 = 0;
7878
Compartment2 = 0;
7979
Compartment3 = 0;
8080
Compartment4 = 0;
8181
};
82-
class Compartment3 {
82+
class Compartment3 {
8383
Compartment1 = 0;
8484
Compartment2 = 0;
8585
Compartment3 = 0;
8686
Compartment4 = 0;
8787
};
88-
class Compartment4 {
88+
class Compartment4 {
8989
Compartment1 = 0;
9090
Compartment2 = 0;
9191
Compartment3 = 0;
@@ -130,6 +130,7 @@ but the config `ConfigFile >> CfgVehicles >> myTank >> ACRE >> attenuationTurned
130130
131131
{% include note.html content="The path in the <span style='color:#e3aa2b'>_**yellow**_</span> scenario is different because the value is looked up in the `attenuationTurnedOut` class instead of `attenuation`." %}
132132
133+
133134
## Debugging
134135
135136
You can toggle the ability to view attenuation behaviour at runtime to diagnose issues with compartment configs. It will draw the current attenuation value over all units and a hint will be shown with information about your crew (and their detected compartments) as well as the attenuation values of units outside of a vehicle. You'll also get a short rundown of the configured compartment connection attenuation values for the current vehicle.
@@ -138,4 +139,44 @@ You can toggle the ability to view attenuation behaviour at runtime to diagnose
138139
139140
### Usage
140141
141-
Use the debug console in a mission or editor preview with some units and/or vehicles placed down and execute `call acre_sys_attenuate_fnc_toggleDebugInfo;`.
142+
Use the debug console in a mission or editor preview with some units and/or vehicles placed down and execute `call acre_sys_attenuate_fnc_toggleDebugInfo;`.
143+
144+
#### Disable and Force Attenuation
145+
146+
Most if not all FFV seats inherit `disableSoundAttenuation = 1` from their `CargoTurret` config parent. This causes all FFV seats to ignore any configured sound attenuations.
147+
148+
`forceSoundAttenuation` is available as a shortcut. This avoids having to edit each individual turret and can be used like this:
149+
150+
```cpp
151+
class CfgVehicles {
152+
class ParentVehicle;
153+
class MyVehicle: ParentVehicle {
154+
class ACRE {
155+
class attenuation {
156+
// Force enable attenuation
157+
forceSoundAttenuation = 1;
158+
159+
class Compartment1 {
160+
Compartment1 = 0;
161+
Compartment2 = 0.6;
162+
};
163+
class Compartment2 {
164+
Compartment1 = 0.6;
165+
Compartment2 = 0;
166+
};
167+
};
168+
169+
class attenuationTurnedOut {
170+
class Compartment1 {
171+
Compartment1 = 0.3;
172+
Compartment2 = 0;
173+
};
174+
class Compartment2 {
175+
Compartment1 = 0;
176+
Compartment2 = 0;
177+
};
178+
};
179+
};
180+
};
181+
};
182+
```

0 commit comments

Comments
 (0)