Yep, that's pretty much how I made the flash appear.
The way the POV model's muzzle flash worked was by using a keyframe trick that made a node teleport instead of moving. The POV model had a single face mesh that had the muzzle flash texture and use attached to the weapon mesh of the weapon. It placed the mesh in the back of the gun (to keep out of sight) by making all the animations that weren't for firing (like the mounting, dismounting, and reloading animations) and made the muzzle flash appear in front of the gun during a gun fire animation and made the flash teleport behind the weapon after the key ran for one frame. To make a node teleport instead of moving, I just removed the differentials setting for the entry for the entries that caused the muzzle flash to move. I also used this method before for the clip reloads of the weapons.
For the external view. I made two external meshes for the weapon where one of them had the flash attach to it while the other gun does not have the flash on it. I then made it that when the player shot the gun, the external weapon mesh switches to the mesh with the muzzleflash and then used a timer to set it back to the non muzzleflash mesh after 0.05 seconds. I also made it set back to the non muzzleflash mesh whenever the player switched to another gun (deselected), when the player releases the fire button (deactivated) and when the player dies (killed) in case the timer isn't reached when these situtations occur (BTW, I used the killtimer cogverb too to make sure the timer isn't called when the above 3 occur). For the fast firing guns, I don't use a timer since that method will cause lag (forcing other players to update you weapon's muzzleflash every 0.05 is BAD) so I used a multi celled animation for the muzzleflash texture (cel 0 being the flash textures and cel 1 being a blank black image) and used the MaterialAnim cog verb to make the texture animate (setting the framerate for that texture to 10 works best). Then, when the gun begins to fire using the activated message, I made the gun use the muzzleflash mesh and then turned it back to the non muzzleflash mesh when the player stopped firing.
Well, that's basically how I did it. I really should write a tutorial for this effect but I never got around to it.
-- SavageX
------------------
"Everyone dies." - Boba Fett
"Be kind to nerds because one day... one will be your boss."
SavageX's Editing Corner