Skaruts

Generic Quake C file

Oct 30th, 2011
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // READ FIRST: This qc is a work in progress and probably the simplest you can get and will work
  2. // fine with any simple model (that has no animations, no jiggle bones, or any other more
  3. // advanced features).
  4. //
  5. // This should be a good start if you are going through your very first simple hat
  6. // or c_weapon for TF2. This will not work for prop models as it needs a few changes for that.
  7. //
  8. // For weapons you will need to change the compiler destination folders and $cdmaterials folders
  9. // accordingly.
  10. //
  11. // For more qc commands refer to:
  12. // http://developer.valvesoftware.com/wiki/Category:QC_Commands
  13. //
  14. // Happy compiling!
  15. //
  16. //--------------------------------------------------------------------------------------------
  17. //
  18. // Let's assume you'd be making a soldier hat called my_hat.
  19. // You'd create a folder called "my hat" (optional name) and have these files in it
  20. //
  21. // C:\TF2 Works\my hat\my_hat.smd         // Your exported model
  22. //             LOD1_my_hat.smd    // Lower poly version
  23. //             LOD2_my_hat.smd    // Even lower poly version
  24. //                     idle.smd           // Get this from any decompiled model
  25. //                     my_hat.qc          // Name is arbitrary, but you should stay organized.
  26.  
  27.  
  28. // Lines with two forward slashes (//) are comments and will be ignored by studiomdl.
  29.  
  30.  
  31. // Work folder, where your smd files are
  32. $cd "C:\TF2 Works\my hat\ "
  33.  
  34. // Folder where your compiled files will be saved. You can specify the folder in which the game
  35. // looks for models, as that will make things easier if you need to recompile. Otherwise you
  36. // will have to copy/paste the files every time.
  37. $modelname "player/items/soldier/my_hat.mdl"
  38.  
  39. // Name of your smd model file (not sure about the 1st quoted part - seems to not affect it)
  40. $model "my hat" "my_hat.smd"  
  41.  
  42. // LOD models will replace the original model as you get more distant (ommit this if you
  43. // don't have them) At least one LOD is included in Valve's requirements, though)
  44. $lod 10     //some distance (around 4-5 meters)
  45. {
  46.   replacemodel "my_hat_hat.smd" "LOD1_my_hat.smd"
  47. }
  48.  
  49. $lod 25     //even more distance
  50. {
  51.   replacemodel "LOD1_my_hat.smd" "LOD2_my_hat.smd"
  52. }
  53.  
  54.  
  55. // Where you will place the materials (whatever you put here will determine where your model
  56. // will look for the vmt)
  57. $cdmaterials "models\player\items\soldier\ "
  58.  
  59. // Not very sure. Creates a hitbox around a bone. I believe "default" will make it be auto-generated.
  60. $hboxset "default"  
  61.  
  62. // Not very sure either. This line can be omitted in certain circunstances, but that's another
  63. // story. Usualy I get these values from the qc file from a similar model to mine.
  64. $hbox 0 "bip_head" -5.119  -8.492  -6.836  3.941  0.000  3.310
  65.  
  66. // Material surface properties - this affects the sounds the model makes when colliding
  67. // or getting hit - http://developer.valvesoftware.com/wiki/Material_surface_properties
  68. $surfaceprop "cloth"
  69.  
  70. // Uncoment this line if you're making a weapon. simply delete the two slashes behind it.
  71. // I would advise getting the values from the qc of an existing model similar to yours
  72. // $illumposition -1.634 -1.268 11.460
  73.  
  74. // $sequence specifies model animations. In this case there's none, so you only need
  75. // the idle one.
  76. $sequence idle "idle" fps 30.00
  77.  
  78. // You can make a colision model, export it as my_hat-phy.smd (name is optional)
  79. // or you can use the original model as its own collision model. Whatever the case, the
  80. // name of the collision model file is specified here. Both options seem to work fine.
  81. // The parameter settings were taken from a Valve hat, and seem to work fine with others
  82. $collisionmodel "my_hat.smd"
  83. {
  84.     $mass 5.0
  85.     $inertia 1.00
  86.     $damping 0.00
  87.     $rotdamping 0.00
  88. }
Advertisement
Add Comment
Please, Sign In to add comment