Home   Help Search Login Register  

Author Topic: Minigun magazine  (Read 6332 times)

0 Members and 2 Guests are viewing this topic.

bennyboy

  • Guest
Re:Minigun magazine
« Reply #15 on: 15 Jan 2005, 13:00:06 »
WeaponSlotItem is a definition to tell ofp how many slots to take up.  OFP defines one slot taken up as having a value of 256, so for 4 slots you'd need a value of 1024.  

Make sure you have the definition line correct and use a multiplier as stated above.  Your config appears to have 2 errors:

1) The config below seems to be missing a correct definition for WeaponSlotItem - you've configured a definition called WeaponSlotItem256 instead.  You need to put a space between the variable name you are defining and it's value.  OFP is probably crashing (when you have tried to use the correct variable name) beacuse it is being told to multiply 4*0 since it can't find a correct definition of WeaponSlotItem.

2) Looking closer at the config, you have this line:

      magazineType="4 * 256"

that will set magazineType to the string of "4 * 256", the quotes should be left out to get a numerical value of 4*256.

You could always just hardcode it to magazineType = 1024;

Hope this helps.

Offline Plane

  • Members
  • *
  • You can call me my nickname "Plane"!
Re:Minigun magazine
« Reply #16 on: 16 Jan 2005, 05:38:50 »
All right,where is the problem.It still crash...

Here is my config:

// 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 hh_minigun_Soldier   {units[] = {hh_minigun_Soldier};   weapons[] = {};   requiredVersion = 1.75;   };
   class m134_minigun      {units[] = {m134_minigun};   weapons[] = {};   requiredVersion = 1.75;   };
};


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

class CfgAmmo
{
   class Default {};
   class BulletSingle : Default {};
   class hh_minigunAmmo: BulletSingle
        {
      hit=10;
                indirectHit=0.4;
      indirectHitRange=1.000000;
      minRange=4;
      minRangeProbab=0.900000;
      midRange=200;
      midRangeProbab=0.500000;
      maxRange=800;
      maxRangeProbab=0.050000;
      cost=30;
   };
};

class CfgWeapons

{
   class Default{};
   class MGun: Default{};
   class MachineGun7_6: MGun{};  
   class MachineGun7_6Manual: MachineGun7_6{};
   class PK: MachineGun7_6Manual{};
        class m134_minigun: PK
        {
             ammo=hh_minigunAmmo;
             count=100;
             model="\minigun\minigun";
             modelOptics="optika_PK";
             displayName="M134";
             displayNameMagazine="M134 Magazine";
             shortNameMagazine="M134";
             drySound[]={"weapons\m16dry",0.000316,1};
        initSpeed=600;
        reloadTime=0.0100000;
        magazineReloadTime=0.0500000;
             magazines[] = {"m134_mag"};
             magazineType = 1024;
        autoReload=1;
        dispersion=0.0015;
        sound[]={"\minigun\minigun.wss",db0,1};
        soundContinuous=true;
        maxLeadSpeed=865;
           picture="\minigun\M134.paa";
        revolving="barrels";
        revolvingAxis="barrels_axis";
        };

        class m134_mag: m134_minigun
   {
      displayNameMagazine = M134 Magazine;
      shortNameMagazine = M134mag;
                picture="\minigun\M134Ammobox.paa";
      
   };

};
class CfgNonAIVehicles
{
   class ProxyWeapon {};
   class Proxyhh_minigun: ProxyWeapon {};
};

//Vehicle Settings

class CfgVehicles
{
   class All{};
   class AllVehicles:All{};
   class Land:AllVehicles{};
   class Man:Land{};
   class Soldier:Man{};
   class SoldierWB:Soldier{}
   class hh_minigunSoldier: SoldierWB
   {
      displayName="M134 Machine Gunner";
      weapons[]={"m134_minigun"};
      magazines[]={"m134_mag","m134_mag","m134_mag","m134_mag","m134_mag"};
   };

};
The propeller is just a big fan in front of the plane used to keep the pilot cool. When it stops, you can actually watch the pilot start sweating.

Offline Pilot

  • Contributing Member
  • **
Re:Minigun magazine
« Reply #17 on: 16 Jan 2005, 15:04:11 »
I think what bennyboy is suggesting is to change this define:

Code: [Select]
#define WeaponSlotItem         256// items
to:

Code: [Select]
#define WeaponSlotItem         1024// items
And in the CfgWeapons part of the config, change this value:

Code: [Select]
magazineType = 1024;
to:

Code: [Select]
magazineType = WeaponSlotItem;
Try that and see if it helps.

Offline Plane

  • Members
  • *
  • You can call me my nickname "Plane"!
Re:Minigun magazine
« Reply #18 on: 17 Jan 2005, 11:30:01 »
So sorry,it still crash. :joystick:

Is it a weapon type limitation,PK type weapon at most take 2 slots? ???

If it is, can we try other weapon types but not Secondary weapon?
 :help:
The propeller is just a big fan in front of the plane used to keep the pilot cool. When it stops, you can actually watch the pilot start sweating.

Offline Infierie Blou

  • Members
  • *
  • Keep your friends close but your enemies closer
Re:Minigun magazine
« Reply #19 on: 17 Jan 2005, 11:53:23 »

#define WeaponNoSlot0 // dummy weapons
#define WeaponSlotPrimary1 // primary weapons
#define WeaponSlotSecondary16 // secondary weapons
#define WeaponSlotHandGun2 // HandGun
#define WeaponSlotHandGunItem32 // HandGun magazines
#define WeaponSlotItem256 // items
#define WeaponSlotBinocular4096 // binocular
#define WeaponHardMounted65536

that's what you want (I think ???)

Offline Infierie Blou

  • Members
  • *
  • Keep your friends close but your enemies closer
