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 #1053
Merged
Add ACE Arsenal Stats #1053
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
class ace_arsenal_stats { | ||
class statBase; | ||
class GVAR(frequencyRange): statBase { | ||
scope = 2; | ||
stats[] = {QEGVAR(arsenalStats,frequencyMin), QEGVAR(arsenalStats,frequencyMax)}; | ||
displayName= CSTRING(arsenalStats_frequencyRange); | ||
showText = 1; | ||
textStatement = QUOTE(call FUNC(arsenalStats_frequencyRange)); | ||
condition = QUOTE((getNumber(_this select 1 >> 'acre_isRadio')) == 1); | ||
tabs[] = {{}, {7}}; // Misc-Items on right tab | ||
}; | ||
class GVAR(transmitPower): statBase { | ||
scope = 2; | ||
stats[] = {QEGVAR(arsenalStats,transmitPower)}; | ||
displayName= CSTRING(arsenalStats_transmitPower); | ||
showText = 1; | ||
textStatement = QUOTE(call FUNC(arsenalStats_transmitPower)); | ||
condition = QUOTE((getNumber(_this select 1 >> 'acre_isRadio')) == 1); | ||
tabs[] = {{}, {7}}; | ||
}; | ||
class GVAR(effectiveRange): statBase { | ||
scope = 2; | ||
stats[] = {QEGVAR(arsenalStats,effectiveRange)}; | ||
displayName= CSTRING(arsenalStats_effectiveRange); | ||
showText = 1; | ||
textStatement = QUOTE(getText ((_this select 1) >> (_this select 0 select 0))); | ||
condition = QUOTE((getNumber(_this select 1 >> 'acre_isRadio')) == 1); | ||
tabs[] = {{}, {7}}; | ||
}; | ||
class GVAR(externalSpeaker): statBase { | ||
scope = 2; | ||
stats[] = {QEGVAR(arsenalStats,externalSpeaker)}; | ||
displayName= CSTRING(arsenalStats_externalSpeaker); | ||
showText = 1; | ||
textStatement = QUOTE(call FUNC(arsenalStats_externalSpeaker)); | ||
condition = QUOTE((getNumber(_this select 1 >> 'acre_isRadio')) == 1); | ||
tabs[] = {{}, {7}}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ class CfgPatches { | |
|
||
#include "CfgVehicles.hpp" | ||
#include "CfgEventHandlers.hpp" | ||
#include "ace_arsenal_stats.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "script_component.hpp" | ||
/* | ||
* Author: PabstMirror | ||
* Shows arsenal stats | ||
* | ||
* Arguments: | ||
* 0: Stats Array of config strings <ARRAY> | ||
* 1: Radio Cfg <CONFIG> | ||
* | ||
* Return Value: | ||
* <STRING> | ||
* | ||
* Example: | ||
* [["acre_arsenalStats_externalSpeaker"], configFile >> "CfgWeapons" >> "ACRE_PRC117F"] call acre_ace_interact_fnc_arsenalStats_externalSpeaker | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_statsArray", "_itemCfg"]; | ||
|
||
private _val = getNumber (_itemCfg >> (_statsArray select 0)); | ||
if (_val > 0) then { localize "str_lib_info_yes" } else { localize "str_lib_info_no" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include "script_component.hpp" | ||
/* | ||
* Author: PabstMirror | ||
* Shows arsenal stats for frequency range | ||
* | ||
* Arguments: | ||
* 0: Stats Array of config strings <ARRAY> | ||
* 1: Radio Cfg <CONFIG> | ||
* | ||
* Return Value: | ||
* <STRING> | ||
* | ||
* Example: | ||
* [["..min", "...max"], configFile >> "CfgWeapons" >> "ACRE_PRC117F"] call acre_ace_interact_fnc_arsenalStats_frequencyRange | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_statsArray", "_itemCfg"]; | ||
|
||
_statsArray = _statsArray apply { | ||
private _value = getNumber (_itemCfg >> _x); | ||
switch (true) do { | ||
case (_value == 0): {"?"}; | ||
case (_value < 1e6): {format ["%1kHz", _value / 1e3]}; | ||
case (_value < 1e9): {format ["%1MHz", _value / 1e6]}; | ||
default {format ["%1GHz", _value / 1e9]}; | ||
}; | ||
}; | ||
|
||
// note: doesn't handle non-contiguous ranges, | ||
// and just because 2 radios are on same freq doesn't mean their bandwidth/modulation will be compatible.. | ||
|
||
format ["%1 - %2", _statsArray#0, _statsArray#1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "script_component.hpp" | ||
/* | ||
* Author: PabstMirror | ||
* Shows arsenal stats | ||
* | ||
* Arguments: | ||
* 0: Stats Array of config strings <ARRAY> | ||
* 1: Radio Cfg <CONFIG> | ||
* | ||
* Return Value: | ||
* <STRING> | ||
* | ||
* Example: | ||
* [["...power"], configFile >> "CfgWeapons" >> "ACRE_PRC117F"] call acre_ace_interact_fnc_arsenalStats_transmitPower | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_statsArray", "_itemCfg"]; | ||
|
||
private _power = getNumber (_itemCfg >> _statsArray select 0); //in milliwatts | ||
|
||
if (_power == 0) exitWith {"?"}; | ||
if (_power >= 1e3) then { format ["%1W", _power/1000] } else { format ["%1mW",_power] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure I like placing those arbitrary numbers here. It's clear it's for the Arsenal, so that's good, but can we get those from actual radio data that's already defined somehow? @Sniperhid @Soldia1138
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
148 seems to validate data with
if (_newVal > 512 || {_newVal < 30}) then {
but 152 allows you to enter anything
117 same
could add new (non-arsenal) configs for min/max frequency for user input
but I don't know how the real radios handle this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@IDI-Systems/acre-managers ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the way to go about this is make those not Arsenal-specific, but actually use those config entries to limit radio operation (like 148 does).