Page MenuHomeFeedback Tracker

Omission in fn_kbTellLocal.sqf makes it unusable for user missions
New, NormalPublic

Description

The script \A3\functions_f\Conversations\fn_kbTellLocal.sqf has a few omissions/bugs that make the whole radio system around BIS_fnc_kbTell unusable for user missions unless they are in an addon.

  1. From above script:
		if (_channel in ["DIRECT", "VEHICLE"] || _showSubtitles || (hasInterface && { "ItemRadio" in (assignedItems player) })) then
		{
			// Search for disconnected subtitles, play if necessary
			private _text = getText (configFile >> "CfgSentences" >> _mission >> _topic >> "Sentences" >> _sentence >> "textPlain");
			if (_text != "") then {[_from getvariable ["bis_fnc_kbTellLocal_name",name _from], _text] call BIS_fnc_showSubtitle;};
		};

The script *always* uses configFile >> CfgSentences, instead of using the function BIS_fnc_kbTopicConfig which is specifically for that purpose. A simple modification of the above If statement would remedy the problem:

             if (_channel in ["DIRECT", "VEHICLE"] || _showSubtitles || (hasInterface && { "ItemRadio" in (assignedItems player) })) then
		{

			private _cfgTopic = [_mission, _topicName] call BIS_fnc_kbTopicConfig;
			// Search for disconnected subtitles, play if necessary
			private _text = getText (_cfgTopic >> "Sentences" >> _sentence >> "textPlain");
			if (_text != "") then {[_from getvariable ["bis_fnc_kbTellLocal_name",name _from], _text] call BIS_fnc_showSubtitle;};
		};
`
  1. since the popular Radio modification "ACRE 2" replaces ItemRadio, the above will break as well if ACRE is used. Instead, a simple "force override" would make the system usable again even with ACRE:
if (_channel in ["DIRECT", "VEHICLE"] || _showSubtitles || (hasInterface && { "ItemRadio" in (assignedItems player) })) then

could be replaced with

if (_channel in ["DIRECT", "VEHICLE"] || _showSubtitles || (hasInterface && { "ItemRadio" in (assignedItems player)  || _to getVariable ["BIS_fnc_kbTellLocal_forceRadio", false])) then

This would allow to "force" a radio on a unit via a unit-local variable

Details

Severity
Tweak
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
Scripting

Event Timeline

Alwarren created this task.Feb 17 2018, 1:48 AM