1. Intel iGPU (6xx series) crashes
    Fixed drivers available!
    Instructions here

    Dismiss Notice

Sound Loader For Different Cars

Discussion in 'Ideas and Suggestions' started by KamikazeF0X, Jun 30, 2014.

?

Is it possible

  1. Yes

    42.9%
  2. No

    0 vote(s)
    0.0%
  3. I don't know

    57.1%
  1. KamikazeF0X

    KamikazeF0X
    Expand Collapse

    Joined:
    Aug 6, 2013
    Messages:
    38
    Hi! I wanted to know if it is possible to make a script that would change the sound of a vehicle when it is loaded by the game

    Should ensure that if the vehicle has a present "engine.wav" file in the folder (\\BeamNG.drive\vehicles\hatch - for example) it is loaded with the car in question, and each have their own cars engine sound

    Should integrate in the game and do not run it on a "bat" outside the game
    The best would be to load the ".wav" directly it would load a file containing information sounds to use for different engine speeds (see code below, racer.nl code used in the game as a file ".ini")

    PS: I am a potato in it's about coding something


    (My poor engish force me to use google translate ... )

    Original text ;)

    Salut ! Je voulais savoir si il est possible de faire un script qui changerait le son d'un véhicule quand il est chargé par le jeu

    Il faudrait faire en sorte que si le vehicule a un fichier "engine.wav" présent dans son dossier ( \\BeamNG.drive\vehicles\hatch - par exemple) il soit chargé avec la voiture en question, ainsi chaque voitures auront leurs propre bruit de moteur


    Il faudrait l'integrer au jeu et ne pas le faire tourner sur un "bat" extérieur au jeu

    Le mieux serait au lieu de charger le "wav" directement ce serait de charger un fichier regroupant des informations de bruits a utiliser selon les différents régimes moteurs (voir le spoil, code utilisé dans le jeu racer.nl sous forme d'un fichier "ini")


    PS: La programation et moi ca fait deux ...


    Code:
    -- This is working with Fmod
    --      sample=2000.wav        -- Sample used
    --      min=1500        -- RPM Min for this sample
    --      max=2500        -- RPM Max for this sample
    --      attack=1000        -- Sound Modifier
    --      decay=1000        -- Sound Modifier
    --      natural=4100        -- Sound Modifier
    
    audio
    {
      skid
      {
        sample=skid.wav
      }
      accelerate_out
      {
        smp0
        {
          sample=idle.wav
          volume=1.1
          min=300
          max=1000
          decay=900
          natural=2300
        }
        smp1
        {
          sample=lo.wav
          volume=2
          min=300
          max=600
          decay=2000
          natural=16000
        }
        smp2
        {
          sample=mid.wav
          volume=2
          min=600
          max=2000
          attack=300
          decay=4000
          natural=11500
        }
        smp3
        {
          sample=hi.wav
          volume=1.5
          min=4000
          max=10000
          attack=3000
          natural=26000
        }
        smp4
        {
          sample=hi2.wav
          volume=0.5
          min=4000
          max=10000
          attack=3000
          natural=26000
        }
        smp5
        {
          sample=gearwhine.wav
          volume=0.06
          min=2600
          max=4000
          attack=2000
          decay=1000
          natural=500
        }
      }
     decelerate_out
      {
        volume=1.0
         smp0
        {
          sample=idle.wav
          volume=1.1
          min=300
          max=1000
          decay=900
          natural=2200
        }
        smp1
        {
          sample=low.wav
          min=500
          max=2400
          attack=1000
          decay=1000
          natural=2900
          volume=1.3
        }
        smp2
        {
          sample=d1.wav
          min=2400
          max=3100
          attack=1000
          decay=1000
          natural=3200
        }
        smp3
        {
          sample=d2.wav
          min=3100
          max=7500
          attack=1000
          decay=1000
          natural=4100
        }
        smp5
        {
          sample=gearwhine.wav
          volume=0.07
          min=2600
          max=4000
          attack=2000
          decay=1000
          natural=470
        }
      }
    
    
        wind
        {
            smp0
            {
                sample=wind.wav
                volume=1
                min=1
                max=100
                natural=50
            }
        }
    }
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice