You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note on workshop maps for CS2, CS:GO used to have a startup parameter +workshop_start_map id it would download/update the workshop map on server start and also load it, but this has been removed in CS2, a clunky workaround I have found is to load an "empty" map (literally a map called <empty>), and then starting the workshop map with host_workshop_map id, so if you could maybe account for <empty> being loaded first (when trying to autoload a config, just return the method I guess).
Possible improvement over get5:
Change the way maps are passed into the match config into cleaner JSON objects, so instead of passing map file names we can pass:
map.type could be a C# enum, could also be a string instead of a number, this is just an example:
enumMapType{Official,Workshop}
map.name can be used in chat messages and such.
The above improvement would make it easier for the plugin to tell if a map is a workshop map without needing to split strings like get5 did.
C# example of handling a map change
publicstaticasync Task ChangeMap(Mapmap,intdelay=3){
Server.PrintToChatAll($"Changing to map: {map.Name}");if(map.Type == MapType.Workshop){
Server.PrintToChatAll($"Warning: Since {map.Name} is a workshop map");
Server.PrintToChatAll("The server might need to download / update the map");}await Task.Delay(delay*1000);
Server.NextFrame(()=>{if(map.Type == MapType.Official){ Server.ExecuteCommand($"changelevel {map.Id}");}else{ Server.ExecuteCommand($"host_workshop_map {map.Id}");}});}
The text was updated successfully, but these errors were encountered:
Autoload config
A configuration that if set, loads a match config every time a map loads, if the match isn't already live obviously.
Get5 documentation reference of a ConVar that does the same thing: https://splewis.github.io/get5/latest/configuration/#get5_autoload_config
Workshop maps
Note on workshop maps for CS2, CS:GO used to have a startup parameter
+workshop_start_map id
it would download/update the workshop map on server start and also load it, but this has been removed in CS2, a clunky workaround I have found is to load an "empty" map (literally a map called <empty>), and then starting the workshop map withhost_workshop_map id
, so if you could maybe account for <empty> being loaded first (when trying to autoload a config, just return the method I guess).Get5 reference on workshop maps (click on + of maplist property): https://splewis.github.io/get5/latest/match_schema/#schema
Possible improvement over get5:
Change the way maps are passed into the match config into cleaner JSON objects, so instead of passing map file names we can pass:
map.type
could be a C# enum, could also be a string instead of a number, this is just an example:map.name
can be used in chat messages and such.The above improvement would make it easier for the plugin to tell if a map is a workshop map without needing to split strings like get5 did.
C# example of handling a map change
The text was updated successfully, but these errors were encountered: