The QC (QuakeC) file is a script used by the Source Engine to compile models. It contains instructions and settings that define how the model is compiled, its associated textures, animations, and other properties. Modifying the QC file is often necessary when preparing a model for recompilation after editing it in Blender. Here's a detailed guide on how to modify a QC file:
Structure of a QC File
A typical QC file may include several sections, such as:
- Model Declaration: Specifies the path and name of the model.
- Scale, Sequences, and Animations: Sets the scale of the model and defines animations.
- Texture and Material Settings: Links the model to its textures.
- Physics Settings: If applicable, defines the collision model and physical properties.
- Include Files: References to other QCs or model components.
Common QC File Entries
Here’s a breakdown of common entries you may need to modify in a QC file:
1. Model Declaration
$modelname "models/your_model_name.mdl"
- Edit: Change
"your_model_name.mdl" to your desired output model name.
2. Scale
$scale 1.0
- Edit: This is the scale of the model. Change if necessary to increase or decrease the model size after editing.
3. Bodygroups and Mesh
$body "body_name" "mesh.smd"
- Edit: Point to your newly exported mesh file from Blender. Ensure the path points to your edited SMD or DMX file.
4. Texture and Material Paths
$cdmaterials "models/your_materials_folder/"
- Edit: Ensure this path reflects where your materials will be in the SFM directory. It should correspond to the folder with your compiled textures.
5. Sequences and Animations
$sequence "idle" "anim.smd" {
fps 30
}
- Edit: Add or modify sequences if you have new or edited animations. Ensure paths point to the correct SMD files.
6. Physics
$collisionmodel "phymodel.smd" {
$mass 10.0
$inertia 1.00
$damping 0.00
$rotdamping 0.00
}
- Edit: If your model has a collision mesh, ensure the path is correct and adjust physics properties as needed.
Example QC File
Here’s a basic example of what a QC file might look like:
$modelname "models/your_model_name.mdl"
$scale 1.0
$body "body" "your_model.smd"
$cdmaterials "models/your_materials_folder/"
$sequence "idle" "your_animation.smd" {
fps 30
}
$collisionmodel "your_collision.smd" {
$mass 10.0
$inertia 1.00
$damping 0.00
$rotdamping 0.00
}
How to Modify the QC File
-
Open the QC File:
- Use a text editor like Notepad++ or Sublime Text to open the
.qc file.
-
Edit Paths and Names:
- Update file paths to point to your modified mesh, animation, and collision SMD files.
- Make sure
modelname points to where you want your compiled model to be saved.
-
Adjust Settings:
- Change settings like
$scale, $mass, and add or modify sequences.
-
Save Changes:
- After editing, save the QC file. Ensure it stays in the same directory intended for compilation.
Using the QC File
- Compile: Use Crowbar or another Source Engine tool to compile the model using the QC file.
- Check Logs: If there are errors during compilation, check the log output for hints about what needs to be corrected in the QC file.
By following this guide, you can effectively modify the QC file to suit the changes made to your model and prepare it for recompilation into the Source Engine.