OFPEC Forum

Addons & Mods Depot => OFP - Addons & Mods General => Topic started by: DBR_ONIX on 16 May 2004, 20:21:05

Title: CPP Help - Important!
Post by: DBR_ONIX on 16 May 2004, 20:21:05
Yeah, another one ::)
I've got a config, to me is looks like it should work
But when I load ofp, it get an error, something about cfgWeapons error
And when I add the black op guy, I get a .modelspecial error

I'm 100% sure it's the config (I know it is)

here it is :
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 CfgPatches
{
   class ChechLSW
   {
      units[] = {"ChechLSWSoldier"};
      weapons[] = {ChechLSW};
      requiredVersion = 1.75;
   };
};



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


class CfgAmmo
{   
   class default {};
   class BulletSingle : Default {};
    class ChechLSWSingle: BulletSingle
   {
      hit=8
      indirectHit=1
      indirectHitRange=0.100000;
      visibleFire=0.7500;
      audibleFire=0.7500;
      visibleFireTime=2
      tracerColor[]={0,0,0,0.005000};
      tracerColorR[]={0,0,0,0.005000};
   };
};

class CfgWeapons
{
   class Default   {};
   class MGun: Default {};
   class Riffle: MGun {};
   class ChechLSWbullet: Riffle
   {
      scopeWeapon=public;
      scopeMagazine=public;
      model="\Chech_LSW\LSW.p3d";
      picture="\Chech_LSW\p_lsw.pac";
      modelOptics="\Chech_LSW\optika_LSW.p3d";
      displayName="L86 LSW";
      drySound[]={"weapons\M16Dry",0.003162,1};
      magazines[]={"ChechLSWmag"};
      opticsZoomMin=0.04;
      opticsZoomMax=0.04;
      distanceZoomMin=400;
      distanceZoomMax=80;
      flash="zalesh";
      flashSize=5;
      initSpeed=938;
      opticsFlare= true;
      modes[]= {"Single","Full"};
      class Single
      {
         ammo="ChechLSWSingle";
         multiplier=1;
         burst=1;
         displayName="LSW Single Shot";
         dispersion=0.04000;
         sound[]={"\ChechLSW\lsw.wav",1.000000,1};
         soundContinuous=0;
         ffCount=1;
         reloadTime=0.0100000;
         recoil="MGun";
         autofire=0;
         aiRateOfFire=0.10000;
         aiRateOfFireDistance = 200;
         UseAction=0;
         useActionTitle="";
      };
      class Full
      {
         ammo="ChechLSWbullet";
         multiplier= 1;
         burst= 1;
         displayName= "LSW Full Auto";
         dispersion=0.0008000;
         sound[]={"\Chech_LSW\lsw.wav",1.000000,1};
         soundContinuous=0;
         reloadTime=0.0100000;
         ffCount=3;
         recoil="MGun";
         autoFire=1;
         aiRateOfFire=5.00000;
         aiRateOfFireDistance=200;
         useAction = 0;
         useActionTitle="";
      };

   };
   class ChechLSWmag: ChechLSWbullet
   {
        ammo="ChechLSWbullet"
      scopeWeapon=public;
      scopeMagazine=2;
      displayNameMagazine="LSW 5.56 Mag";
      shortNameMagazine="5.56 Mag";
      picture="\Chech_LSW\pm_lsw.pac";
   };
};
class CfgNonAIVehicles
{
   class ProxyWeapon {};
   class ProxyChechLSW: ProxyWeapon {};
};

class CfgVehicles
{
   class All{};
   class AllVehicles:All{};
   class Land:AllVehicles{};
   class Man:Land{};
   class Soldier:Man{};
   class SoldierWB:Soldier{};
   class SoldierWSniper:SoldierWB{};
   class SoldierWSaboteur:SoldierWB{};
   class SoldierWSaboteurPipe:SoldierWSaboteur{};
   class SoldierWSaboteurDay:SoldierWSaboteurPipe{};

   class ChechLSWSoldier: SoldierWSaboteurPipe
   {
      displayName="Black Op (L86 LSW)";
      vehicleClass="Chechnya Mod - Men";
      accuracy=1000.000000;
      nightVision=1;
      sensitivity=2;
      camouflage=0.0700000;
      weapons[]={ChechLSW,Ingram,NVGoggles,Throw,Put};
      magazines[]={ChechLSWmag,ChechLSWmag,ChechLSWmag,ChechLSWmag,IngramMag,IngramMag,IngramMag,IngramMag,handgreande,handgrenade};
   };
};

