关于sfm自带的hlmv使用方法

编程入门 行业动态 更新时间:2024-10-04 09:25:17

关于sfm<a href=https://www.elefans.com/category/jswz/34/1769640.html style=自带的hlmv使用方法"/>

关于sfm自带的hlmv使用方法

由于hlmv即起源1模型查看器,启动时需要引导文件gameinfo.txt,来设置其资源管理根目录(也因为hlmv并不是一个单独的软件,它的启动需要配套的dll文件,因此才需要引导文件。)

下面是gameinfo的示例

下列代码来自SourceFilmmaker\game\usermod中的gameinfo.txt文件

"GameInfo"
{game	"Source Filmmaker [Beta]"gamelogo 1type multiplayer_onlynomodels 1nohimodel 1nocrosshair 0hidden_maps{"test_speakers"		1"test_hardware"		1}nodegraph 0SupportsDX8     0FileSystem{SteamAppId				1840		// This will mount all the GCFs we need (240=CS:S, 220=HL2).ToolsAppId				1840		// 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.txtSearchPaths{Game				|gameinfo_path|.Game				tf_moviesGame				tfGame				left4dead2_moviesGame				hl2Game				workshop}}ToolsEnvironment{"Engine"	"SFM""ToolsDir"	"../sdktools"	// Default Tools path. NOTE: This is relative to the mod path.}
}

您可以看到在最末的SearchPaths属性组中,每一列的属性都是Game,其值代表:

1、|gameinfo_path| 意为引导文件自身路径,但只写这一个是不行的,后面说原因。

2、例如 <tf_movies> 等 指代了引导文件上级目录中的文件夹路径

hlmv运行原理:

1、启动hlmv.exe
2、通过命令行参数(或者通过crowbar工具设置set up game项中的Gameinfo路径启动)寻找gameinfo.txtSearchPaths属性组,将引导路径加入准使用路径。
3、在准使用路径中搜寻script文件夹,并依次开启其中的dll库文件,将库中的资源载入内存中。
4、载入库过程中,如果遭遇dll文件缺失(这就是为什么不能只写|gameinfo_path|,有可能引导文件自身目录内不包含需要的所有dll),则报错并闪退,如果全部载入成功,则显示图形化界面,进入可操作模式,此后则可以加载全电脑中任意目录下的模型。

(一般情况下是可以加载任意地方的的模型,但仍有几率会加载失败,因此保险起见,还是请将您的模型放入SearchPaths属性组所包含的路径下在进行查看)

遇到如下报错解决办法

Unable to find gameinfo.txt

Unable to find gameinfo.txt 是指在运行原理步骤2中未指定正确的gameinfo.txt文件所致,需要重新指定为usermod文件夹中的gameinfo.txt文件即可解决。

更多推荐

关于sfm自带的hlmv使用方法

本文发布于:2024-02-28 09:24:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1769044.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自带   使用方法   sfm   hlmv

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!