Creating a mod

From Valve Developer Community
Jump to navigation Jump to search
English (en)中文 (zh)Translate (Translate)

Setting up the directory

If you haven't done this already, create the folder source2mods inside your steamapps directory:

  • Steam\steamapps\source2mods

Inside the source2mods, create a folder, without special characters, representing your mod content. For example:

  • Steam\steamapps\source2mods\mysource2mod

Creating the mod folder.png

Copying the required files

In order to get the barebones of your mod working, copy the cfg and the webui folder from Half-Life Alyx\game\hlvr, and the files gameinfo.gi and gameinfo_branchspecific.gi to your mod folder.

Note.pngNote:If your mod is going to be flat only, you don't need to include the webui folder.

Copying the required files 2.png

Editing the gameinfo.gi

Title

Open the gameinfo.gi file. Change the title keyvalue to the name of your mod.

Warning.pngWarning:Do not change the game keyvalue, or it won't work.

Screen mode

Below the first keyvalues, add a screenmode key with one of the following values:

  • vr_only: It will only run in VR.
  • flat_only: It will only run in flat mode.
  • both: It can be run both in VR and flat modes.

File system

In the filesystem group, insert in the first line a new Game key and set its value exactly like your mod folder name. Modify the Mod and Write values to also match your mod folder name.

Gameinfo.png

Finishing up

Your mod now can run with source2mod. Start source2mod.exe and select your mod, or run source2mod.exe with the -game parameter and the name of your mod folder.

My source2mod menu.png