S2General/Importing .VMF Files to Source 2

From Valve Developer Community
< S2General
Revision as of 00:56, 6 May 2020 by RandomCatDude (talk | contribs) (Setting Up the .VMF: fixed formatting a bit)
Jump to: navigation, search

Source 2 has a bit of a complex way of importing Source 1 maps into Source 2, but this tutorial should help you bring over your old maps after you've converted your materials and models.

Setting Up the .VMF

Your .VMF must have header data that some popular decompilers, like BSPSrc, do not include. To add this data, its recommended that you open the .vmf in the Hammer editor most appropriate for the game it's from and saving over it, as this will also help fix any data left over by BSPSrc. Alternatively, if you want a quick and dirty way to fix it, just add the following header to the .vmf: versioninfo { } viewsettings { }

Adding Source 1 Game Content

So, if you've already converted your Source 1 content to Source 2, you may think you can go along and load this .VMF file and call it a day, but unfortunately, there is some data that is lost from Source 1 to Source 2, including some important scaling data in the .VTF. So, you need to give Source 2 access to your game. The easiest way to go about this is by taking your imported model, putting it in a new mod called "modname_imported" and then putting your Source 1 materials folder unedited into your modname folder, with the gameinfo.txt file from the Source 1 game. For instance, if I want to port content from TF2, I will have to bring over the Source 1 materials and place them in Half-Life Alyx/game/tf/materials with the gameinfo.txt. I will then need to place my converted content into Half-Life Alyx/game/tf_imported/materials. After that, in my active mod for Half-Life Alyx, I will have to edit the gameinfo.gi file to include "tf_imported" and then it will recognize the materials.

Finally, I must take the .vmf and put it in a matching content folder for the modname folder, i.e. Half-Life Alyx/content/tf/maps. This is an important step because it tells the engine that we are importing a Source 1 map file.

Loading the .VMF

Now, all that's left to do is to load the .vmf file. To load it, go to File->Open, and on the bottom right, select the "Valve Map Files" dropdown and select "Source 1 Map Files (.vmf)" instead. Then, load your map file that's inside your Source 1 content directory.

If all goes well, your map should be upconverted to Source 2, and all entities available in Source 2 should be there, and the rest that aren't are attempted to be upconverted to the new versions (so Source 1 lights are automatically converted to Source 2 lights, free of charge.) You can now freely compile the map and see it in-engine.