Fire light

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Jack oneill

New Member
Sep 4, 2001
81
0
0
42
France
atlantis.jolt.co.uk
Hi,

i have a problem with my weapon code. I'm coding a HK mark 23 socom with a sound suppressor. I would like to enable the player to add it or not. It's pretty easy to code in general, but there is something i don't understand...

I wanted to make something like that : when you have the module, there is no muzzle flash, nor flash light when you shot. Ands when you don't have the module, there is. But, i can't delete this ****ing flashlight. I don't understand since there is nothing in my code which add a such light.

For other weapon, i've created a light called ATFireLight which is spawned when firing. But i've overidden the tracefire function in order not to spawn it. But it don't works.

Do you know if Unreal spawn a light when a weapon shot ? I think not since i had to make this light before...

Any idea ?
 

Papapishu

我是康
Jun 18, 2001
2,043
0
0
43
void
www.vovoid.com
Simple (I think) in the weapon class (tournamentweapon's parent) you get the answer...
It says there:
Code:
// Muzzle Flash
// weapon is responsible for setting and clearing bMuzzleFlash whenever it wants the
// MFTexture drawn on the canvas (see RenderOverlays() )
The Muzzle flash is drawn in the function renderoverlays, and if you set the variable bDrawMuzzleFlash to false, it won't be drawn at all...
So when you use the surpressor, set bDrawMuzzleFlash to false and when it's of set it to true
You can also design your own muzzleflash texture, and assign MFTexture to it...
 

Jack oneill

New Member
Sep 4, 2001
81
0
0
42
France
atlantis.jolt.co.uk
not this

No no no :) It's not the muzzle flash. If it were, i would have use the word muzzle flash.

The problem (and that's why it is a problem :) is that i got a light which lit around the player when he shot. For exemple, if you are near a wall in the darkness, the wall will be lightened.

I don't understand why since i don't know any piece of code in UT which make it...
 

Blödsinn machen

cannon fodder
Dec 4, 2001
68
0
0
Switzerland
dwmade.stormpages.com
if you have an instant hit weapon (such as the Enforcer), then look in the ProcessTraceHit function; it could be that the weapon is spawning something that has ambient light, such as a shell case, or something like that. or if your weapon fires projectiles then it's quite probable that the projectile has some sort of light set. look at the code