Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

How To Compile World Models with 3DSMax - A Tutorial for Counter-Strike: Source.

How to compile world models for CS:S

HOW TO MAKE WORLD MODELS To make a working World model, you need to open up the SMD of the model you're replacing (extract it from the GCF then decompile it). Once open in Max, import or merge the model you've been working with, and try and make it fit as best as possible onto the previous model, this will minimize clipping when viewed ingame. Once you've got that done, you can go to the QC file and start the real work. To get it to work, you first need to edit the Physmodel that will be used, and in this case that means changing it (generally from phymodel.smd) to the same thing as your ref model (meaning p90.smd if that's the case). "$collisionmodel "phymodel.smd" {"
becomes
"$collisionmodel "w\_pist\_deagle.smd" {" Then you can compile, and test it in game. Be sure to enable cheats ("sv\_cheats 1" in console) and then switch to thirdperson ("thirdperson" in console). You can also change the angle you see by using cam\_idealdist, cam\_idealpitch, cam\_idealyaw (in console). Now odds are that it doesn't look right ingame when it's put away (it normally looks fine when held, minor tweaking may be necessary though). So you'll have to change the rotation of the weapon in the QC file by adding the line "rotate #" in the sequence line. "$sequence idle "idle" rotate -# fps 30.00" You will have to mess around until you find the right angle so that it doesn't clip through the players back. An advantage with making World models, is that the shell eject and muzzleflash attachments are normally already made. However, should they not line up correctly, you can modify them in the same manner as you did in the Muzzleflash/ShellEject section. Example of a World Model QC:
$cd "E:\Source\Source\deagle\nubanim smd\w"
$modelname "weapons\w\_pist\_deagle.mdl"
$model "studio" "w\_pist\_deagle.smd"

$cdmaterials "models/weapons/w\_models/Vashts Deagle"

$attachment "muzzle\_flash" "ValveBiped.flash" 0.00 0.20 0.00 rotate -90 0 0

$surfaceprop "weapon"
$keyvalues  { prop\_data { "base" "Metal.Small"  } } 
$illumposition -0.629 6.470 1.581

$sequence idle "idle" rotate -180 fps 30.00

