Mounting multiple GCFs: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
(avoid double redir)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{deletebecause|merged to [[IFileSystem#Mount Steam Application Content|IFileSystem]]}}
#redirect [[Mounting multiple games]]
{{cleanup}}<!--[[Category:Programming]][[Category:Tutorials]][[Category:Modding]]-->
Sometimes we want to mount multiple GCF's, for example: if you have made a new mod, based on HL2MP, that needs to loads files from HL2MP '''and''' HL2. Well, of course you could copy the files to your mod but that's just wasting bandwidth and space :)
 
Well, it's only a couple of lines of code:
 
== The code ==
Open the file ''cdll_client.cpp'' and find the function ''int CHLClient::Init''.
Go to end of the function and add before ''return true;''
 
<pre>
filesystem->AddSearchPath("hl2", "GAME");
filesystem->MountSteamContent(220);
</pre>
 
That's all :)
 
This only adds HL2 but you can add more, possible values are listed in [[Steam Application IDs]], although mounting a [[Half-Life]] or a [[:Category:Official third party games|Third party game]] GCF might not be beneficial.

Latest revision as of 16:40, 21 February 2010