Mounting multiple games: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Updated with orange box references)
Line 8: Line 8:
This code will now fix bugs which may be featured with a game, also this allows you use the CS:S and DOD:S etc maps.. Though the info_player_*** will not work, you'll have to bind that to the original info_player_start which isn't hard.
This code will now fix bugs which may be featured with a game, also this allows you use the CS:S and DOD:S etc maps.. Though the info_player_*** will not work, you'll have to bind that to the original info_player_start which isn't hard.


cdll_client_int.cpp - Go to about line "622" and paste this. CLIENTSIDE
Firstly for cdll_client_int.cpp (CLIENTSIDE)
<pre>
#ifndef DEBUG
filesystem->AddSearchPath("hl2mp", "GAME");
filesystem->AddSearchPath("hl2", "GAME");
filesystem->AddSearchPath("episodic", "GAME");
filesystem->AddSearchPath("dod", "GAME");
filesystem->AddSearchPath("cstrike", "GAME");
filesystem->MountSteamContent(220);
filesystem->MountSteamContent(320);
filesystem->MountSteamContent(300);
filesystem->MountSteamContent(240);
#endif // DEBUG
</pre>


Now open GameInterface.cpp (SERVERSIDE)and about line 551 paste this.
Go to about line 622 (EP1) or line 710 (Orange box beta) - after the big list of conditions to return false in CHLClient::Init - and paste this:
<pre>
 
#ifndef DEBUG
#ifndef DEBUG
filesystem->AddSearchPath("hl2mp", "GAME");
filesystem->AddSearchPath("hl2mp", "GAME");
filesystem->AddSearchPath("hl2", "GAME");
filesystem->AddSearchPath("hl2", "GAME");
filesystem->AddSearchPath("episodic", "GAME");
filesystem->AddSearchPath("episodic", "GAME");
filesystem->AddSearchPath("dod", "GAME");
filesystem->AddSearchPath("dod", "GAME");
filesystem->AddSearchPath("cstrike", "GAME");
filesystem->AddSearchPath("cstrike", "GAME");
filesystem->MountSteamContent(220);
filesystem->MountSteamContent(220);
filesystem->MountSteamContent(320);
filesystem->MountSteamContent(320);
filesystem->MountSteamContent(300);
filesystem->MountSteamContent(300);
filesystem->MountSteamContent(240);
filesystem->MountSteamContent(240);
#endif // DEBUG
#endif // DEBUG
</pre>
 
Now open GameInterface.cpp (SERVERSIDE)
 
About line 551 (EP1) or line 567 (Orange box beta) - after the list of conditions to return false in CServerGameDLL::DLLInit - and paste this:
 
#ifndef DEBUG
filesystem->AddSearchPath("hl2mp", "GAME");
filesystem->AddSearchPath("hl2", "GAME");
filesystem->AddSearchPath("episodic", "GAME");
filesystem->AddSearchPath("dod", "GAME");
filesystem->AddSearchPath("cstrike", "GAME");
filesystem->MountSteamContent(220);
filesystem->MountSteamContent(320);
filesystem->MountSteamContent(300);
filesystem->MountSteamContent(240);
#endif // DEBUG


Compile or rebuild and run your game.
Compile or rebuild and run your game.
Line 42: Line 44:
{{warning|This will '''not''' work in ''debug mode'' if you are using a version of the source code prior to the [[Orange Box]] version. If you ''are'' using the Orange Box source code, you can remove the "#ifndef DEBUG" and "#endif" statements.}}
{{warning|This will '''not''' work in ''debug mode'' if you are using a version of the source code prior to the [[Orange Box]] version. If you ''are'' using the Orange Box source code, you can remove the "#ifndef DEBUG" and "#endif" statements.}}


== Add Type ==
== Add Order ==
You can also select how the path should be added to the directory table.
You can also select how the path should be added to the directory table, to affect the priority given to files of the same name:
 
filesystem->AddSearchPath("dod", "GAME", PATH_ADD_TO_TAIL); //Add to the Tail
<code><pre>filesystem->AddSearchPath("dod", "GAME", PATH_ADD_TO_TAIL); //Add to the Tail</pre></code>
 
== Credits ==
* John Stuart a.k.a. ''TommyGun''


== See also ==
== See also ==

Revision as of 17:34, 14 March 2008

The following short section of code allows you to mount additional files from the following games:

  • Counter Strike Source,
  • Hl2MP,
  • Episode 1,
  • Day of Defeat Source,
  • Half Life 2 (fixes),

This code will now fix bugs which may be featured with a game, also this allows you use the CS:S and DOD:S etc maps.. Though the info_player_*** will not work, you'll have to bind that to the original info_player_start which isn't hard.

Firstly for cdll_client_int.cpp (CLIENTSIDE)

Go to about line 622 (EP1) or line 710 (Orange box beta) - after the big list of conditions to return false in CHLClient::Init - and paste this:

#ifndef DEBUG
	filesystem->AddSearchPath("hl2mp", "GAME");
	filesystem->AddSearchPath("hl2", "GAME");
	filesystem->AddSearchPath("episodic", "GAME");
	filesystem->AddSearchPath("dod", "GAME");
	filesystem->AddSearchPath("cstrike", "GAME");
	filesystem->MountSteamContent(220);
	filesystem->MountSteamContent(320);
	filesystem->MountSteamContent(300);
	filesystem->MountSteamContent(240);
#endif // DEBUG

Now open GameInterface.cpp (SERVERSIDE)

About line 551 (EP1) or line 567 (Orange box beta) - after the list of conditions to return false in CServerGameDLL::DLLInit - and paste this:

#ifndef DEBUG
	filesystem->AddSearchPath("hl2mp", "GAME");
	filesystem->AddSearchPath("hl2", "GAME");
	filesystem->AddSearchPath("episodic", "GAME");
	filesystem->AddSearchPath("dod", "GAME");
	filesystem->AddSearchPath("cstrike", "GAME");
	filesystem->MountSteamContent(220);
	filesystem->MountSteamContent(320);
	filesystem->MountSteamContent(300);
	filesystem->MountSteamContent(240);
#endif // DEBUG

Compile or rebuild and run your game.

Warning.pngWarning:This will not work in debug mode if you are using a version of the source code prior to the Orange Box version. If you are using the Orange Box source code, you can remove the "#ifndef DEBUG" and "#endif" statements.

Add Order

You can also select how the path should be added to the directory table, to affect the priority given to files of the same name:

filesystem->AddSearchPath("dod", "GAME", PATH_ADD_TO_TAIL); //Add to the Tail

See also