Jump to content
Sign in to follow this  
BGF Krätzer

Define Sound for Automode

Recommended Posts

What i have to paste here if i want that the weapon plays while firing this sound KZ_FG42is/sound/shoot.wss

////////////////////////////////////////////////////////////////////
//Produced from mikero's Dos Tools using dll 2.99
//http://dev-heaven.net/projects/list_files/mikero-pbodll
////////////////////////////////////////////////////////////////////

#define _ARMA_

//Class KZ_FG42is : config.bin{
class CfGPatches
{
class KZ_FG42is
{
 Units[] = {};
 weapons[] = {"KZ_FG42is"};
 requiredVersion = 1.0;
 requiredAddons[] = {};
};
};
class CfgWeapons
{
class rw_BAR;
class KZ_FG42is: rw_BAR
{
 DisplayName = "KZ_FG42is";
 Model = "KZ_FG42is\Fg42is.p3d";
};
};
class cfgVehicles
{
class ReammoBox;
class TestWeaponBox: ReammoBox
{
 scope = 2;
 accuracy = 1000;
 displayName = "Test Weapon Box";
 model = "\ca\weapons\AmmoBoxes\USBasicWeapons.p3d";
 class TransportMagazines
 {
  class 20Rnd_556x45_Stanag
  {
   magazine = "20Rnd_556x45_Stanag";
   count = 200;
  };
 };
 class TransportWeapons
 {
  class KZ_FG42is
  {
   weapon = "Fg42";
   count = 12;
  };
 };
};
};
//};

Edited by BGF Krätzer

Share this post


Link to post
Share on other sites

Put this:

begin1[] = {"\KZ_FG42is\sound\shoot.wss", 1.77828, 1, 1000};

soundBegin[] = {"begin1",1};

inside your fullauto mode. First number behind file is loudness, second is speed of playback and third is distance.

Look at your parent class rw_BAR to see the names of the modes. You can use different sound files and add them as begin2[], begin3[] etc., then add them to the soundbegin[] array, the number behind the name is the probability, so use 0.5 with two different sounds.

Example from BAF_L110A1:

    class BAF_L110A1_Aim: Rifle
   {
       modes[] = {"manual","close","short","medium","far"};
       class manual: Mode_FullAuto
       {
           recoil = "recoil_auto_machinegun_8outof10";
           recoilProne = "recoil_auto_machinegun_prone_5outof10";
           dispersion = 0.0008;
           begin1[] = {"Ca\sounds_baf\weapons\l110_single1a_vetsi_raze",1.77828,1,1000};
           begin2[] = {"Ca\sounds_baf\weapons\l110_single1b_vetsi_raze",1.77828,1,1000};
           soundBegin[] = {"begin1",0.5,"begin2",0.5};
           soundContinuous = 0;
           soundBurst = 0;

soundContinuous = 1; makes the game wait until the sound is finished before playing the next one

soundburst = 1; is for prerecorded burst sounds with three shots in one file, if = 0 it plays the sound again for every shot fired in the burst.

Share this post


Link to post
Share on other sites

Maybe it doesn't have one and inherited it from the parent class. In that case you need to follow the ancestors until you find one ;)

Edit: Or just define your own of course, but you'll have to look for an example anyway.

Edited by Scruffy

Share this post


Link to post
Share on other sites

This code works, thx:

#define _ARMA_

//Class KZ_FG42is : config.bin{
class CfGPatches
{
class KZ_FG42is
{
 Units[] = {};
 weapons[] = {"KZ_FG42is"};
 requiredVersion = 1.0;
 requiredAddons[] = {"rw_weap","VILAS_Stare"};
};
};
class Mode_SemiAuto{};
class Mode_FullAuto{};
class CfgWeapons
{
class rw_bar;
class KZ_FG42is: rw_bar
{
 DisplayName = "KZ_FG42is";
 model = "\KZ_FG42is\Fg42is.p3d";
 modes[] = {"Single","ai_single","auto"};
 magazines[] = {"VIL_20Rnd_mauser"};
 class Single: Mode_SemiAuto
 {
  sound[] = {"\KZ_FG42is\sound\shoot.wss",5.62341,1};
  recoil = "M4Recoil";
  recoilProne = "m4Recoil";
  reloadTime = 0.1;
  dispersion = 0.001;
  aiRateOfFire = 5;
  minRange = 25;
  minRangeProbab = 0.1;
  midRange = 10;
  midRangeProbab = 0.5;
  maxRange = 40;
  maxRangeProbab = 0.01;
 };
 class ai_Single: Mode_SemiAuto
 {
  sound[] = {"\KZ_FG42is\sound\shoot.wss",5.62341,1};
  recoil = "M4Recoil";
  recoilProne = "m4Recoil";
  reloadTime = 0.1;
  dispersion = 0.003;
  aiRateOfFire = 5;
  minRange = 25;
  minRangeProbab = 0.1;
  midRange = 100;
  midRangeProbab = 0.5;
  maxRange = 400;
  maxRangeProbab = 0.01;
  showtoplayer = 0;
 };
 class auto: Mode_FullAuto
 {
  sound[] = {"\KZ_FG42is\sound\shoot.wss",5.62341,1};
  recoil = "M4Recoil";
  recoilProne = "m4Recoil";
  reloadTime = 0.09;
  dispersion = 0.004;
  aiRateOfFire = 5;
  autofire = 1;
  minRange = 2;
  minRangeProbab = 0.1;
  midRange = 50;
  midRangeProbab = 0.1;
  maxRange = 100;
  maxRangeProbab = 0.01;
 };
};
};
class cfgVehicles
{
class ReammoBox;
class TestWeaponBox: ReammoBox
{
 scope = 2;
 accuracy = 1000;
 displayName = "Test Weapon Box";
 model = "\ca\weapons\AmmoBoxes\USBasicWeapons.p3d";
 class TransportMagazines
 {
  class VIL_20Rnd_mauser
  {
   magazine = "VIL_20Rnd_mauser";
   count = 200;
  };
 };
 class TransportWeapons
 {
  class KZ_FG42is
  {
   weapon = "KZ_FG42is";
   count = 12;
  };
 };
};
};
//};

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  

×