Home   Help Search Login Register  

Author Topic: HERES THE SOLUTION TO THE MUZZLE FLASH BUG!!!  (Read 2232 times)

0 Members and 1 Guest are viewing this topic.

Black Death

  • Guest
HERES THE SOLUTION TO THE MUZZLE FLASH BUG!!!
« on: 30 Jun 2004, 21:46:56 »
Hey everyone!! 8) ;D

I am so happy today.  I have finally found a way to fix the muzzle flash bug.  It has taken me about three months of digging around and a little forum posting but now I finally have the solution(this is the solution that still produces a muzzle flash instead of just deleting it.)

  The first step of course is to obtain an addon that possesses the muzzle flash bug(it was introduced in v1.46 of OFP)

  The second step is to download Amalfi's PBO maker and PBO decryptor from here: http://www.ofpec.com/editors/browse.php?browsewhat=3&category=3_2  
This is a life saver for the job we have to do.(Thanks Amalfi!!)

  Then after you do that, I need to tell you what the problem is that is causing the muzzle flash bug.  There is a missing class in our CPPs, which is the problem we need to correct.

  The first thing we need to do is get the config.cpp file by itself so we can edit it properly.  This is what the PBO decryptor is used for.  Once you have downloaded it, open it and then select the PBO file that you need to change(the PBO file contains the config.cpp file and other things, but we are only changing the config file.)  It will then create a folder with the same name as the addon folder in the addon folder, but when you go into it, you will find the config.cpp file, which is what we need to edit.

  After you have opened the file, this is the missing class that you need to put in:

class CfgModels
{
class Default
{
sections[]={};
sectionsInherit="";
};
class Weapon: Default
{
sections[]={"zasleh"};
};
class (put weapon name here, no parentheses): Weapon{};
};

MAKE SURE YOU SAVE THE CHANGES YOU MADE!!!
You should put this right after the last #define and before the class CfgPatches(make sure there is a blank line before you start typing class CfgModels and after the last }; ).
Then after you have typed in the missing class, it is time to put it back together.  Open up the PBO maker and select the folder that contains the changed config.cpp file. But before you do this, I must warn you: It overwrites the old PBO file.  I don't know why you would want the old one, but just so that you know.  Then select the Make PBO button and you have a fixed and bug free PBO file.  :wow:

  Just place the new PBO file in your addons directory or wherever you are supposed to put it, it varies with certain addons.  Then start up the game and kill some people with you new muzzle flash free gun :gunman:   :joystick:

I would like to thank Amalfi for his tools, they are invaluable.  And I would also like to thank VTX for his help as well. ;)

If you have any questions or comments, please post them and I will respond.  I just don't want everyone else to have the same frustrations I had trying to fix this bug. >:(

I posted this on the forums because I think more people will look here than in the tutorials section.

Well, Enjoy! :toocool:

moondogy

  • Guest
