Results 1 to 5 of 5

Thread: Define Sound for Automode

  1. #1

    Define Sound for Automode

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

    Code:
    ////////////////////////////////////////////////////////////////////
    //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;
       };
      };
     };
    };
    //};
    Last edited by BGF Krätzer; Aug 31 2010 at 16:50.

  2. #2
    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:
    Code:
        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.

  3. #3
    So i need to search for the class code and can´t define it in die .cpp of the Weapon?

  4. #4
    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.
    Last edited by Scruffy; Sep 3 2010 at 14:38.

  5. #5
    This code works, thx:
    Code:
    #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;
       };
      };
     };
    };
    //};

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •