What are you attempting to achieve?
I want to make certain sounds play at random or when a vehicle (in this case, a train) isn’t moving. Such sounds would be:
When stationary:
- air releasing or air compressor sounds
- ticking or spitting (similar to the sounds a car makes after you turn it off after driving and it just sits)
- audible passenger or freight effects like people talking, radio chatter, and other ambient
When moving:
- train car squeals, squeaks, or ‘flat spots’ (the thumping you hear on some train cars as they go by)
What is the issue?
I don’t know how to make an efficient script that does this. My game is built by several of us and we do have a lead scripter, but he’s currently working on something in it that has far more priority and I wish not to interrupt him.
What solutions have you tried so far?
I thought about taking a script from a friend of mine that has a sound pack that includes a sound-randomizing script and altering it, but I decided against this as the method I had in mind seems inefficient, impractical, and memory consuming.
References:
- A video with a really loud flat spot at the end (skip to 2:52) https://www.youtube.com/watch?v=znryKLzTVgA
- A video with a “whoop” compressor sound (skip to 1:25) https://www.youtube.com/watch?v=VB_n8y-9dHI