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

Add ACE Arsenal stats #6110

Merged
merged 83 commits into from
Feb 15, 2018
Merged

Add ACE Arsenal stats #6110

merged 83 commits into from
Feb 15, 2018

Conversation

alganthe
Copy link
Contributor

@alganthe alganthe commented Feb 1, 2018

When merged this pull request will:

  • Add ACE Arsenal stats

Stats documentation as well as a documentation overhaul for ACE Arsenal is coming in an other PR.

Current stats::

Click to expand

Default stats

All tabs:

  • Mass, kg / lbs (mass)

Left panel "misc" tabs + the right panel tabs only have mass by default

Primary / handgun weapons

  • Rate of fire, RPM + bar (reloadTime)
  • Accuracy, MIL / MOA + bar (dispersion)
  • Range, bar (maxZeroing)
  • Impact, bar (hit, initspeed)

Launchers

  • Range, bar (maxZeroing)
  • Impact, bar (hit, initspeed)

Uniform / vests

  • Ballistic protection, bar (passthrough)
  • Explosive resistance, bar (armor)
  • Load, bar (maximumLoad)

Backpacks

  • Load, bar (maximumLoad)

Headgear

  • Ballistic protection, bar (passthrough)
  • Explosive resistance, bar (armor)

Ballistic stats

These stats will only show up if the ballistics module is loaded.

Primary / handgun

  • Barrel twist, mm / inches (ACE_barrelTwist)
  • Barrel length, mm / inches (ACE_barrelLength)

Mags

  • Ammo, classname (ammo)
  • Ballistic coefficient, ballistic coef / drag model (ACE_dragModel, ACE_ballisticCoefficients)
  • Bullet mass, g / gr (ACE_bulletMass)

Hearing stats

These stats will only show up if the hearing module is loaded.

Headgear

  • Hearing protection, bar (ACE_hearing_protection)
  • Volume muffling, bar, (ACE_hearing_lowerVolume)

Explosive stat

These stats will only show up if the explosives module is loaded.

Right tab misc

  • Explosive range, m / ft (ACE_explosive_range)

Close #5964

Reason: add support for conditions, less redundant code, less reasons for dedmen to emasculate me
@alganthe
Copy link
Contributor Author

alganthe commented Feb 8, 2018

Added script profiler related macro and code, should be good to go now. (to be removed when ded fixes the profiler)

@@ -5,6 +5,7 @@
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define ENABLE_PERFORMANCE_COUNTERS
// #define ENABLE_PERF_PROFILING
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe add a little note about what this does / requires

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true.

