-
Notifications
You must be signed in to change notification settings - Fork 118
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
External radios #214
External radios #214
Conversation
Yeah, we should limit them based on what connectors they have available I guess. 343 has no external headset after all (I think).
That's completely fine. One thing that should be done is simply checking |
Ref. 343 - There are two variants. One has an I/O port for the user headset, whilst the commander variant has a cable that comes out of the bottom and goes into the manpack, like a passthrough so that they only have to wear one headset, and push the prestle on the relevant radio to transmit. For our purposes though, I am sure removing the pass headset from the 343 would be sensible... |
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.
As-side from the initial code comments:
- I would like to see this not work for radios inside vehicle inventories - It saves a few complications not handling this case (initializing radios/accounting for vehicle racks later).
- 'Retrieve Radio' - I think should become 'Unshare Radio' particularly as it seems more precise (specially if a person isn't using the radio - maybe it should be retrieve if someone else is using the radio).
- This NEEDS multiplayer testing as there's potential for several kinks throughout.
}; | ||
|
||
private _idx = _pttAssign find _radio; | ||
_txt = localize LSTRING(bindMultiPushToTalk);; |
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.
double ;;
if (!(_radio in ACRE_ACTIVE_EXTERNAL_RADIOS)) then { | ||
_action = ["acre_share_radio", localize LSTRING(shareRadio), "", {[(_this select 2) select 0, true] call EFUNC(sys_external,allowExternalUse)}, {!([(_this select 2) select 0] call EFUNC(sys_external,isRadioShared))}, {}, _params] call ace_interact_menu_fnc_createAction; | ||
_actions pushBack [_action, [], _target]; | ||
_action = ["acre_retrieve_radio", localize LSTRING(retrieveRadio), "", {[(_this select 2) select 0, false] call EFUNC(sys_external,allowExternalUse)}, {[(_this select 2) select 0] call EFUNC(sys_external,isRadioShared)}, {}, _params] call ace_interact_menu_fnc_createAction; |
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 changing the terminology from retrieve radio
to unshare radio
would be more accurcate
|
||
private _isShared = [_radioId] call FUNC(isRadioShared); | ||
|
||
private ["_isUsedExternally", "_owner", "_user"]; |
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.
This should be mixed into the below lines
i.e. private _isUsedExternally = false;
_user = nil; | ||
|
||
if (_isShared) then { | ||
private _isUsedExternally = [_radioId] call FUNC(isExternalRadioUsed); |
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.
using private here creates a new local variable in this private scope.
if (_isShared) then { | ||
private _isUsedExternally = [_radioId] call FUNC(isExternalRadioUsed); | ||
if (_isUsedExternally) then { | ||
private _owner = [_radioId] call FUNC(getExternalRadioOwner); |
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.
using private here creates a new local variable in this private scope.
private _isUsedExternally = [_radioId] call FUNC(isExternalRadioUsed); | ||
if (_isUsedExternally) then { | ||
private _owner = [_radioId] call FUNC(getExternalRadioOwner); | ||
private _user = [_radioId] call FUNC(getExternalRadioUser); |
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.
using private here creates a new local variable in this private scope.
// Add the radio to the player | ||
ACRE_ACTIVE_EXTERNAL_RADIOS pushBackUnique _radioId; | ||
|
||
player sideChat format ["Start using %1", _radioId]; |
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 systemChat
should be used over player sideChat.
|
||
ACRE_ACTIVE_EXTERNAL_RADIOS = ACRE_ACTIVE_EXTERNAL_RADIOS - [_radioId]; | ||
[1] call EFUNC(sys_list,cycleRadios); // Change active radio | ||
player sideChat format ["Stop using %1", _radioId]; |
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 systemChat
should be used over player sideChat.
PR changes as requested by @Sniperhid
|
Add a config value for it. |
addons/sys_external/CfgVehicles.hpp
Outdated
statement = "true"; | ||
insertChildren = QUOTE(_this call FUNC(listChildrenActions)); | ||
priority = 0.1; | ||
icon = "\a3\Ui_f\data\GUI\Cfg\CommunicationMenu\call_ca.paa"; |
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.
Can use ICON_RADIO_CALL
macro now, since #239.
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.
yes. I will update this accordingly. And also I will substitute systemchat by hints.
On a side note, the changes here are also ported to the implementation of external radios using hashes instead of storing information on radioData. We can decide later which implementation is better.
@@ -24,4 +24,4 @@ params ["_radioID", "_owner", "_endUser"]; | |||
// Add the radio to the player | |||
ACRE_ACTIVE_EXTERNAL_RADIOS pushBackUnique _radioId; | |||
|
|||
systemChat format ["Start using %1", _radioId]; | |||
[format ["Start using %1", _radioId];] call EFUNC(sys_core,displayNotification); |
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.
No semi-colon in there.
* | ||
* Arguments: | ||
* 0: Infantry unit <OBJECT> | ||
* | ||
* Return Value: | ||
* False | ||
* <BOOL> |
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.
Bool what?
if (acre_player == [_radio] call FUNC(getExternalRadioOwner)) then { | ||
_playerOwnsRadio = true; | ||
}; | ||
private _playerOwnsRadio = (acre_player == [_radio] call FUNC(getExternalRadioOwner)); |
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.
No outer parenthesis, it's just a simple boolean.
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.
jonpas 3 days ago:
L24-L27 as: private _playerOwnsRadio = (acre_player == [_radio] call FUNC(getExternalRadioOwner));
That's why ;)
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.
But you know better, I am just a scrub making you change things. 😆
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.
Note: doc page needs to be added to sidebar.
docs/wiki/user/external-radios.md
Outdated
@@ -0,0 +1,9 @@ | |||
--- | |||
title: External radios |
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.
External Radios
03a354d
to
ca2ee40
Compare
1e3b99e
to
ec529f2
Compare
@@ -22,6 +22,15 @@ if (alive acre_player) then { | |||
private _weapons = [acre_player] call EFUNC(sys_core,getGear); | |||
_radioList = _weapons select {_x call EFUNC(sys_radio,isUniqueRadio)}; | |||
|
|||
// Remove those radios that are being actively used by other players. |
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.
No final dot.
addons/sys_external/CfgVehicles.hpp
Outdated
class CAManBase: Man { | ||
class ACE_Actions { | ||
class ACE_MainActions { | ||
class ACRE_Interact { |
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.
Should be ACRE_Interact_External
or something unique to the action - future proof.
addons/sys_external/config.cpp
Outdated
}; | ||
}; | ||
|
||
PRELOAD_ADDONS; |
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.
Necessary?
@@ -0,0 +1,21 @@ | |||
/* | |||
* Author: ACRE2Team | |||
* Mark a radio in order to enable/disable to be used by other units (external use) |
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.
Missing final dot.
@@ -0,0 +1,26 @@ | |||
/* | |||
* Author: ACRE2Team | |||
* Check if a given action is available for a specific radio and unit |
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.
Missing final dot.
@@ -0,0 +1,24 @@ | |||
/* | |||
* Author: ACRE2Team | |||
* Check if a given action is available for a specific radio external radio |
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.
Missing final dot.
|
||
if (vehicle acre_player != acre_player) exitWith {false}; | ||
|
||
true |
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.
Entire thing as one direct return if
.
@@ -0,0 +1,32 @@ | |||
/* | |||
* Author: ACRE2Team | |||
* Start using an external radio |
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.
Missing final dot.
/* | ||
* Author: ACRE2Team | ||
* Stop using an external radio, either returning it to the owner or giving it to another player. If target | ||
* is skipped, a default action to return to the owner is taken |
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.
Missing final dot.
* | ||
* Arguments: | ||
* 0: Unique radio identity <STRING> | ||
* 1: New end user/original owner <OBJECT>(Optional) |
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.
... <OBJECT> (default: objNull)
It's not actually optional per params
though.
private _externalRadiosInUse = _radioList select {_x call EFUNC(sys_external,isExternalRadioUsed)}; | ||
_radioList = _radioList - _externalRadiosInUse; | ||
// Remove those radios that are being actively used by other players | ||
_radioList = _radioList select {!(_x call EFUNC(sys_external,isExternalRadioUsed))}; |
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.
This could be merged with L23 and form:
_radioList = _weapons select {_x call EFUNC(sys_radio,isUniqueRadio) && {!(_x call EFUNC(sys_external,isExternalRadioUsed))}};
for faster iteration (from 2n to n).
* Use code block for mods list in issue template * Hide radio self-interaction node if no radio in inventory * Introduce Variable to deactivated distance-based muting (#228) * Order radio ear left/right correctly * Cleanup and macros (#230) * Delete unused traces * QEFUNC Macro * Moved all opening braces on same line * Removed spaced after classes * Spaces and Indentation * More spaces * Fix direct speech page vehicle attenuation link * Add Custom Signal Processing wiki page to sidebar, Cleanup sidebar config * Use ACE3 notification if available instead of hint (#239) * Add displayNotification function * Fix log * Pass functions 'by reference' to BI evenEHs * acre_api_fnc_setCustomSignalFunc - reset fix (#227) * fixes the possibility to reset the function to default behavior * wrong term * lowercase if * Update documentation * Use of ICON_RADIO_CALL in ace_interact * Fix ctrSetEventHandler. Back to Quotes as in #241 (#243) Fix ctrlSetEventHandler - back to quotes as in #241 * Fixes the antenna direction calculation (#233) * Improve mod listing on issue template * Update easylogging++ to v9.94.1 (#246) * Update easylogging++ to v9.94.1, Bandaid prevent default log file from creation * Include easylogging++.cc in CMake, Change max file size to 1 MB * Hotfix muting variable (#248) * Fix duplicate ID handling (#251) * Fix acre failing initialise due to a race condition (#240) * Documentation -- Function Headers -- sys_prc343 (#110) * Changed function example calls * Headers 1 * Completed headers. Missing arguments * Improvements on Doc * Review changes * v2.4.0.943 - Build 37 * Use CBA Namespaces * 4nec2 Antenna Calculation (#244) - Switches Antenna Calculation from MMANA-GAL to 4NEC2 (Closes #201) - Converts all existing antenna data files to 4NEC2 ones - Adds additional antennas for e.g SEM52 (Closes #29) - Introduces a new script to convert 4NEC2 output files to ACRE's `*.aba` file * SEM70 (#199) Adds a new radio: SEM70, a manpack radio used by German Armed Forces. It comes with an UI, rendered in 3D like all other ACRE2 radios. Model and textures created by Raspu (https://github.com/Raspu86). Additionally it is the first radio featuring an automatic channel selection. Details will follow in the documentation. * Fixes * Fix duplicate mounted radios in racks * Infantry Phone (#224) * External intercom * Handle dead units using the intercom * Some requested changes * Lunch break fixes * Changes all references of external Intercom to Infantry Phone * DOC: Infantry telephone * Macroize interactions, Fix missing string * Add actions dynamically, Add support for custom position/selection * Improve things * Add vanilla Tanks and Tracker APCs custom positions, Disable debug * Fix in vehicle checks * Revert some changes from previous commit * Moved to sys_intercom * Call functionality implemented * Fix the spalling of own name * Fixes of example calls * Fix headers, Use clientInit postInit * Move intercom/infantry phone config to vehicle root class * Changed true/false to 1/0 in configs * Cleanup configs, Don't attach init EH if ACE3 disabled * Add vehicle intercom and infantry phone documentation * Use ACE3 notifications, Cleanup minor things * Added ringing description * Add additional line regarding ringing position in framework doc * Use displayNotification * Fix issue * Fix stupidity... * Fix displayNotification * Add infantry phone connected message * PhoneCall fixes * Remove of duplicate private * Prevent destroyed vehicle beeping and infantry phone interaction * Stop infantry phone from beeping if no crew members are aboard * Doc and lazy evaluation * HCs are kind of important * No need for code in code * Redefined infantry phone position for compatibility with other mods * Fix: sound in all clients * Fixed intercom * remoteExecCall to CBA_fnc_globalEvent * Privatising * inline functions though, yuck * Updated documentation * Fix SEM70 (#257) - Frequency default (stupid) - PBOPrefix was ooold - Disable Debugging * Use CBA Namespaces * v2.4.0.944 - Build 38 * Update Documentation Theme (#253) * Add url to branching image, Put --incremental guideline as optional * Update Jekyll Documentation Theme to 06dc9e0e257e014d1ccf9de158e76a61d74f84e6 * Remove redundant tooltips files, Fix search * Use url from file location by default for images * Renamed settings variables (#259) * Teamspeak channel switching functionality (#225) * Initial commit for channel move functionality * Changes as per previous review * Request changes and improvements * Fixed incorrect use of EGVAR * Requested changes. Normalised name to TS3 and normalised formatting. * Improved name search utilising Levenshtein distance * Whitespace * Requested changes * Whitespaceroni * Requested changes * Removed comment from pipe timeout * Use display XEH instead of PFH * Add missing checks in display XEH * Removes extra include causing make error (#261) * Removes extra include causing make error * There was another one as well... * Use custom namespace for Fast Hashes (#267) * Use custom location with invalid drawStyle for fast hashes to improve performance * Fully move hashes to sys_core * Move the rest of fast hashes to sys_core, Fix crash in PREP * Prefix global fast hash variables * Remove redundant code * Fix missing renames * Move all fast hash stuff to main * Create menu hashes before using them * Return Menu hashes to working location * Cleanup 117f and 152 menus compilation (don't run in preStart) * Use custom namespace for Fast Hashes (#267) * Use custom location with invalid drawStyle for fast hashes to improve performance * Fully move hashes to sys_core * Move the rest of fast hashes to sys_core, Fix crash in PREP * Prefix global fast hash variables * Remove redundant code * Fix missing renames * Move all fast hash stuff to main * Create menu hashes before using them * Return Menu hashes to working location * Cleanup 117f and 152 menus compilation (don't run in preStart) * v2.4.0.945 - Build 39 * v2.4.0.946 - Build 6 * Actually increment patch version * v2.4.1.947 - Build 7 * Polish translation. (#268) Polish translation * Box with radios (#265) * Box with radios * Requested changes * Added forgotten displayName * Added box to units[] in CfgPatches * Rename tag, lower amount of radios, more small radios than big radios * Clean-up and document to sys_io (#249) * Some improvements to sys_io * Improve mentions of the extension. * Improve comments * Added SEM70 to main readme (#270) * External radios (#214) * First implementation of external radios * Fixes, vehicles added and tweaked availability of ace actions * Fixes * Fixes and remove debug * Fixes and improvements * Fixed vehicles * Updated german translations * Improved ace interaction actions * Fixed Doc * Prevent the use of an external radio if it is already in use * PR requested changes * Additional fixes * Moved ace_interaction related functions to sys_external * Update notifications and use of icon macro * Removed extra semicolons * Hide entry if no radios are shared externally * Allow players to give the radio headsets to other units * Radio owner awareness * Requested changes * Requested changes and documentation * Adding new page to sidebar * Fix doc entry in side-bar * Fixes * Removed tabs at the end of line * Set external radio as active and improve messages * Fixed display messages * Prevent action from showing if distance is too large * Requested changes * Tabs tabs tabs. those hateful tabs * Forgetful magnetar * Forgetful magnetar. Part 2. * Further optimisations * Intercom overhaul and passenger intercom (#255) * External intercom * Handle dead units using the intercom * Some requested changes * Lunch break fixes * Changes all references of external Intercom to Infantry Phone * DOC: Infantry telephone * Macroize interactions, Fix missing string * Add actions dynamically, Add support for custom position/selection * Improve things * Add vanilla Tanks and Tracker APCs custom positions, Disable debug * Fix in vehicle checks * Revert some changes from previous commit * Moved to sys_intercom * Call functionality implemented * Fix the spalling of own name * Fixes of example calls * Fix headers, Use clientInit postInit * Move intercom/infantry phone config to vehicle root class * Changed true/false to 1/0 in configs * Cleanup configs, Don't attach init EH if ACE3 disabled * Add vehicle intercom and infantry phone documentation * Use ACE3 notifications, Cleanup minor things * Added ringing description * Add additional line regarding ringing position in framework doc * Use displayNotification * Fix issue * Fix stupidity... * Fix displayNotification * Add infantry phone connected message * PhoneCall fixes * Remove of duplicate private * Prevent destroyed vehicle beeping and infantry phone interaction * Stop infantry phone from beeping if no crew members are aboard * Doc and lazy evaluation * HCs are kind of important * No need for code in code * Redefined infantry phone position for compatibility with other mods * First implementation * Fix: sound in all clients * Fixed intercom * Fixes for passenger intercom * cba_fnc_globalEvent instead of remoteExecCall * Requested changes * Requested changes II * Intercom overhaul and passenger intercom * CBA settings and network optimisations * Fixed: prevent from connecting to passenger intercom when the phone is ringing * Fixes and corner cases * BLUFOR vehicles * Fixed attenuation checks * Helicopters, SDVs and VTOLS * Added hook for custom actions on Inf. phone change status * Documentation formatting issues * Update Documentation * Don't use negation * Fixes + doc * Remove debug comment * Requested changes * Removed fnc_intercomActions.sqf since it was no longer needed * Optimisations and noApiFunctions for debugging purposes * Improve config inheritance, Check event type * Passenger to Pax, Add note * Shorten Inf Phone strings * Formatting of ace actions and removal of switch intercom message * v2.4.1.948 - Build 40 * Fix Vehicle Intercom Framework documentation page * Formatting * TS3 channel switching documentation (#272) * Added TS3 channel switching documentation * Few grammar changes * Changes * Hash be gone * Empty lines * Russian translation (#278) * no message * PAX translations. * Power fixes and request changes
When merged this pull request will:
This is a first implementation of external radios. It works in the following way (I am looking at you oh mighty bug) and it requires ace_interaction in order to work.
For infantry units:
For vehicles:
Limitations: