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

Muzzleflash & Shell Eject Attachments - How To - A Tutorial for Counter-Strike: Source.

Explains how to make Muzzleflash, Shell Eject attachments

HOW TO MAKE MUZZLEFLASH AND SHELL EJECT ATTACHMENTS 

Before starting, make sure you already have the model ready for compile: To make the muzzleflash, before you compile the model, you must put another bone in the scene (anywhere works, but it's easiest if in front of the barrel - View Pic 1). You then give this Bone a name (say "Flash" in this case). Make sure you also know the main Bone that all the objects in your scene are parented too to (ie, when this bone moves, the rest of the gun does too), in this case we'll call it "Gun_bone". If you're using Max 09, open the "select by list" option, it will be the bone with the weapons name, not parented to any others.

In the QC File, you should add the line (or edit if there's a similar one, it will be between the lines $model and $cdmaterials) : $attachment "Flash" "Gun_bone" 0 0 0 rotate 0 0 0
What that says to the compiler that there is an attachment, in this case it's name is "Flash" (the bone we made) and it's attached to the model ("Gun_bone").
The following three numbers correspond to its position, and the final 3 are it's rotation.

Compile the model, then open up Model Viewer. When in MV, go to the Attachments tab, you should now see the name "Flash" listed, select it, and three lines (RGB) will appear in the main view. At the bottom you will notice 6 numbers, like the ones above, you modify them until you have the desired rotation and position, then copy paste the entire thing over the line you just made in the QC, then recompile. It's exactly the same procedure to make the Shell Eject function, however you simply have a different locations and bone (meaning instead of "Flash" it would be "Eject"). Example V Model QC:
$cd "E:\Source\Source\deagle\nubanim smd"
$modelname "weapons\v_pist_deagle.mdl"
$model "studio" "deag_ref_vash.smd"

$attachment "MuzzleFlash" "Deag" 2.70 -22.70 5.30 rotate 0 -180 0
$attachment "Shell Eject" "Deag" 2.30 -16.50 5.50 rotate -10 20 30

$cdmaterials "models/weapons/v_models/Vashts Deagle"
$cdmaterials "models\weapons\v_models\hands\"

$surfaceprop "default"
$illumposition -3.334 5.962 -8.123
$sequence idle1 "idle1" ACT_VM_IDLE 1 rotate -90 fps 16.00
$sequence shoot1 "shoot1" ACT_VM_PRIMARYATTACK 1 snap rotate -90 fps 40.00 {
  { event 5001 0 "1" }
  { event AE_CLIENT_EFFECT_ATTACH 0 "EjectBrass_9mm 2 100" }
}

$sequence shoot2 "shoot2" ACT_VM_PRIMARYATTACK 1 snap rotate -90 fps 40.00 {
  { event 5001 0 "1" }
  { event AE_CLIENT_EFFECT_ATTACH 0 "EjectBrass_9mm 2 100" }
}

$sequence shoot_empty "shoot_empty" ACT_VM_DRYFIRE 1 snap rotate -90 fps 40.00 {
  { event 5001 0 "21" }
}

$sequence reload "reload" ACT_VM_RELOAD 1 rotate -90 fps 30.00 {
  { event 5004 0 "Weapon_DEagle.Slideback" }
  { event 5004 16 "Weapon_DEagle.Clipout" }
  { event 5004 34 "Weapon_DEagle.Clipin" }
}

$sequence draw "draw" ACT_VM_DRAW 1 snap rotate -90 fps 30.00 {
  { event 5004 1 "Weapon_DEagle.Deploy" }
}
Lines in yellow represent the main lines worked with in this Tutorial.
1-10 of 17
1
Pages
  • 1
  • 2
Go to page:
  • Knife Kitty avatar
    Knife Kitty Joined 13y ago
    Offline
    1,708 points Ranked 24,483rd
    10 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
    10y
    thanks for tut
    expert na bity a bajty
    URL to post:
  • Hi I'm new and I'm from Peru I had to google translate it. Well it looks like you know a lot about me I could teach how to create or edit weapons for Counter Strike Source?. I would greatly appreciate it, I have the MilkShape 3d but not how to compile my models but also not much on this since I have not studied animation or anything. I await your response and help me and it looks like a good post hisiste.
    Bananite
    URL to post:
  • PaiN_Agent avatar
    PaiN_Agent Joined 13y ago
    Offline
    6,477 points Ranked 1,636th
    11 medals 1 legendary 1 rare
    • 10 years a member Medal icon
    • 6 years a member Medal icon
    • 1-5 Entries! GameBanana’s Christmas Giveaway 2014 Medal icon
    • Reached 1,000 Points Medal icon
    • Reached 2,500 Points Medal icon
    • One month a member Medal icon
    12y
    It worked. Thank you a lot :)
    PaiN avatar
    Mantra
    PaiN
    URL to post:
  • THEnub avatar
    THEnub Joined 15y ago
    Offline
    Iris Studios Flag Affiliation: Iris Studios
    42,777 points Ranked 124th
    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
    Posted by THEnub
    Posted by dddanielll What if these coordinates are already set but theres no muzzleflash? for example, chad509 mp5a5
    I don't quite understand what you mean by the last two things? You mean it's "$attachment "chad509 " "mp5a5"" But no coordinates?
    nei, when i say chad509 mp5a5, i mean the skin named that. the muzzleflash are already set but it doesnt appear
    And it is set in the QC? Copy paste the attachment line from the QC to here so I can see for myself if you don't mind. Or PM me with pics.
    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,329th
    12y
    Posted by THEnub
    Posted by dddanielll What if these coordinates are already set but theres no muzzleflash? for example, chad509 mp5a5
    I don't quite understand what you mean by the last two things? You mean it's "$attachment "chad509 " "mp5a5"" But no coordinates?
    nei, when i say chad509 mp5a5, i mean the skin named that. the muzzleflash are already set but it doesnt appear
    Daniel A.K.A. PilotDani avatar
    Mantra
    Daniel A.K.A. PilotDani
    URL to post:
  • lightswitch avatar
    lightswitch Joined 15y ago
    Offline
    28,679 points Ranked 235th
    12 medals 1 legendary 1 rare
    • 10 years a member Medal icon
    • 6 years a member Medal icon
    • Reached 1,000 Points Medal icon
    • Reached 2,500 Points Medal icon
    • Reached 7,500 Points Medal icon
    • Reached 25,000 Points Medal icon
    12y
    Posted by ZeeJ You animate with bones :o i just use the mesh :P
    All the objects you animate in a scene get a corresponding bone once its compiled into smd format.
    Dubtastic avatar
    Mantra
    Dubtastic
    URL to post:
  • THEnub avatar
    THEnub Joined 15y ago
    Offline
    Iris Studios Flag Affiliation: Iris Studios
    42,777 points Ranked 124th
    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 What if these coordinates are already set but theres no muzzleflash? for example, chad509 mp5a5
    I don't quite understand what you mean by the last two things? You mean it's "$attachment "chad509 " "mp5a5"" But no coordinates?
    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,329th
    12y
    What if these coordinates are already set but theres no muzzleflash? for example, chad509 mp5a5
    Daniel A.K.A. PilotDani avatar
    Mantra
    Daniel A.K.A. PilotDani
    URL to post:
  • THEnub avatar
    THEnub Joined 15y ago
    Offline
    Iris Studios Flag Affiliation: Iris Studios
    42,777 points Ranked 124th
    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 Igor der Schreckliche Nicely done but dont need to add a new bone you can just use the weapon as a bone that works as well and goes alot faster! But this is just fyi
    Huh, I never knew that, thanks a lot man, haha, that would definitely speed things up. I just like using a seperate bone because it makes it obvious to me that I have an attachment, since they're normally the last thing I add before release.
    I spent so much time here avatar
    Mantra
    I spent so much time here
    URL to post:
  • Igor der Schreckliche avatar
    Offline
    -10,816 points Ranked 49,696th
    4 medals 1 legendary 1 rare
    • Submitted 100 WiPs Medal icon
    • Submitted 50 WiPs Medal icon
    • Submitted 10 Skins Medal icon
    • Submitted 10 WiPs Medal icon
    12y
    Nicely done but dont need to add a new bone you can just use the weapon as a bone that works as well and goes alot faster! But this is just fyi
    I can do and edit anims ;) avatar
    Mantra
    I can do and edit anims ;)
    URL to post: