Okay, this changes things significantly! If the server is sv_pure 0, then the server is allowing your custom .mdl file to be loaded.
This means the problem is not the server blocking your file. The problem lies within your custom model file itself or how it's interacting with the game's animation system and attachment points when it is loaded.
Here are the most likely causes when sv_pure 0 is active:
-
Bone/Rigging Mismatch: This is the most common reason for "wrong animations" and models "flying away".
- Source Engine animations are tied to specific bone names and hierarchies within the model.
- If the bone names, their parent-child relationships, or their initial positions/rotations in your custom model differ from the standard TF2 viewmodel skeleton that the game's animations are designed for, the animations will look completely wrong, distorted, or cause the model to appear in the wrong place or "fly away".
- Even a small difference in a bone name ("weapon_bone" vs "weaponbone") or a slight change in hierarchy can break everything.
-
Incorrect Animation Data or Sequences:
- Your custom model's
.mdl file contains the animation data (either embedded or referencing external .ani files).
- The
.qc file used to compile the model defines "sequences" which link game activities (like ACT_VM_DRAW, ACT_VM_PRIMARYATTACK) to specific animation data within the .mdl.
- If the animation data you've included is corrupted, incorrectly exported, or if the sequences in your
.qc file are misconfigured, the model won't play the correct animations, or the animations will look broken.
-
Attachment Point Issues:
- Viewmodels often have attachment points (
$attachment in the .qc file) where weapons, magazines, or other effects attach.
- If these attachment points are missing, misnamed, or located incorrectly in your custom model, attached items (like a weapon barrel for particle effects, or a magazine during a reload) will appear detached and "fly away".
-
Compilation Errors:
- While Studiomdl (the tool used to compile Source models) usually gives errors if the
.qc is wrong, sometimes it can compile with warnings or subtle issues that result in a corrupted or malformed .mdl file, especially if there are problems with the source files (like .smd or .dmx).
Troubleshooting Steps:
-
Verify Bone/Rigging:
- This is the most critical step. You need to ensure the bone names, parenting, and initial transforms in your custom model's source files (like
.smd or .dmx) exactly match the default TF2 viewmodel skeleton for that weapon type.
- You might need to decompile the default TF2 viewmodel for the weapon you're modding to see its exact bone structure.
- Compare your model's skeleton rigorously. Even capitalization matters.
-
Review Your QC File:
- Carefully check all
$sequence definitions. Ensure they are pointing to the correct animation data and are linked to the appropriate ACT_ activities (e.g., ACT_VM_PRIMARYATTACK, ACT_VM_RELOAD).
- Verify any
$attachment lines for weapons or effects. Check their names and coordinates/bones are correct relative to your model.
-
Check Source Animation Files:
- Ensure the animation files you used to create your custom model are correct and were exported properly. Sometimes animation export settings can cause issues.
-
Re-compile the Model:
- Use the correct version of Studiomdl (usually found in your TF2 game files or Source SDK base) to compile your
.qc file.
- Pay close attention to any warnings or errors during the compilation process. Even warnings can sometimes indicate problems.
-
Isolate the Mod:
- Make sure your custom viewmodel is the only custom file in your
tf/custom/yourmod/models/... directory that could affect that specific weapon's viewmodel. Other conflicting mods could potentially interfere, although this is less common for viewmodels.
-
Test in HLMV Again:
- Load your compiled
.mdl in HLMV.
- Go to the "Sequences" tab and play through the various animations (draw, idle, attack, reload, etc.).
- Does it look correct in HLMV? If it looks wrong even in HLMV, the problem is definitely with your model/animation data or compilation. If it looks correct in HLMV but wrong in-game on a
sv_pure 0 server, it's still likely a bone/attachment issue that only manifests during live gameplay bone transformations, or a subtle compilation/sequence error.
The "fly away" behaviour strongly suggests an issue with bone rigging/weighting or attachment points. When the game tries to move a bone or attach an item, and the bone is missing, misnamed, or weighted incorrectly in your model, it can result in the model or attached part jumping to a default or incorrect position.
Since sv_pure 0 is confirmed, focus entirely on the integrity and correctness of your custom model's .mdl file and the source files used to create it.