Author Topic: I need help with sound coding!  (Read 868 times)

So i have recently exported Battlefeild 3 death yells, but if any of you reading this have battlefield experience you will realize that sound travels far in that game, id like someone to tell me what part of the sound code to edit to increase sound range: heres the code wtf do i need to do?

datablock AudioProfile(Scream1)
{
   fileName = "./Death-01.wav";
   description = AudioClosest3d;
   preload = false;
};

This is from the "sound.cs" file.

package DeathYells
{
    function gameConnection::onDeath(%this)
    {
        serverplay3d("scream" @ getRandom(1, 29), %this.player.getHackPosition() SPC "0 0 1 0");
       
        return parent::onDeath(%this);
    }
};
activatepackage (DeathYells);


package customDeathSound
{
     function player::playDeathCry(%this)
     {
          serverPlay3D(DeathSound, %this.getHackPosition());
     }
};

activatePackage("customDeathSound");

This is from the "script.cs" file. Which one do i need to edit and what part?

change AudioClosest3d to AudioDefault3d
this will double the range, there isn't much more you can do though as the description variable only allow for close range or double that range

Your awsome dude thanks!

there isn't much more you can do though as the description variable only allow for close range or double that range

What? Just make a description with whichever attributes you want.

datablock AudioDescription(AudioReallyVeryFar3D : AudioDefault3D)
{
  referenceDistance = 4096;
  maxDistance = 8192;
};

at first thats what i thought i needed to do, so i replaced "AudioClosest3d" with "AudioLongest3d" but it ended up canceling the yells. are there certain words i need?