Trying to add download for sounds

Post Reply
tinymidget1979
New to forums
New to forums
Posts: 9
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Sun Oct 06, 2013 10:54 am

Trying to add download for sounds

Post by tinymidget1979 »

So, I'm using a jihad addon from the workshop. It's in the game, and it's buyable by Traitors. They can use it and it works fine. But...the sounds do not play.

In the console it says:
Failed to load sound "sound\siege\jihad.wav", file probably missing from disk/repository
Failed to load sound "sound\siege\big_explosion.wav", file probably missing from disk/repository

Now, I have these added to my garrysmod/sound/siege/[those files] for my server. I also added them to my website for FastDL, those were put: public/server/sound/siege/[those files]

I figured the addon would make it so I wouldn't have to force players to download these sounds. Anyway, I tried to force the downloads by doing:

Code: Select all

if (server) then
	resource.AddWorkshop( "184346376" ) <-- this is my collection
	resource.AddSingleFile( "/public/server/sound/siege/jihad.wav" )
	resource.AddSingleFile( "/public/server/sound/siege/big_explosion.wav")
end
This is in my garrysmod/lua/autorun/server/resource.lua

So, I guess my question is..how can I get this to work?

Note: I can do 'ulx playsound /siege/jihad.wav' and it will play the sound on the server for everyone.
Also note: I am using the .gma file. It hasn't been extracted and placed ( I don't know if that makes a difference ).

Thank you!
User avatar
kraze
Former staff
Former staff
Posts: 4362
Joined: Fri Sep 17, 2010 9:06 am
Location: California

Re: Trying to add download for sounds

Post by kraze »

For your resource.lua file keep in mind that "garrysmod" is assumed, so your path should be /sound/mysound or /materials/mymaterial..etc
@Kraze^NFo> Juski has a very valid point
@Juski> Got my new signature, thanks!
@Kraze^NFo> Out of context!
@Juski> Doesn't matter!
@Juski> You said I had a valid point! You can't take it back now! It's out there!
tinymidget1979
New to forums
New to forums
Posts: 9
Joined: Sun Oct 06, 2013 10:54 am

Re: Trying to add download for sounds

Post by tinymidget1979 »

I don't really understand. Where in my resource.lua am I referencing the garrysmod folder?
User avatar
kraze
Former staff
Former staff
Posts: 4362
Joined: Fri Sep 17, 2010 9:06 am
Location: California

Re: Trying to add download for sounds

Post by kraze »

tinymidget1979 wrote:I don't really understand. Where in my resource.lua am I referencing the garrysmod folder?
You don't need to reference it because it is assumed automatically, you only need to reference the path after that.
@Kraze^NFo> Juski has a very valid point
@Juski> Got my new signature, thanks!
@Kraze^NFo> Out of context!
@Juski> Doesn't matter!
@Juski> You said I had a valid point! You can't take it back now! It's out there!
tinymidget1979
New to forums
New to forums
Posts: 9
Joined: Sun Oct 06, 2013 10:54 am

Re: Trying to add download for sounds

Post by tinymidget1979 »

Right, but I'm not referencing it.

I guess maybe I'm confused as to what 'resource.AddSingleFile()' does. Am I putting the PATH from my Website to jihad.wav, or am I putting the path in my server directory?

I guess I just don't understand how to fix this so it will download for the users when they join my game. None of the items in my resource.lua are referencing my garrysmod folder at all. They're referencing the folders that contain sound/siege/jihad.wav.
User avatar
kraze
Former staff
Former staff
Posts: 4362
Joined: Fri Sep 17, 2010 9:06 am
Location: California

Re: Trying to add download for sounds

Post by kraze »

Your resource.lua file needs to reference the locations of the files on your server. We talk a bit about how force downloading works here as well.
http://www.nfoservers.com/forums/viewto ... =65&t=7337

The path you're specifying is not correct, since it needs to be the server and with the server garrysmod is assumed.
@Kraze^NFo> Juski has a very valid point
@Juski> Got my new signature, thanks!
@Kraze^NFo> Out of context!
@Juski> Doesn't matter!
@Juski> You said I had a valid point! You can't take it back now! It's out there!
tinymidget1979
New to forums
New to forums
Posts: 9
Joined: Sun Oct 06, 2013 10:54 am

Re: Trying to add download for sounds

Post by tinymidget1979 »

Okay, got that changed now. How should my website be looking? Where should I be putting the sounds for FastDL?

Thank you for all your help!
User avatar
kraze
Former staff
Former staff
Posts: 4362
Joined: Fri Sep 17, 2010 9:06 am
Location: California

Re: Trying to add download for sounds

Post by kraze »

You should just need to run a websync operation via the "websync" tab in your control panel. Our system will do the rest.
@Kraze^NFo> Juski has a very valid point
@Juski> Got my new signature, thanks!
@Kraze^NFo> Out of context!
@Juski> Doesn't matter!
@Juski> You said I had a valid point! You can't take it back now! It's out there!
tinymidget1979
New to forums
New to forums
Posts: 9
Joined: Sun Oct 06, 2013 10:54 am

Re: Trying to add download for sounds

Post by tinymidget1979 »

Sorry for such a delayed reply.

I have done all of this and still there is still no sound playing. The Jihad item will work, but it will not play sound when exploding. I have ran a websync, after adding to the lua/autorun/server/resource.lua file. Is there anything I am missing here?
User avatar
kraze
Former staff
Former staff
Posts: 4362
Joined: Fri Sep 17, 2010 9:06 am
Location: California

Re: Trying to add download for sounds

Post by kraze »

Post your resource.lua file so we can take a look at it.
@Kraze^NFo> Juski has a very valid point
@Juski> Got my new signature, thanks!
@Kraze^NFo> Out of context!
@Juski> Doesn't matter!
@Juski> You said I had a valid point! You can't take it back now! It's out there!
ahoffman
New to forums
New to forums
Posts: 9
Joined: Mon Nov 11, 2013 3:53 pm

Re: Trying to add download for sounds

Post by ahoffman »

You don't need an if (server) then, since you're already putting it in the autorun server anyway. It'd be if SERVER then, if you're planning on using it outside of the server autorun folder. I use resource.AddFile in mine. Since I use ttt, the resource.lua is already in the gamemode folder and doesn't require it outside. If I wanted clients to download the Jihad sound, I'd do

Code: Select all

resource.AddFile("sound/siege/jihad.wav")
I manually add my materials/models/sounds to the fastdl, so I don't have to worry about it not working or anything, just in case.
Your_Stalker
New to forums
New to forums
Posts: 11
Joined: Sun Nov 10, 2013 1:03 pm

Re: Trying to add download for sounds

Post by Your_Stalker »

Example of mine:

resource.AddFile( "/sound/ttt/song1.mp3" );
resource.AddFile( "/sound/ttt/song2.mp3" );
resource.AddFile( "/sound/ttt/song3.mp3" )
Post Reply