Scripts / [SOLVED] Music loop problems

Author
Message
kozel
3
Years of Service
User Offline
Joined: 27th Nov 2021
Location:
Posted: 27th Nov 2021 16:48
Hi all, I hope everyone is doing okay.
I just recently discovered GamerGuru and I really like it. So I started a simple WW2 FPS shooter project .
I ran into a problem however. I watched many tutorials and searched for threads on this forum and followed every step, but I can't get the music loop indefinitely.
I have a proper trigger zone with musicinzone.lua script, pointed to the audio files in OGG format. Each audio file is around 1 minute 30 second long. Some background battle sound and upbeat battle music, not important.
Both triggers are on top of each other in the player start zone. The music and sound triggers and plays, but only 1x or 2x, no looping. I did not make any changes to the musicinzone.lua script, so it is the default. I'm very new to scripting. But according to the tutorials, I did everything correctly.
I am out of ideas and help would be appriecated.
Thank you

The author of this post has marked a post as an answer.

Go to answer
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 27th Nov 2021 17:36
musicinzone.lua should work at least it does for me.
If you want the same music to play right throughout the level try an ambience zone.
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
kozel
3
Years of Service
User Offline
Joined: 27th Nov 2021
Location:
Posted: 27th Nov 2021 18:17
Thank you for the quick response, I will try the Ambience zone instead and see if that helps.
PM
kozel
3
Years of Service
User Offline
Joined: 27th Nov 2021
Location:
Posted: 27th Nov 2021 18:45
Ok, so I tried again with the musicinzone script and it works. I stuck around in game longer, after the music stops. However, the problem is that when the song ends, it doesn't start again right away. Almost seems like that the length of the pause between the end and the music starting again is the length of the song. I am not sure if there is some command in the script file that would just start looping the track right after it ends, without that long pause.
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 27th Nov 2021 18:50
Its probably because there is to much of a delay at the end of the track that needs snipping off in a sound program.
Then it will start again instantly.
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
kozel
3
Years of Service
User Offline
Joined: 27th Nov 2021
Location:
Posted: 27th Nov 2021 19:05
Hmmmm. I don't think that would cause an almost 2 minute pause. Here is the song:

PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 27th Nov 2021 19:18
There is nothing attached ?
Can you zip it up and attach it ..
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
kozel
3
Years of Service
User Offline
Joined: 27th Nov 2021
Location:
Posted: 27th Nov 2021 19:20
Yessir, attached is the picture zipped.

Attachments

Login to view attachments
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 27th Nov 2021 19:44
This post has been marked by the post author as the answer.
Well it looks ok so no idea why really ?
I use loops all the time with musicinzone.lua and even cut them so they are as seameless as possible so you do not even notice a break. What format are you saving them as .. I use .wav
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
kozel
3
Years of Service
User Offline
Joined: 27th Nov 2021
Location:
Posted: 27th Nov 2021 19:56
I use them in .OGG. I will give a try in .wav
PM
kozel
3
Years of Service
User Offline
Joined: 27th Nov 2021
Location:
Posted: 27th Nov 2021 20:08
It works with .wav!
Now I just have to figure out why the sound is fixated to where the trigger zone is. I mean if I turn around, the surround seem to be on, hearing the music in left or right ear as I turn in 360 degrees.
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 27th Nov 2021 20:21
Quote: "Now I just have to figure out why the sound is fixated to where the trigger zone is"

Thats why i said use an ambiance zone .. it wont be fixed.
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
kozel
3
Years of Service
User Offline
Joined: 27th Nov 2021
Location:
Posted: 27th Nov 2021 20:39
I think it has to do with converting .ogg to .wav
I used ambiance zone but got the same surround result. I will have to start with the original .mp3 file, converting it to .wav mono.
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 28th Nov 2021 19:36
You want stereo WAV for music, mono WAV files will be treated as positional sounds.

You should really use the music system for music though. Look at music.lua to see how it works.
Been there, done that, got all the T-Shirts!
PM
kozel
3
Years of Service
User Offline
Joined: 27th Nov 2021
Location:
Posted: 28th Nov 2021 20:55
Thanks for the tip, I'll check it out.
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 28th Nov 2021 22:46
https://forum.game-guru.com/thread/220877#msg2617569

You may find that interesting.
Been there, done that, got all the T-Shirts!
PM
kozel
3
Years of Service
User Offline
Joined: 27th Nov 2021
Location:
Posted: 29th Nov 2021 15:34
That's very informative AmenMoses, thanks.
PM

Login to post a reply

Server time is: 2024-12-22 01:27:58
Your offset time is: 2024-12-22 01:27:58