@@ -0,0 +1,96 @@
class CfgACEArsenalStats {
Copy link
Member

Choose a reason for hiding this comment

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

Should be renamed to class ACE_Arsenal_Stats (GVAR(Stats)) to fit other configs we have (ACE_detector, ACE_UI, ACE_Settings, ACE_Extensions, etc.).

scope = 1;
priority = 0;
stats[]= {};
displayName= "";
Copy link
Member

Choose a reason for hiding this comment

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

Spacing around =, rest of this file and other config files too.

condition = "true";
tabs[]= {{}, {}};
};
class bananaPotassium: statBase {
Copy link
Member

Choose a reason for hiding this comment

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

We should prefix those too, this config will be public API.

I think it's best to prefix all, but some base ones that have nothing to do with ACE features could be left unprefixed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what kind of prefix tho.

Copy link
Member

Choose a reason for hiding this comment

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

ACE_

private _barrelLengthTable = getArray (_ammoCfg >> "ACE_barrelLengths");

if (_barrelLength != 0 && {count _muzzleVelocityTable > 0} && {count _barrelLengthTable > 0}) then {
private _muzzleVelocity = [_barrelLength, _muzzleVelocityTable, _barrelLengthTable, 0] call EFUNC(advanced_ballistics,calculateBarrelLengthVelocityShift);
Copy link
Member

Choose a reason for hiding this comment

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

Indentation much?

if (count _primaryMag > 0) then {
[handgunWeapon EGVAR(arsenal,center), _primaryMag select 0]
} else {
[handgunWeapon EGVAR(arsenal,center), ""]
Copy link
Member

Choose a reason for hiding this comment

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

Couldn't just use param?

@@ -14,6 +14,10 @@
#include "script_component.hpp"
#include "..\defines.hpp"

#ifdef ENABLE_PERF_PROFILING
private _scopeOnSelChangedRight= createProfileScope QFUNC(onSelChangedRight);
Copy link
Member

Choose a reason for hiding this comment

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

What's with your spaces around =.

@@ -14,6 +14,10 @@
#include "script_component.hpp"
#include "..\defines.hpp"

#ifdef ENABLE_PERF_PROFILING
private _scopeOnSelChangedRightLNB= createProfileScope QFUNC(onSelChangedRightListnBox);
Copy link
Member

Choose a reason for hiding this comment

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

Spaces around =.

@alganthe
Copy link
Contributor Author

Todo: fix scaling on 4:3 for the stats box, it's fucked right now.

Copy link
Contributor

@PabstMirror PabstMirror left a comment

Choose a reason for hiding this comment

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

Should be good to go

@alganthe
Copy link
Contributor Author

yep.

@PabstMirror PabstMirror merged commit 1d6e07d into acemod:master Feb 15, 2018
@PabstMirror PabstMirror modified the milestones: 3.13.0, 3.12.2 Apr 2, 2018
BaerMitUmlaut pushed a commit that referenced this pull request Aug 5, 2019
* Add test class

* Add stats mockup

* Merge branch 'master' of https://github.com/acemod/ACE3 into arsenalStats

* Finish mockup, add basic hide/show logic

* Add base for stats

* Use CBA EHs for stats to allow 3rd party mods of it

* Add handleStats and most of the UI behaviors for stats

* Continue work on stats

* Add container stats

* Add page support for stats

* Add text for the ROF stat

* Add accuracy in MOA for the accuracy stat

* Change accuracy shown number to 1 decimal instead of 2

* Add MIL in the dispersion stat text

* Change stats layout, remove dummy text strings

* Add some AB stats

* Remove last test string

* Replace configExtremes by normal lookup where it's relevant

* Add "undefined value" string when AB stat isn't present

Mostly for laucnhers

* Fix typo in preInit

* Change drag model stat to ballistic coef

* Fix issue with unused stats, change text to white when bar is present

* Rewrite some part of handleStats

Reason: add support for conditions, less redundant code, less reasons for dedmen to emasculate me

* Re-add _hideUnusedFnc, handle empty stats arrays

* Pass args to stat conditions, add test condition stat

* Add hearing related stats

* Remove the padding between stats and the stat bar / text

* Add strings for stats

* Change stats window to fit baer's suggestion

* Algin the close stats button, add missing strings

* Finish code review

* Add missing newline

* Remove duplicate strings

* Add explosive range stat

* Use proper string for the explo range stat

* Fix capitalization for ctrlParent

* Fix conditional stats blocking other stats

* Add better integration for ballistics, hearing and explosive stats

* Replace the private array in handleStat by params

* Add backblast stats

* Add backblast stat strings

* Add flashlight map color and g-force reduction stats

* Shorten preInit

* Change stats close button to fit arsenal design

* Improve stats page indicator look

* Rework how stats are stored and retrieved

* Remove args config entry, add priority entry, add vanilla weapon stats

* Add vanilla container stats

* Remove some lines in preInit

* Add ballistics stats

* Add hearing stats

* Remove uneeded config entries

* Add explosive range stat

* Add backblast stats

* Add spaces after semicolons in statements

To make JJ happy because I don't care.

* Add flashlights map color stat

* Add gforce reduction stat

FINALLY FUCKING DONE

* Fix headers for the new stats funcs

* Add add / remove stat API

* Fix typo in removeStat header

* Remove uneeded inline func

* Clean up add / remove stat

* Move all CfgACEArsenalStats entries to their own file

* Replace STR_ACE_Ballistics_statAmmo by a BI string

* Add script profiler related macro and code

* Use the highest ballistic coef instead of first one defined

* Add support for future ammo displayname

* Add ACE_standardAtmosphere for ballistic coef

* Add mag muzzle velocity stat

* Add weapon muzzle velocity stat

* Add comment explaining the ENABLE_PERF_PROFILING macro

* Change cfgACEArsenalStats to ACE_Arsenal_Stats

* Make JJ less pissy about spaces around =

* Fix indentation in weaponMuzzleVelocity, use param

* Use GVAR and EGVAR when appropriate

* Prefix all stats except the base class

* Fix Merge

* Fix aspect ratio scaling of stats panel

* Minor fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants