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

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
23 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
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 = LSTRING(distanceCoefficient_displayName);
tooltip = LSTRING(distanceCoefficient_toolTip);
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"};
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO this is reserved for people who have contributed significantly in either the creation or the refactoring of a component, https://github.com/acemod/ACE3/blob/master/AUTHORS.txt would be more appropriate for this PR.

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
37 changes: 22 additions & 15 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);
bluefieldcreator marked this conversation as resolved.
Show resolved Hide resolved

// 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);

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
Loading