Jump to content
Sign in to follow this  
johnnyboy

does sideradio require PVEH like say3d so all MP client hear the sound?

Recommended Posts

Does sideradio work like say3d, in that you need to use public variable eventhandlers to broadcast sound to all MP Clients?

Please advise. Thanks.

Share this post


Link to post
Share on other sites

Fistly, sideRadio and say3D are two different things.

sideRadio writes a message, defined in the Description.ext, into the side radio.

say3D plays a sound, defined in the Description.ext.

But if you want others to hear/read that, you need to broadcast it manually (using BIS_fnc_MP) to make it hearable/readable to all clients in an MP game.

[color=#FF8040][color=#8B3E2F][b][[/b][/color][color=#8B3E2F][b][[/b][/color][color=#000000]player[/color][color=#8B3E2F][b],[/b][/color] [color=#7A7A7A]"sound"[/color][color=#8B3E2F][b]][/b][/color][color=#8B3E2F][b],[/b][/color] [color=#8B3E2F][b]{[/b][/color][color=#8B3E2F][b]([/b][/color][color=#000000]_this[/color] [color=#191970][b]select[/b][/color] [color=#FF0000]0[/color][color=#8B3E2F][b])[/b][/color] [color=#191970][b]say3D[/b][/color] [color=#8B3E2F][b]([/b][/color][color=#000000]_this[/color] [color=#191970][b]select[/b][/color] [color=#FF0000]1[/color][color=#8B3E2F][b])[/b][/color][color=#8B3E2F][b];[/b][/color][color=#8B3E2F][b]}[/b][/color][color=#8B3E2F][b],[/b][/color] [color=#000000]true[/color][color=#8B3E2F][b],[/b][/color] [color=#000000]false[/color][color=#8B3E2F][b]][/b][/color] [color=#191970][b]spawn[/b][/color] BIS_fnc_MP[color=#8B3E2F][b];[/b][/color]
[color=#006400][i]//where "sound" must be a sound defined in your Description.ext[/i][/color][/color]

So, to aswer your question: As I wrote above, you don't need an EH for say3D or sideRadio. You broadcast it using BIS_fnc_MP.

Regards,

waltenberg aka Johnny

Edited by waltenberg

Share this post


Link to post
Share on other sites
Fistly, sideRadio and say3d are two different things.

sideRadio writes text into the side channel.

say3d plays a sound, but you need to broadcast it manually (using BIS_fnc_MP) to make it hearable to all clients in an MP game.

Hi Waltenburg. Its true that sideRadio writes text to side channel, but it also plays a sound that is defined in a cfgRadio entry in the description.ext file. Example entry:

class CfgRadio
{
sounds[] = {};
class RadioMsg1
{
	name = "";
	sound[] = {"\sound\filename1.ogg", db-100, 1.0};
	title = "I am ready for your orders.";
};
class RadioMsg2
{
	name = "";
	sound[] = {"\sound\filename2", db-100, 1.0}; // .wss implied
	title = {$STR_RADIO_2};
};
};

So my question still stands. Do I need to PVEH sideradio messages to be sure all clients hear the messages defined in cfgradio in description.ext?

Share this post


Link to post
Share on other sites

Let me give you the code for broadcasting sideRadio:

[color=#FF8040][color=#8B3E2F][b][[/b][/color][color=#8B3E2F][b][[/b][/color][color=#000000]player[/color][color=#8B3E2F][b],[/b][/color] [color=#7A7A7A]"message"[/color][color=#8B3E2F][b]][/b][/color][color=#8B3E2F][b],[/b][/color] [color=#8B3E2F][b]{[/b][/color][color=#8B3E2F][b]([/b][/color][color=#000000]_this[/color] [color=#191970][b]select[/b][/color] [color=#FF0000]0[/color][color=#8B3E2F][b])[/b][/color] [color=#191970][b]sideRadio[/b][/color] [color=#8B3E2F][b]([/b][/color][color=#000000]_this[/color] [color=#191970][b]select[/b][/color] [color=#FF0000]1[/color][color=#8B3E2F][b])[/b][/color][color=#8B3E2F][b];[/b][/color][color=#8B3E2F][b]}[/b][/color][color=#8B3E2F][b],[/b][/color] [/color]playerSide[color=#FF8040][color=#8B3E2F][b],[/b][/color] [color=#000000]false[/color][color=#8B3E2F][b]][/b][/color] [color=#191970][b]spawn[/b][/color] BIS_fnc_MP[color=#8B3E2F][b];[/b][/color]
[color=#006400][i]//where "message" is the message defined in your description.ext in CfgRadio[/i][/color][/color]

So this remote executes the code (within the {}) on each connected client of your side. That means, you can consider it as if the code is executed on the respective clients as if it was placed there. So you don't need to worry about the sound - if it plays on your machine, it will play on theirs.

If you want it to execute on every client, use "true" instead of "playerSide".

Regards,

waltenberg aka Johnny

Edited by waltenberg

Share this post


Link to post
Share on other sites

Thanks alot! That's much cleaner than raising Public Variable Event Handlers like I've been doing with SAY3D.

Share this post


Link to post
Share on other sites

Hi,

I know this is an old thread, but it is exactly what I need answer on.

I tried the above codes, but it just doesn't work. Tried both version (using playerSide or True) and also tried with "if (isServer) then". Is it suppose to be in a script, or in a trigger?

Here is the 4 variants I tried, none working:

if (isServer) then {
[[Girna_radio, "GIRNA_INI"], {(_this select 0) sideRadio (_this select 1);}, true, false] spawn BIS_fnc_MP;
};

if (isServer) then {
[[Tempest_radio, "TEMPEST_INI"], {(_this select 0) sideRadio (_this select 1);}, playerSide, false] spawn BIS_fnc_MP;
};

[[Airstation_radio, "AIRSTATION_INI"], {(_this select 0) sideRadio (_this select 1);}, true, false] spawn BIS_fnc_MP;

[[Maxwell_radio, "MAXWELL_INI"], {(_this select 0) sideRadio (_this select 1);}, playerSide, false] spawn BIS_fnc_MP;

All of 'hem are called with nul=[] execVM "scripts\something.sqf", all having their own .sqf file. Also, the description.ext is writen without any errors and as it should (with sounds in class CfgRadio), and all of them working (in SP)when only using:

unit sideRadio "Radiomsg"

Hope you can help me.

Have a nice day.

Share this post


Link to post
Share on other sites
[[_unit,"RadioMsg"],"sideRadio",side,false,false] call BIS_fnc_MP;

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×