Barba-negra 117 Posted August 30, 2018 good morning to all guys, a greeting and a hug, I wanted to ask here if there are any scripts that make the AI can detect players when they speak for the microphone at a certain distance? 1 Share this post Link to post Share on other sites
Mr H. 400 Posted August 30, 2018 ACRE2 mod does this and I think the Beta version of TFAR does it too. If you don't want an additional mod there is this system, but it doesn't take AIs into account I think. Scripting it might be possible, detect when the player uses the push to talk key and reveal them to nearby enemies maybe? Share this post Link to post Share on other sites
Barba-negra 117 Posted August 30, 2018 I've been reading about it, and affectively the ACRE2 apparently does it, but the current version of the radio task force does not do it, and done tests and nothing, and ideally I could hear you even without using the radio at a pre-determined distance, I've got something here but I have not made it work https://github.com/michail-nikolaev/task-force-arma-3-radio/issues/902 Share this post Link to post Share on other sites
Mr H. 400 Posted August 30, 2018 But this version of TFAR does it https://steamcommunity.com/sharedfiles/filedetails/?id=894678801 if you really don't want to use ACRE2. If you wan't to use only the vanilla system you'll have to script it yourself but it's not impossible. 2 Share this post Link to post Share on other sites
Barba-negra 117 Posted August 30, 2018 Does that version do it without using a separate script? that is, is the scritpts included? Share this post Link to post Share on other sites
Barba-negra 117 Posted August 30, 2018 There is a script of the radio task force that I would like to understand but I do not understand how it works, this is it, but what is it for? this is possible to place it through a radio, and when I speak the event is activated ?, I really do not understand very well how this works API: Events Use the following calls: TFAR_fnc_AddEventHandler – to add an event handler TFAR_fnc_removeEventHandler – to remove it. Examples [MyID, EventName, Code, Object] call TFAR_fnc_addEventHandler; // binding to the player object: ["MyID", "OnSpeak", { hint format ["%1 %2 speaking", _this select 0, if(_this select 1)then{"is"}else{"isn't"}]; }, Player] call TFAR_fnc_addEventHandler; // binding to the mission namespace and not the player object in particular: ["MyID", "OnSpeak", { hint format ["%1 %2 speaking", _this select 0, if(_this select 1)then{"is"}else{"isn't"}]; }, ObjNull] call TFAR_fnc_addEventHandler; // removing event handler that was bound to the player: ["MyID", "OnSpeak", player] call TFAR_fnc_removeEventHandler // removing event handler that was bound to the mission namespace: ["MyID", "OnSpeak", objNull] call TFAR_fnc_removeEventHandler is from this page https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Functions#TFAR_fnc_addEventHandler 1 Share this post Link to post Share on other sites
Mr H. 400 Posted August 30, 2018 Yes it adds an event handler (and from that you can script what you want to achieve ) but again tfar beta does it (I use acre2 so I'm only 90% sure ). Either use acre or tfar beta and you won't even have to bother scripting it. 1 1 Share this post Link to post Share on other sites
HazJ 1288 Posted August 30, 2018 Easy options are as @Mr H. said, TFAR/ACRE2. However... You may be able to do this in vanilla using keyDown EH and inputAction. Though this will trigger if you press the VoN key, not sure if you can return real transmission. 1 1 Share this post Link to post Share on other sites
Mr H. 400 Posted August 31, 2018 6 hours ago, HazJ said: Easy options are as @Mr H. said, TFAR/ACRE2. However... You may be able to do this in vanilla using keyDown EH and inputAction. Though this will trigger if you press the VoN key, not sure if you can return real transmission. That's what I had in mind too. Don't think there are many other options to do this. 1 Share this post Link to post Share on other sites
Barba-negra 117 Posted September 1, 2018 ok friends I'm trying to create a script that when the player speaks within a specific radius, a trigger is triggered, but I do not know if I'm okay could they get a hand? [] spawn { if ( speaker player ) then { triggerActivated trg1} }; Share this post Link to post Share on other sites
HazJ 1288 Posted September 1, 2018 This returns the speaker voice of a unit I believe? A getter for the setSpeaker command. https://community.bistudio.com/wiki/speaker https://community.bistudio.com/wiki/setSpeaker Not tested: _display = findDisplay 49; voiceKeyEH = _display displayAddEventHandler ["KeyDown", { if (param [1] isEqualTo inputAction "voiceOverNet") then { // player is pressing VoN key... hintSilent "player is pressing VoN key..."; } else { // player is NOT pressing VoN key... hintSilent "player is NOT pressing VoN key..."; }; }]; 1 Share this post Link to post Share on other sites
Larrow 2801 Posted September 1, 2018 4 hours ago, HazJ said: if (param [1] isEqualTo inputAction "voiceOverNet") then so if the display isEqualTo number if ( inputAction "voiceOverNet" > 0 ) then 2 Share this post Link to post Share on other sites
Barba-negra 117 Posted September 1, 2018 thank you, mates, I am going to try, this would be more complicated to do, if for example the player has voice recognition enabled and does not use a key to talk? Well, although I think that's only if TFR or Acre is used? Share this post Link to post Share on other sites
Barba-negra 117 Posted September 1, 2018 I'm testing it, and nothing happens after pressing the key, I put it in the init, and I also test it with a trigger, will it have something to do if I have the radio task force activated? Share this post Link to post Share on other sites
Mr H. 400 Posted September 1, 2018 What @HazJ and @Larrow gave you are just the bases to create your own script nothing will happen if you use it as is. I don't use the vanilla von system but I think it cannot be voice activated and you must use a key. Again this is only a necessary step if you use vanilla von (or the base version of tfar) using tfar beta or acre make this unnecessary since detection by AI are built in features. 2 Share this post Link to post Share on other sites
HazJ 1288 Posted September 1, 2018 14 hours ago, Larrow said: so if the display isEqualTo number if ( inputAction "voiceOverNet" > 0 ) then Yeah that! Share this post Link to post Share on other sites