Home   Help Search Login Register  

Author Topic: Config problem  (Read 2102 times)

0 Members and 1 Guest are viewing this topic.

Offline hamis

  • Members
  • *
  • I'm a llama!
Config problem
« on: 09 Jan 2008, 20:31:41 »
What's wrong with this (magazines.hpp)?I get undefined base class "ak74" msg ???
//------------------------------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------- Magazines ----------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------------------------



//--------------------------
//---- 5.45x39 SD AK Bullet
//--------------------------
class default {};
 class BulletSingle:Default {};
   class BulletSilencedSingle: BulletSingle {};
   class RHS_30RD_545_SDmag: AK74
   {
      scopeWeapon=0;
      scopeMagazine=2;
      count=30;
      initSpeed=530;
      distanceZoomMin=100;
      distanceZoomMax=100;
      displayNameMagazine="30rd 5.45x39 SD Magazine";
      shortNameMagazine="30rd 5.45x39 SD Mag.";
      picture="\RHS_Weap\AK_Pics\m_30RD_5,45_MAG.paa";
      modes[]={"Single","FullAuto"};

      class Single
      {
         ammo="RHS_E545x39_30_BulletSilencedSingle";
         multiplier=1;
         burst=1;
         displayName="5.45x39 SD Semi";
         dispersion=0.0000200;
         sound[]={"\RHS_Weap_Sounds\AK_Sounds\RHS_AK_545_silenced_single.wss",1.000000,1.00};
         soundContinuous=0;
         reloadTime=0.100000;
         ffCount=1;
         recoil="RHS_E545x39_RifleRecoil";
         autoFire=0;
         aiRateOfFire=2;
         aiRateOfFireDistance=100;
         useAction=0;
         useActionTitle="";
      };
      class FullAuto
      {
         ammo="RHS_E545x39_30_BulletSilencedFullAuto";
         multiplier=1;
         burst=1;
         displayName="5.45x39 SD Auto";
         dispersion=0.0001000;
         sound[]={"\RHS_Weap_Sounds\AK_Sounds\RHS_AK_545_silenced_single.wss",1.000000,1.00};
         soundContinuous=0;
         reloadTime=0.0667;
         ffCount=30;
         recoil="RHS_E545x39_RifleAutoRecoil";
         autoFire=1;
         aiRateOfFire=1;
         aiRateOfFireDistance=80;
         useAction=0;
         useActionTitle="";
      };
      canDrop = true;
   };
};

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Config problem
« Reply #1 on: 09 Jan 2008, 20:58:35 »
This is an addon configuration issue not a scripting issue, so is in the wrong forum. Hopefully someone with the correct evil powers can move it to the correct place.

You aren't really being clear what you are doing. You say that you are creating a magazine and the class is named RHS_30RD_545_SDmag (therefore a magazine type), then the comment says it is for the 5.45x39 SD AK Bullet (therefore an ammo type) and the actual config you give is for a weapon and the class inherits from AK74 (which is a weapon type). I think this means you don't quite know what you are trying to achieve and/or what you are doing, which never helps.

You also don't define the config class (CfgAmmo, CfgWeapons, CfgMagazines) that this item is to be configured as so that is another reason this will be failing (though you may just have not included that outer class in what you pasted up).

The reason OFP fails though, is because when you inherit from the AK74 in the RHS_30RD_545_SDmag class, it doesn't recognise the AK47 because it is defined in another file (weapons.pbo). What you need to tell OFP is enough information about the AK47 so that it is seen as a valid class, but you don't need to define it fully, since, once the game is running, the game inherits from the real AK74 that is in weapons.pbo.

