Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overpressure - Add editor range attribute for vehicles #10411

Merged
merged 33 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1848969
feat: overpressure settings
bluefieldcreator Oct 13, 2024
10c1601
fix: stuff
bluefieldcreator Oct 13, 2024
e19ee0e
feat: overpressure slider
bluefieldcreator Oct 13, 2024
365877e
style: remove macro padding
bluefieldcreator Oct 13, 2024
db5bdee
doc: fix typo
bluefieldcreator Oct 13, 2024
93cf975
lint: fix tabs
bluefieldcreator Oct 13, 2024
791022c
refactor: switch slider attribute to text attribute & add -1 check.
bluefieldcreator Oct 13, 2024
1f613f0
fix: change to localized strings
bluefieldcreator Oct 13, 2024
6285a18
fix: typo
bluefieldcreator Oct 13, 2024
dcbedf0
Update addons/overpressure/functions/fnc_firedEHOP.sqf
bluefieldcreator Oct 13, 2024
b10cd76
Update addons/overpressure/functions/fnc_firedEHOP.sqf
bluefieldcreator Oct 13, 2024
92b8b8b
Update addons/overpressure/functions/fnc_firedEHOP.sqf
bluefieldcreator Oct 13, 2024
1cb0ce0
Update addons/overpressure/functions/fnc_firedEHOP.sqf
bluefieldcreator Oct 13, 2024
c2273e9
Update addons/overpressure/functions/fnc_firedEHOP.sqf
bluefieldcreator Oct 13, 2024
9f85f2c
feat: rename CfgEden
bluefieldcreator Oct 13, 2024
0c3cc8f
Merge branch 'master' of github.com:anomia-org/ACE3
bluefieldcreator Oct 13, 2024
b6aae55
Rename: part 1
bluefieldcreator Oct 13, 2024
21c892a
Rename: Part 2
bluefieldcreator Oct 13, 2024
9865705
Update addons/overpressure/CfgEden.hpp
bluefieldcreator Oct 13, 2024
07df160
Update addons/overpressure/functions/fnc_firedEHOP.sqf
bluefieldcreator Oct 13, 2024
bdef984
Update fnc_firedEHOP.sqf
bluefieldcreator Oct 13, 2024
2ae3b15
Update addons/overpressure/functions/fnc_firedEHOP.sqf
bluefieldcreator Oct 14, 2024
773eab5
Update addons/overpressure/functions/fnc_firedEHOP.sqf
bluefieldcreator Oct 14, 2024
0c18cc6
Merge branch 'acemod:master' into master
bluefieldcreator Oct 19, 2024
8525e82
Update config.cpp
bluefieldcreator Oct 19, 2024
e1ee573
Update AUTHORS.txt
bluefieldcreator Oct 19, 2024
965429f
Update addons/overpressure/functions/fnc_firedEHOP.sqf
bluefieldcreator Oct 19, 2024
144bdd6
Update addons/overpressure/CfgEden.hpp
bluefieldcreator Oct 19, 2024
6b963d9
Update addons/overpressure/functions/fnc_firedEHOP.sqf
bluefieldcreator Oct 19, 2024
152115a
Update fnc_firedEHOP.sqf
bluefieldcreator Oct 19, 2024
f5d7dc4
Merge branch 'acemod:master' into master
bluefieldcreator Oct 20, 2024
7102c9c
Update fnc_firedEHOP.sqf
bluefieldcreator Oct 20, 2024
5fd440f
Merge branch 'acemod:master' into master
bluefieldcreator Oct 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions addons/overpressure/cfgEden.hpp
LinkIsGrim marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
class Cfg3DEN {
class Object {
class AttributeCategories {
class ace_attributes {
class Attributes {
class GVAR(overPressureDistanceSetting) {
displayName = CSTRING(Overpressure_distanceCoefficient_displayName);
bluefieldcreator marked this conversation as resolved.
Show resolved Hide resolved
tooltip = CSTRING(Overpressure_distanceCoefficient_toolTip);
LinkIsGrim marked this conversation as resolved.
Show resolved Hide resolved
property = QUOTE(overpressureDistanceCoefficient);
control = "Edit";
expression = QUOTE(_this setVariable [ARR_3(QQEGVAR(overpressure,distance),_value,true)]);
defaultValue = -1;
validate = "number";
typeName = "NUMBER";
condition = "objectVehicle";
};
};
};
};
};
};
3 changes: 2 additions & 1 deletion addons/overpressure/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author = ECSTRING(common,ACETeam);
authors[] = {"commy2","KoffeinFlummi","esteldunedain"};
authors[] = {"commy2","KoffeinFlummi","esteldunedain", "bluefield"};
bluefieldcreator marked this conversation as resolved.
Show resolved Hide resolved
url = ECSTRING(main,URL);
VERSION_CONFIG;
};
Expand All @@ -17,3 +17,4 @@
#include "CfgEventHandlers.hpp"
#include "CfgWeapons.hpp"
#include "ACE_Arsenal_Stats.hpp"
#include "CfgEden.hpp"

