Project Zomboid

Project Zomboid

Not enough ratings
TVLib
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
1.456 MB
Nov 25, 2024 @ 2:16pm
Nov 25, 2024 @ 5:55pm
10 Change Notes ( view )

Subscribe to download
TVLib

Description
Features
Add New TV Shows:
  • Easily add multiple TV shows to specific frequencies.
Replace Existing TV Shows:
  • Replace current TV shows with new content seamlessly.

How to use with your VHS mod?
To add or replace TV shows, you need to call the provided functions in the OnInitWorld event.
There are a few things to note, This assumes each show is about an hour long in game, so check for gaps in RadioData.xml to determine the best time for your show, in Scrapworks we chose 8pm because in Life and Living TV the last show is played at 6-7pm

media/lua/server/{Mod_Name}_AddTVShows.lua
Events.OnInitWorld.Add(function() if TVLib and TVLib.addTVShows then TVLib.addTVShows({ { id = "23a63269-ad2b-49d8-9f78-9317bf082b34", startTime = "2000", -- Start time in HHMM format (e.g., 8:00 PM) day = 0, freq = 203, -- Frequency of the channel "Life and Living TV" advertCat = "5b86d977-59f6-4e4c-be27-9ca92e4ab5fa", -- Same advertCat for Life and Living TV but you can use "none" isSegment = false, lines = { { ID = "d5fe3df0-5e3b-4297-b896-1f40e9e7593a", r = 184, g = 140, b = 191, codes = "BOR-1", text = "Wham-O! Welcome to Scrapworks!" }, } }, { id = "c3a75dd6-1881-43fb-91f1-fcda7d2163ab", startTime = "2000", day = 1, freq = 203, advertCat = "none", isSegment = false, lines = { { ID = "example-id", r = 0, g = 176, b = 80, text = "Another show entry." } } } }) else print("TVLib or TVLib.addTVShows not available.") end end)

Here's an example of Replacement,
media/lua/server/{Mod_Name}_ReplaceTVShows.lua
Events.OnInitWorld.Add(function() if TVLib and TVLib.replaceTVShows then TVLib.replaceTVShows({ { id = "aece616a-4883-4e09-bd35-39aed89fe655", replaceid = "aece616a-4883-4e09-bd35-39aed89fe655", advertCat = "none", isSegment = false, lines = { { ID = "d3e99611-97b3-4ac2-bc8a-cf9641b470c8", r = 0, g = 176, b = 80, text = "THIS IS A TEST" }, { ID = "41bdcd7f-ae3c-40c6-862a-59a16be6759d", r = 0, g = 176, b = 80, text = "TESTING TESTING TESTING" }, { ID = "255e366a-1954-44ce-bed3-c43b4501c1cf", r = 0, g = 176, b = 80, text = "YOU HAVE SUCCESSFULLY BYPASSED WOODCRAFT" }, } }, { id = "another-id", replaceid = "replace-id", advertCat = "none", isSegment = false, lines = { { ID = "d3e99611-97b3-4ac2-bc8a-cf9641b470c8", r = 0, g = 176, b = 80, text = "THIS IS A TEST" }, { ID = "41bdcd7f-ae3c-40c6-862a-59a16be6759d", r = 0, g = 176, b = 80, text = "TESTING TESTING TESTING" }, } } }) else print("TVLib or TVLib.addTVShow not available.") end end)

Note:
This was created entirely because i wanted a metalworking show on Life and Living TV
This may become irrelevant with b42 but if it's still needed i will update after 42 comes out
The source is available on GitHub Here[github.com]

Workshop ID: 3372067776
Mod ID: TVLib