Can someone correct this for me?

I'd be ethernaly grateful if you could :)
- Ben
Code: [Select]
Title: Re:CPP Help - Important!
Post by: DanAK47 on 16 May 2004, 23:48:40
ChechLSW is undefined in cfgWeapons, you have it named ChechLSWBullet instead. And ChechLSWBullet, referred to in the fullAuto part is undefined in cfgAmmo. In CfgModels you have the model called ChechLSW but it is apparently actually LSW.p3d (rename it to ChechLSW.p3d).
Title: Re:CPP Help - Important!
Post by: DBR_ONIX on 17 May 2004, 17:41:43
Ta mate  :cheers:
I'll make those changes in a sec :)
(Eating ATM :P)

Really aprecate it :)

I gotta read though some CPP tuts sometime :)
- Ben
Title: Re:CPP Help - Important!
Post by: DBR_ONIX on 18 May 2004, 17:22:17
Right, I tried the changes you said.. But  :'(
It didn't work :(
I mucked around for a while, it fired a mag called Riffle (It must be from the inheritance stuff)
And I kept trying (I musta rePBOed the CPP, in a different PBO, and in the weapon PBO about 30 times :()

So, I got the PBO of a Minime machine gun (Pretty similar weapons), and edited it.. it's nearly there, but I can't get the hang of the inheritance stuff >:(

Heres the config I've got now :
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 CfgWeapons
{
    class Default {};
   class MGun: Default {};
   class Riffle: MGun {};
   class MachineGun7_6: MGun {};
   class MachineGun7_6Manual: MachineGun7_6 {};

   class Weapon: Default{};
   class Chech_LSW : Weapon
   {
      units[] = {};
      weapons[] = {"Chech_LSW","Chech_LSWmag"};
      requiredVersion = 1.46;
   };

   class Chech_LSWMag : Chech_LSW
   {
      scopeWeapon = 0;
      scopeMagazine = 2;
      displayNameMagazine = "L86 5.56 mag";
      shortNameMagazine = "5.56 Mag";
      picture="\Chech_LSW\m_LSW.pac";
      uiPicture="\Chech_LSW\m_LSW.pac";
      count=30;
      weaponType=1;
      magazineType="3 * 256";
      magazineReloadTime=6.0;
      dexterity=0.7;
      reloadMagazineSound[]={"\Chech_LSW\LSWreload.wav",db-40,1};
      ammo="BulletFullAutoW";
      drySound[]={"weapons\M16dry",0.010000,1};
      sound[]={\Chech_LSW\LSWfire.wav,1,1};
      soundContinuous=0;
      reloadTime=0.10000;
      dispersion=0.005000;
      initSpeed=1000;
      maxLeadSpeed=300;
      ffCount=10;
      aiDispersionCoefX=5;
      ffMagnitude=0.500000;
      ffFrequency=11;
      recoil="riffleBurst3";
      autoFire=true;
      aiRateOfFire=0.5;
      aiRateOfFireDistance=900;
      useAction=0;
      useActionTitle="";
   };

 class Chech_LSW
   {
      scopeWeapon = 2;
      scopeMagazine = 0;
      displayName = "L86 LSW";
      picture="\Chech_LSW\p_LSW.pac";
       uiPicture="\Chech_LSW\p_LSW.pac";
      model="\Chech_LSW\ChechLSW.p3d";
      reloadMagazineSound[]={"\Chech_LSW\lswreload.wav",db-40,1};
      drySound[]={"weapons\M16dry",db-40,1};
      modelOptics="\Chech_LSW\optika_lsw.p3d";
      optics = true;
         opticsZoomMin=0.350000;
         opticsZoomMax=0.350000;
         distanceZoomMin=400;
         distanceZoomMax=400;
        magazines[]={"Chech_LSWMag"};
   };
 };

Please help!! :'(

It's just the something : somethingelse {}; stuff, I think.. But I can't work it out :(

Help!!!

You'll be creditied in the readme, and the mods website :)

Thanks so much :)
- Ben
Code: [Select]
Title: Re:CPP Help - Important!
Post by: Pathy on 18 May 2004, 18:58:32
One....where has your CFGmodels gone? Thats pretty important on a gun.

CFGweapons is well....minimalistic!

Go with your original attempt and i will fix it in a mo (got to eat)
Title: Re:CPP Help - Important!
Post by: Pathy on 18 May 2004, 19:34:19
Quote
// 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 CfgPatches
{
   class ChechLSW
   {
      units[] = {"ChechLSWSoldier"};
      weapons[] = {ChechLSW};
      requiredVersion = 1.75;
   };
};



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


class CfgAmmo
{  
   class default {};
   class BulletSingle : Default {};
   class ChechLSWSingle: BulletSingle
   {
      hit=8
      indirectHit=1
      indirectHitRange=0.100000;
      visibleFire=0.7500;
      audibleFire=0.7500;
      visibleFireTime=2
      tracerColor[]={0,0,0,0.005000};
      tracerColorR[]={0,0,0,0.005000};
   };
};

class CfgWeapons
{
   class Default   {};
   class MGun: Default {};
   class Riffle: MGun {};
   class ChechLSW: Riffle
   {
      scopeWeapon=public;
      scopeMagazine=public;
      model="\Chech_LSW\LSW.p3d";
      picture="\Chech_LSW\p_lsw.pac";
      modelOptics="\Chech_LSW\optika_LSW.p3d";
      displayName="L86 LSW";
      drySound[]={"weapons\M16Dry",0.003162,1};
      magazines[]={"ChechLSWmag"};
      opticsZoomMin=0.04;
      opticsZoomMax=0.04;
      distanceZoomMin=400;
      distanceZoomMax=80;
      flash="zalesh";
      flashSize=5;
      initSpeed=938;
      opticsFlare= true;
      modes[]= {"Single","Full"};
      class Single
      {
         ammo="ChechLSWSingle";
         multiplier=1;
         burst=1;
         displayName="LSW Single Shot";
         dispersion=0.04000;
         sound[]={"\ChechLSW\lsw.wav",1.000000,1};
         soundContinuous=0;
         ffCount=1;
         reloadTime=0.0100000;
         recoil="MGun";
         autofire=0;
         aiRateOfFire=0.10000;
         aiRateOfFireDistance = 200;
         UseAction=0;
         useActionTitle="";
      };
      class Full
      {
         ammo="ChechLSWSingle";
         multiplier= 1;
         burst= 1;
         displayName= "LSW Full Auto";
         dispersion=0.0008000;
         sound[]={"\Chech_LSW\lsw.wav",1.000000,1};
         soundContinuous=0;
         reloadTime=0.0100000;
         ffCount=3;
         recoil="MGun";
         autoFire=1;
         aiRateOfFire=5.00000;
         aiRateOfFireDistance=200;
         useAction = 0;
         useActionTitle="";
      };

   };
   class ChechLSWmag: ChechLSW
   {
        ammo="ChechLSWsingle"
      scopeWeapon=public;
      scopeMagazine=2;
      displayNameMagazine="LSW 5.56 Mag";
      shortNameMagazine="5.56 Mag";
      picture="\Chech_LSW\pm_lsw.pac";
   };
};
class CfgNonAIVehicles
{
   class ProxyWeapon {};
   class ProxyChechLSW: ProxyWeapon {};
};

class CfgVehicles
{
   class All{};
   class AllVehicles:All{};
   class Land:AllVehicles{};
   class Man:Land{};
   class Soldier:Man{};
   class SoldierWB:Soldier{};
   class SoldierWSniper:SoldierWB{};
   class SoldierWSaboteur:SoldierWB{};
   class SoldierWSaboteurPipe:SoldierWSaboteur{};
   class SoldierWSaboteurDay:SoldierWSaboteurPipe{};

   class ChechLSWSoldier: SoldierWSaboteurPipe
   {
      displayName="Black Op (L86 LSW)";
      vehicleClass="Chechnya Mod - Men";
      accuracy=1000.000000;
      nightVision=1;
      sensitivity=2;
      camouflage=0.0700000;
      weapons[]={ChechLSW,Ingram,NVGoggles,Throw,Put};
      magazines[]={ChechLSWmag,ChechLSWmag,ChechLSWmag,ChechLSWmag,IngramMag,IngramMag,IngramMag,IngramMag,handgreande,handgrenade};
   };
};

If that doesnt work i will.....ermmm......try again....

BTW if it doesnt work, quote the exact error message, it allows quick location of the problem.  :)
Title: Re:CPP Help - Important!
Post by: DBR_ONIX on 19 May 2004, 16:52:37
Thank you sooooooo much :D
I'll try it now!
Yeah, the second one was a "lets make a really simple cpp so maybe it will work" attempt
The first one was a closer to release type attempt

Thanks so much!!
I'll make sure that you get credited somehow ;)
(If it works.. IF IT DOESN'T, well... :P:P)

Ta
- Ben
Title: Re:CPP Help - Important!
Post by: DBR_ONIX on 19 May 2004, 17:13:57
IT---WORKED---!!!!!!!!!!!!!!!!!!!!!!
Thanks so much
Just need to tweak the full auto speed.. It emptys the 30 round clip in under a second ::)
:P

Thanks a lot
Oh, it gives an error, "Missing recoil : MGun"
But I know how to sort that :)

