Mounting multiple games: Difference between revisions
| Craziestdan (talk | contribs) m (correcting line number ;)) | Craziestdan (talk | contribs)   (Shortened/easier,) | ||
| Line 3: | Line 3: | ||
| * '''Hl2MP,''' | * '''Hl2MP,''' | ||
| * '''Episode 1,''' | * '''Episode 1,''' | ||
| * '''Episode 2,''' | |||
| * '''Team Fortress 2''' | |||
| * '''Portal''' | |||
| * '''Day of Defeat Source,''' | * '''Day of Defeat Source,''' | ||
| * '''Half Life 2 (fixes),''' | * '''Half Life 2 (fixes),''' | ||
| Line 14: | Line 17: | ||
| Go to about line 622 (EP1) or line 710 (Orange box) - after the big list of conditions to return false in CHLClient::Init - and paste this: | Go to about line 622 (EP1) or line 710 (Orange box) - after the big list of conditions to return false in CHLClient::Init - and paste this: | ||
|    filesystem->AddSearchPath("hl2mp", "GAME"); | |||
|    filesystem->AddSearchPath("hl2", "GAME"); | |||
|    filesystem->AddSearchPath("episodic", "GAME"); | |||
|    filesystem->AddSearchPath("dod", "GAME"); | |||
|    filesystem->AddSearchPath("cstrike", "GAME"); | |||
|    filesystem->AddSearchPath("tf", "GAME"); | |||
|    filesystem->AddSearchPath("portal", "GAME"); | |||
|    filesystem->AddSearchPath("ep2", "GAME"); | |||
|    filesystem->AddSearchPath("hl1", "GAME"); | |||
|    filesystem->AddSearchPath("hl1mp", "GAME"); | |||
|    filesystem->AddSearchPath("lostcoast", "GAME"); | |||
|    filesystem->MountSteamContent(-220);  //Half-Life 2 | |||
|    filesystem->MountSteamContent(-320);  //Half-Life 2: Deathmatch | |||
|    filesystem->MountSteamContent(-380);  //Half-Life 2: Episode One | |||
|    filesystem->MountSteamContent(-300);  //Day of Defeat: Source | |||
|    filesystem->MountSteamContent(-240);  //Counter-Strike: Source | |||
|    filesystem->MountSteamContent(-440);  //Team Fortress 2  | |||
|    filesystem->MountSteamContent(-400);  //Portal | |||
|    filesystem->MountSteamContent(-420);  //Half-Life 2: Episode Two | |||
|    filesystem->MountSteamContent(-280);  //Half-Life: Source | |||
|    filesystem->MountSteamContent(-360);  //Half-Life: Source | |||
|    filesystem->MountSteamContent(-340);  //Half-Life 2: Lost Coast | |||
| {{note|The above code mounts all Source games. Simply comment out the games you don't want to mount, if any.}} | |||
| Now open GameInterface.cpp (SERVERSIDE) | Now open GameInterface.cpp (SERVERSIDE) | ||
| About line 551 (EP1) or line 735 (Orange box) - after the list of conditions to return false in CServerGameDLL::DLLInit - and paste  | About line 551 (EP1) or line 735 (Orange box) - after the list of conditions to return false in CServerGameDLL::DLLInit - and paste the same code above. | ||
| Compile or rebuild and run your game. | Compile or rebuild and run your game. | ||
| {{ | {{tip|This works in debug mode. (By keeping the - sign in front of the app number.}} | ||
| == Add Order == | == Add Order == | ||
Revision as of 06:00, 29 September 2008
The following short section of code allows you to mount additional files from the following games:
- Counter Strike Source,
- Hl2MP,
- Episode 1,
- Episode 2,
- Team Fortress 2
- Portal
- 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.
 Warning:Steam will allow the mod to run regardless of whether or not the user owns the game that you mount content for. If the game isn't owned the content will not be mounted, and error signs will appear everywhere instead! It's a good idea to make it VERY CLEAR to players what games are required if you use this trick.
Warning:Steam will allow the mod to run regardless of whether or not the user owns the game that you mount content for. If the game isn't owned the content will not be mounted, and error signs will appear everywhere instead! It's a good idea to make it VERY CLEAR to players what games are required if you use this trick.Firstly for cdll_client_int.cpp (CLIENTSIDE)
Go to about line 622 (EP1) or line 710 (Orange box) - after the big list of conditions to return false in CHLClient::Init - and paste this:
  filesystem->AddSearchPath("hl2mp", "GAME");
  filesystem->AddSearchPath("hl2", "GAME");
  filesystem->AddSearchPath("episodic", "GAME");
  filesystem->AddSearchPath("dod", "GAME");
  filesystem->AddSearchPath("cstrike", "GAME");
  filesystem->AddSearchPath("tf", "GAME");
  filesystem->AddSearchPath("portal", "GAME");
  filesystem->AddSearchPath("ep2", "GAME");
  filesystem->AddSearchPath("hl1", "GAME");
  filesystem->AddSearchPath("hl1mp", "GAME");
  filesystem->AddSearchPath("lostcoast", "GAME");
  filesystem->MountSteamContent(-220);  //Half-Life 2
  filesystem->MountSteamContent(-320);  //Half-Life 2: Deathmatch
  filesystem->MountSteamContent(-380);  //Half-Life 2: Episode One
  filesystem->MountSteamContent(-300);  //Day of Defeat: Source
  filesystem->MountSteamContent(-240);  //Counter-Strike: Source
  filesystem->MountSteamContent(-440);  //Team Fortress 2 
  filesystem->MountSteamContent(-400);  //Portal
  filesystem->MountSteamContent(-420);  //Half-Life 2: Episode Two
  filesystem->MountSteamContent(-280);  //Half-Life: Source
  filesystem->MountSteamContent(-360);  //Half-Life: Source
  filesystem->MountSteamContent(-340);  //Half-Life 2: Lost Coast
 Note:The above code mounts all Source games. Simply comment out the games you don't want to mount, if any.
Note:The above code mounts all Source games. Simply comment out the games you don't want to mount, if any.Now open GameInterface.cpp (SERVERSIDE)
About line 551 (EP1) or line 735 (Orange box) - after the list of conditions to return false in CServerGameDLL::DLLInit - and paste the same code above.
Compile or rebuild and run your game.
 Tip:This works in debug mode. (By keeping the - sign in front of the app number.
Tip:This works in debug mode. (By keeping the - sign in front of the app number.
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
filesystem->AddSearchPath("dod", "GAME", PATH_ADD_TO_HEAD); //Add to the Head