• Is there a way to make it so people dont have to download every workshop map?
    13 replies, posted
I would like to make it so they only have to download the current map from workshop, because it takes forever for them to download every single map, and it is taking away potential joiners.
Only add the one the server is playing.
So basically deal with it or get a fastdownload server?
[QUOTE=CrimsonChin;45380104]So basically deal with it or get a fastdownload server. Got it.[/QUOTE] No, write a script that only adds the map the server is currently on using resource.AddWorkshop. I am pretty sure you can just find one by googling, there were a lot of such scripts posted around here in the past, unfortunately I don't have a link.
[QUOTE=Robotboy655;45380166]No, write a script that only adds the map the server is currently on using resource.AddWorkshop. I am pretty sure you can just find one by googling, there were a lot of such scripts posted around here in the past, unfortunately I don't have a link.[/QUOTE] Literally, [code]if ( game.GetMap() == "ttt_whatever" ) then resource.AddWorkshop( "bleh" ) elseif ( game.GetMap() == "de_whatever" ) then resource.AddWorkshop( "bleh2" ) -- Etc. end[/code] This MIGHT have issues of the AddWorkshop being set too late, so it might be better to do it after a map vote ends.
Oh I see, cool :) Sorry, I know jack shit about lua. How do I use that code to do this? Where does it go?
lua/autorun/server
If I am using a collection, then will it do that automatically if I remove the file in lua/autorun/server which has this stuff in it? [code]resource.AddWorkshop("236239138") resource.AddWorkshop("105462463") resource.AddWorkshop("187693631") resource.AddWorkshop("183439047")[/code]
No. 1. resource.AddWorkshop doesn't support collections. 2. +host_workshop_collection is for receiving addons, not sending them.
Is this correct? [code]if ( game.GetMap() == "zs_ambush" ) then resource.AddWorkshop( "183439047" ) elseif ( game.GetMap() == "Gm_Middle_of_Nowhere_day" ) then resource.AddWorkshop( "110979635" ) elseif ( game.GetMap() == "Gm_Middle_of_Nowhere_night" ) then resource.AddWorkshop( "110979635" ) elseif ( game.GetMap() == "Zs_You_Are_a_Virus_Inside_Joe" ) then resource.AddWorkshop( "110982993" ) elseif ( game.GetMap() == "ze_lotr_helms_deep_v9" ) then resource.AddWorkshop( "184950395" ) elseif ( game.GetMap() == "ze_grand_boat_escape_day_v5" ) then resource.AddWorkshop( "184965826" ) elseif ( game.GetMap() == "zs_obj_827_to_phoenix" ) then resource.AddWorkshop( "185135410" ) elseif ( game.GetMap() == "zs_cargo_freight" ) then resource.AddWorkshop( "185775560" ) elseif ( game.GetMap() == "zs_obj_upward_v20" ) then resource.AddWorkshop( "187804097" ) elseif ( game.GetMap() == "zs_nastyhouse2_v2" ) then resource.AddWorkshop( "203975990" ) elseif ( game.GetMap() == "zs_forgotten_city_enclosed" ) then resource.AddWorkshop( "203970248" ) elseif ( game.GetMap() == "zs_subway_v8" ) then resource.AddWorkshop( "224702863" ) elseif ( game.GetMap() == "zs_cheap_hotel_v2" ) then resource.AddWorkshop( "275628740" ) elseif ( game.GetMap() == "zs_trinity_passage" ) then resource.AddWorkshop( "277094970" ) elseif ( game.GetMap() == "zs_fearhouse_v4" ) then resource.AddWorkshop( "276989178" ) elseif ( game.GetMap() == "zs_desert_hideout_v6" ) then resource.AddWorkshop( "276972617" ) elseif ( game.GetMap() == "zs_cyanide_vixed" ) then resource.AddWorkshop( "277218719" ) elseif ( game.GetMap() == "zs_submerged" ) then resource.AddWorkshop( "277266310" ) elseif ( game.GetMap() == "dm_Park_Terminal_b1" ) then resource.AddWorkshop( "285164906" ) elseif ( game.GetMap() == "gm_croftmanor" ) then resource.AddWorkshop( "185606196" ) elseif ( game.GetMap() == "Zs_abandon_mall" ) then resource.AddWorkshop( "184522164" ) elseif ( game.GetMap() == "ZS_CLAV_MASSIVE" ) then resource.AddWorkshop( "172051398" ) elseif ( game.GetMap() == "ze_jurassic_park_story" ) then resource.AddWorkshop( "207578807" ) elseif ( game.GetMap() == "zs_gameshow_r1" ) then resource.AddWorkshop( "184916359" ) elseif ( game.GetMap() == "ze_hypernova_v4" ) then resource.AddWorkshop( "184904962" ) elseif ( game.GetMap() == "gm_Freecity_plaza" ) then resource.AddWorkshop( "112514251" ) end [/code]
You could have done this the other way: [code]local maps = { gm_Freecity_plaza = 112514251, ze_hypernova_v4 = 184904962, } resource.AddWorkshop( maps[ game.GetMap() ] )[/code]
[CODE]if (SERVER) then --This is a list of your server's maps which are available through the workshop --Each one uses the map file's name and the workshop ID -- Workshop IDs für jede Map maplist = {} maplist["TTT_67thway_v7"] = "140410125" maplist["ttt_aircraft_v1b"] = "154177743" maplist["ttt_amsterville"] = "104518391" maplist["ttt_bb_canalwarehousev2_r3"] = "117743323" maplist["ttt_bb_schooldayv3_r3"] = "114042471" --add more maps here local map = game.GetMap() -- Get's the current map name local workshopid = maplist[map] -- Finds the workshop ID for the current map name from the table above if( workshopid != nil )then --If the map is in the table above, add it through workshop print( "[WORKSHOP] Setting up maps. " ..map.. " workshop ID: " ..workshopid ) resource.AddWorkshop( workshopid ) else --If not, ) then hope the server has FastDL or the client has the map print( "[WORKSHOP] Not available for current map: "..map..". Using FastDL instead hopefully..." ) if( map == "ttt_waterworld") then resource.AddSingleFile( "materials/maps/ttt_waterworld.vmt" ) resource.AddSingleFile( "materials/maps/ttt_waterworld.vtf" ) resource.AddSingleFile( "materials/dglz/dglz_plastic_blue.vmt" ) resource.AddSingleFile( "materials/dglz/dglz_plastic_blue.vtf" ) resource.AddSingleFile( "materials/dglz/dglz_plastic_yellow.vmt" ) resource.AddSingleFile( "materials/dglz/dglz_plastic_yellow.vtf" ) resource.AddSingleFile( "materials/dglz/dglz_tiles_blue_01.vmt" ) resource.AddSingleFile( "materials/dglz/dglz_tiles_blue_01.vtf" ) resource.AddSingleFile( "materials/dglz/dglz_tiles_blue_03.vmt" ) resource.AddSingleFile( "materials/dglz/dglz_tiles_blue_03.vtf" ) resource.AddSingleFile( "materials/dglz/dglz_tiles_white_01.vmt" ) resource.AddSingleFile( "materials/dglz/dglz_tiles_white_01.vtf" ) resource.AddSingleFile( "materials/dglz/dglz_waterwolrdcredits.vmt" ) resource.AddSingleFile( "materials/dglz/dglz_waterwolrdcredits.vtf" ) end end end[/CODE] That will work for u i think (: [editline]18th July 2014[/editline] i google for i think 4 min and found it there ;)
Use resource.AddFile() instead of resource.AddSingleFile(). That way you can just include the material file and it will automatically add the vtf. Also half of this isn't related to the question.
Crazyscouter, i know that. But its so long i add that "if-statement" that i cant remember why i do that an this way :D
Sorry, you need to Log In to post a reply to this thread.