Tomb Raider Forums  

Go Back   Tomb Raider Forums > Tomb Raider Level Editor and Modding > Tomb Raider Level Editor > Tutorials and Resources

Reply
 
Thread Tools
Old 22-07-23, 12:09   #1
Kubsy
Member
 
Kubsy's Avatar
 
Joined: Nov 2019
Posts: 900
Default TEN: Making subtitles with Voice soundtrack channel

Making subtitles with voice soundtrack channel

With TEN 1.1.0, you are now able to make subtitles much easier with the new voice soundtrack channel. this tutorial teaches you how to do that.
Kubsy is offline   Reply With Quote
Old 22-07-23, 12:10   #2
Kubsy
Member
 
Kubsy's Avatar
 
Joined: Nov 2019
Posts: 900
Default

Part 1: Downloading Subtitle edit

In order to start making subtitles, you will need subtitle edit which is a program to add subtitles to the audio.

So search for subtitle edit in your favourite search engine or go to this link: https://www.nikse.dk/subtitleedit then click on “Download latest version of Subtitle Edit”

After going through the usual installation process you can now launch Subtitle Edit and get to know it’s layout.



So this is how the program looks, on the right hand side you have the preview when you play the audio and add the subtitles.
At the bottom you have waveform which can also be extremely useful to adjust the time of subtitles appearing in relation to the audio.
The left hand side will have all the subtitles you made.
Kubsy is offline   Reply With Quote
Old 22-07-23, 12:11   #3
Kubsy
Member
 
Kubsy's Avatar
 
Joined: Nov 2019
Posts: 900
Default

Part 2: Making subtitles

Now we are going to load an audio and add a bunch of subtitles to it. Go to the navigation bar and click video -> open video file… (Don’t worry as you can also import Audio and videos to the program but we are only concerned with Audio)



After importing, you can play the audio on the right hand side with blue play button.

Now, you can start adding subtitles, but first click on “click to add waveform” this will help you adding subtitles. Next click on the textbox and the red outline should appear on the waveform with ability to add text.

Now add text and adjust the bar as you wish. It now should look like this:



Now you can do that for the whole audio. Right click on the subtitles tab and click “insert new line” and a red waveform will again appear so you can adjust the length etc etc.
A completed subtitle program could look like this:

Kubsy is offline   Reply With Quote
Old 22-07-23, 12:13   #4
Kubsy
Member
 
Kubsy's Avatar
 
Joined: Nov 2019
Posts: 900
Default

Part 3: integrating into the level

Now after we complete subtitles, it is time to insert it into our level. Save the .srt file into your Audio folder (THE .SRT FILE NAME AND .WAV MUST MATCH AND BE TOGETHER IN THE AUDIO FOLDER)



Now there are 2 ways to draw the subtitle: Lua and nodes.

The Lua way.

Go to your lua level file and insert this to OnControlPhase: (Can be anywhere, but for tutorial purposes I put in OnControlPhase)

Code:
local subtitle = GetCurrentSubtitle()
if (subtitle ~= '') then 
	local x, y = PercentToScreen(50, 80)
	local str = DisplayString(subtitle, x, y, TEN.Color(255,255,255), false)
ShowString(str, 1/30)
end
This is a relatively simple block of code, what it does it the variable subtitle will fetch the subtitle text from .srt file IF and only IF the soundtrack is playing in a Voice channel. Then it displays it if something was found. Otherwise it won’t display.

Note: keep the 1/30 in the ShowString, otherwise if you put 1 second then the string will overlay on each other every frame, and you will get 30 similar strings, resulting in an extremely oversaturated string

Now go to Tomb Editor event set and insert a new event set with a node to play soundtrack in voice channel:



Now you can play the game and see the magic:
https://streamable.com/fol53l

you can see in the video, the channel and subtitles will stop when in pause or inventory menu so that both do not go out of sync.

The nodes way

Go to your event set that you created, and switch to “when inside” event. And insert the following node:



This will draw the subtitle string like the Lua way.
NOTE: You still need to play the audio in voice channel!

However, this comes with certain limitations, because the volume boxes need to be adjusted so that the text can appear, especially if you have cutscenes in your level, considering that volume boxes cannot span across the room (as of TE 1.7 they now can by checking the checkbox at the bottom left of the volume window ). You are probably good to go with the Lua way so it works in all 100% cases.

Last edited by Kubsy; 24-02-24 at 10:58.
Kubsy is offline   Reply With Quote
Old 25-08-23, 09:56   #5
Kubsy
Member
 
Kubsy's Avatar
 
Joined: Nov 2019
Posts: 900
Default

Frequently Asked Questions (Optional section - updated regularly)


Q: My subtitles are not displaying the final line for some reason. What should I do?

A: Open the SRT file with a text editor, scroll to the very bottom of the file and add an additional line by pressing enter, that should fix the final line not showing in game.
Kubsy is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 10:26.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Tomb Raider Forums is not owned or operated by CDE Entertainment Ltd.
Lara Croft and Tomb Raider are trademarks of CDE Entertainment Ltd.