Product Chat / GG Music Player - WIP

Author
Message
gd
7
Years of Service
User Offline
Joined: 21st Jul 2016
Location: Small Darkroom with no red light
Posted: 19th Dec 2016 05:57 Edited at: 19th Dec 2016 06:22
Hi guys, I have just be working on a in-game music player for GG. It works really well so far. I just need to add a few more functions to the music player.

The idea behind this is so you don't have to use trigger zones to change the track; unless you want to set the mood for that location using trigger zones which you can still do.

You can see in the image below it has the track name, artist, track number and a track counter. I will still need to add a few more player options to change the tracks. The next and previous tracks will work by pressing a keyboard key(s) which I hope are not being used but can be easily updated by you.

The reason for adding track artist and title is so you can advertise the composer. Why you ask? I have from time to time wanted to know the artist of the track in a game I'm playing but not wanting to read all the credits. Plus its also a good way to get composer to give their music more freely. The track info can be left clear if you don't want to use them.

The music player will also change colour three seconds before the next track is faded in, then back to is original colour.



Only three files need for this so far unless I make a drop in entity for ease of use. So far your only need to update one file which is the music.lua file like you would anyway. I have also made it very easy to use. You don't need to work out the track length in lua, just add the normal track length.

Example:
If your normal track length is 3:30 (3 minutes and thirty seconds long) then just add 3.30 to the track length field and that's it. The lua script will do the rest. The only issue so far is the track counter goes to 99 seconds instead of 60 seconds; like your see in the image below... but I will sort this.

The three files the player uses
music.lua ~ which will need a little mod.
musicsoundtrack.lua - which holds all the music player functions.
MusicPlayer.png - which is the music players background.

In the image below you will see three music players. The top left music player is the one that will show in-game, not the other two. I just add them so you can see it in action.

When it gets to three seconds before the track ends the music player turns red. Once the next track plays the music player will turn back to its original colour.

You can place the player anywhere on screen by just changing the X and Y in the script. I have added the music player to this location so it is just below the FPS for testing. Just like in the third image.


I was making this for a fast pace game and did not want to use trigger zones. It would be good for a multiplayer game too... when you can use custom script in GG MP!

Let me know what you guys think and if it is something that is needed?

Thanks guys.

gd - Ed.
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 SLI mode, Water cooled with an old Victorian cast iron radiator and a industrial leather belt driven fan - That's what you call Steampunked.

Laptop - M17xR3


A new competition running for GG

Attachments

Login to view attachments
PM
gd
7
Years of Service
User Offline
Joined: 21st Jul 2016
Location: Small Darkroom with no red light
Posted: 19th Dec 2016 09:45 Edited at: 19th Dec 2016 09:57
Little update



Music Player is now working with next and previous keyboard keys "<" for previous track and ">" for next track.
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 SLI mode, Water cooled with an old Victorian cast iron radiator and a industrial leather belt driven fan - That's what you call Steampunked.

Laptop - M17xR3


A new competition running for GG

Attachments

Login to view attachments
PM
GraPhiX
Forum Support
19
Years of Service
User Offline
Joined: 15th Feb 2005
Playing:
Posted: 19th Dec 2016 11:02
that's quite cool well done, so basically you can have background music and action sounds at the same time very usefull for setting an atmosphere
Welcome to the real world!
gd
7
Years of Service
User Offline
Joined: 21st Jul 2016
Location: Small Darkroom with no red light
Posted: 5th Jan 2017 19:38 Edited at: 5th Jan 2017 19:47
Hi guys, just another update for those who have ask for news.

Been working on the script for triggers, I will post a vid when I think it is worth posting.
I have added more code to the music .lua for up to 10 tracks. I have set it up to play from track 6-10 for the sound tracks. Banks 1-4 + 1 = 1-5 are for the other GG core system. When you use multi tracks you will need to optimise your audio files due to memory limits. I would use smaller ogg files which can also be used for looping if needed. The reason I have added more tracks is because of AI changing tracks like with combat, etc.

It is all working well except the triggers which I will have to probably make my own. The normal triggers still work fine with the music in the background for a loop atmosphere effect. I may also make new sound triggers to switch of background music or change the volume so you get the best atmosphere music coming through when playing. Also added the option to have random track play at start of game. This can be switch off if you want only one track to play at the start of the game to set the atmosphere and story line.

Any ideas you guys have please let me know.
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 SLI mode, Water cooled with an old Victorian cast iron radiator and a industrial leather belt driven fan - That's what you call Steampunked.

Laptop - M17xR3


A new competition running for GG
PM
granada
Forum Support
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 5th Jan 2017 19:45
Looking very nice,well done.

Dave
GeForce GTX 1050 Ti
AMD FX (tm)-9590 Eight-core Processor
31.96 GB RAM
1920x1080,60 Hz
PM
lordjulian
10
Years of Service
User Offline
Joined: 10th Jan 2014
Location:
Posted: 5th Jan 2017 19:46
Looks useful!
Julian
PM

Login to post a reply

Server time is: 2024-07-03 03:54:27
Your offset time is: 2024-07-03 03:54:27