Re:HERES THE SOLUTION TO THE MUZZLE FLASH BUG!!!
« Reply #1 on: 12 Aug 2004, 19:43:23 »
it does not work in my addon  :-[

Code: [Select]
// some basic defines
#define TEast 0
#define TWest 1
#define TGuerrila 2
#define TCivilian 3
#define TSideUnknown 4
#define TEnemy 5
#define TFriendly 6
#define TLogic 7

#define true 1
#define false 0

// type scope
#define private 0
#define protected 1
#define public 2

#define WeaponNoSlot            0// dummy weapons
#define WeaponSlotPrimary      1// primary weapons
#define WeaponSlotSecondary   16// secondary weapons
#define WeaponSlotItem         256// items
#define WeaponSlotBinocular   4096// binocular
#define WeaponHardMounted      65536
class CfgModels
{
     
  class Default
  {
  sections[]={};
  sectionsInherit="";
  };
  class Weapon: Default
  {
  sections[]={"zasleh"};
  };
  class BigGunMG: Weapon {};
  class BigGun_scope: Weapon {};  

};

class CfgPatches
{
   class BigGunMG
   {
      units[] = {"GunnerBG"};
      weapons[] = {"BigGunMG","BigGunMag"};
      requiredVersion = 1.75;
   };
};

class CfgAmmo
{
   class default {};
   class BulletSingle : default{};
   class BulletSingleE: BulletSingle {};   
   class BigGunBullet : BulletSingleE
   {
      hit=10;
      indirectHit=1;
      indirectHitRange=0.100000;      
   };
   
};



class CfgWeapons
{
   class Default{}
   class MGun: Default{};
   class MachineGun7_6: MGun{};
   class MachineGun7_6Manual: MachineGun7_6{};
   class biggunmg: MachineGun7_6Manual   
      {
      scopeWeapon=2;
      scopeMagazine=0;
      model="\BigGun\BigGun.p3d";
      modelOptics="\BigGun\BigGun_scope";
      optics=1;
      opticsZoomMin=0.280000;
      opticsZoomMax=0.280000;
      displayName="BigGun";
      displayNameMagazine="BigGun Mag.";
      count=200
      shortNameMagazine="BigGun";
      drySound[]={"\BigGun\m16_dry.wss",1.000000,1};
      modes[]={"Single","FullAuto"};
      magazines[]={"BigGunMag"};
      initSpeed=815;
      
      class Single
      {
         ammo="BigGunBullet";
         multiplier=1;
         burst=1;
         displayName="Single";
         dispersion=0.000200;
         sound[]={"\BigGun\pk.wss",1.000000,0.91};         
         
         soundContinuous=0;
         reloadTime=0.100000;
         ffCount=1;
         recoil="riffleSingle";
         autoFire=0;
         aiRateOfFire=5.000000;
         aiRateOfFireDistance=500;
         useAction=0;
         useActionTitle="";
      };
      class FullAuto
      {
         ammo="BIgGunBullet";
         multiplier=1;
         burst=1;
         displayName="Full Auto";
         dispersion=0.000800;
         sound[]={"\BigGun\pk.wss",1.000000,0.91};               
         
         soundContinuous=0;
         reloadTime=0.1;
         ffCount=30;
         recoil="riffleBurst3";
         autoFire=1;
         aiRateOfFire=5.000000;
         aiRateOfFireDistance=500;
         useAction=0;
         useActionTitle="";
      };
   };
   
   class BigGun: biggunmg   {      
      scopeWeapon=2;
      scopeMagazine=0;
      picture="\BigGun\Slikca.paa";      
   };

   class BigGunMag: biggunmg   {
      scopeWeapon=0;
      scopeMagazine=2;   
      picture="\BigGun\m_m60.paa";   
   };      
   
};

class CfgVehicles
{
   class All{};
   class AllVehicles:All{};
   class Land:AllVehicles{};
   class Man:Land{};
   class Soldier:Man{};
   class SoldierEB:Soldier{};
   class GunnerBG:SoldierEB{
      accuracy=1000;   
      displayName="GunnerBG";
      weapons[]={"BigGunMG","Throw","Put"};
      magazines[]={"BigGunMag","BigGunMag","BigGunMag","BigGunMag","BigGunMag"};      
   };
};

Offline Pathy

  • Former Staff
  • ****
  • I'm not a F***in llama!
    • Volcbat.
Re:HERES THE SOLUTION TO THE MUZZLE FLASH BUG!!!
« Reply #2 on: 12 Aug 2004, 23:54:29 »
Quote
class CfgModels
{
     
  class Default
  {
  sections[]={};
  sectionsInherit="";
  };
  class Weapon: Default
  {
  sections[]={"zasleh"};
  };
  class BigGunMG: Weapon {};
  class BigGun_scope: Weapon {};  

};

Should be

Quote
class CfgModels
{
     
  class Default
  {
  sections[]={};
  sectionsInherit="";
  };
  class Weapon: Default
  {
  sections[]={"zasleh"};
  };
  class BigGun: Weapon {};

};

incase you dont see the difference:

  class BigGun: Weapon {};

is the correct entry. Before you had:

   class BigGunMG: Weapon {};

However, the CFGmodels entry here needs to be the same name as the p3d in your addon folder. Hence, you cant have a p3d called BigGun and put BigGunMG: Weapon in.

Ok?  ;)

Hope that helps and also hope it makes it clear  :)

Edit: OH btw, you dont need to put the scope in there.
« Last Edit: 13 Aug 2004, 23:37:47 by Pathy »

moondogy

  • Guest
Re:HERES THE SOLUTION TO THE MUZZLE FLASH BUG!!!
« Reply #3 on: 13 Aug 2004, 18:33:40 »
 :P it works now!  :o FINNALY!! ;D

Offline Jay

  • Members
  • *
  • I'm a llama!
