File Missing from Disk / Custom Gamemode Content

[Edit]

Working. I had to extract the contents of the gamemode’s content folder to the garrysmod root folder before the server allowed clients to download it.
Saving below incase any other server owner’s are struggling with it.

[Original]

Hey guys. I’m making a post about this because I have completely gone insane. For two days I’ve been trying to get this to work and I can’t. No matter how I do this I just can’t make it work.

I’m trying to create custom sounds and textures to be downloaded by the clients from the gamemode, no matter who’s hosting the server (the hope is to release the gamemode and let others host servers without having to jump through hoops to make it work). The sounds are for the in-game radio (think CS:S) and the textures are for the scoreboard/menu. Their locations are as follows:

FILE PATH



-- garrysmod
-- -- garrysmod
-- -- -- gamemodes
-- -- -- -- custommode
-- -- -- -- -- content
-- -- -- -- -- -- materials
-- -- -- -- -- -- -- vgui
-- -- -- -- -- -- -- (5 VMF's, 5 VMT's)
-- -- -- -- -- -- sound
-- -- -- -- -- -- -- pescort
-- -- -- -- -- -- -- -- radio
-- -- -- -- -- -- -- -- (10 WAV's)
-- -- -- -- -- -- -- (4 WAV'S)


gamemodes/custommode/gamemode/init.lua



        --blahblahblah includes yada yada)

        -- Each individual file is added just to get it to work. Then I'll make functions to make it less ugly.
        -- Make it work first, decorate it later.
	resource.AddFile("sound/pescort/radio/affirm.wav")
	resource.AddFile("sound/pescort/radio/assistme.wav")
	resource.AddFile("sound/pescort/radio/clear.wav")
	resource.AddFile("sound/pescort/radio/coverme.wav")
	resource.AddFile("sound/pescort/radio/enemydown.wav")
	resource.AddFile("sound/pescort/radio/enemyspotted.wav")
	resource.AddFile("sound/pescort/radio/followme.wav")
	resource.AddFile("sound/pescort/radio/getback.wav")
	resource.AddFile("sound/pescort/radio/getposition.wav")
	resource.AddFile("sound/pescort/radio/gogogo.wav")
	resource.AddFile("sound/pescort/radio/grenade.wav")
	resource.AddFile("sound/pescort/radio/holdposition.wav")
	resource.AddFile("sound/pescort/radio/inposition.wav")
	resource.AddFile("sound/pescort/radio/moveit.wav")
	resource.AddFile("sound/pescort/radio/needbackup.wav")
	resource.AddFile("sound/pescort/radio/negative.wav")
	resource.AddFile("sound/pescort/radio/regroup.wav")
	resource.AddFile("sound/pescort/radio/reportingin.wav")
	resource.AddFile("sound/pescort/radio/requestreport.wav")
	resource.AddFile("sound/pescort/radio/roger.wav")
	resource.AddFile("sound/pescort/radio/run.wav")
	resource.AddFile("sound/pescort/radio/sticktogether.wav")
	resource.AddFile("sound/pescort/radio/storm.wav")
	resource.AddFile("sound/pescort/radio/takepoint.wav")
	resource.AddFile("sound/pescort/1.wav")
	resource.AddFile("sound/pescort/2.wav")
	resource.AddFile("sound/pescort/3.wav")
	resource.AddFile("sound/pescort/4.wav")
	resource.AddFile("sound/pescort/5.wav")
	resource.AddFile("sound/pescort/10.wav")
	resource.AddFile("sound/pescort/30.wav")
	resource.AddFile("sound/pescort/60.wav")
	resource.AddFile("sound/pescort/minutes.wav")
	resource.AddFile("sound/pescort/seconds.wav")
	resource.AddFile("sound/pescort/remaining.wav")
	resource.AddFile("sound/pescort/time_remaining.wav")
	resource.AddFile("sound/pescort/victory.wav")
	resource.AddFile("materials/vgui/petut01.vmt")
	resource.AddFile("materials/vgui/petut01.vtf")
	resource.AddFile("materials/vgui/petut02.vmt")
	resource.AddFile("materials/vgui/petut02.vtf")
	resource.AddFile("materials/vgui/petut03.vmt")
	resource.AddFile("materials/vgui/petut03.vtf")
	resource.AddFile("materials/vgui/petut04.vmt")
	resource.AddFile("materials/vgui/petut04.vtf")
	resource.AddFile("materials/vgui/petut05.vmt")
	resource.AddFile("materials/vgui/petut05.vtf")
	
	util.PrecacheSound("sound/pescort/radio/affirm.wav")
	util.PrecacheSound("sound/pescort/radio/assistme.wav")
	util.PrecacheSound("sound/pescort/radio/clear.wav")
	util.PrecacheSound("sound/pescort/radio/coverme.wav")
	util.PrecacheSound("sound/pescort/radio/enemydown.wav")
	util.PrecacheSound("sound/pescort/radio/enemyspotted.wav")
	util.PrecacheSound("sound/pescort/radio/followme.wav")
	util.PrecacheSound("sound/pescort/radio/getback.wav")
	util.PrecacheSound("sound/pescort/radio/getposition.wav")
	util.PrecacheSound("sound/pescort/radio/gogogo.wav")
	util.PrecacheSound("sound/pescort/radio/grenade.wav")
	util.PrecacheSound("sound/pescort/radio/holdposition.wav")
	util.PrecacheSound("sound/pescort/radio/inposition.wav")
	util.PrecacheSound("sound/pescort/radio/moveit.wav")
	util.PrecacheSound("sound/pescort/radio/needbackup.wav")
	util.PrecacheSound("sound/pescort/radio/negative.wav")
	util.PrecacheSound("sound/pescort/radio/regroup.wav")
	util.PrecacheSound("sound/pescort/radio/reportingin.wav")
	util.PrecacheSound("sound/pescort/radio/requestreport.wav")
	util.PrecacheSound("sound/pescort/radio/roger.wav")
	util.PrecacheSound("sound/pescort/radio/run.wav")
	util.PrecacheSound("sound/pescort/radio/sticktogether.wav")
	util.PrecacheSound("sound/pescort/radio/storm.wav")
	util.PrecacheSound("sound/pescort/radio/takepoint.wav")
	util.PrecacheSound("sound/pescort/1.wav")
	util.PrecacheSound("sound/pescort/2.wav")
	util.PrecacheSound("sound/pescort/3.wav")
	util.PrecacheSound("sound/pescort/4.wav")
	util.PrecacheSound("sound/pescort/5.wav")
	util.PrecacheSound("sound/pescort/10.wav")
	util.PrecacheSound("sound/pescort/30.wav")
	util.PrecacheSound("sound/pescort/60.wav")
	util.PrecacheSound("sound/pescort/minutes.wav")
	util.PrecacheSound("sound/pescort/seconds.wav")
	util.PrecacheSound("sound/pescort/remaining.wav")
	util.PrecacheSound("sound/pescort/time_remaining.wav")
	util.PrecacheSound("sound/pescort/victory.wav")

        function GM:PreGamemodeLoaded()
        end
        -- So on so forth (above added to give you relation to how my file is set up)


Server Settings: sv_allowdownloads 1

Everytime a client connects or the server changes maps, they download all the above files all over again, but yet the sounds still don’t play and the textures are all still purple/black (missing). I’m going insane trying to get this to work.

What I’ve tried:

  • Putting resource.AddFile/util.PrecacheSound into GM:PreGamemodeLoaded() and GM:PostGamemodeLoaded() and GM:Initialize()
  • Putting above calls into a separate “resources.lua” file in the custommode/gamemode/* folder.
  • Throwing my mouse across the room hoping the impact would make it work

“play pescort/radio/<file>” also returns “File Missing from Disk”
The F1 Menu that uses the VGUI materials, has purple-black.
“Play pescort/victory” returns “File Missing from Disk”

http://wiki.garrysmod.com/page/resource/AddFile States:

I don’t know if you did the typo here or in your server settings, but the correct cvar is:
sv_allowdownload