Difference between revisions of "Installing Metamod:Source"

From AlliedModders Wiki
Jump to: navigation, search
 
(please stop modifying your gameinfos. god is weeping)
 
(41 intermediate revisions by 16 users not shown)
Line 1: Line 1:
This article will guide you through a [[SourceMM]] installation.
+
This article will guide you through a [[Metamod:Source]] installation.
  
If you don't already have Metamod:Source bundled with a plugin, you can install it manually with the directions below.
+
=Normal Installation=
 +
 
 +
''Not applicable for Source 2. See GameInfo section below''
 +
 
 +
Valve sometimes makes changes in their games that break Metamod:Source between releases.  When this happens, you may need to install a snapshot versions of Metamod:Source.  You can see if this is required on the [[Required Versions (SourceMod)|Required Versions]] page.
  
 
<ol>
 
<ol>
<li>Download the appropriate package for your server: there is a Linux tarball and Windows zip file.  You can get this from the [http://www.sourcemm.net/ SourceMM Website].</li>
+
<li>[http://www.metamodsource.net/ Download] Metamod:Source.</li>
<li>Open the package, you will either have "server_i486.so" or "server.dll".</li>
+
<li>Extract the package to your game folder.  For example, for Counter-Strike:Source, you would have <code>cstrike/addons/metamod</code> after extracting. If you are uploading to FTP, extract the files locally before transferring to your server's game folder.</li>
<li>Find your "mod folder" on your server. This will be something like "cstrike" or "hl2mp".</li>
+
<li>Restart your server.</li>
<li>Make a folder in your mod folder called "addons", if it doesn't already existMake a folder inside addons called "metamod", and a folder inside "metamod" called "bin".</li>
+
<li>Type "meta version" in your server console (or RCon). You should see a line like: "Loaded As: Valve Server Plugin." If you see this, you are done.  If the command is not recognized, see the sections below.</li>
<li>Create a new, blank, text file called "metaplugins.ini".</li>
+
</ol>
<li>Upload the files to your server:
+
 
<ul><li>Upload the server.dll or server_i486.so file to your addons/metamod/bin Folder.</li>
+
When using a Linux server, you may see the following messages:
<li>Upload the metaplugins.ini file to your addons/metamod folder.</li>
+
 
<li>WARNING! - Do not replace the mod's server.dll/server_i486.so (usually in "<mod>\bin"). This will cause your mod to stop working.</li>
+
* An error indicating that it could not be loaded due to "wrong ELF class: ELFCLASS64".  If you are using a 32-bit dedicated server installation, this is normal behavior; as long as <code>meta version</code> is recognized, Metamod:Source is installed.
</ul>
+
* An error indicating that it could not be loaded because "/path/to/server_install/bin/libgcc_s.so.1: version `GCC_7.0.0` not found (required by /some_system_path_to/libstdc++.so.6". This is because Valve ships their own copies of those libraries.  As modern systems will have newer versions, you can safely delete the listed file from the server install.  Do not delete the file in the system path (usually <code>lib</code> or <code>lib32</code>).
<li>Open the file in the mod folder called "gameinfo.txt". You will see a few lines at the bottom like this:
+
* If you are running a 64-bit operating system yourself, you may need to install the system's 32-bit libraries.
:<pre>
+
** On Debian / Ubuntu, you can do this with <code>apt install gcc-multilib</code>.
 +
* You may find more information about any load failures under a <code>metamod-fatal.log</code> in metamod's <code>bin</code> folder.
 +
 
 +
==Custom VDF File==
 +
'''Note: This is normally not needed - Metamod:Source 1.10.0 and later include a <code>metamod.vdf</code> file for easier installation on most games.'''
 +
 
 +
You really, really do not need to do this.
 +
 
 +
Known setups that require this step:
 +
<ol>
 +
<li>Left 4 Dead 1</li>
 +
<li>3rd party mods using the Source SDK Base.</li>
 +
<li>Listen servers (created with the in-game "Create Server" option) for non-english game clients.</li>
 +
</ol>
 +
 
 +
If you are running any of the above, then yes, you probably do need it. But you probably aren't, so you probably don't, and plenty of people have fallen into the trap of doing these steps unnecessarily and have had to be told otherwise.
 +
 
 +
So again, if you followed the normal installation process above and <code>meta version</code> was recognized, ''do not do this''.
 +
 
 +
Otherwise, if you have trouble getting Metamod:Source to load, [http://www.metamodsource.net/?go=vdf go here] to generate a VDF file specific to your game. This file should be placed into your server's <code>addons</code> directory.
 +
 
 +
=Adjust gameinfo file=
 +
 
 +
'''Adjusting gameinfo for Source 1 is normally not needed. If you do not understand what this is, do NOT do this unless instructed to. The above instructions are sufficient to install Metamod:Source for 99% of servers. For Source 2, this is, however, the only supported loading method. See [[#Source_2|Source 2]] for more info.'''
 +
 
 +
==Source 1==
 +
Metamod:Source 1.4.2 and lower used an older method for loading itself. The advantage of this method was that Metamod:Source could be loaded before the actual game mod, which gave it a small amount of extra functionality. This functionality was never used by plugin developers, and Steam updates kept overwriting <code>gameinfo</code> files, so we switched to a different loading mechanism.
 +
 
 +
However this loading mechanism may still be desirable if you run into backwards compatibility issues, or you have a plugin which takes advantage of the early-loading mechanism.  If this is your case, here are the <code>gameinfo</code> directions below:
 +
 
 +
<ul>
 +
<li>Open the file in the mod folder called <code>gameinfo.txt</code>. You will see a few lines at the bottom like this:
 +
<pre>
 
SearchPaths
 
SearchPaths
 
{
 
{
Line 23: Line 59:
 
}
 
}
 
</pre></li>
 
</pre></li>
<li>#Add a line before all of the "Game" entries that looks like this:<pre>GameBin |gameinfo_path|addons/metamod/bin
+
<li>Add a line after the <code>{</code> sign but before all of the <code>Game</code> entries that looks like this:<pre>GameBin |gameinfo_path|addons/metamod/bin
 
</pre>
 
</pre>
 
</li>
 
</li>
<li>You're done! To test whether it worked, restart your game server and type "meta" in the [[server console]]. You should get a menu.
+
<li>If you're using Windows, you may need to use a backwards slash (\) instead.
<li>For more information, documentation, and troubleshooting, see [[:Category:Documentation (SourceMM)]]</li>
+
<li>You're done! To test whether it worked, restart your game server and type <code>meta version</code> in the server console. You should see a line that says <code>Loaded as: GameDLL (gameinfo.txt)</code>.
#Optional Cvars:
+
If it doesn't recognize the command, the installation probably failed.  If the <code>Loaded as:</code> line says something else, <code>gameinfo</code> was probably not modified correctly.</li>
#*<tt>mm_pluginsfile</tt> - Sets the path and name of the plugins file, defaulting to "addons/metamod/plugins.ini". It is relative to the mod directory.
+
<li>For more information or documentation, see [[:Category:Metamod:Source Documentation]]</li>
 +
</ul>
  
 +
==Source 2==
 +
Source 2 does not have server plugins, so you will need to load Metamod the old-fashioned way: replacing the server library with Metamod's stub loader.
 +
 +
{{Sad|You will need to redo these changes every time a developer pushes a change that modifies gameinfo.gi}}
 +
 +
<ul>
 +
<li>Open the file in the mod folder called <code>gameinfo.gi</code>. In CS2 this is <code>csgo/gameinfo.gi</code>.
 +
<li>Note that even though it says <code>DO NOT EDIT THIS FILE DIRECTLY</code> and advises to edit <code>csgo_core/gameinfo.gi</code>, editing that file does not correctly load Metamod.
 +
<li>Look for the <code>SearchPaths</code> section of code.
 +
<li>Add a line after the <code>{</code> sign but before all of the <code>Game</code> entries that looks like this, replacing <code>csgo</code> (for CS2) with your game name found in lines beneath it:
 +
<pre>Game csgo/addons/metamod</pre>
 +
{{CommonMistake|Make sure the Metamod entry is the '''first''' in the searchpaths list! This list is ordered and placing it anywhere else will prevent Metamod from loading}}
 +
<li>Using <code>GameBin</code> instead of <code>Game</code> does not work.
 +
<li>In Windows, the backslash is no longer required for paths.</li>
 +
<li>You're done! To test whether it worked, restart your game server and type <code>meta version</code> in the server console. You should see a line that says <code>Metamod:Source version 2.x.x</code>.
 +
If it doesn't recognize the command, the installation probably failed. Try updating your game to the latest version and using the latest version of Source 2.</li>
 +
<li>For more information or documentation, see [[:Category:Metamod:Source Documentation]]</li>
 +
</ul>
  
[[Category::Documentation (SourceMM)]]
+
[[Category:Metamod:Source Documentation]]

Latest revision as of 09:07, 5 September 2024

This article will guide you through a Metamod:Source installation.

Normal Installation

Not applicable for Source 2. See GameInfo section below

Valve sometimes makes changes in their games that break Metamod:Source between releases. When this happens, you may need to install a snapshot versions of Metamod:Source. You can see if this is required on the Required Versions page.

  1. Download Metamod:Source.
  2. Extract the package to your game folder. For example, for Counter-Strike:Source, you would have cstrike/addons/metamod after extracting. If you are uploading to FTP, extract the files locally before transferring to your server's game folder.
  3. Restart your server.
  4. Type "meta version" in your server console (or RCon). You should see a line like: "Loaded As: Valve Server Plugin." If you see this, you are done. If the command is not recognized, see the sections below.

When using a Linux server, you may see the following messages:

  • An error indicating that it could not be loaded due to "wrong ELF class: ELFCLASS64". If you are using a 32-bit dedicated server installation, this is normal behavior; as long as meta version is recognized, Metamod:Source is installed.
  • An error indicating that it could not be loaded because "/path/to/server_install/bin/libgcc_s.so.1: version `GCC_7.0.0` not found (required by /some_system_path_to/libstdc++.so.6". This is because Valve ships their own copies of those libraries. As modern systems will have newer versions, you can safely delete the listed file from the server install. Do not delete the file in the system path (usually lib or lib32).
  • If you are running a 64-bit operating system yourself, you may need to install the system's 32-bit libraries.
    • On Debian / Ubuntu, you can do this with apt install gcc-multilib.
  • You may find more information about any load failures under a metamod-fatal.log in metamod's bin folder.

Custom VDF File

Note: This is normally not needed - Metamod:Source 1.10.0 and later include a metamod.vdf file for easier installation on most games.

You really, really do not need to do this.

Known setups that require this step:

  1. Left 4 Dead 1
  2. 3rd party mods using the Source SDK Base.
  3. Listen servers (created with the in-game "Create Server" option) for non-english game clients.

If you are running any of the above, then yes, you probably do need it. But you probably aren't, so you probably don't, and plenty of people have fallen into the trap of doing these steps unnecessarily and have had to be told otherwise.

So again, if you followed the normal installation process above and meta version was recognized, do not do this.

Otherwise, if you have trouble getting Metamod:Source to load, go here to generate a VDF file specific to your game. This file should be placed into your server's addons directory.

Adjust gameinfo file

Adjusting gameinfo for Source 1 is normally not needed. If you do not understand what this is, do NOT do this unless instructed to. The above instructions are sufficient to install Metamod:Source for 99% of servers. For Source 2, this is, however, the only supported loading method. See Source 2 for more info.

Source 1

Metamod:Source 1.4.2 and lower used an older method for loading itself. The advantage of this method was that Metamod:Source could be loaded before the actual game mod, which gave it a small amount of extra functionality. This functionality was never used by plugin developers, and Steam updates kept overwriting gameinfo files, so we switched to a different loading mechanism.

However this loading mechanism may still be desirable if you run into backwards compatibility issues, or you have a plugin which takes advantage of the early-loading mechanism. If this is your case, here are the gameinfo directions below:

  • Open the file in the mod folder called gameinfo.txt. You will see a few lines at the bottom like this:
    SearchPaths
    {
    	Game				|gameinfo_path|. 
    	Game				cstrike
    	Game				hl2
    }
    
  • Add a line after the { sign but before all of the Game entries that looks like this:
    GameBin				|gameinfo_path|addons/metamod/bin
    
  • If you're using Windows, you may need to use a backwards slash (\) instead.
  • You're done! To test whether it worked, restart your game server and type meta version in the server console. You should see a line that says Loaded as: GameDLL (gameinfo.txt). If it doesn't recognize the command, the installation probably failed. If the Loaded as: line says something else, gameinfo was probably not modified correctly.
  • For more information or documentation, see Category:Metamod:Source Documentation

Source 2

Source 2 does not have server plugins, so you will need to load Metamod the old-fashioned way: replacing the server library with Metamod's stub loader.

You will need to redo these changes every time a developer pushes a change that modifies gameinfo.gi

  • Open the file in the mod folder called gameinfo.gi. In CS2 this is csgo/gameinfo.gi.
  • Note that even though it says DO NOT EDIT THIS FILE DIRECTLY and advises to edit csgo_core/gameinfo.gi, editing that file does not correctly load Metamod.
  • Look for the SearchPaths section of code.
  • Add a line after the { sign but before all of the Game entries that looks like this, replacing csgo (for CS2) with your game name found in lines beneath it:
    Game csgo/addons/metamod

    Make sure the Metamod entry is the first in the searchpaths list! This list is ordered and placing it anywhere else will prevent Metamod from loading

  • Using GameBin instead of Game does not work.
  • In Windows, the backslash is no longer required for paths.
  • You're done! To test whether it worked, restart your game server and type meta version in the server console. You should see a line that says Metamod:Source version 2.x.x. If it doesn't recognize the command, the installation probably failed. Try updating your game to the latest version and using the latest version of Source 2.
  • For more information or documentation, see Category:Metamod:Source Documentation