L4D2解决新图换图时所有客户端必须关闭游戏重进的方法。
本帖最后由 111ss 于 2011-7-25 19:03 编辑大家都知道L4D在2037版本以前是可以正常读取转换第三方地图的,以后由于几个NC的玩家投诉VALVE由于换图占用了过大的系统资源导致损坏了他们的电脑硬件(看样国外生活水平有限啊),这个功能被取消掉了。从此新图发展便一蹶不振,很多优秀的第三方地图也少有人问津。好了,废话不多说了,我们就着手来解决这个问题吧,即不让新图换图时占用过大的系统资源,又可以不让我们每次换图都要关闭游戏重新进入。我想这个方法应该算全球首发吧。呵呵。
NO.1第一步:
下载一个VPK格式的第三方地图,在这里我以questionableethics.vpk这个地图为例子。打开游戏目录中的BIN目录,如果你不是过于精简的版本你会在目录中发现一个VPK.EXE的文件,这个文件是VALVE提供的专门用来打包/解压VPK格式的软件。当然你也可以用别的软件打开他。比如说GCF。我们将questionableethics.vpk拖放到VPk.EXE上面,就会出现一个DOS窗口,同时显示解压进度。
NO.2:第二步:
解压完毕后。在questionableethics.vpk的所在的目录会产生一个和该VPK一样名字的文件夹,里面存放着该地图所使用到的模型,脚本,声音,等等吧。我们将该文件夹剪切到游戏主目录下。何为主目录?就是有着left4dead2.exe这个文件的目录。
NO.3:第三部:
本步是为了让游戏能在启动的时候加载该目录下的所有信息,我们打开游戏主目录下的left4dead2子文件夹。查找gameinfo.txt的文本文件,该文件原始内容如下
"GameInfo"
{
game "Left 4 Dead 2" // Window title
type multiplayer_only
nomodels 1
nohimodel 1
l4dcrosshair 1
hidden_maps
{
"test_speakers" 1
"test_hardware" 1
}
nodegraph 0
perfwizard 0
SupportsXbox360 1
SupportsDX8 0
GameData "left4dead2.fgd"
FileSystem
{
SteamAppId 550// This will mount all the GCFs we need (240=CS:S, 220=HL2).
ToolsAppId 211// Tools will load this (ie: source SDK caches) to get things like materials\debug, materials\editor, etc.
//
// The code that loads this file automatically does a few things here:
//
// 1. For each "Game" search path, it adds a "GameBin" path, in <dir>\bin
// 2. For each "Game" search path, it adds another "Game" path in front of it with _<langage> at the end.
// For example: c:\hl2\cstrike on a french machine would get a c:\hl2\cstrike_french path added to it.
// 3. For the first "Game" search path, it adds a search path called "MOD".
// 4. For the first "Game" search path, it adds a search path called "DEFAULT_WRITE_PATH".
//
//
// Search paths are relative to the base directory, which is where hl2.exe is found.
//
// |gameinfo_path| points at the directory where gameinfo.txt is.
// We always want to mount that directory relative to gameinfo.txt, so
// people can mount stuff in c:\mymod, and the main game resources are in
// someplace like c:\program files\valve\steam\steamapps\<username>\half-life 2.
//
SearchPaths
{
Game update
Game left4dead2_dlc3
Game left4dead2_dlc2
Game left4dead2_dlc1
Game |gameinfo_path|.
Game hl2
}
}
}
好了。我们修改成:
"GameInfo"
{
game "Left 4 Dead 2" // Window title
type multiplayer_only
nomodels 1
nohimodel 1
l4dcrosshair 1
hidden_maps
{
"test_speakers" 1
"test_hardware" 1
}
nodegraph 0
perfwizard 0
SupportsXbox360 1
SupportsDX8 0
GameData "left4dead2.fgd"
FileSystem
{
SteamAppId 550// This will mount all the GCFs we need (240=CS:S, 220=HL2).
ToolsAppId 211// Tools will load this (ie: source SDK caches) to get things like materials\debug, materials\editor, etc.
//
// The code that loads this file automatically does a few things here:
//
// 1. For each "Game" search path, it adds a "GameBin" path, in <dir>\bin
// 2. For each "Game" search path, it adds another "Game" path in front of it with _<langage> at the end.
// For example: c:\hl2\cstrike on a french machine would get a c:\hl2\cstrike_french path added to it.
// 3. For the first "Game" search path, it adds a search path called "MOD".
// 4. For the first "Game" search path, it adds a search path called "DEFAULT_WRITE_PATH".
//
//
// Search paths are relative to the base directory, which is where hl2.exe is found.
//
// |gameinfo_path| points at the directory where gameinfo.txt is.
// We always want to mount that directory relative to gameinfo.txt, so
// people can mount stuff in c:\mymod, and the main game resources are in
// someplace like c:\program files\valve\steam\steamapps\<username>\half-life 2.
//
SearchPaths
{
Game update
Game questionableethics //唯一的变化就是添加了我们刚才解压出来并且放到游戏主目录的第三方文件夹。
Game left4dead2_dlc3
Game left4dead2_dlc2
Game left4dead2_dlc1
Game |gameinfo_path|.
Game hl2
}
}
}
好了。到这里基本上要操作的部分就结束了,这样做的好处就是省略了换图解压新图的过程,从而节约了系统资源,对于以后地图升级和管理。我们只要删除或者覆盖该文件夹就可以了。如果想添加更多地图,方法也是一样的。如果你是开服者,无需这样做(不过任然建议你将服务器上的新地图解压出来放到ADDONS目录里,减少资源占用和加快换图速度)。次方法真针对新地图服的玩家换图必须重新关闭游戏在进入而研究出来的。未经详细测试,测试通过游戏版本:2075。
欢迎转载,请保留出处和作者信息www.l4dcn.com. 有疑问的同学贴下留言,方法很简单,无意中所得,并非什么高深技术,如任然觉的麻烦,可等待未知的未来官方发布修复补丁。
所需VPK官方工具下载地址:由正版提取,放心使用。
http://u.115.com/file/bhq8fx5z 杀花我坐么。。。支持了!
回去试试 不错的方法 好多错别字和语误。。。修正了。fenghf给加个红。嘎嘎 {:3_147:}試試去 很多优秀的第三方地图也少有人问津。好了,废话不多说了,我们就着手来解决这个问题吧,即不让新图换图时占用过大的系统资源,又可以不让我们每次换图都要关闭游戏重新进入 不太好用,不知道是不是这种方法只适合自己客户端的每次换新图不被弹出时使用?我在服务器上试,换图时还是会被弹出! 本帖最后由 111ss 于 2011-7-27 17:03 编辑
不会吧,我在局域网测试的。客户端照这个设置,另外一台服务端换图我这台机子并没有弹出啊。
服务端是2075+EST破解+插件平台,用srcds.exe开服。未做任何特殊设置。 不过任然建议你将服务器上的新地图解压出来放到ADDONS目录里,减少资源占用和加快换图速度
这一句话里的addons是sourcemod的还是材质里的。? 回复 9# gg017748
地图和插件无必然关系,都是附加内容而已 回复 10# 金城武
不过自动换地图的插件好像不支持换地图,或者说某些地图不行,
页:
[1]