Hello.
I have a server and i have install addons and stuff via the collections at workshop and then i did a lua file, and when a player join so will it auto download the files but the models and stuff are still errors.
The code is like this in my FastDL.lua file
[CODE]resource.AddWorkShop( "157660704" )[/CODE]
Thanks!:)
1. WorkshopDL and FastDL are two different things.
2. resource.AddWorkshop doesn't support collections; you'll have to make a line for each addon.
3. Have you setup your +host_workshop_collection command line?
[QUOTE=code_gs;42223753]1. WorkshopDL and FastDL are two different things.
2. resource.AddWorkshop doesn't support collections; you'll have to make a line for each addon.
3. Have you setup your +host_workshop_collection command line?[/QUOTE]
Hello thanks for your answer.
So the file should be called WorkshopDL.lua ?
And i know but i using the collection so the addons will be added to the server and i will use the WorkshopDL so the players can download the addons from workshop.
And yes i have setup the +host_workshop_collection and -authkey.
:)
[editline]17th September 2013[/editline]
This still not working, if anyone please can help so please post here.
If you want to add a [B]collection of addons[/B] to your server, follow [URL="http://wiki.garrysmod.com/page/Workshop_for_Dedicated_Servers"]this guide[/URL]. Ultimately, you need to add each addon inside the collection that contains any materials, models or sounds through resource.AddWorkshop for them to work for the players.
Now, you can name the lua file whatever you want but you want to put it in lua/autorun/server.
E.g. /lua/autorun/server/forcedownloads.lua
Let's say you've installed these addons via workshop on the server:
[URL="http://steamcommunity.com/sharedfiles/filedetails/?id=177910237&searchtext="]Prophunt Music[/URL]
[URL="http://steamcommunity.com/sharedfiles/filedetails/?id=177607093&searchtext="]Nissan Skyline[/URL]
You want to put this into your [B]forcedownloads.lua[/B] file:
[CODE]
resource.AddWorkshop("177910237") --Prophunt Music
resource.AddWorkshop("177607093") --Nissan Skyline
[/CODE]
This will force the players that join your server to download the workshop addons so they work for them.
To get the workshop ID, go to the addon in either Steam or your browser, right click and press "Copy page URL" and you will end up with a URL containing the ID of the addon.
Also, if you can't understand what I'm talking about, just send me the link to your [B]workshop collection[/B] and I'll create a code for you to put inside forcedownloads.lua.
Hello i'm happy for your answer.
I did the collection thing, and i have fix the lua code but im not sure if i did it right but here is my collection: [url]http://steamcommunity.com/sharedfiles/filedetails/?id=178787141[/url]
Thanks!:)
Here's how your forcedownloads.lua should look like:
[CODE]
resource.AddWorkshop("157660704") -- Agent 47
resource.AddWorkshop("144982052") -- M9K Specialties
resource.AddWorkshop("128093075") -- M9K Small Arms Pack
resource.AddWorkshop("128091208") -- M9K Heavy Weapons
resource.AddWorkshop("128089118") -- M9K Assault Rifles
resource.AddWorkshop("115164078") -- Black Ops 2 Seal
resource.AddWorkshop("121961644") -- NYPD 1940's Model-Group
resource.AddWorkshop("129774825") -- Rorschach
resource.AddWorkshop("105341946") -- Veteran Rebel Players
resource.AddWorkshop("172303156") -- Spider Man Player Models
resource.AddWorkshop("119222908") -- Agent Smith Playermodel & NPC
[/CODE]
Put the forcedownloads.lua inside [B]/lua/autorun/server[/B]!
Note that "--" is a comment, it doesn't affect the code, but it's good to add that to your code if you want to remove an addon someday.
Do you have skype or steam? because this didn't work, the players still see stuff in errors.
Just ask for help in the thread; no point to add people on Skype or Steam.
[quote]So the file should be called WorkshopDL.lua ?[/quote]
Names of lua files don't matter. Are you sure you put it in the correct server directory? Because that code is correct.
[QUOTE=code_gs;42226182]Just ask for help in the thread; no point to add people on Skype or Steam.
Names of lua files don't matter. Are you sure you put it in the correct server directory? Because that code is correct.[/QUOTE]
Yes i'm sure, lua/autorun/server
[QUOTE=sheders99;42226336]There is a point to add at steam so can i do it live and don't need to wait hours to get answers.[/QUOTE]
Right now I can't support you over Steam or Skype as I'm busy with other stuffs.
[QUOTE=Svenskunganka;42226473]Right now I can't support you over Steam or Skype as I'm busy with other stuffs.[/QUOTE]
Alright, can you help me here at facepuch?
Yes. That code is correct so you probably did something wrong.
[QUOTE=Svenskunganka;42226772]Yes. That code is correct so you probably did something wrong.[/QUOTE]
Like what ? :S
Do your players happen to see anything in console about an HTML error or timing out?
[code]
if (SERVER) then
resource.AddWorkshop( "157660704" ) -- Agent 47
resource.AddWorkshop( "144982052" ) -- M9K Specialties
resource.AddWorkshop( "128093075" ) -- M9K Small Arms Pack
resource.AddWorkshop( "128091208" ) -- M9K Heavy Weapons
resource.AddWorkshop( "128089118" ) -- M9K Assault Rifles
resource.AddWorkshop( "115164078" ) -- Black Ops 2 Seal
resource.AddWorkshop( "121961644" ) -- NYPD 1940's Model-Group
resource.AddWorkshop( "129774825" ) -- Rorschach
resource.AddWorkshop( "105341946" ) -- Veteran Rebel Players
resource.AddWorkshop( "172303156" ) -- Spider Man Player Models
resource.AddWorkshop( "119222908" ) -- Agent Smith Playermodel & NPC
end[/code]
Try the code with the added lines
[QUOTE=DerfStew;42232416][code]
if (SERVER) then
resource.AddWorkshop( "157660704" ) -- Agent 47
resource.AddWorkshop( "144982052" ) -- M9K Specialties
resource.AddWorkshop( "128093075" ) -- M9K Small Arms Pack
resource.AddWorkshop( "128091208" ) -- M9K Heavy Weapons
resource.AddWorkshop( "128089118" ) -- M9K Assault Rifles
resource.AddWorkshop( "115164078" ) -- Black Ops 2 Seal
resource.AddWorkshop( "121961644" ) -- NYPD 1940's Model-Group
resource.AddWorkshop( "129774825" ) -- Rorschach
resource.AddWorkshop( "105341946" ) -- Veteran Rebel Players
resource.AddWorkshop( "172303156" ) -- Spider Man Player Models
resource.AddWorkshop( "119222908" ) -- Agent Smith Playermodel & NPC
end[/code]
Try the code with the added lines[/QUOTE]
Put that code in lua/autorun, not lua/autorun/server
[QUOTE=code_gs;42233179]Put that code in lua/autorun, not lua/autorun/server[/QUOTE]
Hello i fixed it i got help from ankkungen, and you are wrong there, the file gonna be in lua/autorun/server it work fine for me.
It's useless if you put it in lua/autorun/server when adding if (SERVER) then
You must have done something wrong with the other code. Guess it doesn't matter now that it's fixed.
[QUOTE=code_gs;42235769]It's useless if you put it in lua/autorun/server when adding if (SERVER) then
You must have done something wrong with the other code. Guess it doesn't matter now that it's fixed.[/QUOTE]
yeh:) i know i didn't use the code he sended, i just added the wrong path to the shared.lua from the .gma file:P
So how can you force downloads to occur from the workshop before fastdl server?
In other words my files download always from the fastdl server before workshop for some reason.
Any ideas?
Remove "sv_downloadurl" from your server.cfg
Btw, don't bump threads that's half a year old.
[QUOTE=Svenskunganka;44307267]Remove "sv_downloadurl" from your server.cfg
Btw, don't bump threads that's half a year old.[/QUOTE]
Ya but then they would only get workshop files. I want them to be able to get both in other words but have workshop addons download first.
Then you just leave it as it is. There's no way to modify which one goes first. Either way I think Workshop files are downloaded before FastDL begins.
actaully I tried it. The addon files from the fast download server were downloaded first which defeats the purpose. So I guess there is no way to force them first unforunately.
Sorry, you need to Log In to post a reply to this thread.