• Print

Author Topic: Setting maps to fastdl when that map is chosen  (Read 13442 times)

0 Members and 1 Guest are viewing this topic.

Offline syn.

  • Jr. Member
  • **
  • Posts: 56
  • Karma: 6
  • Lua Padawan
    • SynGaming
Setting maps to fastdl when that map is chosen
« on: January 30, 2014, 05:02:30 pm »
okay title might be weird but is there any way to set the maps to download only when it is selected and we are loading for that particular map? if there is please help me do it:o thanks
WOOOO JR MEMBER:D
Lua Student

"The more you understand, the crazier you get."

Offline Eccid

  • Full Member
  • ***
  • Posts: 115
  • Karma: 11
  • Hey, come on... We just met...
    • Terror Abound! Steam Group
Re: Setting maps to fastdl when that map is chosen
« Reply #1 on: January 30, 2014, 05:09:58 pm »
if your fastdl is set up right, gmod should automatically do that.

Offline syn.

  • Jr. Member
  • **
  • Posts: 56
  • Karma: 6
  • Lua Padawan
    • SynGaming
Re: Setting maps to fastdl when that map is chosen
« Reply #2 on: January 30, 2014, 05:24:03 pm »
what my FastDL does is that whenever a new player joins my server, it forces them to download ALL of the maps. This makes the loading time of my server skyrocket. I think it would be better for them to download each map whenever the have to PLAY that map.
Lua Student

"The more you understand, the crazier you get."

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Setting maps to fastdl when that map is chosen
« Reply #3 on: January 30, 2014, 05:26:01 pm »
FastDL hasn't ever done that to me...
You're on XenonServers, I think, right?
bw81@ulysses-forums ~ % whoami
Homepage

Offline syn.

  • Jr. Member
  • **
  • Posts: 56
  • Karma: 6
  • Lua Padawan
    • SynGaming
Re: Setting maps to fastdl when that map is chosen
« Reply #4 on: January 30, 2014, 05:28:11 pm »
yep maybe I have a different method of FastDl o.O I just added a workshop.lua on lua/autorun/server/ and manually added each file (resource.AddWorkshop("335286353") )
Lua Student

"The more you understand, the crazier you get."

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Setting maps to fastdl when that map is chosen
« Reply #5 on: January 30, 2014, 05:32:40 pm »
Yeah, you don't need to do that.

Just leave it alone. Maps automatically download.
Out of the Garry's Mod business.

Offline syn.

  • Jr. Member
  • **
  • Posts: 56
  • Karma: 6
  • Lua Padawan
    • SynGaming
Re: Setting maps to fastdl when that map is chosen
« Reply #6 on: January 30, 2014, 05:34:48 pm »
ohh so I dont add the wokrshop.lua? is that it?
Lua Student

"The more you understand, the crazier you get."

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Setting maps to fastdl when that map is chosen
« Reply #7 on: January 30, 2014, 07:18:04 pm »
Remove the ones for maps.
Out of the Garry's Mod business.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Setting maps to fastdl when that map is chosen
« Reply #8 on: January 30, 2014, 07:20:17 pm »
The only time you add a workshop lua is if it's a workshop item for lua/models/sounds.
Maps by default, if on the fastdl host, will download when you're on that map.
Make sure to bz2 compress them. (Find any 'Source map bz2' tutorial)
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Setting maps to fastdl when that map is chosen
« Reply #9 on: January 30, 2014, 07:29:30 pm »
You could technically do this, could you not?

Code: Lua
  1. --This is a list of your server's maps which are available through the workshop
  2. --Each one uses the map file's name and the workshop ID
  3. maplist = {}
  4.  
  5. --change this table definition to your needs.
  6. maplist["ttt_community_bowling_v5a"] = "131667838"
  7. maplist["ttt_westwood_v4"] = "104520719"
  8. maplist["ttt_mc_skyislands"] = "106498411"
  9.  
  10.  
  11. local map = game.GetMap() -- Get's the current map name
  12. local workshopid = maplist[map]
  13. -- Finds the workshop ID for the current map name from the table above
  14.  
  15. if( workshopid != nil )then
  16.         --If the map is in the table above, add it through workshop
  17.         print( "[WORKSHOP] Setting up maps. " ..map.. " workshop ID: " ..workshopid )
  18.         resource.AddWorkshop( workshopid )
  19. else
  20.         --If not, ) then hope the server has FastDL or the client has the map
  21.         print( "[WORKSHOP] Not available for current map. Using FastDL instead hopefully..." )
  22. end
Taken from the GMod wiki.
bw81@ulysses-forums ~ % whoami
Homepage

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Setting maps to fastdl when that map is chosen
« Reply #10 on: January 30, 2014, 07:35:04 pm »
That works, but is not needed.
Out of the Garry's Mod business.

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Setting maps to fastdl when that map is chosen
« Reply #11 on: January 30, 2014, 07:39:46 pm »
That works, but is not needed.
Well, Workshop is most likely faster than a conventional FadtDL server... I'm actually planning doing a Workshop DL system for my server to decrease total loading time.
bw81@ulysses-forums ~ % whoami
Homepage

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Setting maps to fastdl when that map is chosen
« Reply #12 on: January 31, 2014, 02:18:00 pm »
Here's the issue.
By uploading anything to workshop, you're agreeing that 1) you own/are the creator of the content being uploaded and therefore 2) You're allowing Valve to lay claim to it, if they so wish.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

  • Print