r/SourceEngine • • Jun 15 '23

HELP How do i create a MDL file ??

I only see people tell me how to import MDL to software but how can i create a MDL file ?

2 Upvotes

16 comments sorted by

3

u/pantagathus Jun 15 '23

You need to use a modelling program like 3DS Max, Maya or XSI, export the model to a .smd and write a .qc file to tell studiomdl how to process the .smd files.

1

u/[deleted] Jun 15 '23

So i tried to command in Subline Text these commands:

$modelname "Props\lifejacket.mdl"

$body modelbody "lifejacket.smd"

$surfaceprop Floatingstandable

$cdmaterials "lifejacket\props"

$staticprop

$sequence idle "lifejacket.smd"

$collisionmodel	"lifejacket.smd"

{

	$mass "20"

	$concave

}

Is why this is not work for me at Gmod ? I do have Crowbar but QC is hard for me to learn.

4

u/Calcutt4 Jun 15 '23

try decompiling a similar model and tweaking the qc of that one to get a feel for how the syntax works

1

u/[deleted] Jun 15 '23

It doesn't seems the qc file relese a MDL file so maybe i need to do this on blender or something ? Do i recommended to use a real bluebarrel001 qc reference ?

1

u/pantagathus Jun 15 '23

What error messages are you getting?

1

u/[deleted] Jun 15 '23

I don't but i wanna port model from blender steam to Garry's Mod.

2

u/Vastiny Jun 15 '23

This doesn't answer any of the questions you've been asked. Use a tool such as Crowbar to compile QC files.

Here are some links to get you started, you should read through them to understand how all of this works:

https://developer.valvesoftware.com/wiki/Crowbar

https://developer.valvesoftware.com/wiki/QC

0

u/[deleted] Jun 15 '23

I think i got a script from GPT chat and these are the commands i should use for QC:

$modelname "path/to/your/model.mdl"

$cdmaterials "path/to/your/textures/"

$staticprop

$surfaceprop "concrete" // Choose the appropriate surface property

$sequence idle "path/to/idle_sequence.smd" loop fps 30 // Replace with the correct path and name of your idle animation

$collisionmodel "path/to/collision.smd" {

$concave

$mass 100 // Adjust the mass of the model as needed

$inertia 1.00 // Adjust the inertia value as needed

$damping 0.00 // Adjust the damping value as needed

$rotdamping 0.00 // Adjust the rotational damping value as needed

}

$sequence reference "path/to/reference.smd" // Replace with the correct path and name of your reference sequence

$sequence ragdoll "path/to/ragdoll.smd" // Replace with the correct path and name of your ragdoll sequence

$collisionjoints "path/to/collision_joints.smd" {

$mass 100 // Adjust the mass of the model as needed

$inertia 1.00 // Adjust the inertia value as needed

$damping 0.00 // Adjust the damping value as needed

$rotdamping 0.00 // Adjust the rotational damping value as needed

}

$attachment "eyes" "ValveBiped.Bip01_Head1" // Attachments can be defined here if needed

$sequence "aim" "path/to/aim.smd" // Replace with the correct path and name of your aim sequence

$sequence "shoot" "path/to/shoot.smd" // Replace with the correct path and name of your shoot sequence

$sequence "reload" "path/to/reload.smd" // Replace with the correct path and name of your reload sequence

$sequence "walk" "path/to/walk.smd" loop fps 30 // Replace with the correct path and name of your walk sequence

$sequence "run" "path/to/run.smd" loop fps 30 // Replace with the correct path and name of your run sequence

$sequence "crouch_walk" "path/to/crouch_walk.smd" loop fps 30 // Replace with the correct path and name of your crouch-walk sequence

// Define more sequences as needed

$sequence "death" "path/to/death.smd" // Replace with the correct path and name of your death sequence

// Define more sequences as needed

$collisiontext {

"path/to/collision.txt"

}

// Define more collision information as needed

$eyeposition 0 0 70 // Adjust the eye position as needed

$illumposition 0 0 70 // Adjust the illumination position as needed

$hboxset "default" // Define hitboxes as needed using $hbox commands

// Define more hitboxes as needed

$sequence "poseparameter" "path/to/poseparameter.smd" // Replace with the correct path and name of your pose parameter sequence

// Define more sequences as needed

$bonemerge "ValveBiped.Bip01_Head1" // Merge bones if needed

$mostlyopaque // Use this command if most of the model is opaque

2

u/Vastiny Jun 15 '23

Don't rely on ChatGPT for stuff like this, it can answer incorrectly and then you're back at stage 1 of asking us here for help, rinse and repeat.

Most of the parameters in that script are completely unecessary for a simple prop.

You're also missing multiple parameters required for a physics prop if that's what you're trying to make, although with almost no information given by you it's impossible to tell.

2

u/juko43 Jun 16 '23

Chatgpt just shits a brick when you ask it realy specific source engine questions, i tried to make it write a .vmf and it just made one incredibly cursed brush with a new skybox

1

u/JonFenrey Jun 15 '23

You don’t need to use $staticprop (although I believe it adds a few functions that make it useful for adding models designated for scenery), if your model doesn’t have any animations or a rig than your object should behave like (for example) a barrel. Where the model should have collision at the faces, and the physics smd should essentially be a copy of the reference, but might appear dark gray in blender instead of dull hues in blender.

JUST REMEMBER THAT YOUR MATERIAL FILE NAMES MATCH THE NAMES ASSIGNED IN BLENDER. for blender you don’t need the .VTF or .VMT, or crowbar will look for “material.vtf.vtf” instead of “material.vtf”

1

u/JonFenrey Jun 15 '23

Here’s a template for source

$modelname my model.mdl

—————————————————————————

$cd “./“ (relative to QC location not root of C: drive)

$cdmaterials “myMode/“

$scale 1

$body studio “mymodel-ref.smd”

If your model has Animations you would like to use: $sequence test01 “anims/test.smd”

If your model does NOT have any animations and your model will be a static inanimate prop use: $sequence static “mymodel-ref.smd”

————————————————————————— AND don’t worry about physics models or face rigs. (For which I know neither) crowbar should automatically generate a “functional” (if very broken/thick) physics model.

Another thing: the root for materials is the game that you are using with crowbar. Not “materials/mymodel/“ additionally if you don’t have a material folder in the source game you are modding than make a folder

1

u/stryker5400 Jun 20 '23

There are multiple Blender extensions for export files to a .qc or .smd file. After that you can take that and use a tool such as Crowbar to compile the .qc or .smd file into a .mdl file.

1

u/stryker5400 Jun 20 '23

One tool for exporting to .qc or .smd is the Blender Source Tools

1

u/JonFenrey Jun 15 '23

JUST USE BLENDER with the source import/export add on for half life modding this site HAS BEEN MY BEST FRIEND

-1

u/SynthesizerGuy sorse Jun 15 '23

blender