Thanks so much :)
- Ben
Title: Re:CPP Help - Important!
Post by: Pathy on 19 May 2004, 19:24:36
Np mate!  :)  Always glad to help  ;)

If you run into any more problems, let me know  8)
Title: Re:CPP Help - Important!
Post by: DBR_ONIX on 22 May 2004, 14:48:16
Muzzleflash bug :(
But the CfgModels bit is there ???
Code: [Select]
//------------------------------------------------------
//                 L86 Light Support Weapon
//                     L     S       W
//                            by
//                     D B R _ O N I X
//------------------------------------------------------
// Thanks ::
// Andy, "Hotel 2-4" - Reference pics, and forcing me to join the mod :P
// "Helipilot" - Reference, help with config, and helping with weapons info
// People I forrgot - For making be forrget them :P

// 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 CfgPatches
{
  class ChechLSW
  {
      units[] = {"ChechLSWSoldier"};
      weapons[] = {ChechLSW};
      requiredVersion = 1.75;
  };
};



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


class CfgAmmo
{  
  class default {};
  class BulletSingle : Default {};
  class ChechLSWSingle: BulletSingle
  {
      hit=8
      indirectHit=1
      indirectHitRange=0.100000;
      visibleFire=0.7500;
      audibleFire=0.7500;
      visibleFireTime=2
      tracerColor[]={0,0,0,0.005000};
      tracerColorR[]={0,0,0,0.005000};
  };
};

class CfgWeapons
{
  class Default  {};
  class MGun: Default {};
  class Riffle: MGun {};
  class ChechLSW: Riffle
  {
      scopeWeapon=public;
      scopeMagazine=public;
      model="\Chech_LSW\ChechLSW.p3d";
      picture="\Chech_LSW\p_lsw.pac";
      modelOptics="\Chech_LSW\optika_LSW.p3d";
      displayName="L86 LSW";
      drySound[]={"weapons\M16Dry",0.003162,1};
      magazines[]={"ChechLSWmag"};
      opticsZoomMin=0.04;
      opticsZoomMax=0.04;
      distanceZoomMin=400;
      distanceZoomMax=80;
      flash="zalesh";
      flashSize=5;
      initSpeed=938;
      opticsFlare= true;
      modes[]= {"Single","Full"};
      class Single
      {
        ammo="ChechLSWSingle";
        multiplier=1;
        burst=1;
        displayName="LSW Single Shot";
        dispersion=0.0008000;
        sound[]={"\Chech_LSW\lswfire.wav",1.000000,1};
        soundContinuous=0;
        ffCount=1;
        reloadTime=0.0100000;
        recoil="rifflesingle";
        autofire=0;
        aiRateOfFire=0.10000;
        aiRateOfFireDistance = 200;
        UseAction=0;
        useActionTitle="";
      };
      class Full
      {
        ammo="ChechLSWSingle";
        multiplier= 1;
        burst= 1;
        displayName= "LSW Full Auto";
        dispersion=0.0008000;
        sound[]={"\Chech_LSW\lswfire.wav",1.000000,1};
        soundContinuous=0;
        reloadTime=0.100000;
        ffCount=3;
        recoil="riffleBurst3";
        autoFire=1;
        aiRateOfFire=5.00000;
        aiRateOfFireDistance=200;
        useAction = 0;
        useActionTitle="";
      };

  };
  class ChechLSWmag: ChechLSW
  {
      ammo="ChechLSWsingle"
      scopeWeapon=public;
      scopeMagazine=2;
      displayNameMagazine="LSW 5.56 Mag";
      shortNameMagazine="5.56 Mag";
      picture="\Chech_LSW\pm_lsw.pac";
  };
};
class CfgNonAIVehicles
{
  class ProxyWeapon {};
  class ProxyChechLSW: ProxyWeapon {};
};

class CfgVehicles
{
  class All{};
  class AllVehicles:All{};
  class Land:AllVehicles{};
  class Man:Land{};
  class Soldier:Man{};
  class SoldierWB:Soldier{};
  class SoldierWSniper:SoldierWB{};
  class SoldierWSaboteur:SoldierWB{};
  class SoldierWSaboteurPipe:SoldierWSaboteur{};
  class SoldierWSaboteurDay:SoldierWSaboteurPipe{};

  class ChechLSWSoldier: SoldierWSaboteurPipe
  {
      displayName="Black Op (L86 LSW)";
      vehicleClass="Chechnya Mod - Men";
      accuracy=1000.000000;
      nightVision=1;
      sensitivity=2;
      camouflage=0.0700000;
      weapons[]={ChechLSW,Ingram,NVGoggles,Throw,Put};
      magazines[]={ChechLSWmag,ChechLSWmag,ChechLSWmag,ChechLSWmag,IngramMag,IngramMag,IngramMag,IngramMag};
  };
};

The muzzleflash in named zalesh, which if I rember, is correct
The only reason I can think of is in one of the configs I tried to write, theres a bit that defines the muzzle..?

That should be the last problem, as every thing seems to work, apart from the AI attack distance (But that's easily changable)

- Ben
Title: Re:CPP Help - Important!
Post by: Planck on 22 May 2004, 17:39:35
I'd check your spelling of the mussle flash name.

I think it is zasleh, not zalesh.


Planck
Title: Re:CPP Help - Important!
Post by: DBR_ONIX on 22 May 2004, 19:55:46
I'll give that a go..
Thanks a lot mate :)
My Checz isn't what it used to be :P
I'll do that list of weapon/vehicle points one day ::)

- Ben
[Edit]Yeah, it's zasleh - I guess that explain the flash being wrong. Ah, I like it when it's simple things :D Thanks![/edit]
Title: Re:CPP Help - Important!
Post by: DesertStormMan on 23 May 2004, 04:02:19
can someone make a config for me for a plane for 1.46
C-47 Skytrain
230 mph max
28 people it can fit in the cargo

Title: Re:CPP Help - Important!
Post by: DBR_ONIX on 23 May 2004, 11:38:08
That was ranom :P
I don't think y'can get more that 12 people in cargo in pre-something (Res?)

Best thing to do it get a 1.46 plane, and de-pbo it..?
Also, how y'gonna do the stuff like animate selections (Like the doors).. Do they work? (Not sure)

Anyway, the weapon works perfectly :) I'm gonna redo the muzzleflash though, as it looks naff.. But it works :)

