Momentum Mod Playtest

Momentum Mod Playtest

Not enough ratings
How to use weapons from other games
By VortexPDX
Want to bring over your favorite Source game weapon to Momentum Mod? You can! Like with other Source games, we support asset modding and you can define or override models, materials, sounds and/or particles, so long as you set them up correctly.
Momentum Mod supports assets from HL2, CS:S, CS:GO, TF2 and Portal 2, and if you have them installed through Steam, it'll even mount them for you!

In the following guide, I'll try to showcase the process you have to go through to get the Soldier's Festivized Australium Rocket Launcher to replace Momentum's Rocket Launcher, a Shotgun with the Deadly Daffodil Killstreak Sheen to replace the Momentum Shotgun, and the Market Gardener to replace the Knife.
   
Award
Favorite
Favorited
Unfavorite
Before we begin...
This guide assumes you have a small understanding of Source's internal filesystem, you may have heard of the custom folder in TF2, or the addons or sdk_content folder in most other games if so.
It also assumes you know how to use a computer and have enough logical skills to navigate a potentially new program for you, just based on focused instructions.

What we'll need:
  • Crowbar
  • A text editor of your choice (I'll be using VSCode).
You should also set up Momentum as a game for Crowbar.
  • Switch to the "Set Up Games" tab.
  • Click on Add and fill up the form as it instructs you.
  • That's it, you can now compile models for Momentum Mod.
[Hard] - Bringing over the Festivized Australium Rocket Launcher
(c_models with skins and bonemerged cosmetics) CS:GO | TF2
"There's difficulty levels to this?" you may ask, well, different games handle their first person and third person weapon models in different ways. Having Momentum Mod support all of them would make the system we do have messier. Depending on the game you want use assets from, you'll have to get your hands dirty with some good ol' Source modding.

In TF2, the weapons are a static model in the sense that they carry no animations, instead, the player's first person model (the viewmodel) is the class' hands, over which the weapon is bone-merged in. Then the game fires the correct animations on the hands to have it display the draw, idle, shoot or whatever-else sequences.
This system is referred to as "c_model" (I think the 'c' stands for combined, as you reuse the world model in first person).

NOTE: Momentum has support for this system, however, it is currently broken, so we'll have to modify the weapon to instead use the v_model system (HL2).

What we'll be doing
  • We'll have to compile a manual merge of the weapon, the cosmetic it has and the arms to a new view model.
  • Since TF2 picks the skin to use through code, and we can't do that with a simple weapon script in Momentum, we'll be making the Australium and the RED Soldier skin the default.
Remember: This guide will not teach you the specifics of this process, I will assume you have basic Source engine modding skills. It's not complicated, but you can get lost in the sorse if you experience an issue not covered in this guide

Step 1: Unpacking the models from TF2's VPKs
The stuff we need is located inside the tf2_misc VPK, open tf2_misc_dir.vpk with Crowbar and navigate to
models/weapons/c_models/
once there, extract c_soldier_arms.*, c_soldier_animations.mdl, c_rocketlauncher/c_rocketlauncher.* and c_rocketlauncher/c_rocketlauncher_festivizer.* files to a temporary folder of your choice. You can do this by just selecting the files and dragging them to the place you picked.

Once done, go to Decompile, and open the folder.
Set up the Output to: folder to whatever is best for you.
Ensure that under the "Re-Create Files" section you have "QC file", "Reference mesh SMD file", "Bone animation SMD files" and "Place in 'anims' subfolder" ticked.
On the "Options" section, I recommend ticking "Folder for each model" for organization sake
Hit Decompile, a new folder with the source files for the models should have been spat out.
Open c_soldier_arms/c_soldier_arms.qc with your text editor.

You'll be jumpscared by a wall of text, no worries, we won't be looking at it for too long.

Step 2 - Working with the source files.
We're gonna have to modify a few of the commands here:
  • $modelName "weapons/v_models/v_festivized_australium_rocketlauncher.mdl"
    or whatever you want, just remember where you're placing it.

  • Swap $bodyGroup block for
    $body body c_soldier_arms $body rocketlauncher ../c_rocketlauncher/c_rocketlauncher $body festivizer ../c_rocketlauncher_festivizer/c_rocketlauncher_festivizer
  • $CDMaterials for
    $CDMaterials "models\weapons\w_rocketlauncher" $CDMaterials "models\weapons\c_models\c_rocketlauncher\" $CDMaterials "models\weapons\c_items\" $CDMaterials "models\player\soldier\"
  • Add
    $renameMaterial c_rocketlauncher c_rocketlauncher_gold
  • If present, remove everything about $defineBone
  • Scroll all the way down until you hit the first $sequence line. Delete everything after that.
    Add
    $Sequence "idle" { ..\c_soldier_animations\c_soldier_animations_anims\dh_idle ACT_VM_IDLE 1 loop } $Sequence "fire" { ..\c_soldier_animations\c_soldier_animations_anims\dh_fire ACT_VM_PRIMARYATTACK 1 snap } $Sequence "draw" { ..\c_soldier_animations\c_soldier_animations_anims\dh_draw ACT_VM_DRAW 1 snap } $Sequence "reload_start" { ..\c_soldier_animations\c_soldier_animations_anims\dh_reload_start ACT_VM_RELOAD_START 1 snap } $Sequence "reload_loop" { ..\c_soldier_animations\c_soldier_animations_anims\dh_reload_loop.smd ACT_VM_RELOAD 1 loop } $Sequence "reload_finish" { ..\c_soldier_animations\c_soldier_animations_anims\dh_reload_finish.smd ACT_VM_RELOAD_FINISH 1 }
    I know, a lot of stuff just happened, as I said, I will not explain what they each do, but the VALVe Developer Wiki can do a much better job at that than I could here, so head over there to search for what the commands are able to do if you want to learn.
    One thing you should note, however, is the activities (ACT_VM_*) we defined. No matter the weapon or the sequence's name, we MUST match the activity name, otherwise the game won't know which sequence to play.
    If you want to know which ACTs are being used in a model, you can open them in HLMV and switch the View > Show Activities option on to see activity names instead of sequences in the Sequence tab.

Step 3 - Compiling the model
We just finished working with the QC file. Now, go back to Crowbar and switch to the Compile tab. In QC Input:, select the QC. On Output to:, navigate to
Momentum Mod Playtest/momentum/custom/overrides/.
You can now commit to the compile. Press the button and the program will start working with StudioMDL to get your model compiled and placed where you asked it.
If the log that was printed below doesn't show any ERROR:s, press the Use in View button. It'll jump you to that tab with info about the model we just compiled. Press View
Bam, job done! You can go to the Sequence tab to pick animations if you want to check them out now. Momentum only asks for draw, idle and shooting animations for most of its weapons, but reloading may be a requirement in the future, so we just future-proofed it by defining them here.

Step 4 - Using it in-game
Now, the easiest part, text editing. Again.
Go to the scripts/ folder for Momentum and copy weapon_momentum_rocketlauncher.txt and place it in custom/overrides/scripts. Open it to begin editing it.
Change "attach_to_hands" value to 0.
Look for the ModelData block and modify the value of the "view" to point to your newly compiled v_model. BUG! There currently is an issue with attach_to_hands that will make the viewmodel attach itself incorrectly to your camera, as a workaround, assign the model to "view_side" and "world" key as well!
You could also edit the QC file you just made to create the world model version, that is, the weapon without the hands, but that's out of the scope of this guide.
With that done, save the file and launch the game. Then join a Rocket Jump map...
And reap the fruit of your efforts
[Intermediate] - Market Gardener
(c_models) CS:GO | TF2
What we'll be doing
  • We will have to decompile the c_model and the Soldier's arms. I'll omit precise steps here as we already did this on the last section.
Step 1 - Decompiling the weapon
The weapon is located in models/weapons/c_models/c_market_gardener/. Extract all the files to your working directory.
If you already followed how to get the Rocket Launcher working, you already have the Soldier's arms decompiled! Now we build that QC file to make the final v_model we can use.

Step 2 - Compiling the viewmodel
For convenience, separate your working directory from the rest of your decompiles, that way you can navigate the folders Crowbar creates and its files without getting lost on where things are.
For that effect, I made the directory market_gardener/ and renamed a copy of the QC file we just got to v_market_gardener.qc.
Then, all we have to do is make these edits:
$ModelName "weapons/v_models/v_market_gardener.mdl" $Body market_gardener ../c_market_gardener/c_market_gardener $body soldier_arms ../c_soldier_arms/c_soldier_arms $CDMaterials "models\weapons\c_items" $CDMaterials "models\player\soldier\" $CDMaterials "models\weapons\w_rocketlauncher" $Sequence "s_draw" { ../c_soldier_animations/c_soldier_animations_anims/s_draw ACT_VM_DRAW 1 } $Sequence "s_idle" { ../c_soldier_animations/c_soldier_animations_anims/s_idle ACT_VM_IDLE 1 loop } $Sequence "s_swing_a" { ../c_soldier_animations/c_soldier_animations_anims/s_swing_a ACT_VM_HITCENTER 1 snap } $Sequence "s_swing_b" { ../c_soldier_animations/c_soldier_animations_anims/s_swing_b ACT_VM_HITCENTER 1 snap } $Sequence "s_swing_b2" { ../c_soldier_animations/c_soldier_animations_anims/s_swing_b ACT_VM_MISSCENTER 1 snap } $Sequence "s_swing_b3" { ../c_soldier_animations/c_soldier_animations_anims/s_swing_b ACT_VM_SWINGMISS 1 snap } $Sequence "s_swing_c" { ../c_soldier_animations/c_soldier_animations_anims/s_swing_c ACT_VM_SWINGHIT 1 snap }
Again here, notice the ACTs being renamed. Don't forget to check this part on any other weapons you plan porting!
And that's it! Next step would be compiling it back, but I already covered how to do that in the last section, so take a look if you skipped that part. Instead, we'll jump straight into writing the weapon script next, but this time we'll be adding the sounds the TF2 shovel makes.

Step 3 - Creating the weapon script
After we got our weapon_momentum_knife.txt script ready to go in our custom/overrides/scripts and with the updated "view" key to our newly compiled model, we need to get sounds working with the weapon.

Oct. 5 2025: Some sounds do not play from the weapon, so sound overrides may not work for those. It's definitely the case for the knife, so don't worry if they don't work for you. I'll keep this warning up until we confirm it's been fixed!


Just below the ModelData block we worked on, is SoundData { overrides { } }. At the moment it's empty, so we have to investigate what sounds the weapon will call for and assign it the new sound script entry we want to use.
Navigate to momentum/scripts/server_weapon/, here the game stores all the trusted weapon scripts.


DO NOT MODIFY THESE, not only will you lose your edits after game updates, but you'll also mark your game as untrusted, and won't be able to submit runs in the future or even run the game until they can be verified.



Just open the knife script and take a look at what it says in SoundData { }. Copy the definitions over to your script, but inside overrides { }.
Having done that, go back to momentum/scripts/ and open game_sounds_weapons_tf.txt. Search for the Shovel sounds and replace your weapon script entries to these Weapon_Shovel* definitions instead. Like so:
SoundData { Overrides { "deploy" "Weapon_Shovel.Draw" "swish" "Weapon_Shovel.Miss" "stab" "Weapon_Shovel.MissCrit" "hit" "Weapon_Shovel.HitFlesh" "hit_wall" "Weapon_Shovel.HitWorld" } }

And we're done! You may now test in-game.
[Easy] - Shotgun with Deadly Daffodil Killstreak Sheen
(v_models with skins) HL2 | CS:S
What we'll be doing
  • We already have a v_model we can use for Momentum directly, no need to decompile anything.
  • TF2 enables certain features of the material the weapon uses through something called AnimatedWeaponSheen, an effect that highlights the weapon as the player stacks up kills. We'll be hardcoding it to on for Momentum, as we don't implement that proxy in game code.

Step 1: Extracting the shotgun materials
Using Crowbar, we open tf2_misc_dir.vpk, then navigate to the place it's stored in: materials/models/weapons/v_shotgun/v_shotgun.vmt.
We need to make Momentum override the version we're about to create, so we copy the file structure and the file itself to our custom/overrides/ folder. With that done, we can make our changes.

Step 2: Editing the VMT file
  • We'll have to remove $baseMapAlphaPhongMask, $phong*, $lightWarpTexture and $rimLight*. This is because of a shader incompatibility between $envMap and $phong. We could work around it, but that's more complicated than the intended difficulty of this section.
  • Change the $sheen* material parameters references to be $env* instead, that means $sheenMap becomes $envMap, $sheenMapMask to $envMapMask and so on.
  • While we're here, we should remove unsupported parameters and proxies, just so the game doesn't complain:
    • $glowColor
    • $*PassEnabled
    • $sheenIndex
    • $yellow
    • Invis to Multiply proxies

  • Swap AnimatedWeaponSheen to AnimatedTexture
Done! The VMT should look like this:
VertexLitGeneric { $baseTexture "models/weapons/v_shotgun/v_shotgun" $envmap "cubemaps\cubemap_sheen001" $envmapmask "effects\animatedsheen\animatedsheen0" $envmaptint "{ 242 172 10 }" $envmapmaskframe 0 Proxies { AnimatedTexture { animatedtexturevar $envmapmask animatedtextureframenumvar $envmapmaskframe animatedtextureframerate 40 } } }
Moving onto the weapon script.

Part 3 - Editing the Shotgun weapon script
Last thing we have to do is make our Shotgun override.
Copy scripts/weapon_momentum_shotgun.txt and drop it in your custom/overrides/scripts.
Change the "view" key to store "models/weapons/v_models/v_shotgun_soldier.mdl" in place of the Momentum model.
Save it. We can now test it in-game!


Closing notes
So that's it, as you can see, it's not terribly difficult, but it does require handling a lot of files. That's just how Source works.

In the future, Momentum will have a cosmetic system that could support items from other games, but it hasn't been properly discussed nor fleshed out, so no promises on that last bit. But the cosmetic system for original items is planned.

What about weapon <model/particle effect/sound> from <game>?
Same method and tools, if not slightly different steps. Hopefully you can extrapolate the instructions to your situation. Just need to know how to get the source files and how Momentum wants to use them. We're still on Source Engine, so if you can manage to find instructions for at least SDK 2013 games/mods, you can almost guarantee it'll work in Momentum too.
4 Comments
mooch 9 Oct @ 2:48am 
okay thanks W devs
sam sulek 8 Oct @ 7:53am 
nice guide
VortexPDX  [author] 6 Oct @ 8:04am 
At the start of each section I say where those instructions can apply. It isn't just for TF2.
If you mean CS:S, try the easy section. If you mean CS:GO, try the other two, depending on if you need to replace a specific material (Hard) or not (Intermediate).
mooch 6 Oct @ 3:02am 
how to use cs knife instead of scuffed robot shit when i surf tho