How to Override Custom Assets

When the game boots, it scans the momentum/custom/ folder for VPK files and subfolders. For steam users, this will be

Steam/steamapps/common/Momentum Mod/momentum/custom/

under the steam install path.

Each VPK and subfolder is added as a “search custom”, meaning that the files inside them will override the default game’s files. Using this is recommended over modifying the game’s files, as the custom folder will persist when installing an update or using Steam’s “verify integrity of game files” feature.

File Structure Examples

Here are some examples of correct file structure:

  • momentum/custom/some_mod.vpk
  • momentum/custom/another_mod.vpk
  • momentum/custom/my_custom_stuff/
  • momentum/custom/my_custom_stuff/models/custom_model.mdl
  • momentum/custom/my_custom_stuff/materials/custom_material.vmt
  • momentum/custom/my_custom_stuff/materials/vgui/custom_ui_thing.res

In these examples, some_mod.vpk, another_mod.vpk, and my_custom_stuff will be added as search customs.

Some examples of incorrect file structures are:

  • momentum/custom/models/custom_model.mdl
  • momentum/custom/materials/custom_material.vmt

In these examples, models and materials are search customs, meaning that custom_model.mdl and custom_material.vmt exist at the root of the game’s virtual filesystem instead of in their appropriate folders.

Example - Overriding Weapon Script

Weapon Model Comparison

Inside momentum/custom/overrides/scripts/ there are some weapon script overrides available. For these overrides to take effect they need to be renamed to match the file they are overriding in momentum/scripts/.

For example, renaming weapon_momentum_stickylauncher_tf2.txt to weapon_momentum_stickylauncher.txt within momentum/overrides/scripts/ overrides the sticky launcher script in momentum/scripts/. This replaces the momentum default sticky launcher to be the one from TF2.

Weapon scripts can be reloaded from within the game by using the console commands weapon_reload_script_current and/or weapon_reload_scripts.

Example - Overriding Speedometer Position

Centered Speedometer

Gamemode specific speedometer layouts can be set in momentum/cfg/speedometer.vdf (see the guide for gamemode specific configurations).

The resource file for the speedometer is speedometer.res, located in momentum/resource/ui/. Copy this file to momentum/custom/overrides/resource/ui/ to override the game’s base file. From this you can modify each speedometer’s position, font, width, background color, etc.

For example, changing the "ypos" field under "HudSpeedMeter" changes the vertical position of all speedometers. To completely center hud elements, they will have to be moved upwards by half their height. A good value to center the speedometer with the default font is "c-8", which sets the speedometer 8 pixels (half the height of the default font text) above the center.

Reloading Within the Game

To reload all control resource files, including the ones you are overriding, use the command hud_reloadcontrols.

Performance

Mounting a subfolder is less efficient than a VPK, since the engine has to make a call to the operating system to search the folder each time it needs to open a file. For optimal load times use VPKs, since they can be searched by the engine much more efficiently.