Jump to content

Recommended Posts

Hey guys,

 

I am trying to wrap my head around the various playMusic, say2D, playSound3D commands and am still having trouble. I would like achieve the following two things:

 

- When a blufor player uses an action on an object, ONLY the blufor players hear a 2D sound (it has to follow the player and be heard locally, like a radio message of sort).

- The same as above, but triggered when any blufor player enters a trigger.

 

I tried various commands but am still struggling with locality of the commands. I believe that I am not using them on the correct clients, or something like that. The reason it needs to be played for side is that the mission is supposed to be PvP, so I do not want the opfor team to hear the audio.

 

Any help will be much appreciated.

 

Cheers!

Share this post


Link to post
Share on other sites
8 hours ago, Dj Rolnik said:

- When a blufor player uses an action on an object, ONLY the blufor players hear a 2D sound (it has to follow the player and be heard locally, like a radio message of sort).

playSound is the right option. it has local effect and is therefore only heard by the player that executed the command. To make all BLUFOR players hear it we use remoteExec:

_object addAction ["Play Sound for BLUFOR", {
	"soundName" remoteExec ["playSound", allPlayers select {side _x == west}];
}];

The same code can be used for the trigger.

  • Like 3

Share this post


Link to post
Share on other sites
On ‎10‎/‎15‎/‎2021 at 3:48 PM, 7erra said:

allPlayers select {side _x == west}

RemoteExec also targets a side, so you should just be able to put West.

  • Like 1

Share this post


Link to post
Share on other sites
On 10/16/2021 at 12:48 AM, 7erra said:

playSound is the right option. it has local effect and is therefore only heard by the player that executed the command. To make all BLUFOR players hear it we use remoteExec:


_object addAction ["Play Sound for BLUFOR", {
	"soundName" remoteExec ["playSound", allPlayers select {side _x == west}];
}];

The same code can be used for the trigger.

 

Confirmed, working just as expected. Thank you my man, much appreciated!

Share this post


Link to post
Share on other sites
On 10/17/2021 at 7:48 PM, opusfmspol said:

RemoteExec also targets a side, so you should just be able to put West.

true. But question: The following setup:

  • Hosted MP
  • Host is player on the east side
  • Another player west
  • AI created on the server for side west
  • Execute remoteExec with west targets

Isn't the AI getting targeted as well, so the sound also plays for the server, aka the host on the east side?

 

EDIT: side works fine. as BIKI and @pierremgi say, only players are considered

Spoiler

spongebob-squarepants.gif

 

Edited by 7erra
  • Like 1

Share this post


Link to post
Share on other sites
5 hours ago, 7erra said:

true. But question: The following setup:

  • Hosted MP
  • Host is player on the east side
  • Another player west
  • AI created on the server for side west
  • Execute remoteExec with west targets

Isn't the AI getting targeted as well, so the sound also plays for the server, aka the host on the east side?

  Reveal hidden contents

spongebob-squarepants.gif

 

 

Read BIKI: https://community.bistudio.com/wiki/remoteExec
Side - The function / command will be executed on machines where the player is on the specified side.

 

  • Like 3

Share this post


Link to post
Share on other sites

Tested it and confirmed. Edited my post above.

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

×