Re:Minigun magazine
« Reply #20 on: 17 Jan 2005, 11:55:19 »
(Sorry didn't read 2nd page)

Offline Pilot

  • Contributing Member
  • **
Re:Minigun magazine
« Reply #21 on: 17 Jan 2005, 20:18:45 »
It may be a weapon type limitation, I really don't know. ???

If you want to try another weapon type, try this, change:
Quote
class CfgWeapons

{
   class Default{};
   class MGun: Default{};
   class MachineGun7_6: MGun{};  
   class MachineGun7_6Manual: MachineGun7_6{};
   class PK: MachineGun7_6Manual{};
   class m134_minigun: PK
to:
Code: [Select]
class CfgWeapons

{
   class Default{};
   class LAWLauncher: Default{};
   class class m134_minigun: LAWLauncher

or:
Code: [Select]
class CfgWeapons

{
   class Default{};
   class LAWLauncher: Default{};
   class CarlGustavLauncher : LAWLauncher{};
   class m134_minigun: CarlGustavLauncher

Offline Plane

  • Members
  • *
  • You can call me my nickname "Plane"!
Re:Minigun magazine
« Reply #22 on: 18 Jan 2005, 05:35:27 »
Yes this may works,but it's on the secoundary weapon and fires on the shoulder with one bullet.
Not full auto mode anymore! ???

 :help:
The propeller is just a big fan in front of the plane used to keep the pilot cool. When it stops, you can actually watch the pilot start sweating.

Offline Pilot

  • Contributing Member
  • **
Re:Minigun magazine
« Reply #23 on: 18 Jan 2005, 19:04:47 »
put this into your CfgWeapons section:

Code: [Select]
weapontype= WeaponSlotPrimary;

Offline Pilot

  • Contributing Member
  • **
Re:Minigun magazine
« Reply #24 on: 23 Jan 2005, 18:23:33 »
If that doesn't work, you can try one of the following:
Code: [Select]
class CfgWeapons

{
  class Default{};
  class MGun: Default{};
  class MachineGun7_6: MGun{};  
  class MachineGun7_6Manual: MachineGun7_6{};
  class m134_minigun: MachineGun7_6Manual
or
Code: [Select]
class CfgWeapons

{
  class Default{};
  class MGun: Default{};
  class MachineGun7_6: MGun{};  
  class m134_minigun: MachineGun7_6

I hope one of those works!

Offline Plane

  • Members
  • *
  • You can call me my nickname "Plane"!
Re:Minigun magazine
« Reply #25 on: 28 Jan 2005, 09:55:22 »
I used the following...

class Default{};
 class MGun: Default{};
 class MachineGun7_6: MGun{};  
 class MachineGun7_6Manual: MachineGun7_6{};
 class m134_minigun: MachineGun7_6Manual
And add
weapontype= WeaponSlotPrimary;

But it has no picture now
The propeller is just a big fan in front of the plane used to keep the pilot cool. When it stops, you can actually watch the pilot start sweating.

Offline Pilot

  • Contributing Member
  • **
Re:Minigun magazine
« Reply #26 on: 28 Jan 2005, 16:22:39 »
Damn!  If it isn't one thing it's another! ::)

Anyway, does the weapon work the way it's supposed to?

Also, does the magazine picture show up properly?  Or do both pictures not work?

Offline Pilot

  • Contributing Member
  • **
Re:Minigun magazine
« Reply #27 on: 28 Jan 2005, 16:43:08 »
I've been looking through the commented config, and found this command.  I pretty sure it defines the picture.  Put it in your CfgWeapons Section:
Code: [Select]
uiPicture = \YourAddonFolder\YourPictureName;Make sure to put in this command for both your weapon and magazine

If you have any other command that calls the picture, delete it.

I hope that fixes the problem!

EDIT:
I've been looking at your config you posted above.  In the CfgVehicles section, you assigned the soldier 5 mags.  If each mag takes up 4 slots, 5 mags will take up 20 slots.  Operation Flashpoint only allows 10 slots for ammo.  Delete 3 of the mags, so you only have 2 mags assigned to the soldier.  It should look like this:
Code: [Select]
magazines[]={"m134_mag","m134_mag"};The two mags will take up 8 slots, allowing two more slots for handgrenades or flares.  Don't know if this was causing a problem, but it sure couldn't be helping anything.
« Last Edit: 28 Jan 2005, 16:58:35 by Student Pilot »

Offline Plane

  • Members
  • *
  • You can call me my nickname "Plane"!
Re:Minigun magazine
« Reply #28 on: 29 Jan 2005, 08:28:16 »
Thanks! Student Pilot :thumbsup:

The problem is the overload of soldior's magazine, it cause OFP crashes.
Now it solved! ;D
Well done guys! :cheers:

I have another small question:
M134 minigun have a max speed of 4200 shot/min, it means 70 shot/sec, so the reload time is 0.0142s.
So...
Code: [Select]
reloadTime=0.0142;
But I test its speed, still not reached, only 800 shots per minite...
Even I change to
Code: [Select]
reloadTime=0.0100000;
So how can I add the firing speed? :gunman:
The propeller is just a big fan in front of the plane used to keep the pilot cool. When it stops, you can actually watch the pilot start sweating.

Offline Pilot

  • Contributing Member
  • **
Re:Minigun magazine
« Reply #29 on: 29 Jan 2005, 19:09:03 »
Glad to hear it's working! :gunman:

Well, you math is right, and reload time appears to be the time it takes to reload each bullet.  So I am not sure what is wrong ???

Try an experiment. Put this in instead:
Code: [Select]
reloadTime=0.0010000;And see if the firing rate increases.

btw, what class does you weapon inherit in the CfgWeapons section?