Garry's Mod

Garry's Mod

BattleBeats | Dynamic Music System
 此主題已被置頂,因此它可能很重要
ricky dicky doo dah grimes  [開發人員] 11 月 2 日 上午 9:03
Adding Subtitles


First things first, BattleBeats only supports subtitles in the .srt format (it’s the same format used by YouTube and many other platforms). You can download subtitles from a YouTube video using various online sites

Since this requires only minor Lua knowledge (really just copy and paste), I recommend downloading the pack template from the link below to skip part of the process, though I still suggest reading the rest:

Pack Template[github.com]



If you want to do it manually, here’s where it gets a little trickier:
  1. In your main addon folder, create a new directory next to the sound folder named lua
  2. Inside it, create autorun, then client, and inside that folder make a new file named cl_subtitles.lua (you can name it whatever you want as long as it’s a .lua file)

Now open that file (Notepad++ works, but I recommend something like Visual Studio Code) and paste this:

BATTLEBEATS = BATTLEBEATS or {} BATTLEBEATS.subtitles = BATTLEBEATS.subtitles or {} BATTLEBEATS.subtitles["song title"] = { raw = [[ ]] }

If you pasted it, change "song title" to the actual song title from your pack (lowercase only!)



Now, between the [[ and ]], paste your SRT file contents (you can open the .srt file with Notepad)
It should look like this:

BATTLEBEATS.subtitles["my song"] = { raw = [[ 1 00:00:54,731 --> 00:00:59,122 Immortal temptation 2 00:00:59,122 --> 00:01:03,088 Takes over my mind 3 00:01:03,088 --> 00:01:07,958 Condemned 4 00:01:07,958 --> 00:01:12,066 Falling weak on my knees ]] }

For each song, you just make a new table, for example:

BATTLEBEATS.subtitles["my song 2"] = { raw = [[ srt content here ]] }

If everything is correct, you should see a comment bubble icon next to the track in the BattleBeats UI, this means the track has subtitles
最後修改者:ricky dicky doo dah grimes; 11 月 9 日 下午 2:12
< >
目前顯示第 1-2 則留言,共 2
will there be support for 16th note lyrics?
ricky dicky doo dah grimes  [開發人員] 12 月 7 日 下午 3:32 
引用自 Pan Mann
will there be support for 16th note lyrics?
it will be added in the next update
< >
目前顯示第 1-2 則留言,共 2
每頁顯示: 1530 50