Re:HERES THE SOLUTION TO THE MUZZLE FLASH BUG!!!
« Reply #4 on: 23 Aug 2004, 13:48:04 »
Black Death... Everything that you wrote..well makes sense anyway. But I still have a problem. I took a Weapon .p3d (LSR_xm773.p3d) from LSR_uswp.pbo ( Not that they were problematic or anything ) and saved it as MLOD. Then i  elongated the tip of the barrel moved the muzzleflash a little forward. In the end it looked like an xm177e2, i was satisfied. Now i didnt want to mess around with the config so i made my weapon use earls C8XM4cco properties. I encrypted it as a pbo and started the game. And you were right the muzzleflash was there. So i added the line as u described it but the flash was still there. Then i tried deliteing and re pasteing the flashy thingy (zasleh) that someone had instructed before. But still the muzzleflash was there. So i did this and that with the config and in the end i just delited the line that u sayd that would help and incredebly the muzzle flash dissapeared and only appeared when the weapon was fired.
Sofar so good i left the properly working .pbo as it was. But a day later i added a M203 grenade launcher under the weapon and added all the stuff so that it would work. I didnt want to replace te previous weapon i made, so i made a new config.cpp. and now the problems began I tried what u instructed, i tried deliteing and repasteing, everything that i came up with but nothing works. The only thing that i havent tried is binarizeing the thing b'cause i cant, binarize doesnt seem to work without DOS and that i dont have, just WIN XP.

So i've got no idea what to do.

Here is my current config

// Basic def.
#define TEast 0
#define TWest 1
#define TGuerrila 2
#define TCivilian 3
#define TSideUnknown 4
#define TEnemy 5
#define TFriendly 6
#define TLogic 7

#define true 1
#define false 0

// type scope
#define private 0
#define protected 1
#define public 2

class CfgPatches
{
   class ColtCar15Carbine
   {
      units[]={SoldierCAR15M203};
      weapons[]={"CAR15M203"};
      requiredVersion=1.450000;
   };
};

class CfgModels
{
class Default
{
sections[]={};
sectionsInherit="";
};
class Weapon: Default
{
sections[]={"zasleh"};
};
class CAR15M203: Weapon{};
};

class CfgWeapons
{
   class Default   {};
   class MGun: Default {};
   class GrenadeLauncher: Default{};
   class C8XM4M203: GrenadeLauncher{};      
       
        class CAR15M203 : C8XM4M203
   {
      
      scopeWeapon = public;
      scopeMagazine = private;
                autoreload=1;
      model="\CAR15M203\LSR_xm177M203.p3d";
      modelOptics="\Conf\BASAimpointSight.p3d";
                cursorAim = "\BAS_Weap\Optics\laser_dot.paa";
      displayName = Colt Car-15 M203;
   };
    };
};

Offline Pathy

  • Former Staff
  • ****
  • I'm not a F***in llama!
    • Volcbat.
Re:HERES THE SOLUTION TO THE MUZZLE FLASH BUG!!!
« Reply #5 on: 23 Aug 2004, 13:53:57 »
When you say you did everything he said, you were wrong  :)

Once again, CFG models MUST be the same name as the model.

This is wrong:

class CfgModels
{
class Default
{
sections[]={};
sectionsInherit="";
};
class Weapon: Default
{
sections[]={"zasleh"};
};
class CAR15M203: Weapon{};
};


Because its not the name of the model. If your P3d was called CAR15M203 there would be no problem. However, your model is called LSR_xm177M203, so THIS is right:

class CfgModels
{
class Default
{
sections[]={};
sectionsInherit="";
};
class Weapon: Default
{
sections[]={"zasleh"};
};
class LSR_xm177M203: Weapon{};
};

Cheers  :)

Offline Jay

  • Members
  • *
  • I'm a llama!
Re:HERES THE SOLUTION TO THE MUZZLE FLASH BUG!!!
« Reply #6 on: 23 Aug 2004, 17:19:34 »
Argh so thats why the first model an its config mached.

Thanks for a really quick responce.

Makes Addon makeing alot more easyer for me. :-*

Rocko Bonaparte

  • Guest
Re:HERES THE SOLUTION TO THE MUZZLE FLASH BUG!!!
« Reply #7 on: 01 Oct 2004, 04:39:24 »
I wanted to resurrect this thread that I fixed a tank machine gun muzzle flash bug using this.  I used the tank model's name, not the gun's name.  I was curious how I could turn off the flash for the front headlights on the tank.  The sprites are stuck on, kind of like the muzzle flash on the machine gun.

Offline oyman

  • Members
  • *
  • king of pings
Re:HERES THE SOLUTION TO THE MUZZLE FLASH BUG!!!
« Reply #8 on: 02 Oct 2004, 00:52:06 »
put this in config
Code: [Select]
class CfgModels
{
   class Default {};
   class Vehicle: Default {};
   class Tank: Vehicle {};
   class m1_abrams: Tank {};
   class model_name: m1_abrams {};
   };