Check failure on line 20 in addons/overpressure/config.cpp

View workflow job for this annotation

GitHub Actions / build

include not found

not found
39 changes: 23 additions & 16 deletions addons/overpressure/functions/fnc_firedEHOP.sqf
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
#include "..\script_component.hpp"
/*
* Author: joko // Jonas
* Handle fire of Vehicle Weapons. Called from the unified fired EH only for the local player vehicle.
*
* Arguments:
* None. Parameters inherited from EFUNC(common,firedEH)
*
* Return Value:
* None
*
* Example:
* [tank, "cannon_125mm", "cannon_125mm", "player", "Sh_125mm_APFSDS_T_Green", "24Rnd_125mm_APFSDS_T_Green", projectile] call ace_overpressure_fnc_firedEHOP
*
* Public: No
* Handle fire of vehicle weapons. Called from the unified fired EH only for the local player vehicle.
*
* Arguments:
* None. Parameters inherited from EFUNC(common, firedEH)
*
* Return Value:
* None
*
* Example:
* [tank, "cannon_125mm", "cannon_125mm", "player", "Sh_125mm_APFSDS_T_Green", "24Rnd_125mm_APFSDS_T_Green", projectile] call ace_overpressure_fnc_firedEHOP
*
* Public: No
*/

//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
// IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
bluefieldcreator marked this conversation as resolved.
Show resolved Hide resolved
TRACE_8("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_gunner);

// Retrieve overpressure values
private _opValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues);

_opValues params ["_dangerZoneAngle", "_dangerZoneRange", "_dangerZoneDamage"];
_dangerZoneRange = _dangerZoneRange * GVAR(overpressureDistanceCoefficient);

private _unitOverpressureRangeAttribute = _unit getVariable QEGVAR(overpressure,distance);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will be undefined for most cases

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the editor attribute set it to -1 because of default value?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private _unitOverpressureRangeAttribute = _unit getVariable QEGVAR(overpressure,distance);
private _unitOverpressureRangeAttribute = _unit getVariable [QEGVAR(overpressure,distance), -1];

in any case


// If -1 (disabled) we return to server value, otherwise we use the given value.
if(_unitOverpressureRangeAttribute == -1) then { _unitOverpressureRangeAttribute = GVAR(overpressureDistanceCoefficient); };
bluefieldcreator marked this conversation as resolved.
Show resolved Hide resolved


bluefieldcreator marked this conversation as resolved.
Show resolved Hide resolved
_dangerZoneRange = _dangerZoneRange * _unitOverpressureRangeAttribute;

TRACE_3("cache",_dangerZoneAngle,_dangerZoneRange,_dangerZoneDamage);
bluefieldcreator marked this conversation as resolved.
Show resolved Hide resolved

Expand All @@ -32,7 +39,7 @@ if (_dangerZoneDamage <= 0) exitWith {};
private _position = getPosASL _projectile;
private _direction = vectorDir _projectile;

// Damage to others
// damage to others
bluefieldcreator marked this conversation as resolved.
Show resolved Hide resolved
private _affected = (ASLToAGL _position) nearEntities ["CAManBase", _dangerZoneRange];

// Let each client handle their own affected units
Expand Down Expand Up @@ -63,4 +70,4 @@ private _affected = (ASLToAGL _position) nearEntities ["CAManBase", _dangerZoneR
[1,1,0,1]
] call EFUNC(common,addLineToDebugDraw);

#endif
#endif
bluefieldcreator marked this conversation as resolved.
Show resolved Hide resolved
Loading