yes but you will need to put the text in the script at the right time and translate it yourself etc.
this will work for multiple scripts but the text will be the same so only really useful if you have plans for a repeated interaction in different parts of the map (a save point or civilians that have the same response etc)
you'll have to rename it to change the text (or add a double array but i felt this would be too confusing for general use) if you want different outputs
subtitles.lua
local line_length = {}
local line_text = {}
local played = {}
local current_line = {}
--number of lines to display in total
local max_lines = 3
function subtitles_init(e)
--change prompt here to the subtitles you wish to show
line_text[1] = "Hello there cruel world"
--change time here to length you want to display each line for (in seconds)
line_length[1] = 2
--repeat for all lines (increasing the line number each time) like so
line_text[2] = "I am a test for subtitles"
line_length[2] = 1.5
line_text[3] = "How am i doing so far?"
line_length[3] = 1.1
--etc
end
function subtitles_main(e)
--start our timer at 0
if current_line[e] == nil then
current_line[e] = 1
StartTimer(e)
played[e] = 0
else
--check player in a zone to trigger the script
--replace it with GetPlayerDistance(e) if you want etc
if GetPlayerInZone(e) == 1 then
--used to only play the sound once
if played[e] == 0 then
--sound needs to be slot 0
PlaySoundIfSilent(e,0)
if line_length[current_line[e]] ~= nil then
--check timer is less than line duration so we can show the text correctly
if GetTimer(e) < line_length[current_line[e]] * 1000 then
if line_text[current_line[e]] ~= nil then
Prompt(line_text[current_line[e]])
end --nil check
else
StartTimer(e)
--check if we have reached the end or increase to next line
if current_line[e] < max_lines then
current_line[e] = current_line[e] + 1
else
played[e] = 1
end --end of subtitles
end --timer for next line
end --nil check
end --play once check
else
current_line[e] = nil
end --in zone
end --set up
end --main
function subtitles_exit(e)
end
life\'s one big game
windows vista ultimate
i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11