Hi,
I'm making a weapon for Opflash: Resistance (OICW, for personal use) and I've got a few problems with it. I've made many weapons before, but this is my first time making one with a grenade launcher clip, and it's taken many months and effort, different styles of configs and what not. I can make one with a single shot grenade launcher, but a clip sized grenade launcher and the whole thing bugs up with errors.
1. The thing is stuck at single fire, burst and grenade launcher. I added full auto but for some reason it's not selecting it ingame. It goes from single to burst to grenade. I have no idea why this is, I've checked over hundreds of times and full auto should work, but it's not.
2. I want to make seperate magazines for the gun(30 round rifle rounds and 6 grenade rounds) so it will have it's own reload sound (currently it keeps playing the original one for all rifles in the game) and a clip for the grenades that can hold 6 rounds. I've tried making my own clips but it keeps coming up with errors this can't be found, undefined base class this and that, blah de blah. I
normally use this config:
class YIJ_OICWMag : YIJ_OICW
{
scopeWeapon=0;
scopeMagazine=2;
picture="\dtaext\equip\m\m_m4.paa";
displayNameMagazine = "OICW Magazine";
shortNameMagazine = "OICW";
count=30;
};
};
[/b]
but then that keeps bugging me about undefined base class, so I didn't use it. If someone could tell me how to write a new magazine properly that would be great. A link to a still working tutorial would be ace.
Thanks very much for the help! If you need me to send you the actual weapon to work in the game I will do so.
Here's my config.cpp file
[b]
//------------------------------------------------------
//OICW by Yij
//------------------------------------------------------
// some basic defines
#define TEast 1
#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
//------------------------------------------------------
//Patches
//------------------------------------------------------
class CfgPatches
{
class YIJ_OICWSoldier
{
units[] = {OICWSoldier};
weapons[] = {};
requiredVersion = 1.30;
};
//------------------------------------------------------
//Weapons
//------------------------------------------------------
class YIJ_OICW
{
units[] = {YIJ_OICW};
weapons[] = {};
requiredVersion = 1.30;
};
};
//------------------------------------------------------
//Models
//------------------------------------------------------
class CfgModels
{
class Default
{
sections[]={};
sectionsInherit="";
};
class Weapon: Default
{
sections[]={"zasleh"};
};
class OICW: Weapon{};
};
//------------------------------------------------------
//Recoils
//------------------------------------------------------
class CfgRecoils
{
OICWrec[]={0.05,0.02,0.04, 0.05,0,0};
OICW20mmrec[]={0.05,0.06,0.08, 0.1,0,0};
};
//------------------------------------------------------
//Ammo
//------------------------------------------------------
class CfgAmmo
{
class default {};
class BulletSingle : default{};
class BulletBurst: BulletSingle{};
class BulletFullAuto: BulletBurst{};
class BulletSingleW: BulletSingle{};
class BulletBurstW: BulletBurst{};
class BulletFullAutoW: BulletFullAuto{};
};
//------------------------------------------------------
//Weapons
//------------------------------------------------------
class CfgWeapons
{
class Default {};
class MGun: Default {};
class Riffle: MGun {};
class M16: Riffle {};
class YIJ_OICW: M16
{
displayName="OICW";
scopeWeapon=2;
scopeMagazine=2;
weaponType=1;
picture="\dtaext\equip\m\m_m4.paa";
model="\OICW\OICW.p3d";
modelOptics = "optika_snpierw";
optics=1;
opticsZoomMin=0.300000;
opticsZoomMax=0.300000;
displayNameMagazine="OICW Mag";
shortNameMagazine="OICW";
reloadMagazineSound[]={"\OICW\OICW_reload.wav",db-70,1};
drySound[]={"\OICW\OICW_Dry.wav",db-70,1};
initSpeed=950;
maxLeadSpeed=500;
count=30;
modes[]={"Single","Burst","FullAuto"};
magazines[]={"YIJ_OICW"};
class Single
{
ammo="BulletSingleW";
multiplier=1;
burst=1;
displayName="OICW Single";
dispersion=0.0002;
sound[]={"\OICW\OICW_Fire.wav",db0,1};
soundContinuous=0;
reloadTime=0.08;
ffCount=1;
autoFire=0;
recoil="OICWrec";
aiRateOfFire=5.000000;
aiRateOfFireDistance=500;
useAction=0;
useActionTitle="";
};
class Burst
{
ammo="BulletBurstW";
multiplier=1;
burst=3;
displayName="OICW Burst";
dispersion=0.0005;
sound[]={"\OICW\OICW_Burst.wav",db0,1};
soundContinuous=0;
reloadTime=0.08;
ffCount=1;
autoFire=0;
recoil="OICWrec";
aiRateOfFire=5.0;
aiRateOfFireDistance=700;
useAction=0;
useActionTitle="";
};
class FullAuto
{
ammo="BulletFullAutoW";
multiplier=1;
burst=1;
displayName="OICW Auto";
dispersion=0.0008;
sound[]={"\OICW\OICW_Fire.wav",db0,1};
soundContinuous=0;
reloadTime=0.08;
ffCount=1;
recoil="OICWrec";
autoFire=1;
aiRateOfFire=5.0;
aiRateOfFireDistance=700;
useAction=0;
useActionTitle="";
};
};
class GrenadeLauncher: Default {};
class YIJ_OICWGL
{
scopeWeapon=2;
scopeMagazine=0;
weaponType=1;
displayName="OICW 20mmGL";
model="\OICW\OICW.p3d";
picture="\dtaext\equip\m\m_m4.paa";
muzzles[]={"YIJ_OICWMuzzle","YIJ_OICWGLMuzzle"};
recoil="OICW20mmrec";
class YIJ_OICWMuzzle: M16
{
modelOptics = "optika_snpierw";
optics = true;
opticsZoomMin=0.04;
opticsZoomMax=0.12;
displayNameMagazine="OICW Mag";
shortNameMagazine="OICW";
magazines[]={"YIJ_OICW"};
};
class YIJ_OICWGLMuzzle: GrenadeLauncher
{
displayName="OICW 20mmGL";
modelOptics = "optika_snpierw";
optics = true;
opticsZoomMin=0.04;
opticsZoomMax=0.12;
sound[]={"weapons\M16GrenadeLaunch",0.000316,1};
magazines[]={"GrenadeLauncher"};
recoil="OICW20mmrec";
};
};
//------------------------------------------------------
//Vehicles
//------------------------------------------------------
};
class CfgVehicles
{
class all {};
class AllVehicles: All {};
class Land: AllVehicles {};
class Man: Land {};
class Soldier: Man {};
class SoldierWB: Soldier {};
class YIJ_OICWGLSoldier: SoldierWB
{
displayName="Soldier, OICW";
vehicleclass = "Yij";
weapons[]={"Throw","Put","NVGoggles","YIJ_OICWGL"};
magazines[]={"YIJ_OICW","YIJ_OICW","YIJ_OICW","GrenadeLauncher","GrenadeLauncher"};
class CfgNonAIVehicles
{
class ProxyWeapon {};
class ProxyYIJ_OICW: ProxyWeapon {};
};
[/b]