Hello,
when creating a custom channel and using the customChat command, there is no message shown. If you open the chat manually.
You can post in the custom channel.
Hello,
when creating a custom channel and using the customChat command, there is no message shown. If you open the chat manually.
You can post in the custom channel.
_channel = radioChannelCreate [[0.9,0.1,0.1,1],"Admin","Admin",[],true];
_channel radioChannelAdd [player];
_channel radioChannelSetCallSign format ["MEH0", "MEH"];
player customChat [_channel, "ADADADA"];
Can confirm it works in SP until you use the command radioChannelRemove and wait before you add to the channel again.
The custom chat does not work at all when hosted through listen server through 3den.
Code I tried it with with local execution, similar to working code prior to 2.18
// post init if (isNil "diw_chatChannel") then { diw_chatChannel = radioChannelCreate [[0.9,0.1,0.1,1], "Chat", "Chat", [], true]; publicVariable "diw_chatChannel"; // not needed for test }; // simulate FPARMA usecase for receiving whispered messages [] spawn { // get whisper message sent diw_chatChannel radioChannelAdd [player]; diw_chatChannel radioChannelSetCallsign "Some schmuck"; player customChat [diw_chatChannel, format ["Hey this works!! %1", time]]; diw_chatChannel radioChannelRemove [player]; sleep 1; // get another message diw_chatChannel radioChannelAdd [player]; diw_chatChannel radioChannelSetCallsign "Some schmuck"; player customChat [diw_chatChannel, format ["This doesn't!! %1", time]]; diw_chatChannel radioChannelRemove [player]; sleep 1; comment "see if new channel works, for some reason // breaks here"; private _channel = radioChannelCreate [[0.9,0.1,0.1,1],"Admin","Admin",[],true]; _channel radioChannelAdd [player]; _channel radioChannelSetCallSign format ["MEH0", "MEH"]; player customChat [_channel, "Hey I work! 1"]; player customChat [_channel, "Hey I work! 2"]; _channel radioChannelRemove [player]; _channel radioChannelAdd [player]; player customChat [_channel, "Hey I work! 3"]; _channel radioChannelRemove [player]; sleep 1; _channel radioChannelAdd [player]; player customChat [_channel, "Aaaand borke it 1"]; player customChat [_channel, "Aaaand borke it 2"]; };
If you wait after adding or removing player before sending chat it works. I am going too see if this can be improved
Ok the problem is that after player is removed from the channel, this channel is muted so customchat doesnt work, when player is added back the channel is made audible again but not immediately, this is why adding sleep before customchat works. I will force it to update quicker
Just saying, the code snippet i posted earlier is working code prior to 2.18. Gruppe Adler and FPArma had functioning whispers like that, there was no waiting after adding or removing the player to the custom chat what so ever, all that code runs unscheduled as well.
Retested with current profiling branch version: 2.18.152307
Hosted MP through 3den, the chat message does not show at all still.
Running the same script i have posted above (see link below) the issue still appears while testing in singleplayer
https://feedback.bistudio.com/T185296#2690883
The context why the used script snipped is used to test and no new one that waits a frame after adding the player to the channel, is existing code from multiple units and mods that worked like that since at least 2018.
These mods and scripts create one channel, publicVariable that one, so every player has the same channel and add and remove the player on a local basis to display messages.
Usually done so in adding the player, sending message and then removing the player, all on the same frame.
Since version 2.18 the behavior has changed, existing mods that utilize this feature will not work like this as they do not add the player to the channel and then wait a frame to display the message.
Waiting of any kind can cause race conditions, maybe there are 2 messages coming in one frame after another (unlikely, but as an example), it might cause that the later message gets lost.
Either declare that the behavior has changed since 2.18, thus breaking mods that need this feature and tell them to update. Or retain the behavior.
Retested with current profiling branch version: 2.18.152307
Fixed in Revision: 152319