Overpressure - Add editor range attribute for vehicles (#10411)

* feat: overpressure settings

note: doesnt work yet

* fix: stuff

* feat: overpressure slider

it works fine now

* style: remove macro padding

* doc: fix typo

* lint: fix tabs

* refactor: switch slider attribute to text attribute & add -1 check.

* fix: change to localized strings

* fix: typo

* Update addons/overpressure/functions/fnc_firedEHOP.sqf

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Update addons/overpressure/functions/fnc_firedEHOP.sqf

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Update addons/overpressure/functions/fnc_firedEHOP.sqf

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Update addons/overpressure/functions/fnc_firedEHOP.sqf

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Update addons/overpressure/functions/fnc_firedEHOP.sqf

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* feat: rename CfgEden

* Rename: part 1

* Rename: Part 2

* Update addons/overpressure/CfgEden.hpp

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Update addons/overpressure/functions/fnc_firedEHOP.sqf

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Update fnc_firedEHOP.sqf

Signed-off-by: bluefield <59333909+bluefieldcreator@users.noreply.github.com>

* Update addons/overpressure/functions/fnc_firedEHOP.sqf

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Update addons/overpressure/functions/fnc_firedEHOP.sqf

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Update config.cpp

Signed-off-by: bluefield <59333909+bluefieldcreator@users.noreply.github.com>

* Update AUTHORS.txt

Signed-off-by: bluefield <59333909+bluefieldcreator@users.noreply.github.com>

* Update addons/overpressure/functions/fnc_firedEHOP.sqf

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

* Update addons/overpressure/CfgEden.hpp

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

* Update addons/overpressure/functions/fnc_firedEHOP.sqf

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

* Update fnc_firedEHOP.sqf

Signed-off-by: bluefield <59333909+bluefieldcreator@users.noreply.github.com>

* Update fnc_firedEHOP.sqf

Signed-off-by: bluefield <59333909+bluefieldcreator@users.noreply.github.com>

---------

Signed-off-by: bluefield <59333909+bluefieldcreator@users.noreply.github.com>
Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
This commit is contained in:
bluefield
2024-10-22 20:15:30 +02:00
committed by GitHub
parent 3773684751
commit c87e2cb3b5
4 changed files with 26 additions and 1 deletions

View File

@ -64,6 +64,7 @@ Barman75
Bla1337
BlackPixxel <blackpixxel96@gmail.com>
BlackQwar
Bluefield <tatsuyahayami1@gmail.com>
Brakoviejo
Brisse <brisse@outlook.com>
Brostrom.A | Evul <andreas.brostrom.ce@gmail.com>

View File

@ -0,0 +1,21 @@
class Cfg3DEN {
class Object {
class AttributeCategories {
class ace_attributes {
class Attributes {
class GVAR(overPressureDistanceSetting) {
displayName = CSTRING(distanceCoefficient_displayName);
tooltip = CSTRING(distanceCoefficient_toolTip);
property = QUOTE(overpressureDistanceCoefficient);
control = "Edit";
expression = QUOTE(if (_value >= 0) then { _this setVariable [ARR_3(QQGVAR(distance),_value,true)] });
defaultValue = -1;
validate = "number";
typeName = "NUMBER";
condition = "objectVehicle";
};
};
};
};
};
};

View File

@ -17,3 +17,4 @@ class CfgPatches {
#include "CfgEventHandlers.hpp"
#include "CfgWeapons.hpp"
#include "ACE_Arsenal_Stats.hpp"
#include "CfgEden.hpp"

View File

@ -22,12 +22,14 @@ TRACE_8("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_gunn
private _opValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues);
_opValues params ["_dangerZoneAngle", "_dangerZoneRange", "_dangerZoneDamage"];
_dangerZoneRange = _dangerZoneRange * GVAR(overpressureDistanceCoefficient);
TRACE_3("cache",_dangerZoneAngle,_dangerZoneRange,_dangerZoneDamage);
if (_dangerZoneDamage <= 0) exitWith {};
private _unitOverpressureRangeAttribute = _unit getVariable [QGVAR(distance), GVAR(overpressureDistanceCoefficient)];
_dangerZoneRange = _dangerZoneRange * _unitOverpressureRangeAttribute;
// The weapon produces overpressure, calculate
private _position = getPosASL _projectile;
private _direction = vectorDir _projectile;