Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(2 edits)

I'm having trouble with the "loopstart" and "looplength" parameters. It doesn't seem to be working as expected. I have a loopstart/looplength meant to repeat the intro of a battle song until the battle actually starts at which point the loopstart/looplength will be set to different values so the main part of the battle music plays and loops around the climax of the piece.

But what happens is the loopstart/looplength doesn't actually loop the ogg file and just plays the file in its entirety. And then when I set the loopstart/looplength to continue the rest of the song (same file) it seems to restart the entire song.

I do have loopstart/looplength values in the ogg file itself and it seems to be defaulting the loop to those values... which is fine for in-battle but pre-battle I need the loopstart/looplength to be something else. Seems the script's loopstart/looplength isn't overriding the metadata in the ogg.

(1 edit)

I'll look into this when I have the opportunity, but could you copy/paste:

1. The original LoadBGM command.

2. If you're using it, the original PlayBGM command; otherwise, tell me how the track is being triggered the first time.

3. The PlayBGM command the second time, or how the updated loop settings are being triggered.

There's a possibility the system is attempting to play the system battle theme, which could interfere, but I don't have enough information to determine that. (And that wouldn't explain the problems with the pre-battle loop.)

Also, wouldn't hurt to tell me the length, in samples, of the OGG track and what its default loopstart and looplength are.

(1 edit)

Here's what I am doing - 

The file in my bgm folder is DecisiveBattle1.

This is how I have evented the cutscene.

Pre Battle Loop (below)

LoadBGM DecisiveBattle1 loopstart=129764 looplength=141213

<Boss Appears>

PlayBGM DecisiveBattle1

<Boss Lines Finish>

<Battle start>

This is the new loop and also the same loopstart/looplength values in the ogg file metadata (below)

PlayBGM DecisiveBattle1 loopstart=529959 looplength=4514464 



Currently this order of commands is just playing the BGM with the loopstart/looplength value that is in the ogg file metadata.

I suspect the loopstart/looplength parameters are not overriding the loopstart/looplength values in the metadata and that's why this is happening.