Scripts / music.lua

Author
Message
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 5th Jul 2016 19:51
hi there. i was trying to make multiple music zones for my game and i found this video
https://www.youtube.com/watch?v=Yr3ZqN-OpcE
and i wonder why it doesn't work for me.

i have to put the custom music.lua file in the scripts directory and this is what i did:



i want to use the 4 music pieces from the folder "music\theescape" and first was really wondering why the were two backslashes in the directory. is this right? in the video lee does it like this and it works.

thanks!
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 5th Jul 2016 21:38 Edited at: 5th Jul 2016 21:41
there are two slashes because in LUA a single slash is a precursor to a command, you need two slashes to tell it that it's a directory change.

The reason it's not working is because each track set is calling the track twice, you need to comment out one of the lines in each track:

MUSIC_TRACK1 = "audiobank\\music\\theescape\\default.ogg";
MUSIC_TRACK1 = ""; <----------------------------------------------------------------------------- get rid of this line in each set of tracks
MUSIC_TRACK1_INTERVAL = 3692;
MUSIC_TRACK1_LENGTH = 38000;

i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.
i3 , Intel integrated graphics, 6GB memory, 512GB Generic SATAIII Win8.1.
Intel Celeron (duel Core), Radeon integrated graphics, 4GB memory, 180gB Generic SATAII, WinVista.
Q6600, Intel integrated graphics, 8GB memory, 512GB Generic SATAII, Win7.
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 5th Jul 2016 22:59


(it's working, you found the error in this code! thank you a lot!!!)
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 11th Jul 2016 23:44
hi there, i have a new problem i can't find out why it happens.
here is "my" script für "music.lua"



and these are the four tracks:





now my problem is that the soundtriggers for zone 1 and 3 are working. also the default track 1 is working. zones 2 and 4 are not working and i don't know why? is there something wrong in the music.lua? i have all four tracks in the same way but only half of it works.
i got no idea...
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti

Attachments

Login to view attachments
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 12th Jul 2016 00:47
You're missing a \ from lines 6 and 14 of the music.lua script, it should be:


i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.
i3 , Intel integrated graphics, 6GB memory, 512GB Generic SATAIII Win8.1.
Intel Celeron (duel Core), Radeon integrated graphics, 4GB memory, 180gB Generic SATAII, WinVista.
Q6600, Intel integrated graphics, 8GB memory, 512GB Generic SATAII, Win7.
nuncio
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location: Schleswig Holstein, Germany
Posted: 12th Jul 2016 14:28 Edited at: 12th Jul 2016 22:06
yes. sometimes my head is too full to see the obvisous and someone from outside must take a look to see these easy mistakes. thank you very much. of course this missing "\"must be the reason! great.

edit:

yes it works now. awesome! thank you!
http://www.nuncio-rap.de
intel core i5-3570K CPU @ 3.40GHz; 8GB RAM // NVIDIA GeForce GTX560Ti

Login to post a reply

Server time is: 2024-05-03 19:10:08
Your offset time is: 2024-05-03 19:10:08