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