What this:
Code: [Select]
class default {};
class BulletSingle:Default {};
class BulletSilencedSingle: BulletSingle {};
Is trying to do is set up BulletSilencedSingle as a valid class for inheritance for an ammo type (so has no place in your configuration file for a new weapon, which doesn't define any magazine or ammo types that need to inherit from the internally defined classes).

As I said, I think you are getting confused about ammo, magazine and weapon configurations, which are completely separate, so I think you need to go back to the drawing board (or read someone else's configuration to see how they are set out). Alternatively, try to explain what you are trying to achieve and someone might be able to help out, because it is impossible to guess what the config you have give is actually trying to do.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Config problem
« Reply #2 on: 09 Jan 2008, 22:43:07 »
Being for OFP this would be part of cfgAmmo as OFP never had a cfgMagazine section as such.

In OFP "AK47" was the classname of the weapon and the magazinename, in OFP magazines were more or less defined in the weapons config section.

The ammo used by the AK47 was BulletSingleG, BulletBurstG and BulletFullAutoG, for each of the 3 firing modes.

Now as Spooner has said your .hpp seems to be a sorry mix of a cfgAmmo section and a cfgweapon section.
You cannot really mix them like that they have to be in separate sections.


Planck


I know a little about a lot, and a lot about a little.

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Config problem
« Reply #3 on: 10 Jan 2008, 02:29:08 »
Ah, sorry, as I'm sure you could guess, my inaccuracies were caused by being an ArmA, not an OFP person. Apologies for any confusion caused...
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline hamis

  • Members
  • *
  • I'm a llama!
Re: Config problem
« Reply #4 on: 10 Jan 2008, 13:55:04 »
Sorry,small inaccuracy.This is magazines.cpp from RHS_WeapPack_v1.00.I haven't edited this kind of config's before because it's very rare to have own config for everything.What i am trying to do is reduce this pack to just 1 weapon because my addons folder is much over 1GB,so i want to make it as small as possible(which i have done for many addon pack's before.There is not much original stuff left in my ofp.
[EDIT]
I got it almost working by making normal config.cpp,but now i get "no entry modelspecial in the editor.There is no modelspecial line in the original config.Here is my new config:

#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

#define private    0
#define protected   1
#define public       2

#define WeaponNoSlot      0
#define WeaponSlotPrimary   1
#define WeaponSlotSecondary   16
#define WeaponSlotHandGun   2
#define WeaponSlotHandGunItem   32
#define WeaponSlotItem      256
#define WeaponSlotBinocular   4096
#define WeaponHardMounted   65536

#define SPEED_STATIC 10000000

#define TracerNColor 0,0,0
#define TracerNColorF {TracerNColor,0.005}
#define TRACER_N_ALWAYS tracerColor[]=TracerNColorF;tracerColorR[]=TracerNColorF

class CfgPatches
{
   class RHS_Weap
   {
   units[] = {};
   weapons[] = {"RHS_AKS74PSO1PBS3"};
   requiredVersion = 1.92;
   };
};

class CfgModels
    {
   class Default {};
   class Weapon: Default {};
    class RHS_AKS74PSO1PBS3:weapon{};
    };

class CfgWeapons
{
   class default {};
      class LAWLauncher: default {};
      class MGun: default {};
      class Riffle: MGun {};
      class AK47: Riffle {};
      class AK74: Riffle {};
      class HandGunBase: Riffle {};
      class SniperRiffle: Riffle {};
      class SVDDragunov: SniperRiffle {};
      class MachineGun7_6: MGun {};
      class MachineGun7_6Manual: MachineGun7_6 {};
      class PK: MachineGun7_6Manual {};
   class RPGLauncher: LAWLauncher {};

  class RHS_AKS74PSO1PBS3:AK74
   {
      scopeWeapon=2;
      scopeMagazine=0;
      weaponType=WeaponSlotPrimary;
      displayName="AKS-74B PSO-1";
      model="\RHS_Weap\AKS74\AKS74_PSO1_PBS3";
      modelOptics="\RHS_Weap\AK_Optics\AK_Optic2";
      optics=1;
      opticsZoomMin=0.080000;
      opticsZoomMax=0.080000;
      opticsFlare=false;
      picture="\RHS_Weap\AK_Pics\w_AK74SB_PSO1.paa";
      drySound[]={"weapons\AK74Dry",0.010000,1};
      reloadMagazineSound[]={"\RHS_Weap_Sounds\AK_Sounds\RHS_AK_load.wss",1.000000,1};
      modes[]={"Single","Burst"};
      magazines[]={"JAM_E545_30SDmag"};
       class Single
            {
               ammo = JAM_East_545x39_Silenced_Single_Bullet;
               multiplier = 1;
               burst=1;
               displayName = "5.45x39 Semi SD";
               dispersion=0.000027075;
               sound[]={"\JAM_Sounds\sounds\AKFireSD.wss",db0,1};
               soundContinuous=0;
               reloadTime=0.092;
               ffCount=1;
               recoil=JAM_545x39_RifleRecoil;
               autoFire = 0;
               aiRateOfFire=0.850000;
               aiRateOfFireDistance=500;

               useAction = false;
               useActionTitle = "";
            };
            class Burst
            {
               ammo = JAM_East_545x39_Silenced_Burst_Bullet;
               multiplier=1;
               burst=3;
               displayName = "5.45x39 Burst SD";
               dispersion=0.0001083;
               sound[]={"\JAM_Sounds\sounds\AKBurstSD.wss",db0,1};
               soundContinuous=0;
               reloadTime=0.092;
               ffCount=3;
               recoil=JAM_545x39_RifleRecoil;
               autoFire =0;
               aiRateOfFire=0.850000;
               aiRateOfFireDistance=500;

               useAction = false;
               useActionTitle = "";
            };
            uiPicture="ivojak";
            canDrop = true;
   };
   };
« Last Edit: 10 Jan 2008, 16:11:58 by hamis »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Config problem
« Reply #5 on: 12 Jan 2008, 14:45:11 »
Try changing the cfgModels section to read:

Code: [Select]
class CfgModels
{
   class Default {};
   class Weapon: Default {};
   class AKS74_PSO1_PBS3: Weapon{};
};


Planck
I know a little about a lot, and a lot about a little.