Garry's Mod
Vehicle Radio
 Este tema se ha marcado como fijo, por lo que probablemente sea importante
Fraddy15  [desarrollador] 25 JUN 2018 a las 3:59 p. m.
How to make your own stations
How to make your own stations:

Create lua file in lua\vradio\stations\

Template:
local STATIONS = { [0] = { -- station index ['meta'] = { --station info ['name'] = "Your FM", --display name ['icon'] = "gui/vehicles_radio_icons/youricon.png" -- icon }, ['tracks'] = { --playlist [0] = "vehicles_radio/yourtrack_1.mp3", --track path or URL [1] = "vehicles_radio/yourtrack_2.mp3" } } } VRADIO:IncludeStation(STATIONS) --include station function

Sounds files should be in sound directory, example: your addon or your garry`s mod path\sound
Icon files should be in materials directory, example: your addon or your garry`s mod path\materials

*Recommended MP3 audio format, WAV can cause problems
*Spotify or YouTube URL, currently not supported, you need URL to file, example: "https://www.site.com/file.mp3"


Debug Mode:

Set vehicles_radio_debug to 1, - when the station is turned on, file path or URL will be displayed on screen and also be displayed in console


Syntax:

Creation main array block
local STATIONS = { --brackets open } --brackets close

Creation new block inside, [0] - is number index block, always start from zero.
local STATIONS = { [0] = { --brackets open } --brackets close }

if you want to create multiple blocks inside.
local STATIONS = { [0] = { }, --comma [1] = { } --last block does not have a comma }

Now on an example with a template structure which contains multiple stations, for example three.
local STATIONS = { [0] = { ['meta'] = { --is name block. Please, do not change block names, only index blocks ['name'] = "Your FM", --comma ['icon'] = "gui/vehicles_radio_icons/youricon.png" --does not have a comma }, --comma ['tracks'] = { [0] = "vehicles_radio/yourtrack_1.mp3", --comma [1] = "vehicles_radio/yourtrack_2.mp3", --comma [2] = "vehicles_radio/yourtrack_3.mp3" --does not have a comma } --does not have a comma }, --comma [1] = { ['meta'] = { ['name'] = "Your FM2", ['icon'] = "gui/vehicles_radio_icons/youricon.png" }, ['tracks'] = { [0] = "vehicles_radio/yourtrack_1.mp3", [1] = "vehicles_radio/yourtrack_2.mp3" } }, --comma [2] = { ['meta'] = { ['name'] = "Your FM3", ['icon'] = "gui/vehicles_radio_icons/youricon.png" }, ['tracks'] = { [0] = "vehicles_radio/yourtrack_1.mp3", [1] = "vehicles_radio/yourtrack_2.mp3" } } --does not have a comma }

Do not forget to add function to add a station in end!
local STATIONS = { [0] = { ['meta'] = { ['name'] = "Your FM", ['icon'] = "gui/vehicles_radio_icons/youricon.png" }, ['tracks'] = { [0] = "vehicles_radio/yourtrack_1.mp3", [1] = "vehicles_radio/yourtrack_2.mp3", [2] = "vehicles_radio/yourtrack_3.mp3" } }, [1] = { ['meta'] = { ['name'] = "Your FM2", ['icon'] = "gui/vehicles_radio_icons/youricon.png" }, ['tracks'] = { [0] = "vehicles_radio/yourtrack_1.mp3", [1] = "vehicles_radio/yourtrack_2.mp3" } }, [2] = { ['meta'] = { ['name'] = "Your FM3", ['icon'] = "gui/vehicles_radio_icons/youricon.png" }, ['tracks'] = { [0] = "vehicles_radio/yourtrack_1.mp3", [1] = "vehicles_radio/yourtrack_2.mp3" } } } VRADIO:IncludeStation(STATIONS) --include station function
Última edición por Fraddy15; 2 JUL 2018 a las 1:53 a. m.
< >
Mostrando 1-15 de 460 comentarios
Fraddy15  [desarrollador] 26 JUN 2018 a las 2:55 a. m. 
Added support URL, now you can use the URL instead of path to file
Última edición por Fraddy15; 26 JUN 2018 a las 2:55 a. m.
kmaclives 26 JUN 2018 a las 8:29 a. m. 
what do we name the file? also, is the file supposed to be created within the stations folder?
Última edición por kmaclives; 26 JUN 2018 a las 8:32 a. m.
PackWizzard 26 JUN 2018 a las 11:13 a. m. 
iojiuuuhuhuhuhuhuihuhuhuhhhhhhhhhhhhhh

Bently 26 JUN 2018 a las 11:52 a. m. 
Oohhh..... i see it now... thanks.
JohnMack05 26 JUN 2018 a las 12:33 p. m. 
I can't find the vradio folder. I'm looking in C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod\lua.
Bently 26 JUN 2018 a las 12:38 p. m. 
Also, 1 more suggestion, probably you should add the option for the custom radio station to include or not include the slightly random pitch for each song. If i want to make one, i kinda dont want the random pitch.
Fraddy15  [desarrollador] 26 JUN 2018 a las 2:18 p. m. 
@JohnMack05 You should create one. Addon will automatically find files inside this folder and include them.
Fraddy15  [desarrollador] 26 JUN 2018 a las 2:26 p. m. 
@Kmaclives Lua file must be located at garrysmod/garrysmod/lua/vradio/stations folder. It could have any name you want without spaces and must be in lua file format(.lua). For example : garrysmod/garrysmod/lua/vradio/stations/yourstation.lua. Your sounds could be located anywhere in garrysmod/garrysmod/sound folder. Example: your song path is garrysmod/garrysmod/sound/mycoolstation/song1.mp3 but in lua file it would be “mycoolstation/song1.mp3”
Valkyries733 26 JUN 2018 a las 6:11 p. m. 
Curious: If we made custom radio stations. Could we upload them to the workshop? Only the lua file and what not? So like maybe someone could download a radio station that includes a bunch of halo music or something? I think it'd be cool. (Of course not reuploading your addon, just the radio station files)
Fraddy15  [desarrollador] 26 JUN 2018 a las 6:22 p. m. 
@Valkyries733,Yes of course
Valkyries733 26 JUN 2018 a las 6:50 p. m. 
Sounds awesome man.
Manis 26 JUN 2018 a las 10:15 p. m. 
i copy pasted the template, changed picture, and i made the url a spotify link. But it won't work, could you help me with this? I will add my version of the template if you need to see what's wrong with it. I did save it with .lua too,
Fraddy15  [desarrollador] 26 JUN 2018 a las 10:31 p. m. 
Publicado originalmente por sTEV:
i copy pasted the template, changed picture, and i made the url a spotify link. But it won't work, could you help me with this? I will add my version of the template if you need to see what's wrong with it. I did save it with .lua too,
Yes, send your version
Manis 27 JUN 2018 a las 12:04 a. m. 
ok
Manis 27 JUN 2018 a las 12:05 a. m. 
it looks messed up but it the same as the template

< >
Mostrando 1-15 de 460 comentarios
Por página: 1530 50