• resource.AddWorkshop only if the map is played ?
    9 replies, posted
Hey, i have a small question about lua. Is it possible to use "resource.AddWorkshop" only if a certain Map is played ? So that the Map gets only downloaded if it is played.
Try it with IF and [URL="http://wiki.garrysmod.com/page/game/GetMap"]game/GetMap[/URL]
Doesn't it automatically add the current map if it's from a workshop collection?
[QUOTE=ryankingstone;49468917]Doesn't it automatically add the current map if it's from a workshop collection?[/QUOTE] The plan is that, the Players that join only need to download the Map that is played right now, and not all other Maps aswell. Problem is i don't know how to get there :pudge:
[QUOTE=K4i;49468971]The plan is that, the Players that join only need to download the Map that is played right now, and not all other Maps aswell. Problem is i don't know how to get there :pudge:[/QUOTE] As far as I remember, the current map will automatically download if it is in your Workshop collection. However you can try to do this: [CODE] if game.GetMap() == "mapnamehere" then resource.AddWorkshop("ID") end [/CODE]
[QUOTE=P4sca1;49469018]As far as I remember, the current map will automatically download if it is in your Workshop collection. However you can try to do this: [CODE] if game.GetMap() == "mapnamehere" then resource.AddWorkshop("ID") end [/CODE][/QUOTE] still downloads the map on other maps :/
do not add the map to the resource.addworkshop this is done automatically on join if the player 1. does not have the map 2. the map is uploaded to the workshop by itself (not a pack of maps) 3. the map is from the workshop on the server (if the map is in the maps folder on the server then it needs to be in the maps folder on your fastdl, if the map is in the workshop collection for the server and not in the maps folder then it will download the map if the above conditions are met) ^^ From personal experiance
If the client doesn't have the map that a server is using, they'll receive a message saying "You don't have that map" (pseudophrasing) when they try to connect/load into it. To make this work, the file download system would need to push the map to the player before it begins the checks, tests, error handling and the actual connection, which I have no idea if Gmod supports. "My car is out of gas, but the fact that it's out of gas makes it difficult to drive anywhere to put gas in it. I must find another way, or not use my car." :)
gmod automatically downloads a workshop map if the server uses the SAME workshop map (not an extracted version of it) and the map is not part of a "pack" of different maps
[QUOTE=kulcris;49469891]gmod automatically downloads a workshop map if the server uses the SAME workshop map ([B]not an extracted version of it[/B]) and the map is not part of a "pack" of different maps[/QUOTE] Ok this was my problem its working now.
Sorry, you need to Log In to post a reply to this thread.