OFPEC Forum
Addons & Mods Depot => OFP - Addons & Mods General => Topic started by: Cpl. Vagabond on 23 Aug 2003, 17:08:10
-
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"
-
Replace magazines[]={"vag_nighthawkMag"}; with this magazines[]={"vag_nighthawkammo"};
-
now i get the error
No Entry 'config.cpp/CfgWeapons.vag_nighthawk'.
-
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. ;)
-
well i didn't make the dam config!!!!
-
Sweet jeebus... how hard can it be? I mean, come on...I basically spelled it out for you
Change the line
class vag_nighthawkBase: HandGunBase
to
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
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 (http://www.ofpec.com/yabbse/index.php?board=3;action=display;threadid=12445)
-
i got the same error message
-
Hmm... the CfgModels part lacks a closing "};"
Here's how it looks:
class CfgModels
{
class default {};
class Weapon: default {};
class vag_nighthawk: Weapon {};
And how it should be:
class CfgModels
{
class default {};
class Weapon: default {};
class vag_nighthawk: Weapon {};
};
Note the "};" in the end.
-
No Entry 'config.cpp/CfgWeapons.vag_nighthawkammo'
right about now i'm going insane
-
OK I GOT THE GUN INGAME, BUT I CAN'T GET THE AMMO WORKING
-
Edited, see the end this message...
Does this one work?
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
-
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 (http://www.zerohazard.net/vag_nighthawk.zip)
please fix this thing before this kills me
-
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.
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:
removeAllWeapons player; player addMagazine "vag_nighthawkmag"; player addMagazine "vag_nighthawkmag"; player addMagazine "vag_nighthawkmag"; player addMagazine "vag_nighthawkmag"; player addWeapon "vag_nighthawk"
-
thank you it works, i'll mention your good work in the readme
-
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.)