About the use of hlmv that comes with sfm

Because hlmvit is the source 1 model viewer, it needs a boot file gameinfo.txtto set its resource management root directory when it starts (also because it hlmvis not a separate software, its startup needs a supporting dll file, so the boot file is needed.)

Below is gameinfoan example of

The following code is from the files SourceFilmmaker\game\usermodingameinfo.txt

"GameInfo"
{
	game	"Source Filmmaker [Beta]"
	gamelogo 1
	type multiplayer_only
	nomodels 1
	nohimodel 1
	nocrosshair 0
	hidden_maps
	{
		"test_speakers"		1
		"test_hardware"		1
	}
	nodegraph 0
	SupportsDX8     0


	FileSystem
	{
		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.txt

		SearchPaths
		{
			Game				|gameinfo_path|.
			Game				tf_movies
			Game				tf
			Game				left4dead2_movies
			Game				hl2
			Game				workshop
		}
	}

	ToolsEnvironment
	{
		"Engine"	"SFM"
		"ToolsDir"	"../sdktools"	// Default Tools path. NOTE: This is relative to the mod path.
	}
}

You can see that in the last SearchPathsattribute group, the attribute of each column is Game, and its value represents:

1. |gameinfo_path|It means the path of the boot file itself, but it is not enough to write only this one. The reason will be explained later.

2. 例如 <tf_movies> 等Refers to the folder path in the upper-level directory of the boot file

hlmvOperating principle:

1. Start hlmv.exe
2. Find the middle attribute group through the command line parameters (or start through the path in crowbar工具the setting item) , and add the boot path to the quasi-use path. 3. Search for folders in the quasi-use path, and open the library files in sequence, and load the resources in the library into the memory. 4. In the process of loading the library, if you encounter missing files (this is why you can’t just write , it is possible that the directory of the boot file itself does not contain all the required files ), it will report an error and flash back. If all the files are loaded successfully, it will display graphically interface, enter the operable mode, and then you can load the models in any directory in the whole computer.set up gameGameinfogameinfo.txtSearchPaths
scriptdll
dll|gameinfo_path|dll

(Under normal circumstances, it is possible to load models from anywhere, but there is still a chance that the loading will fail, so to be on the safe side, please put your model into the SearchPathspath included in the attribute group for viewing)

Encountered the following error solution

Unable to find gameinfo.txt

Unable to find gameinfo.txtIt means that the correct gameinfo.txtfile is not specified in step 2 of the operation principle, and it needs to be re-specified as a file usermodin the folder to solve it.gameinfo.txt

おすすめ

転載: blog.csdn.net/weixin_44546865/article/details/119658281
SFM
SFM
SFM
SFM