Mounting Content on a Dedicated Server

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
 
(One intermediate revision by one user not shown)
Line 4: Line 4:
 
=mount.cfg=
 
=mount.cfg=
  
With mount.cfg you can specify folders to add to the filesystem. Garry's Mod will scan the file, mount the folders and any vpk files inside that folder.
+
With mount.cfg you can specify folders to add to the filesystem. Garry's Mod will scan the folder, mount any sub-folders and vpk files inside the given folder.
  
mount.cfg is located in garrysmod/cfg/ - and should look something like this:
+
'''mount.cfg''' is located in '''garrysmod/cfg/''' and can be opened by any plain text editor - and should look something like this:
  
 
+
<pre>
  "mountcfg"
+
"mountcfg"
  {
+
{
  "cstrike" "C:\steamcmd\steamapps\common\Counter-Strike Source Dedicated Server\cstrike"
+
"cstrike" "C:\steamcmd\steamapps\common\Counter-Strike Source Dedicated Server\cstrike"
  "tf" "C:\mytf2server\tf"
+
"tf" "C:\mytf2server\tf"
  }
+
}</pre>
  
 
{{Note|Linux paths cannot contain capital letters}}
 
{{Note|Linux paths cannot contain capital letters}}
Line 19: Line 19:
 
If you are on Linux and your games do not mount, make sure your directories do not contain capital letters like so:
 
If you are on Linux and your games do not mount, make sure your directories do not contain capital letters like so:
  
  "mountcfg"
+
<pre>
  {
+
"mountcfg"
  "tf" "/opt/team fortress 2 dedicated server/tf"
+
{
  "episodic"  "/home/gmod/steam/steamapps/common/half-life 2/episodic" //HL2 Episode 1
+
"tf" "/opt/team fortress 2 dedicated server/tf"
  }
+
"episodic"  "/home/gmod/steam/steamapps/common/half-life 2/episodic" //HL2 Episode 1
 +
}</pre>
 +
 
 +
The key names ("tf", "cstrike" and "episodic" in this example) in the file tell Garry's Mod which game this path is for, i.e. which game should be marked as mounted for you. This affects {{GlobalFunction|IsMounted}} and subsequently tells addons which games are mounted and which aren't.
 +
 
 +
This method will also allow you to mount games (or folder addons) into '''Hammer Editor'''.
  
 
=mountdepots.txt=
 
=mountdepots.txt=
  
There is currently a bug with dedicated servers where the function {{GlobalFunction|IsMounted}} returns the wrong value. If you are experiencing:
+
If you are experiencing:
* The flechette gun has a broken viewmodel and isn't firing projectiles correctly.
+
 
* Your clients are unable to spawn Hunters or NPCs from Half-Life: Source
 
* Your clients are unable to spawn Hunters or NPCs from Half-Life: Source
* Spawning the Jalopy doesn't do anything.
+
* Spawning the Jalopy doesn't do anything
Then you may need to ensure mountdepots.txt exists in garrysmod/cfg/ with contents resembling:
+
* Addons complaining that game content is not installed on the server, despite it being installed
  "gamedepotsystem"
+
 
  {
+
Then you may need to ensure '''mountdepots.txt''' exists in '''garrysmod/cfg/''' with contents resembling:
  "cstrike" "1"
+
<pre>
  "hl1" "1"
+
"gamedepotsystem"
  "hl1_hd" "1"
+
{
  "hl2" "1"
+
"cstrike" "1"
  "hl2mp" "1"
+
"hl1" "1"
  "episodic" "1"
+
"hl1_hd" "1"
  "ep2" "1"
+
"hl2" "1"
  "lostcoast" "1"
+
"hl2mp" "1"
  }
+
"episodic" "1"
 +
"ep2" "1"
 +
"lostcoast" "1"
 +
}</pre>
 +
 
 +
This will tell Garry's Mod that those games are installed and should be mounted (regardless of whether they are actually installed or not)
  
 +
Mounting necessary games using the method above should resolve the issues as well.
  
 
[[Category:Server_Owners]]
 
[[Category:Server_Owners]]

Latest revision as of 16:21, 2 December 2019

You might want to include maps from Counter-Strike or Team Fortress on your server. Updating and copying the maps over can be a pain.

mount.cfg

With mount.cfg you can specify folders to add to the filesystem. Garry's Mod will scan the folder, mount any sub-folders and vpk files inside the given folder.

mount.cfg is located in garrysmod/cfg/ and can be opened by any plain text editor - and should look something like this:

"mountcfg"
{
	"cstrike"	"C:\steamcmd\steamapps\common\Counter-Strike Source Dedicated Server\cstrike"
	"tf"		"C:\mytf2server\tf"
}
NOTE

Linux paths cannot contain capital letters

If you are on Linux and your games do not mount, make sure your directories do not contain capital letters like so:

"mountcfg"
{
	"tf"		"/opt/team fortress 2 dedicated server/tf"
	"episodic"   	"/home/gmod/steam/steamapps/common/half-life 2/episodic" //HL2 Episode 1
}

The key names ("tf", "cstrike" and "episodic" in this example) in the file tell Garry's Mod which game this path is for, i.e. which game should be marked as mounted for you. This affects IsMounted and subsequently tells addons which games are mounted and which aren't.

This method will also allow you to mount games (or folder addons) into Hammer Editor.

mountdepots.txt

If you are experiencing:

  • Your clients are unable to spawn Hunters or NPCs from Half-Life: Source
  • Spawning the Jalopy doesn't do anything
  • Addons complaining that game content is not installed on the server, despite it being installed

Then you may need to ensure mountdepots.txt exists in garrysmod/cfg/ with contents resembling:

"gamedepotsystem"
{
	"cstrike"	"1"
	"hl1"		"1"
	"hl1_hd"	"1"
	"hl2"		"1"
	"hl2mp"		"1"
	"episodic"	"1"
	"ep2"		"1"
	"lostcoast"	"1"
}

This will tell Garry's Mod that those games are installed and should be mounted (regardless of whether they are actually installed or not)

Mounting necessary games using the method above should resolve the issues as well.

Personal tools
Navigation