Deus Ex Clan [A]lpha
homeabout usprojectsmembersmatches
join uschallenge usdownloadsforum
Knowledge Base

Muzzle flash tricks

home / Knowledge Base / Modeling / Muzzle flash tricks

There's lots of confusion about how to make muzzle flashes in DX modelling. I'll show you the easiest way.

  1. First you have to make a flat panel in the tip of your weapon's 3rd and First person models. It has to be considerably medium-sized.
  2. Then, move that muzzle flash group to the third group number (Unreal would recognize this as the 2nd group.)
  3. Then, entire this line of code in your texture area for 1st person import:

#exec MESHMAP SETTEXTURE MESHMAP=famas1 NUM=0 TEXTURE=WeaponHandsTex
#exec MESHMAP SETTEXTURE MESHMAP=famas1 NUM=1 TEXTURE=WeaponHandsTex
#exec MESHMAP SETTEXTURE MESHMAP=famas1 NUM=2 TEXTURE=BlackMaskTex
#exec MESHMAP SETTEXTURE MESHMAP=famas1 NUM=3 TEXTURE=FamasTex1
#exec MESHMAP SETTEXTURE MESHMAP=famas1 NUM=4 TEXTURE=FamasTex1
#exec MESHMAP SETTEXTURE MESHMAP=famas1 NUM=5 TEXTURE=WeaponHandsTex

Note: I used 6 groups, you must have at least 3 groups to make the muzzle flash. Also, that is just an example of texturing I used from my FAMAS; you would replace all of those textures with the names of your textures. Anyways, notice how the NUM=2 is BlackMaskTex? That's gonna be the muzzle flash.

Now, add this below your mesh mapping:

#exec MESH NOTIFY MESH=famas1 SEQ=Shoot TIME=0.01 FUNCTION=SwapMuzzleFlashTexture

This notifies Unreal to swap a different muzzle flash texture at SEQ=Shoot, with a time of 0.01. You could add multiple lines of these if you want. By the way, FAMAS is the example here; in real importing, you would replace that with the name of your model.

Optional: if you have a fire animation that requires the muzzle flash to close during a certain period of time (for example, a shotgun = then pump animation), enter this strip of code below:

#exec MESH NOTIFY MESH=famas1 SEQ=Shoot TIME=0.01 FUNCTION=EraseMuzzleFlashTexture

Note: 0.01 is not an appropriate time, but it makes the muzzle flash disappear after 1 millisecond. You could set it to however you want.

Now, you can open up your _d files (both 3rd person and 1st) in UnrealFX and select the material group "2" faces. Hit "Edit" and select "Transparent" & "2 Sided", then Unlit. Hit "Ok", then save them.

Optional: maybe perhaps you want your own custom muzzle flashes instead of boring ol' DX ones?

Alright, first of all, import them using either a TextureImport.uc or something else. Then enter this strip of coding into either your 1st person mesh or your Weapon.uc mesh (I don't know which).

simulated function SwapMuzzleFlashTexture()
{
if (!bHasMuzzleFlash)
return;
if (FRand() < 0.5)
MultiSkins[2] = Texture'CustomMuzzleFlash1';
else
MultiSkins[2] = Texture'CustomMuzzleFlash2';
MuzzleFlashLight();
SetTimer(0.1, False);
}

Where "CustomMuzzleFlash1" and "CustomMuzzleFlash2" represent the names of your custom muzzle flashes.

Alright, that concludes it for now, happy muzzle flashing!

Guide by Cat

← previousindex

Powered by [A]