Page MenuHomeFeedback Tracker

createSoundSource is not syncronised
Closed, ResolvedPublic

Description

Creating a SoundSource will play different sounds locally.

The creation of the source is all synced but the track selected is random to every player present.

Details

Legacy ID
1182455479
Severity
None
Resolution
No Bug
Reproducibility
Always
Category
Scripting
Steps To Reproduce
  1. multiplayer
  2. createSoundSource
  3. Notice different sounds between players

Event Timeline

th3cr0w edited Steps To Reproduce. (Show Details)Jan 22 2016, 2:06 PM
th3cr0w set Category to Scripting.
th3cr0w set Reproducibility to Always.
th3cr0w set Severity to None.
th3cr0w set Resolution to No Bug.
th3cr0w set Legacy ID to 1182455479.May 8 2016, 1:33 PM

What do you mean by track selected? createSoundSource is like createVehicle command only for sounds. When you indicate what sound to create it is created from config globally, therefore it will be the same globally. Unless you have different sounds under the same name on different PCs (which is possible if everyone is running a different mod) this could not happen.

I tested the command just to be sure, executing this on 1 client:

createSoundSource ["Sound_Alarm", position player, [], 0];

plays alarm at the same place on all clients. Could you please provide more information with repro?

th3cr0w added a subscriber: th3cr0w.May 8 2016, 1:33 PM

Sound_Alarm is defined in cfgVehicles and has a link (sound) to cfgSFX. the CfgSFX Class contains a list of multiple tracks which get selected at random which doesn't get synct.

"sounds[]={ "track01", "track02", "track03"};"

class cfgVehicles
{
class Sound;

class myCustomSound: Sound
{

		scope=2;
		sound="myCustomSound_SFX";
		displayName="myCustomSound";
		vehicleClass="sounds";

};
};

class CfgSFX
{

class myCustomSound_SFX
{

		sounds[]=
		{
			"radio01",
			"radio02",
			"radio03"

		};
		
		name="Custom Sound";
		
		radio01[]=
		{
			"testsound_01_40sek.ogg",
			6,
			1,
			50,
			0.082999997,
			0,
			0,
			0
		};
		radio02[]=
		{
			"testsound_02_40sek.ogg",
			6,
			1,
			50,
			0.082999997,
			0,
			0,
			0
		};
		radio03[]=
		{
			"testsound_03_40sek.ogg",
			6,
			1,
			50,
			0.082999997,
			0,
			0,
			0
		};
		
		empty[]=
		{
			"",
			0,
			0,
			0,
			0,
			0,
			0,
			0
		};

};
};

by creating "myCustomSound" playes can get one of the 3 different tracks(radio01 - radio03) + the empty one.

Ok, this certainly clears it up, lets see if this is a bug or a feature ;)

I have maybe slightly disappointing news, this is not a bug but feature. When more than 1 sound is supplied in sounds[] array, a random sound is picked up and played. In multiplayer every PC would pick its own random sound and this is unlikely to change for the near future.

However the good news is that you as modder or mission designed have a choice how you want to configure your SFX sounds. You can put different sounds under different classnames, 1 for each instead of putting them all in 1 array, then select which sound class you would like to play at random. This will guarantee that the same sound it played everywhere.

For example: createSoundSource [selectRandom ["Sound_Alarm1","Sound_Alarm2","Sound_Alarm3"], position player, [], 0];