cassius Posted May 23, 2016 Share Posted May 23, 2016 Whats the best way to get a muzzleflash for a gun. I see that there is a muzzleflash texture with the engine but can't figure how to use it. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
macklebee Posted May 23, 2016 Share Posted May 23, 2016 Look at the FPSGun.lua script located in the 'Scripts/Objects/Weapons' folder. It shows exactly what you are asking for - applying the muzzleflash material to a sprite. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
cassius Posted May 23, 2016 Author Share Posted May 23, 2016 Forgot to mention I am using c++ but I will take a look. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
macklebee Posted May 23, 2016 Share Posted May 23, 2016 Forgot to mention I am using c++ but I will take a look. The engine commands are the same between lua and C++. If you are using C++, then you should be able to decipher lua. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
cassius Posted May 23, 2016 Author Share Posted May 23, 2016 Yeah. I can understand it ok. Looks a lot more comprehensive than I intended but I can use it Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
f13rce Posted May 24, 2016 Share Posted May 24, 2016 My way is to have a 3D model with a muzzle flash already attached to it, you can give it a name too like "MuzzleFlash". Then in the engine after loading the model, you can keep an Entity pointer to the muzzle flash by using something like FindChild. After that, all you have to do is muzzle->Show() and muzzle->Hide(). For extra effect, you can attach a light to the muzzle object by creating a light after loading the model. You should then make the muzzle object the parent of the light so it doesn't go out of place. Quote Using Leadwerks Professional Edition (Beta), mainly using C++. Windows 10 / Linux Mint, Visual Studio 2017. GPU: NVidia GeForce GTX970, CPU: Intel i7 7700K @ 4.20 GHz Previously known as Evayr. Link to comment Share on other sites More sharing options...
cassius Posted May 24, 2016 Author Share Posted May 24, 2016 Thanks evayr Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
cassius Posted May 28, 2016 Author Share Posted May 28, 2016 I have a sprite and a light set up for my muzzleflash although its not quite in correct position yet. Whats the best way to make it flash on and off? Will show hide be ok or do I need to put a delay between them? Thanks. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.