-
Notifications
You must be signed in to change notification settings - Fork 739
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
Medical Feedback - Set volume and radio usage based current unit #7529
Conversation
Co-Authored-By: jonpas <jonpas33@gmail.com>
I don't think this is such a simple fix as assumed here because the unconscious state of the local machine can change without hitting the setUnconsciousState function (for example, upon death or upon unit switching). See: ACE3/addons/medical_feedback/XEH_postInit.sqf Lines 35 to 92 in 5a4487f
|
Moving the From what i can see, the only place the event gets raised is at the end of Volume gets restored upon respawn, so might not be necessary on
|
@Whigital I would include on death because death does not always immediately lead to respawn and could be filled with other systems (most commonly spectator time). However, on death it would only apply when the In fact, it should probably be clarified how TFAR and ACRE handle the unit variables that function is setting (always on |
ACRE uses a similar system to ace_player. |
Figured as much, then the way I would fix this is add an option parameter to the common function to pass in a unit, and just update all three events in feedback postInit to call that function and pass in the unit if it's |
|
That sound right 👍 Only thing is the |
Beautify the setVolume function and get rid of the if statement ? private _vol = ([MUTED_LEVEL, NORMAL_LEVEL] select _setVolume);
private _voice = ([NO_SOUND, NORMAL_LEVEL] select _setVolume);
2 fadeSound _vol;
//TFAR
_unit setVariable ["tf_voiceVolume", _voice , true];
_unit setVariable ["tf_globalVolume", _vol];
_unit setVariable ["tf_unable_to_use_radio", !_setVolume];
// ACRE2
if (!isNil "acre_api_fnc_setGlobalVolume") then { [_vol^0.33] call acre_api_fnc_setGlobalVolume; };
_unit setVariable ["acre_sys_core_isDisabled", !_setVolume, true]; |
Feel free to do so, current changes look correct to me I also notice we're calling the This area of the code could probably use some cleanup (would avoid that for this PR and just focus on the fix, just noting for other ace devs). |
Roger. Will keep the changes in this PR to just fixing the issue at hand. |
Think i'll leave this PR as is. Will verify functionality and report back. |
Toggling unconscious lowers volume and disables the use of ACRE radio without issues. Not been able to test in MP, but should work the same, considering the code removed from the EH's now run in |
When merged this pull request will:
Fix #7528