Home   Help Search Login Register  

Author Topic: can someone fix this config  (Read 1517 times)

0 Members and 1 Guest are viewing this topic.

Cpl. Vagabond

  • Guest
can someone fix this config
« on: 23 Aug 2003, 17:08:10 »
Code: [Select]
class CfgPatches
{
   class vag_nighthawk
   {
      units[]={};
      weapons[]={"vag_nighthawk"};
      requiredVersion=1.750000;
   };
};

class CfgModels
{
   
   class default {};
   class Weapon: default {};
   class vag_nighthawk: Weapon {};



class CfgRecoils
{
   vag_nighthawkpistolRecoil[]={0.01,0.01,0.1,0.1,0,0};
};

class CfgAmmo
{
   class default {};
   class BulletSingle: default {}
   class vag_nighthawkAmmo: BulletSingle
   {
      hit=7;
      indirectHit=1;
      indirectHitRange=0.050000;   
      minRange=1
      minRangeProbab=0.100000;
      midRange=50
      midRangeProbab=0.900000;
      maxRange=100
      maxRangeProbab=0.050000;
      cartridge="FxCartridgeSmall";      
   };
         
}

class CfgWeapons
{
   class Default {};
   class MGun: Default {};
   class Riffle: MGun {};
   class HandGunBase: Riffle {};
   class vag_nighthawkBase: HandGunBase
   {   
      access=2;
      scopeWeapon=0;
      scopeMagazine=0;
      dexterity=2;      
      aiRateOfFire=0.500000;
      aiRateOfFireDistance=50   
      model="\vag_nighthawk\nighthawk.p3d";
      modelOptics="\O\Guns\optika_CZ75";
      picture="\vag_nighthawk\hawk.paa";      
      displayName="Nighthawk";
      displayNameMagazine="Nighthawk Mag";
      shortNameMagazine="Nighthawk Mag";
      count=15;
      weaponType=2;
      magazineType=32;
      reloadTime=0.050000;
      magazineReloadTime=1.2;
      autoReload=0;
      soundContinuous=0;
      sound[]={"\vag_nighthawk\fire.wav",0.131623,0.95000};
      drySound[]={"weapons\M16dry",0.003162,1};
      magazines[]={"vag_nighthawkMag"};
      burst=1
      multiplier=1
      autoFire=0
      initSpeed=490;
      dispersion=0.002400;         
      
      ammo="vag_nighthawkAmmo";
      
   };
   
      
};


i keep getting the error
"No entry 'config.cpp/CfgWeapons.vag_nighthawkMag"

Yahoo Reborn

  • Guest
Re:can someone fix this config
« Reply #1 on: 24 Aug 2003, 21:30:39 »
Replace magazines[]={"vag_nighthawkMag"}; with this magazines[]={"vag_nighthawkammo"};

Cpl. Vagabond

  • Guest
Re:can someone fix this config
« Reply #2 on: 24 Aug 2003, 21:47:11 »
now i get the error

No Entry 'config.cpp/CfgWeapons.vag_nighthawk'.

Offline Killswitch

  • Members
  • *
  • Peace, cheese and ArmA
Re:can someone fix this config
« Reply #3 on: 25 Aug 2003, 16:13:18 »
Quote
now i get the error

No Entry 'config.cpp/CfgWeapons.vag_nighthawk'
Have a close look at what is says: you dont have a weapon called vag_nighthawk defined in the CfgWeapons part.

What you do have is a weapon called "vag_nighthawkbase"

The fix is left as an excercise.   ;)

Cpl. Vagabond

  • Guest
Re:can someone fix this config
« Reply #4 on: 25 Aug 2003, 16:15:02 »
well i didn't make the dam config!!!!

Offline Killswitch

  • Members
  • *
  • Peace, cheese and ArmA
Re:can someone fix this config
« Reply #5 on: 25 Aug 2003, 17:09:47 »
Sweet jeebus... how hard can it be? I mean, come on...I basically spelled it out for you

Change the line
Code: [Select]
class vag_nighthawkBase: HandGunBase
to
Code: [Select]
class vag_nighthawk: HandGunBase

Also, since the HandGunBase class on which the vag_nighthawk is based on is defined in the bis_weaponpack class in O_WP.pbo that came with Resistance, you need to change the class vag_nighthawk in the CfgPatches part to
Code: [Select]
class vag_nighthawk
{
        units[]={};
        weapons[]={"vag_nighthawk"};
        requiredVersion=1.850000;
        requiredAddons[]={bis_weaponpack,bis_resistance};
};

There. For services rendered by the community, please consider this

« Last Edit: 25 Aug 2003, 17:11:15 by Killswitch »

Cpl. Vagabond

  • Guest
Re:can someone fix this config
« Reply #6 on: 25 Aug 2003, 17:25:24 »
i got the same error message

Offline Killswitch

  • Members
  • *
  • Peace, cheese and ArmA
Re:can someone fix this config
« Reply #7 on: 25 Aug 2003, 17:29:59 »
Hmm... the CfgModels part lacks a closing "};"

Here's how it looks:
Code: [Select]
class CfgModels
{
   
   class default {};
   class Weapon: default {};
   class vag_nighthawk: Weapon {};


And how it should be:
Code: [Select]
class CfgModels
{
   
   class default {};
   class Weapon: default {};
   class vag_nighthawk: Weapon {};
};
Note the "};" in the end.

Cpl. Vagabond

