Advertisement
Guest User

Simplest Subtitles Template

a guest
Nov 9th, 2024
414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.83 KB | None | 0 0
  1. -- Rename this file and put it there:
  2. -- addons/<your pack's addon name>/lua/subtitles/<your pack name>.lua
  3.  
  4. local barney_col = Color(126, 192, 255) -- It is advised to save reused colors in a local variable instead of declaring it every time in a table to save function calls.
  5.  
  6. -- Table with captions
  7. local subtable = {
  8.     -- Regular captions:
  9.     {
  10.         snd = "SIMPLEST_SUBTITLE_TEST_1", -- Path to sound file, name of soundscipt or sentence name (from sentences.txt). Required.
  11.         subject = "Unknown creature", -- The name whoever says the line. Optional.
  12.         text = "*distant howling*",-- The caption. Required (obviously!!)
  13.         range = 512, -- Maximum distance (in Hammer Units) from the source for subtitle to work. Optional.
  14.         duration = 3, -- How long the caption is shown for. Optional, defaults to 5
  15.         closedcaption = false, -- Should the caption only be shown when full closed captions are enabled? Optional, defaults to false
  16.         subjectcol = Color(255,255,255,255), -- Color of the subject. Optional, defaults to white
  17.         textcol = Color(255,255,255,255) -- Color of the caption. Optional, defaults to white
  18.     },
  19.  
  20.     -- Chaining example:
  21.     {
  22.         snd = "BA_DESK",
  23.         text = "Hey, Mr. Freeman! I had a bunch of messages for you, but we had a system crash about 20 minutes ago and I'm still trying to find my files. Just one of those days, I guess...",
  24.         duration = 8.5,
  25.         textcol = barney_col,
  26.         chain = "BA_DESK_PT2" -- Shows the BA_DESK_PT2 caption after this caption fades away (duration, 8.5 seconds)
  27.     },
  28.     {
  29.         snd = "BA_DESK_PT2",
  30.         text = "They were having some problems down in the test chamber, too, but I think that's all straightened out. They told me to make sure you headed down there as soon as you got into your hazard suit.",
  31.         duration = 8.2,
  32.         textcol = barney_col
  33.     },
  34.  
  35.     {
  36.         snd = "SIMPLEST_SUBTITLE_TEST_2",
  37.         subject = "World",
  38.         text = "Null",
  39.         range = 512,
  40.         duration = 3,
  41.         closedcaption = false,
  42.         subjectcol = Color(255,255,255,255),
  43.         textcol = Color(255,255,255,255)
  44.     },
  45.     {
  46.         snd = "SIMPLEST_SUBTITLE_TEST_3",
  47.         text = "*EXPLOSION*",
  48.         range = 512,
  49.         duration = 4,
  50.         closedcaption = true,
  51.         textcol = Color(255,25,25,255)
  52.     },
  53.     {
  54.         snd = "SIMPLEST_SUBTITLE_TEST_4",
  55.         subject = "G-Man:",
  56.         text = "Doctorrr freeeemaaaan \nSeems like you only just arrived",
  57.         range = 512,
  58.         duration = 5,
  59.         closedcaption = false,
  60.         subjectcol = Color(25,25,255,255),
  61.         textcol = Color(255,255,255,255)
  62.     },
  63.     {
  64.         snd = "SIMPLEST_SUBTITLE_TEST_5",
  65.         subject = "M4-Sopmod II:",
  66.         text = "*japanese talk* Shkikan *japanese talk*",
  67.         range = 512,
  68.         duration = 5,
  69.         closedcaption = false,
  70.         subjectcol = Color(25,255,25,255),
  71.         textcol = Color(255,255,255,255)
  72.     },
  73. }
  74.  
  75. -- !!! DO NOT TOUCH BELOW THIS LINE !!!
  76. table.insert(Subtitles_Table, subtable) -- Do not delete this line, it appends the table above to the list of registered captions.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement