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

    Dismiss Notice

Assign Vehicle Sound to a Key?

Discussion in 'Content Creation' started by iheartmods, Mar 16, 2017.

  1. iheartmods

    iheartmods
    Expand Collapse

    Joined:
    Aug 8, 2012
    Messages:
    1,488
    I'm back again ;),

    Am wondering now if I can assign a certain key in the .sbeam to function as a trigger for a sound.

    You'll receive credit in a mod if you can help me make it work!

    Thanks
     
  2. iheartmods

    iheartmods
    Expand Collapse

    Joined:
    Aug 8, 2012
    Messages:
    1,488
     
    • Like Like x 1
  3. metalmuncher

    metalmuncher
    Expand Collapse

    Joined:
    Aug 6, 2012
    Messages:
    257
    The attached mod adds a horn to the pickup as an example. I've named everything so it should make sense as to which values are used where, and there is also an example of a toggle type action too. The thing should be rebindable if you remove the included inputmap, its defaulted to H.
     

    Attached Files:

  4. iheartmods

    iheartmods
    Expand Collapse

    Joined:
    Aug 8, 2012
    Messages:
    1,488
    You're a God. Cheers mate!
     
  5. gigawert

    gigawert
    Expand Collapse

    Joined:
    Sep 6, 2015
    Messages:
    2,087
    If it's that simple, why isn't it in game yet?
     
    • Agree Agree x 1
  6. H/\Z/\RDOUS

    H/\Z/\RDOUS
    Expand Collapse

    Joined:
    Apr 18, 2016
    Messages:
    320
    ¯\_(''3)_/¯
     
  7. VeyronEB

    VeyronEB
    Expand Collapse

    Joined:
    Aug 5, 2012
    Messages:
    1,609
    There is a sound dev working on the sounds, so it will come when the new sounds do.
     
  8. iheartmods

    iheartmods
    Expand Collapse

    Joined:
    Aug 8, 2012
    Messages:
    1,488
    Eh, it's lua. I don't do lua
    --- Post updated ---
    Unfortunately, this isn't doing what I'd like. Thanks for your time anyway!
     
  9. Nadeox1

    Nadeox1
    Expand Collapse
    Administrator
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,702
    What's the point of doing X, if the system under it is going to be re-worked, making X deprecated?
     
    • Agree Agree x 2
  10. Octothorp Obelus

    Octothorp Obelus
    Expand Collapse

    Joined:
    Jan 24, 2014
    Messages:
    280
    To make the Y better, of course! :)
     
  11. Nadeox1

    Nadeox1
    Expand Collapse
    Administrator
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,702
    Not when you have other stuff to work on.
    It's non-sense to dedicate time on X, if you know you will need to rework X in the near future.
    Better spend time on something else, until you can do X properly.

    I hope you see the point there.
     
    • Agree Agree x 2
    • Informative Informative x 1
  12. iheartmods

    iheartmods
    Expand Collapse

    Joined:
    Aug 8, 2012
    Messages:
    1,488
    You OK? Nobody was even arguing here...
     
  13. Nadeox1

    Nadeox1
    Expand Collapse
    Administrator
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,702
    I wasn't arguing, just explaining stuff..

    Let me add a smile:
    :)
     
    • Like Like x 2
    • Agree Agree x 1
  14. Octothorp Obelus

    Octothorp Obelus
    Expand Collapse

    Joined:
    Jan 24, 2014
    Messages:
    280
    ᕕ( ᐛ )ᕗ

    OT: I can see if I can do something that'd let you play a sound on key press, but I'm not at home ATM.
     
  15. iheartmods

    iheartmods
    Expand Collapse

    Joined:
    Aug 8, 2012
    Messages:
    1,488
    The lua files above work well however two problems/undesirable effects occur:
    1. The sound is constantly looping at a fixed rate in time no matter when I press the button. I would like it to start the sound at the beginning of the file when I press 'V'
    2. The sound is supposed to be a startup sound activated by pressing 'V'. I was able to make this work but it breaks the startup function in the game and only plays the sound.
     
    #15 iheartmods, Mar 22, 2017
    Last edited: Mar 22, 2017
  16. metalmuncher

    metalmuncher
    Expand Collapse

    Joined:
    Aug 6, 2012
    Messages:
    257
    You don't want to be making a new binding for something that's already in the game, its way better to just tap into the functionality already in the game. Doing it this way ensures that the sound plays whenever the starter is on e.g. when the automatic gearbox tries to restart. I've attached an example, but haven't had time to get it to loop from the start every time it fires, maybe I'll have a look tomorrow.
     

    Attached Files:

  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