  • Guest
Re:can someone fix this config
« Reply #8 on: 25 Aug 2003, 17:35:13 »
No Entry 'config.cpp/CfgWeapons.vag_nighthawkammo'


right about now i'm going insane

Cpl. Vagabond

  • Guest
Re:can someone fix this config
« Reply #9 on: 25 Aug 2003, 17:40:16 »
OK I GOT THE GUN INGAME, BUT I CAN'T GET THE AMMO WORKING

Offline Killswitch

  • Members
  • *
  • Peace, cheese and ArmA
Re:can someone fix this config
« Reply #10 on: 25 Aug 2003, 19:25:29 »
Edited, see the end this message...

Does this one work?

Code: [Select]
class CfgPatches
{
        class VAG_Nighthawk
        {
           units[]={};
           weapons[]={"VAG_Nighthawk"};
           requiredVersion=1.850000;
           requiredAddons[]={BIS_Weaponpack,BIS_Resistance};
        };
};

class CfgModels
{
        class Default {};
        class Weapon: Default {};
        class VAG_Nighthawk: Weapon {};
};


class CfgRecoils
{
        VAG_NighthawkpistolRecoil[]={0.01,0.01,0.1,0.1,0,0};
};

class CfgAmmo
{
        class Default {};
        class BulletSingle: Default {};
        class VAG_NighthawkAmmo: BulletSingle
        {
           hit=7;
           indirectHit=1;
           indirectHitRange=0.050000;  
           minRange=1;
           minRangeProbab=0.100000;
           midRange=50;
           midRangeProbab=0.900000;
           maxRange=100;
           maxRangeProbab=0.050000;
           cartridge="FxCartridgeSmall";      
        };
};

class CfgWeapons
{
        class Default {};
        class MGun: Default {};
        class Riffle: MGun {};
        class HandGunBase: Riffle {};
// The weapon
        class VAG_Nighthawk: HandGunBase
        {
           access=2;
           scopeWeapon=2;
           scopeMagazine=0;
           weaponType=2;
           autoReload=0;
           model="\VAG_Nighthawk\Nighthawk.p3d";
           modelOptics="\O\Guns\optika_CZ75";
           picture="\VAG_Nighthawk\hawk.paa";
           uiPicture="\misc\iPistole.paa";
           displayName="Nighthawk";
           modes[]={"Single"};
           magazines[]={"VAG_NighthawkMag"};
        };

// The magazine
        class VAG_NighthawkMag: HandGunBase
        {
           scopeWeapon=0;
           scopeMagazine=2;
           dexterity=2;
//           picture="\VAG_Nighthawk\VAG_NighthawkMag.paa";
           picture="\O\Guns\zasobnik.paa";
           displayNameMagazine="Nighthawk Mag";
                 shortNameMagazine="Nighthawk Mag";
           magazineType=32;
           count=15;
           initSpeed=490;
           reloadTime=0.050000;
           magazineReloadTime=1.2;
           drySound[]={"weapons\M16dry",0.003162,1};
           modes[]={"Single"};
           class Single
           {
              ammo=VAG_NighthawkAmmo;
              multiplier=1;
              burst=1;
              displayName="Nighthawk";
              dispersion=0.002400;
              sound[]={"\VAG_Nighthawk\fire.wav",0.131623,0.95000};
              soundContinuous=0;
              reloadTime=0.100000;
              ffCount=1;
              recoil=VAG_NighthawkpistolRecoil;
              autoFire=0;
              aiRateOfFire=0.500000;
              aiRateOfFireDistance=50;
              useAction=0;
              useActionTitle="";
           };
        };   
};

*EDIT: slightly syntax error fixed:
  • I had forgotten a pair of [] brackets at the end of requiredAddons
  • Added modes={"Single"}; to the weapon defintion
  • Added a BIS magazine picture to the magazine defintion

« Last Edit: 25 Aug 2003, 20:53:41 by Killswitch »

Cpl. Vagabond

  • Guest
Re:can someone fix this config
« Reply #11 on: 25 Aug 2003, 19:49:49 »
the dam thing doesn't have ammo, i can't reload either and i think there might be something very wrong. i'm posting the gun here i ask that someone please fix any problems and tell me what they were so i can avoid future problems with my weapons.

http://www.zerohazard.net/vag_nighthawk.zip

please fix this thing before this kills me

Offline Killswitch

  • Members
  • *
  • Peace, cheese and ArmA
Re:can someone fix this config
« Reply #12 on: 25 Aug 2003, 20:57:44 »
There. I had left one syntax error and a few other details in the earlier posting. I edited it and it now contains a working config.cpp for the gun.

Quote
the dam thing doesn't have ammo, i can't reload either and i think there might be something very wrong.

If you give yourself the weapon by addWeapon, you need to give yourself some ammo too:

Try this in the init line of a player soldier:
Code: [Select]
removeAllWeapons player; player addMagazine "vag_nighthawkmag"; player addMagazine "vag_nighthawkmag"; player addMagazine "vag_nighthawkmag"; player addMagazine "vag_nighthawkmag"; player addWeapon "vag_nighthawk"


Cpl. Vagabond

  • Guest
Re:can someone fix this config
« Reply #13 on: 25 Aug 2003, 21:10:56 »
thank you it works, i'll mention your good work in the readme

Offline Killswitch

  • Members
  • *
  • Peace, cheese and ArmA
Re:can someone fix this config
« Reply #14 on: 25 Aug 2003, 21:41:01 »
Glad to be of help. Also - I now know more about config:ing boomsticks  ;D

(Since we seem to be done here, please mark this thread as solved.)