Author Topic: 2D music with range  (Read 492 times)

i've been using music bricks now


there's an option for music bricks to turn off it's "3D" so that the music stays the same where ever you are

but the problem is that, when that is done, you can hear the music everywhere in the server (which is usually really good!)
but i want the music to be hearable only when you're in range


is there a way?

Quote
//server.cs

datablock AudioDescription(AudioBackMusicLooping : AudioMusicLooping3d)
{
   maxDistance = 50; //note: if i wanted it to affect the whole server, just change it to 9999999 or something.
   referenceDistance = 2;
   is3D = 0;
};

datablock fxDtsBrickData(brickBackMusicData : brickMusicData)
{
   uiName = "Back Music";
   musicRange = 50;
   musicDescription = AudioBackMusicLooping;
   //is3D = 0;
};

exec("./Support_backmusicbricks.cs");
Quote
//support_backmusicbricks

if(isObject(MissionMusic))
   return;

brickMusicData.musicRange = 30;
brickMusicData.musicDescripti on = AudioMusicLooping3d;

package customrangebackmusic
{
   function fxDtsBrick::setSound(%this,%music,%client)
   {
      if(isObject(%this.audioEmitter))
         %this.audioEmitter.delete();
      if(!%music || %music == -1)
         return 1;
      %this.audioEmitter = new AudioEmitter()
      {
         position = %this.position;
         rotation = "1 0 0 0";
         scale = "1 1 1";
         profile = %music;
         useProfileDescription = "0";
         description = %this.dataBlock.musicDescription;
         type = "0";
         volume = "1";
         outsideAmbient = "1";
         referenceDistance = "2"; //from what blueblur and chrono said, this is the "earrape distance".
         maxDistance = %this.dataBlock.musicRange;
         isLooping = "1";
         loopCount = "-1";
         minLoopGap = "0";
         maxLoopGap = "0";
         enableVisualFeedback = "1";
         is3D = "%this.dataBlock.is3D;";
         //i don't want any change in audio. i think this is what controls it. //okay yeah i dunno
         coneInsideAngle = "360";
         coneOutsideAngle = "360";
         coneOutsideVolume = "1";
         coneVector = "0 1 0";
      };
   }
};
activatePackage(customrangebackmusic);

you could always make the audio stereo

make referenceDistance the same as the maxdistance?

you could always make the audio stereo
ye


does blockland load those though? i read that it only works in a dedicated server

make referenceDistance the same as the maxdistance?
reference distance increases the scale of music as you get closer

which means that, if you set it to 80 and get reaaaaallly close to the music brick, it'll be super loud and garbled

reference distance increases the scale of music as you get closer

which means that, if you set it to 80 and get reaaaaallly close to the music brick, it'll be super loud and garbled
are you sure about that? what you asked for seemed to work perfectly with just setting referencedistance to the same value as maxdistance without any strange loudness issues
Quote from: Appendix A - Quick References.pdf
ReferenceDistance Distance at which sound turns on to 100% of current maximum gain
« Last Edit: February 15, 2016, 08:58:25 AM by QuadStorm »

are you sure about that? what you asked for seemed to work perfectly with just setting referencedistance to the same value as maxdistance without any strange loudness issues
it works really well!

there are loudness issues though, but this is the best option so far


also, can you link me to that .pdf you used? it interests me