Scripts / Multiple Audio Tracks?

Author
Message
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 29th Sep 2014 09:58 Edited at: 29th Sep 2014 10:04
Hi everyone, I'm quite new to LUA. In fact I'm so new I currently have no idea where to begin yet with poking at it. I've been fluent in FPI though the commands there obviously didn't handle variables, strings and etc the same way or as intuitively. So yes I'm indeed very much excited that we went the LUA route, only now I'm left unable to make drastic changes to scripts yet. Soon I hope!



Any who, so basically I've been taking a look at our musicinzone.lua script and was hoping to make a few changes. I noticed that if you step into one zone with the script music will start playing but once you step into another zone with the same script another track will start playing on top of the previous. I was curious as to what command would stop the previous track from playing for the new one to override? What would be a fantastic bonus, is the ability to have the previous track fade out once you enter a new zone and have a new track crossfade in.



As lovely as that script would be, there is something to be noted since two tracks seem to play at the same time. We could really make some good use of this defect of the original musicinzone script. (No offensive intended by saying defect.) What would be an awesome script is having one that could basically utilize two level specific variables (non internal or global) that we could assign tracks to. I'd love to have the ability to have something similar to Skyrim. Where as you have a music track and an ambient environmental track. For instance you could be walking in some plains listen to some exploration stylized music yet by a zone for the plains.... within another zone in the same area playing the sound of light wind blowing across the ground. You walk into a town that has a zone in it that fades the exploration music and fades in music of a town. As you walk around the town you walk into another zone that fades out the light wind track and introduces the ambient track with say the sounds of a blacksmith's smither burning.



I made a video way back early on Reloaded's development which shows a bit of some feature requests I had made at that time. In this video you can see the different uses of sound for example rain, crickets, wind, snow -- all the while playing music behind it.







Basically having two audio layers that can be assigned some way. I know it sounds like a lot to ask for so early on but is something like this possible?



This post may actually just be a command request and I don't know it. Let me know scripting experts what we can do with this concept and if its feasible



Also forgot to add, in the video example the ambient audio sound loops loaded in are loaded in based on what time of the day it is. This would be an ideal concept for when we reintroduce day and night cycles back into Reloaded.

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce 420 GT
Gtox
3D Media Maker
9
Years of Service
User Offline
Joined: 5th Jun 2014
Location: South Africa
Posted: 29th Sep 2014 12:17
Have you seen this (http://gallery.thegamecreators.com/fpscr/image-view.php?ord=rating&filter=videos#pid=2202&ord=rating) video? Not sure if it's exactly what you're looking for, but it looks quite useful.
tomjscott
User Banned
Posted: 29th Sep 2014 17:29
You can do multiple audio layers in Reloaded and even have other ambient sounds like birds and wind. It's all a bit tricky though because you either have to use the music system or attach sounds to entities in the scene. Btw, there is a document in the docs folder that explains the music system usage and Lua commands for finer control.

However, if you really want to up you sound capability, just grab the Omega Core plugin, which has true 3D positional sound and you can also use it for your 2D music layers as well.

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.0085
Teabone
Forum Support
17
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 2nd Oct 2014 10:36 Edited at: 2nd Oct 2014 10:37
Quote: "Have you seen this (http://gallery.thegamecreators.com/fpscr/image-view.php?ord=rating&filter=videos#pid=2202&ord=rating) video? Not sure if it's exactly what you're looking for, but it looks quite useful. "




Wow I'm very impressed. Pretty much all my questions in regards to music have been answered in that video. Does he have the scripts available? Guess I'll conduct a search at some point soon in the forums.



I'm also going to have to take a stab at LUA quite soon. Seems more than worth while to do so.



Quote: "Omega Core plugin"




Been meaning to try that out. Its next on my list. As I was curious if reverb in zones was possible.

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce 420 GT
tomjscott
User Banned
Posted: 2nd Oct 2014 15:18
Quote: "Been meaning to try that out. Its next on my list. As I was curious if reverb in zones was possible."


Yes, quite possible, but not implemented as yet. I've been a bit busy with other projects. I'm not sure if I'll implement much more with Omega Core, but I did have plans for reverb at one point. I may still end up adding that.

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.0085

Login to post a reply

Server time is: 2024-05-02 06:46:16
Your offset time is: 2024-05-02 06:46:16