Thanks sooo much Pathy & Planck!
- Ben
Title: Re:CPP Help - Important!
Post by: DesertStormMan on 23 May 2004, 20:48:28
can someone give me the link for unpbo
Title: Re:CPP Help - Important!
Post by: Pathy on 26 May 2004, 10:14:39
NP mate. Solve the topic so it cant be crashed any longer.

Desert Storm, start your own topics..... ;)
Title: Re:CPP Help - Important!
Post by: DesertStormMan on 05 Jun 2004, 23:08:34
can someone help me out and make a tank .pbo for me not the tank just the config and then .pbo it.
Title: Re:CPP Help - Important!
Post by: Pathy on 06 Jun 2004, 01:34:37
Ok i shall repeat my message more forcefully, hopefully you will understand this time:

THIS IS NOT YOUR TOPIC. If you want help on another issue which does not relate to the topic that Dr Onix started here, make your own topic. Please.
Title: Re:CPP Help - Important!
Post by: Noon416 on 06 Jun 2004, 01:45:36
IM sent to DesertStormMan.
If it continues, please report this thread to a moderator.

Thanks.
Title: Re:CPP Help - Important!
Post by: DBR_ONIX on 06 Jun 2004, 11:04:15
that Dr Onix started here
Hehehehehe :P
Thats gotta be the best spelling of DBR_ONIX yet :P

Anyway, the weapon is comming along nicely, thanks to y'all (Most of ya, anyway.. j/k :P)

Just need to sort the scaling/position, and fix the reddot scope on it, and I'm done

Thanks for all your help, everyone!
- Ben
[thread thingy solved :)]