Difference between revisions of "Installing Metamod:Source"

From AlliedModders Wiki
Jump to: navigation, search
m (Added a forgotten "is" on the GameInfo section warning. You'll know when you see it.)
(14 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
This article will guide you through a [[Metamod:Source]] 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=
  
 +
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>
 +
<li>[http://www.metamodsource.net/ Download] Metamod:Source.</li>
 +
<li>Extract the package to your game folder.  For example, for Counter-Strike:Source, you would have <tt>cstrike/addons/metamod</tt> after extracting.  If you are uploading to FTP, extract the files locally before transferring to your server's game folder.</li>
 +
<li>Restart your server.</li>
 +
<li>Type "meta version" in your server console (or RCON).  You should see a line like: "Loaded As: Valve Server Plugin."  If the command is not recognized, see the sections below.</li>
 +
</ol>
 +
 +
==Custom VDF File==
 +
Metamod:Source 1.10.0 and later include a <tt>metamod.vdf</tt> file for easier installation on most games. If you have trouble getting it 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 <tt>addons</tt> directory.
 +
 +
Known setups that require this step:
 
<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>Left 4 Dead 1</li>
<li>'''Open''' the package, you will either have "server_i486.so" or "server.dll".</li>
+
<li>3rd party mods using the Source SDK Base.</li>
<li>'''Find '''your "mod folder" on your server. This will be something like "cstrike" or "hl2mp".</li>
+
<li>Listen servers (created with the in-game "Create Server" option) for non-english game clients.</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>
+
</ol>
<li>'''Create''' a new, blank, text file called "metaplugins.ini".</li>
+
 
<li>'''Upload''' the files to your server:
+
=GameInfo=
<ul><li>Upload the server.dll or server_i486.so file to your addons/metamod/bin Folder.</li>
+
'''Note: This 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.'''
<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>
+
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 functionalityThis functionality was never used by plugin developers, and Steam updates kept overwriting <tt>gameinfo.txt</tt> files, so we switched to a different loading mechanism.
</ul>
+
 
<li>'''Open''' the file in the mod folder called "gameinfo.txt". You will see a few lines at the bottom like this:
+
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 <tt>gameinfo.txt</tt> directions below:
 +
 
 +
<ul>
 +
<li>Open the file in the mod folder called "gameinfo.txt". You will see a few lines at the bottom like this:
 
<pre>
 
<pre>
 
SearchPaths
 
SearchPaths
Line 23: Line 39:
 
}
 
}
 
</pre></li>
 
</pre></li>
<li>'''Add''' a line after the "{" sign but before all of the "Game" entries that looks like this:<pre>GameBin |gameinfo_path|addons/metamod/bin
+
<li>Add a line after the "{" sign but before all of the "Game" 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 "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, <tt>gameinfo.txt</tt> was probably not modified correctly.</li>
<li>'''Optional''' Cvars:
+
<li>For more information or documentation, see [[:Category:Metamod:Source Documentation]]</li>
<tt>mm_pluginsfile</tt> - Sets the path and name of the plugins file, defaulting to "addons/metamod/metaplugins.ini". It is relative to the mod directory.</li>
+
</ul>
</ol>
 
  
If your gameinfo.txt gets rewritten, and your line gets removed, metamod won't run. There are a couple ways to fix this:
+
The <tt>gameinfo.txt</tt> loading method is supported as a legacy feature only.  The patcher tool is no longer provided.  You can mark <tt>gameinfo.txt</tt> if you absolutely want to protect it from being overwritten.
  
<ol>
+
We will continue to make sure Metamod:Source can load via this method for as long as the Source Engine allows it. However, we will concentrate more on supporting the new loading mechanism for general use.
<li>'''Quick-fix''' Redo steps 7 and 8.</li>
 
<li>'''Windows-only batch fix''' Create a text file in "counter-strike source" called sourcemm.bat and then right-click edit. put this in.
 
<pre>
 
cd "cstrike"
 
copy GameInfo.txt.mms GameInfo.txt
 
cd ..
 
hl2.exe -insecure -console -game cstrike
 
</pre>
 
Then in "cstrike" (under folder you were just in) copy "gameinfo.txt" and rename it "GameInfo.txt.mms" ( I got this off http://www.tcwonline.org/~dvander/cssdm/ )
 
Or chnage the permission of the file gameinfo.txt to write protected.</li>
 
<li>'''Linux-only fix''' Open a console or xterm or whatever your prefer and cd to the directory where you installed steam (a program called <tt>steam</tt> will be there). Open up a new file called <tt>gameinfopatcher</tt> (in vim or whatever editor you like) and type the following in:
 
<pre>
 
#/bin/bash
 
if [ "`grep addons/metamod/bin < gameinfo.txt`" = "" ]
 
then
 
# I love here document patches.
 
  echo gameinfo.txt needs patching for metamod.
 
  patch -Np0 <<EOPATCH
 
*** gameinfo.txt.bak Sun Apr 16 19:04:34 2006
 
--- gameinfo.txt Mon Apr 17 11:01:49 2006
 
***************
 
*** 41,44 ****
 
--- 41,45 ----
 
  SearchPaths^M
 
  {^M
 
+ GameBin |gameinfo_path|addons/metamod/bin^M
 
EOPATCH
 
 
 
  test $? || echo patch failed
 
  rm gameinfo.txt.orig || echo temp file deletion failed
 
  
else
 
  echo Already patched.
 
fi
 
</pre>
 
Those <tt>^M</tt>'s are control characters. To type them in vim, press <tt>Ctrl-v Ctrl-m</tt>. For other editors, you're on your own. Also, be mindful of tabs and backticks. If you can't figure out how to do all that or just don't want to mess with it, you can download a tarred bzip2 from http://www.tlcomputing.com/gameinfo.txt.updater.tar.bz2 (''note:'' this link appears to alter the GameInfo.txt with an extra '/', which is wrong). To be able to run this script you must make it executable by running:
 
<pre>chmod +x gameinfopatcher</pre>
 
Now cd into the directory of the mod whose <tt>gameinfo.txt</tt> you need to fix. For example,
 
<pre>cd cstrike</pre>
 
Now you just need to run the updater like this:
 
<pre>../gameinfopatcher</pre>
 
You can safely run this script any time, even if Valve changes the contents of <tt>gameinfo.txt</tt>. I recommend running it after every update.</li></ol>
 
 
[[Category:Metamod:Source Documentation]]
 
[[Category:Metamod:Source Documentation]]

Revision as of 21:57, 2 January 2015

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

Normal Installation

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 the command is not recognized, see the sections below.

Custom VDF File

Metamod:Source 1.10.0 and later include a metamod.vdf file for easier installation on most games. If you have trouble getting it to load, go here to generate a VDF file specific to your game. This file should be placed into your server's addons directory.

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.

GameInfo

Note: This 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.

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.txt 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.txt 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.txt was probably not modified correctly.
  • For more information or documentation, see Category:Metamod:Source Documentation

The gameinfo.txt loading method is supported as a legacy feature only. The patcher tool is no longer provided. You can mark gameinfo.txt if you absolutely want to protect it from being overwritten.

We will continue to make sure Metamod:Source can load via this method for as long as the Source Engine allows it. However, we will concentrate more on supporting the new loading mechanism for general use.