Released [TUTORIAL] Unique engine sounds for vehicles

Discussion in 'Programming' started by Fireboyd78, Jul 18, 2014.

  1. Mr.Hankey

    Mr.Hankey
    Expand Collapse

    Joined:
    Aug 9, 2012
    Messages:
    29
    I agree. It is hacky and ugly and it obviously would be nice if the devs would simply include that one-liner in the next update. The only reason I see why it could be useful is that people have a simple way to package custom sounds with their newly released vehicles all in one place. But as you said that's just a minor difference to replacing sounds.lua...

    I don't really see why it would make you loose the ability to load sounds from vehicles/common though.
     
  2. Fireboyd78

    Fireboyd78
    Expand Collapse

    Joined:
    Aug 5, 2013
    Messages:
    85
    Well what I was basically saying is that you lose the ability to access sounds in "vehicles/common/sounds/<etc>" without having to make a "sounds.cs" file. Meaning that there's a common sound called "GenericEngineSound", and I want my car to use it - instead of having to define new sounds for it, I simply add to my JBeam this:

    Code:
    "engineSound":"GenericEngineSound"
    I just find it a lot simpler and easier to do it without using per-vehicle Lua. Sure, it works, but it's just asking for trouble in the future...imagine how many mod authors would have to update their mods just so their sounds work properly. I don't see that going down very well.
     
  3. Mr.Hankey

    Mr.Hankey
    Expand Collapse

    Joined:
    Aug 9, 2012
    Messages:
    29
    I see. Thought you were just referring to having shared sound files in vehicles/common.
     
  4. xKryptx

    xKryptx
    Expand Collapse

    Joined:
    Aug 28, 2013
    Messages:
    102
    Personally I think this is still wrong, the vehicles should not be the ones that define the engine sound... the actual ENGINE JBEAM should be the files that decide what sounds are used as we all like to sometimes have v8's or what ever... an I4 soundfile when you selected a v8.... seems total legit...
     
  5. Fireboyd78

    Fireboyd78
    Expand Collapse

    Joined:
    Aug 5, 2013
    Messages:
    85
    You can put the sounds in whatever JBeam you want. It just has to go in the "engine" section.
     
  6. TrimericMist

    TrimericMist
    Expand Collapse

    Joined:
    Dec 13, 2013
    Messages:
    4






    Hey this is C++ I know this kind of programming :D
     
  7. SixSixSevenSeven

    SixSixSevenSeven
    Expand Collapse

    Joined:
    Sep 13, 2013
    Messages:
    6,960
    except it isnt C++, it may be a C styled syntax but its not C or C++ or C# or Java. Torquescript.
     
  8. Dummiesman

    Dummiesman
    Expand Collapse

    Joined:
    Sep 17, 2013
    Messages:
    4,684
    If it was C++ you'd have

    Code:
    string vehicleName = "Ibishu Covet";
    SFXProfile HatchEngine = new SFXProfile();
    HatchEngine.fileName = "vehicles/hatch/moonhawk_engine.ogg";
    HatchEngine.description = "AudioDefaultLoop3D";
    Buuut it's torquescript
     
  9. KennyWah

    KennyWah
    Expand Collapse

    Joined:
    Jan 16, 2013
    Messages:
    2,629
    If only this were compatible with the current BeamNG exp so it wouldn't break stuff like the large cannon's controls.
     
  10. iheartmods

    iheartmods
    Expand Collapse

    Joined:
    Aug 8, 2012
    Messages:
    1,482
    To update this (found by Dummiesman a while back) for the new version...

    Put this file in C:\Program Files (x86)\Steam\SteamApps\common\BeamNG.drive\lua\vehicle\[replace sounds.lua]

    Some black magic in the file that I don't get makes this system work again :)
     

    Attached Files:

  11. Dummiesman

    Dummiesman
    Expand Collapse

    Joined:
    Sep 17, 2013
    Messages:
    4,684
    ^ Alternatively put sound profiles in materials.cs so that's not needed ;D (for developers of mods)
     
  12. tylermarkert1

    tylermarkert1
    Expand Collapse

    Joined:
    Dec 1, 2014
    Messages:
    1
    can somone walk me threw this i want this sound so bad i dont care if its for every car or truck i just want it to work somone please dumb it down for me or help something lol

    i want this sound for the yota stock runner looks like a ford ranger please help lol
     
  13. Sykriss

    Sykriss
    Expand Collapse

    Joined:
    Aug 13, 2015
    Messages:
    36
    Any idea why, when using this mod, any car that spawns will initially have no engine sound until swapping it out then back in again? Is this normal? If not, how can I fix it?

    EDIT: Nevermind, I figured it out. However, I'm now having an issue that is baffling me. Suddenly my mod that has been extensively using this script has stopped working; I'm getting an error in the console saying that the game engine couldn't find the sound profile specified, even though it is correctly scripted in name.cs. It seems like name.cs is not loading for whatever reason...

    EDIT2: Okay, after completely reinstalling Beam I got the engine sounds working again. However, now I've run into another seemingly inexplicable issue: Now, none of my custom sounds are working. Every different engine that I use that uses custom sounds uses the same generic Beam engine sound, and when I check in the console, the Lua debug says that each one IS correctly loading the sound profile. Can anyone help me with this? It's getting very frustrating and I'm losing the motivation to work on a mod I'm developing because of this. I literally didn't change anything related to the sound processing when the sounds broke. I'll be more than happy to provide the files if someone could help :|

    I also tried editing the custom_sounds.lua file so that it ONLY uses the custom sound, not the EngineTestSound, and when I do that, my engines no longer use the default sounds... They're silent. And the debug text still shows that the correct sound profiles are being loaded, they're just.. not playing. All of these sounds I have been using for hours now, they're all 96k and mono.
     
    #33 Sykriss, Aug 14, 2015
    Last edited: Aug 14, 2015
  14. GeoTelnet111

    GeoTelnet111
    Expand Collapse

    Joined:
    Mar 7, 2013
    Messages:
    193
    So I'm either retarded and need help or I just am doing this wrong.... I don't ever usually script or do anything in LUA or CS, could one of the OPs please upload a new version of the code/instructions or upload a pack of all the vehicles with the replacement CS/JBeam files so all we have to do is replace the ogg files and file names in the entries?

    Thanks
     
  15. Kei Hobo

    Kei Hobo
    Expand Collapse

    Joined:
    Jun 16, 2017
    Messages:
    6
    can someone make a video on how to do this plz? i cant figure it out on my own im new to beamng:(
     
  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