$collisionmodel "w\_pist\_deagle.smd" {

	$mass 5.0
	$inertia 1.00
	$damping 0.00
	$rotdamping 0.00
}
Lines in yellow represent the main lines worked with in this Tutorial. Need Some Extra help or want someone to compile for you? PM me and I'll see what I can do.
  • Triggafingah avatar
    Triggafingah Joined 16y ago
    Offline
    1,545 points Ranked 25,304th
    8 medals 1 legendary 1 rare
    • 10 years a member Medal icon
    • 6 years a member Medal icon
    • Reached 1,000 Points Medal icon
    • One month a member Medal icon
    • 6 months a member Medal icon
    • 1 year a member Medal icon
    7y
    Thank you very much for this. Replacing the physmodel solved a consistency error that I had.
    Razer pwns. avatar
    Mantra
    Razer pwns.
    URL to post:
  • Pr0ph3cy avatar
    Pr0ph3cy Joined 16y ago
    Offline
    1,437 points Ranked 25,914th
    14 medals 2 legendary 2 rare
    • 10 years a member Medal icon
    • Returned 5000 times Medal icon
    • 6 years a member Medal icon
    • Returned 1000 times Medal icon
    • 1 post awarded Exemplary Feedback Medal icon
    • One month a member Medal icon
    12y
    I used a skin that i already knew had working world models, i added some stuff to mine, compiled it the way you say to, and it worked. Came back out of the game, fixed the vmt's so that the textures would work too, and NOW i get a consistency error...
    Formerly
    Mantra
    Formerly "Rctic".
    URL to post:
  • THEnub avatar
    THEnub Joined 15y ago
    Offline
    Iris Studios Flag Affiliation: Iris Studios
    42,777 points Ranked 125th
    19 medals 1 legendary 3 rare
    • 10 years a member Medal icon
    • 25 posts awarded Exemplary Feedback Medal icon
    • 50 posts awarded Exemplary Feedback Medal icon
    • 6 years a member Medal icon
    • Submitted 10 Skins Medal icon
    • Became a Studio Leader Medal icon
    THEnub Iris Studios Flag
    Affiliation
    Iris Studios
    12y
    Posted by shortez So I need to reduce polycount ? Hmm. After compiling in mdlstudio there wasn't any errors, there was in game... And just one more question, there wouldn't be any problem using Your tutorial to compile hacked anims (replaced weapon in anims at another) ? Because I want to learn how to compile anims :) maybe there is any video tut on youtube ?
    Maybe, or you could try some of the other CS:S/Source/HL2 modding sites to look for info. There shouldn't be any issues using my tutorial to do what you wanted, it just means more decompiling.
    I spent so much time here avatar
    Mantra
    I spent so much time here
    URL to post:
  • BrainCollector avatar
    BrainCollector username pic Joined 14y ago
    Offline
    12,921 points Ranked 686th
    18 medals 2 legendary 4 rare
    • Reached 100 subscribers Medal icon
    • 10 years a member Medal icon
    • 2nd Place - CSGO Skinning Contest Medal icon
    • 3rd Place - Homemade Skinning Contest Medal icon
    • 6 years a member Medal icon
    • Reached 50 subscribers Medal icon
    12y
    So I need to reduce polycount ? Hmm. After compiling in mdlstudio there wasn't any errors, there was in game... And just one more question, there wouldn't be any problem using Your tutorial to compile hacked anims (replaced weapon in anims at another) ? Because I want to learn how to compile anims :) maybe there is any video tut on youtube ?
    Polska krew avatar
    Mantra
    Polska krew
    URL to post:
  • THEnub avatar
    THEnub Joined 15y ago
    Offline
    Iris Studios Flag Affiliation: Iris Studios
    42,777 points Ranked 125th
    19 medals 1 legendary 3 rare
    • 10 years a member Medal icon
    • 25 posts awarded Exemplary Feedback Medal icon
    • 50 posts awarded Exemplary Feedback Medal icon
    • 6 years a member Medal icon
    • Submitted 10 Skins Medal icon
    • Became a Studio Leader Medal icon
    THEnub Iris Studios Flag
    Affiliation
    Iris Studios
    12y
    Posted by shortez I have ingame error Model models\weapons\w_rif_m4a1.mdl exceeds maxs (1.3 32.5 25.3 vs. 44.0 16.0 19.0) Model models\weapons\w_rif_m4a1_silencer.mdl exceeds maxs (1.3 33.5 25.3 vs. 44.0 16.0 19.0) Server is enforcing consistency for this file: models\weapons\w_rif_m4a1_silencer.mdl how to fix it ?
    It just sounds to me like the rifle is too odd shaped for CS:S to accept it, it thinks your cheating. Honestly, I can't think of a solution that wouldn't require taking off any scopes and such.
    I spent so much time here avatar
    Mantra
    I spent so much time here
    URL to post:
  • BrainCollector avatar
    BrainCollector username pic Joined 14y ago
    Offline
    12,921 points Ranked 686th
    18 medals 2 legendary 4 rare
    • Reached 100 subscribers Medal icon
    • 10 years a member Medal icon
    • 2nd Place - CSGO Skinning Contest Medal icon
    • 3rd Place - Homemade Skinning Contest Medal icon
    • 6 years a member Medal icon
    • Reached 50 subscribers Medal icon
    12y
    I have ingame error Model models\weapons\w_rif_m4a1.mdl exceeds maxs (1.3 32.5 25.3 vs. 44.0 16.0 19.0) Model models\weapons\w_rif_m4a1_silencer.mdl exceeds maxs (1.3 33.5 25.3 vs. 44.0 16.0 19.0) Server is enforcing consistency for this file: models\weapons\w_rif_m4a1_silencer.mdl how to fix it ?
    Polska krew avatar
    Mantra
    Polska krew
    URL to post:
  • THEnub avatar
    THEnub Joined 15y ago
    Offline
    Iris Studios Flag Affiliation: Iris Studios
    42,777 points Ranked 125th
    19 medals 1 legendary 3 rare
    • 10 years a member Medal icon
    • 25 posts awarded Exemplary Feedback Medal icon
    • 50 posts awarded Exemplary Feedback Medal icon
    • 6 years a member Medal icon
    • Submitted 10 Skins Medal icon
    • Became a Studio Leader Medal icon
    THEnub Iris Studios Flag
    Affiliation
    Iris Studios
    12y
    Posted by nubblecakes Could you give any info on altering the position of the muzzle flash bone? I can't just move the bone itself because it moves everything else around too since they're linked. I'm afraid to break the link, move it, then relink it, because I'm afraid I might royally EFF the rig up. Also, when decompiling the world model, should I tick "Do not fix Rotations on Animations?" I know I have to tick this when decompiling view models (the vanilla ones at least) so the sequence SMDs aren't screwed up in 3DS Max.
    What you do is open up Source Model Viewer, and then select the Attachments Tab. Once there, you select the correct Attachment (In your case the Muzzle Flash) and then you'll notice at the bottom of HLMV text entry boxes called "QC String", "Translation" and "Rotation" (View Screenshot 1). What you do is alter the Translation and Rotation boxes to move and rotate the Bone, and once you've found the spot, you copy paste all of the code in the "QC String" Box to your QC File, and replace the previous Attachment code (View Example of World Model QC, first yellow line). As for the Decompiling, I'm not sure. I personally always have it ticked, though it might explain why I have to rotate the physmodel and what not. But I'll go out on a limb and say it really doesn't make a difference if you do or don't tick it.
    I spent so much time here avatar
    Mantra
    I spent so much time here
    URL to post:
  • nubblecakes avatar
    nubblecakes Joined 17y ago
    Offline
    4,635 points Ranked 2,441st
    15 medals 1 legendary 3 rare
    • 10 years a member Medal icon
    • 25 posts awarded Exemplary Feedback Medal icon
    • 6 years a member Medal icon
    • Returned 1000 times Medal icon
    • Reached 1,000 Points Medal icon
    • Reached 2,500 Points Medal icon
    12y
    Could you give any info on altering the position of the muzzle flash bone? I can't just move the bone itself because it moves everything else around too since they're linked. I'm afraid to break the link, move it, then relink it, because I'm afraid I might royally EFF the rig up. Also, when decompiling the world model, should I tick "Do not fix Rotations on Animations?" I know I have to tick this when decompiling view models (the vanilla ones at least) so the sequence SMDs aren't screwed up in 3DS Max.
    URL to post:
  • THEnub avatar
    THEnub Joined 15y ago
    Offline
    Iris Studios Flag Affiliation: Iris Studios
    42,777 points Ranked 125th
    19 medals 1 legendary 3 rare
    • 10 years a member Medal icon
    • 25 posts awarded Exemplary Feedback Medal icon
    • 50 posts awarded Exemplary Feedback Medal icon
    • 6 years a member Medal icon
    • Submitted 10 Skins Medal icon
    • Became a Studio Leader Medal icon
    THEnub Iris Studios Flag
    Affiliation
    Iris Studios
    12y
    Posted by dddanielll Consistency error? btw, i dont get what you mean when you say edit the phymodel
    In Source the Phymodel (Physics Model) is what actually collides with the world. When you drop your gun, it's this that's hitting the walls, floors, etc. and the weapon is just a model that comes along for the ride. By Edit, I mean change the line. So instead of it reading: "$collisionmodel "phymodel.smd" {" it should be: "$collisionmodel "your_ref.smd" {" (the When you compile the QC, it will compile the reference model you have (meaning the one from the third line in the QC [$model "studio" "your_ref.smd"]) and make a phys model out of it. Generally speaking, you won't get many consistency errors this way, and your model will react normally ingame (meaning will land on the ground, and not 'under' it). It sounds complicated, but for us, it's really easy. It's just a matter of changing a name, and then the compiler does the rest.
    I spent so much time here avatar
    Mantra
    I spent so much time here
    URL to post:
  • dddanielll avatar
    dddanielll Joined 13y ago
    Offline
    1,367 points Ranked 26,374th
    12y
    Consistency error? btw, i dont get what you mean when you say edit the phymodel
    Daniel A.K.A. PilotDani avatar
    Mantra
    Daniel A.K.A. PilotDani
    URL to post: