Home   Help Search Login Register  

Author Topic: config.cpp: some input after EndOfFile  (Read 4962 times)

0 Members and 1 Guest are viewing this topic.

Offline Oni24

  • Members
  • *
config.cpp: some input after EndOfFile
« on: 16 Sep 2008, 20:25:11 »
hello.... i need some help im total beginer in making configs...

im trying to learn from another addon makers config.cpp and i
trying to configure Glock18c with fullauto mode
here it is


Code: [Select]
#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
#define WeaponSlotPrimary  1
#define WeaponSlotSecondary 16
#define WeaponSlotItem   256
#define WeaponSlotBinocular 4096
#define WeaponHardMounted  65536 

class CfgPatches
{
class Glock18c
{
units[] = {Glock18c};
weapons[] = {Glock18c};
requiredVersion = 1.75;
};
};
class CfgModels
{
class Default
{
sections[] = {};
sectionsInherit="zasleh";
};
class Weapon: Default{};
class glock18c: Weapon {};

};

class CfgAmmo
{
class Default {};
class BulletSingle: Default {};
class glock18c: Bulletsingle {};
class glock18cBullet: Glock18c
{
hit = 8.5
indirecthit = 1
indirecthitrange = 0.05
minrange=1; minrangeprobab=0.20000;
midrange=45; midrangeprobab=0.75000;
maxrange=200; maxrangeprobab=0.86500;
cartridge="FXCartridgeSmall";
};

};
class CfgWeapons
{
class Default {};
class MGun: Default {};
class Riffle: MGun {};
class HK: Riffle {};
class Glock18cBase: HK{};
class Glock18c: Glock18cBase
{
scopeWeapon=2;
scopeMagazine=0;
displayName="Glock18c"
displayNameMagazine="Glock18c Mag"
model="\Glock18c\Glock18c.p3d";
modes[]={"Single","FUllAuto"};
magazines[]={"Glock18cMag"};
candrop=true;
enableattack=true;
picture="\glock18c\glock.paa";
modelOptics="\glock18c\glock_opt.p3d";
cursor = w_weapon;
cursorAim ="\Glock18c\empty.paa";
};

class Single
{
ammo = Glock18cBullet;
multiplier=1;
burst=1;
displayName = "9x19 Luger";
dispersion=0.002;
sound[]={"\Glock18c\Fire.wss",db0,1};
soundContinuous=0;
reloadTime=0.066;
ffCount=1;
autoFire = false;
aiRateOfFire=1.00000;
aiRateOfFireDistance=500;
useAction = false;
useActionTitle = "";
};
class FullAuto
{
ammo = Glock18cBulet;
multiplier=1;
burst=1;
displayName= "9x19 Luger";
dispersion=0.004;
sound[]={"\Glock18cd\Fire.wss",db0,1};
soundContinuous=0;
reloadTime=0.066;
ffCount=1;
autoFire = true;
aiRateOfFire=1.00000;
aiRateOfFireDistance=500;
useAction = false;
useActionTitle = "";
};
};

};
class CfgVehicles
{
class All {};
class AllVehicles: All {};
class Land: AllVehicles {};
class Man: Land {};
class Soldier: Man {};
class Civilian:Soldier{};

class Glock18c: Civilian
{
access=2
displayName="Glock18c";
weapons[]={"Throw","Put","Glock18c"};
magazines[]={"Glok18cMag","Glok18cMag","Glok18cMag","Glok18cMag"};
};
};
class CfgNonAIVehicles
{
class ProxyWeapon {};
class ProxyGlock18c : ProxyWeapon {};
};
but it ocures error message "config glock18c\config.cpp: some input after EndOfFile"
i know what it means but cant figure out how to repair it.....
(i dont really know if it is defined as a secundary handgun.....)

thenx
« Last Edit: 16 Sep 2008, 21:15:14 by bedges »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: config.cpp: some input after EndOfFile
« Reply #1 on: 16 Sep 2008, 21:16:45 »
Code: [Select]
class Glock18c: Civilian
{
access=2
displayName="Glock18c";
weapons[]={"Throw","Put","Glock18c"};
magazines[]={"Glok18cMag","Glok18cMag","Glok18cMag","Glok18cMag"};
};

doesn't access=2 need a ; after it? In fact there are quite a few missing ;s...

Offline Oni24

  • Members
  • *
Re: config.cpp: some input after EndOfFile
« Reply #2 on: 16 Sep 2008, 22:32:04 »
yes..... this is my very first config file and i dont really know what must be there so if you can help me with it.... i will be very thenkfull.....

i want it to be secundary weapon (hangun) glock18c with:
- single/fullauto modes
- magazine capacity about 32 rounds
- if posibile then flashlight....


Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: config.cpp: some input after EndOfFile
« Reply #3 on: 17 Sep 2008, 16:18:17 »
Yes as bedges pointed out there are a few lines with ';' missing from the end, however the main problem there was you had closed your cfgWeapons/class Glock18c section before adding the 'class Single' and 'class FullAuto' and then closed the cfgWeapons section after those, leaving a spare ';' on the end which along with the rest of the config was seen as
input after end of file.

Try this one with those bits hopefully fixed, along with other hopeful improvements.   :o

Code: [Select]
#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
#define WeaponSlotPrimary  1
#define WeaponSlotSecondary 16
#define WeaponSlotItem   256
#define WeaponSlotBinocular 4096
#define WeaponHardMounted  65536 


class CfgPatches
{
class Glock18c
{
units[] = {Glock18c};
weapons[] = {Glock18c};
requiredVersion = 1.75;
};
};

class CfgModels
{
class Default
{
sections[] = {};
sectionsInherit="zasleh";
};
class Weapon: Default{};
class glock18c: Weapon {};

};

class CfgAmmo
{
class Default {};
class BulletSingle: Default {};
class glock18cBullet: Bulletsingle
{
hit = 8.5;
indirecthit = 1;
indirecthitrange = 0.05;
minrange=1; minrangeprobab=0.20000;
midrange=45; midrangeprobab=0.75000;
maxrange=200; maxrangeprobab=0.86500;
cartridge="FXCartridgeSmall";
};

};

class CfgWeapons
{
class Default {};
class MGun: Default {};
class Riffle: MGun {};
class HandGunBase:Riffle{};
class GlockBase: HandGunBase {};
class GlockSBase:GlockBase {};
class GlockSMag: GlockSBase {};
class Glock18cMag: GlockSMag {};

class Glock18c: GlockSBase
{
scopeWeapon=2;
magazines[]={"Glock18cMag"};
displayName="Glock18c";
displayNameMagazine="Glock18c Mag";
model="\Glock18c\Glock18c.p3d";
modes[]={"Single","FUllAuto"};
candrop=true;
enableattack=true;
picture="\glock18c\glock.paa";
modelOptics="\glock18c\glock_opt.p3d";
cursor = w_weapon;
cursorAim ="\Glock18c\empty.paa";

class Single
{
ammo = Glock18cBullet;
multiplier=1;
burst=1;
displayName = "9x19 Luger";
dispersion=0.002;
sound[]={"\Glock18c\Fire.wss",db0,1};
soundContinuous=0;
reloadTime=0.066;
ffCount=1;
autoFire = false;
aiRateOfFire=1.00000;
aiRateOfFireDistance=500;
useAction = false;
useActionTitle = "";
};

class FullAuto
{
ammo = Glock18cBulet;
multiplier=1;
burst=1;
displayName= "9x19 Luger";
dispersion=0.004;
sound[]={"\Glock18cd\Fire.wss",db0,1};
soundContinuous=0;
reloadTime=0.066;
ffCount=1;
autoFire = true;
aiRateOfFire=1.00000;
aiRateOfFireDistance=500;
useAction = false;
useActionTitle = "";
};
};
};

class CfgVehicles
{
class All {};
class AllVehicles: All {};
class Land: AllVehicles {};
class Man: Land {};
class Civilian: Man {};

class Glock18c: Civilian
{
access=2;
displayName="Glock18c";
weapons[]={"Throw","Put","Glock18c"};
magazines[]={"Glok18cMag","Glok18cMag","Glok18cMag","Glok18cMag"};
};
};

class CfgNonAIVehicles
{
class ProxyWeapon {};
class ProxyGlock18c : ProxyWeapon {};
};
« Last Edit: 17 Sep 2008, 19:43:08 by Planck »
I know a little about a lot, and a lot about a little.

Offline Oni24

  • Members
  • *
Re: config.cpp: some input after EndOfFile
« Reply #4 on: 17 Sep 2008, 17:22:48 »
 :) thenks for reply and for the config file.. but there is another problem to solve
"error config.cpp/cfgweapons/: 'c' encontered instead of  '{' "
becose of my knowledge of configfiles i dont even know what is this 'c'

// hey question:! is it posible to add reflector on the gun??? like add "l svetlo" and configure it in config.cpp????

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: config.cpp: some input after EndOfFile
« Reply #5 on: 17 Sep 2008, 19:33:51 »
The error comes up because there is a missing {}; in this section:
Code: [Select]
class CfgWeapons
{
class Default {};
class MGun: Default {};
class Riffle: MGun {};
class HandGunBase:Riffle{};
class GlockBase: HandGunBase {};
class GlockSBase:GlockBase
class GlockSMag: GlockSBase {};
class Glock18cMag: GlockSMag {};

Quote
is it posible to add reflector on the gun???
If you mean a light source I'm pretty sure that's not possible :(
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: config.cpp: some input after EndOfFile
« Reply #6 on: 17 Sep 2008, 19:41:43 »
Aye, that was my error h-, one I introduced, one reason why I said:

Quote
Try this one with those bits hopefully fixed, along with other hopeful improvements

 :P :P

My first post modified to reflect the fix.


Planck
« Last Edit: 17 Sep 2008, 19:43:43 by Planck »
I know a little about a lot, and a lot about a little.

Offline Oni24

  • Members
  • *
Re: config.cpp: some input after EndOfFile
« Reply #7 on: 18 Sep 2008, 16:58:26 »
yeah thenx for yours hard work guys. i was able to see my beloved glock18 in my hands in OFP...
but it still needs to fix some big bugs thet will not be posible without your hepl.

bugs:
- when the gun ist in hands it display name "Glock17S" even the magazine thet the character is holding are named glock17sMag.....
- becose of this when you fire all rounds the gun is holding the magazines are worthless (cant reload)
- the magazinecapacity is 17 just like glock17 (real glock 18c is holding 32 rounds.)
- it sound like Glock with silencer it is not using the fire.wss...
- only singleshot mode works. when you press "spacebar" to shwich modes "blam" fatal error!

here is the config file you have made:

Code: [Select]
#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
#define WeaponSlotPrimary  1
#define WeaponSlotSecondary 16
#define WeaponSlotItem   256
#define WeaponSlotBinocular 4096
#define WeaponHardMounted  65536 


class CfgPatches
{
class Glock18c
{
units[] = {Glock18c};
weapons[] = {Glock18c};
requiredVersion = 1.75;
};
};

class CfgModels
{
class Default
{
sections[] = {};
sectionsInherit="zasleh";
};
class Weapon: Default{};
class glock18c: Weapon {};

};

class CfgAmmo
{
class Default {};
class BulletSingle: Default {};
class glock18cBullet: Bulletsingle
{
hit = 8.5;
indirecthit = 1;
indirecthitrange = 0.05;
minrange=1; minrangeprobab=0.20000;
midrange=45; midrangeprobab=0.75000;
maxrange=200; maxrangeprobab=0.86500;
cartridge="FXCartridgeSmall";
};

};

class CfgWeapons
{
class Default {};
class MGun: Default {};
class Riffle: MGun {};
class HandGunBase:Riffle{};
class GlockBase: HandGunBase {};
class GlockSBase:GlockBase {};
class GlockSMag: GlockSBase {};
class Glock18cMag: GlockSMag {};

class Glock18c: GlockSBase
{
scopeWeapon=2;
magazines[]={"Glock18cMag"};
displayName="Glock18c";
displayNameMagazine="Glock18c Mag";
model="\Glock18c\Glock18c.p3d";
modes[]={"Single","FUllAuto"};
candrop=true;
enableattack=true;
picture="\glock18c\glock.paa";

cursor = w_weapon;
cursorAim ="\Glock18c\empty.paa";

class Single
{
ammo = Glock18cBullet;
multiplier=1;
burst=1;
displayName = "9x19 Luger";
dispersion=0.002;
sound[]={"\Glock18c\Fire.wss",db0,1};
soundContinuous=0;
reloadTime=0.066;
ffCount=1;
autoFire = false;
aiRateOfFire=1.00000;
aiRateOfFireDistance=500;
useAction = false;
useActionTitle = "";
};

class FullAuto
{
ammo = Glock18cBulet;
multiplier=1;
burst=1;
displayName= "9x19 Luger";
dispersion=0.004;
sound[]={"\Glock18cd\Fire.wss",db0,1};
soundContinuous=0;
reloadTime=0.066;
ffCount=1;
autoFire = true;
aiRateOfFire=1.00000;
aiRateOfFireDistance=500;
useAction = false;
useActionTitle = "";
};
};
};

class CfgVehicles
{
class All {};
class AllVehicles: All {};
class Land: AllVehicles {};
class Man: Land {};
class Civilian: Man {};

class Glock18c: Civilian
{
access=2;
displayName="Glock18c";
weapons[]={"Throw","Put","Glock18c"};
magazines[]={"Glock18cMag","Glock18cMag","Glock18cMag","Glock18cMag"};
};
};

class CfgNonAIVehicles
{
class ProxyWeapon {};
class ProxyGlock18c : ProxyWeapon {};
};


 :weeping:
« Last Edit: 18 Sep 2008, 21:25:04 by bedges »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: config.cpp: some input after EndOfFile
« Reply #8 on: 18 Sep 2008, 21:24:35 »
Please use the code format when posting code - - makes it easier to read.  :good:

Offline Oni24

  • Members
  • *
Re: config.cpp: some input after EndOfFile
« Reply #9 on: 18 Sep 2008, 22:29:41 »
ok ... my problem is solved..... the config file you gave me was wrong..... after 15hour behind computer punching monitor breaking keybord and lots of strong words i figured out the config.cpp from the very beginning on my own... and it is working perfectly....... thenx all for reply...

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: config.cpp: some input after EndOfFile
« Reply #10 on: 19 Sep 2008, 12:12:55 »
Aye that was a presumption on my part, I presumed you wanted the silenced glock to inherit from (GlockSBase), also inherited your magazine from GlockSBAse too.....sorry.

However the firing modes you have there were not edited at all by me and are the same as your original config, I only moved them into the weapons class definition instead of them lying outside in the cold.


Planck
« Last Edit: 19 Sep 2008, 12:15:32 by Planck »
I know a little about a lot, and a lot about a little.