File ownweapon\config.cpp, line 4: 'cfgWeapons.': '{' encountered instead of ':', D*mn error :@ |
File ownweapon\config.cpp, line 4: 'cfgWeapons.': '{' encountered instead of ':', D*mn error :@ |
Nov 9 2010, 06:42
Post
#1
|
|
Member Group: Members Posts: 131 Joined: 22-May 10 Member No.: 7,651 |
File ownweapon\config.cpp, line 4: 'cfgWeapons.': '{' encountered instead of ':'
So, I was boring and decided just to stick a random model, that I made in 2 secs (a weapon), in ArmA II: OA... I don't have no textures to it yet due to it's a TOTALLY invented model... I've extracted this piece of config.cpp (that I'm using here) from my other post in this section: CODE class cfgWeapons { class AK_74; { model="\ownweapon"; //The directory of the model for the weapon displayname="OWN_WEAPON"; //The display name ingame class Single: Mode_SemiAuto //The semiautomatic firemode class { begin1[] = {"ca\sounds\weapons\rifles\AK74_single2",1.77828,1,1000}; //The firing sound soundBegin[] = {"begin1",1}; //As above, this is a coding relic, to when weapons made different sounds for semi or auto fire back in OFP reloadTime = 0.1; //How fast the weapon fires recoil = "recoil_single_primary_4outof10"; //The recoil, as defined in cfgrecoils, you'll usually just want to use one of the predefined values for this recoilProne = "recoil_single_primary_prone_4outof10"; //As above, but for prone-firing dispersion = 0.00125; //The dispersion minRange = 2;minRangeProbab = 0.3; //For AI, the minimum engagement range with this weapon midRange = 300;midRangeProbab = 0.7; //For AI, the medium engagement range with this weapon maxRange = 600;maxRangeProbab = 0.04; //For AI, the maximum engagement range with this weapon }; class Burst: Mode_Burst { begin1[] = {"ca\sounds\weapons\rifles\AK74_single2",1.77828,1,1000}; soundBegin[] = {"begin1",1}; soundBurst = 0; reloadTime = 0.1; ffCount = 3; recoil = "recoil_auto_primary_3outof10"; recoilProne = "recoil_auto_primary_prone_3outof10"; dispersion = 0.00125; minRange = 50;minRangeProbab = 0.3; midRange = 200;midRangeProbab = 0.7; maxRange = 500;maxRangeProbab = 0.05; }; class FullAuto: Mode_FullAuto { begin1[] = {"ca\sounds\weapons\rifles\AK74_single2",1.77828,1,1000}; soundBegin[] = {"begin1",1}; reloadTime = 0.1; ffCount = 30; recoil = "recoil_auto_primary_4outof10"; recoilProne = "recoil_auto_primary_prone_4outof10"; dispersion = 0.00125; minRange = 0;minRangeProbab = 0.1; midRange = 150;midRangeProbab = 0.7; maxRange = 300;maxRangeProbab = 0.05; }; }; }; I don't care what sound it has, or if it has muzzleflash or not, or any detail... I just want my weapon to appear and being able to fire it. Now the error that turns out to be the title of my post is the error that I get when trying to initialize the game Really have no idea of what's going on, so if any of you got the idea, post it and also (if you feel kindfull) explain how to give my weapon to a unit. Thanks to ya'll |
|
|
Nov 9 2010, 16:46
Post
#2
|
|
Gee, I wish we had one of them doomsday machines. Group: Moderators Posts: 2,037 Joined: 13-November 06 From: Wales Member No.: 155 |
Could you post the whole config? The error indicates a problem near the beginning (probably your CfgPatches section, though I couldn't be sure without seeing the whole thing)
Also, I noticed this line: CODE model="\ownweapon"; //The directory of the model for the weapon Doesn't look right. The directory should look more like this: CODE model="\pbofilename\modelfilename" The way you've defined classes isn't right either, I assume you're trying to make a new weapon, so you'll want to change this: CODE class cfgWeapons { class AK_74; { To this: CODE class cfgWeapons
{ class AK_74; class OWN_Weapon: AK_74 { -------------------- The Rules - Nothing too complicated, follow these and we'll have no problems.
Moderation Feedback Thread - Tell everyone how much you Site Issues Thread - Complain about site issues here. We might even fix them! Community Chatter Thread - Furthest Mud-sling gets a free subscription to "JdB Monthly". QUOTE(Major Mike Shearer) We can categorically state that we have not released man-eating badgers into the area. QUOTE(Brace Belden) A machine gun is like a woman, I don’t understand it, I’m afraid of it, and one day I’ll accidentally be killed by one. |
|
|
Nov 9 2010, 17:17
Post
#3
|
|
Member Group: Members Posts: 131 Joined: 22-May 10 Member No.: 7,651 |
Ohhhhhhhhh!
You'll see: (I'll explain both problems) 1) I thought the 1st directory (pbofilename) was a folder created inside the .PBO, like I had none, I simply erased that part... 2) Like the HSO_AIM47: AK-47 was a model that I THOUGHT was from ArmA II, I didn't bother to keep it... And, respect to that 'whole' config, I'm sorry, I've forgot the cfgPatches Technically THAT'S my 'whole' config I'll fix that now Thanks for your anser EDIT: Okay, here's my cfgPatches stuff: CODE class CfgPatches { class ownweapon //It's best to keep this the same as the name of your pbo, for simplicity { units[] = {}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = {"CAweapons"}; }; }; Is it all okay? I mean, the 'CAweapons' is the appropiate thing to place? And also, should I also include (before cfgPatches and cfgWeapons) the Basic Definitions? Witch are: CODE //Basic Definitions #define true 1 #define false 0 #define VSoft 0 #define VArmor 1 #define VAir 2 #define private 0 #define protected 1 #define public 2 #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 ReadAndWrite 0 #define ReadAndCreate 1 #define ReadOnly 2 #define ReadOnlyVerified 3 #define DefaultManWeapons Throw,Put Again, thanks! This post has been edited by SGJackson: Nov 9 2010, 17:21 |
|
|
Nov 9 2010, 20:08
Post
#4
|
|
Gee, I wish we had one of them doomsday machines. Group: Moderators Posts: 2,037 Joined: 13-November 06 From: Wales Member No.: 155 |
Ok, put in the changes I mentioned in my last post, then add these lines before "class cfgWeapons"
CODE class Mode_SemiAuto { displayName = $STR_DN_MODE_SEMIAUTO; }; class Mode_Burst: Mode_SemiAuto { displayName = $STR_DN_MODE_BURST; }; class Mode_FullAuto: Mode_SemiAuto { displayName = $STR_DN_MODE_FULLAUTO; }; And that *should* fix it. -------------------- The Rules - Nothing too complicated, follow these and we'll have no problems.
Moderation Feedback Thread - Tell everyone how much you Site Issues Thread - Complain about site issues here. We might even fix them! Community Chatter Thread - Furthest Mud-sling gets a free subscription to "JdB Monthly". QUOTE(Major Mike Shearer) We can categorically state that we have not released man-eating badgers into the area. QUOTE(Brace Belden) A machine gun is like a woman, I don’t understand it, I’m afraid of it, and one day I’ll accidentally be killed by one. |
|
|
Nov 9 2010, 20:35
Post
#5
|
|
Member Group: Members Posts: 131 Joined: 22-May 10 Member No.: 7,651 |
ohhhhhhh, you're right, I've forgotten that part... So, my whole config looks like:
CODE //Basic Definitions #define true 1 #define false 0 #define VSoft 0 #define VArmor 1 #define VAir 2 #define private 0 #define protected 1 #define public 2 #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 ReadAndWrite 0 #define ReadAndCreate 1 #define ReadOnly 2 #define ReadOnlyVerified 3 #define DefaultManWeapons Throw,Put class CfgPatches { class ownweapon //It's best to keep this the same as the name of your pbo, for simplicity { units[] = {}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = {"CAweapons"}; }; }; class Mode_SemiAuto { displayName = $STR_DN_MODE_SEMIAUTO; }; class Mode_Burst: Mode_SemiAuto { displayName = $STR_DN_MODE_BURST; }; class Mode_FullAuto: Mode_SemiAuto { displayName = $STR_DN_MODE_FULLAUTO; }; class cfgWeapons { class AK_74; class OWN_weapon: AK_74 { model="\OwnWeapon\ownweapon"; //The directory of the model for the weapon displayname="OWN_WEAPON"; //The display name ingame class Single: Mode_SemiAuto //The semiautomatic firemode class { begin1[] = {"ca\sounds\weapons\rifles\AK74_single2",1.77828,1,1000}; //The firing sound soundBegin[] = {"begin1",1}; //As above, this is a coding relic, to when weapons made different sounds for semi or auto fire back in OFP reloadTime = 0.1; //How fast the weapon fires recoil = "recoil_single_primary_4outof10"; //The recoil, as defined in cfgrecoils, you'll usually just want to use one of the predefined values for this recoilProne = "recoil_single_primary_prone_4outof10"; //As above, but for prone-firing dispersion = 0.00125; //The dispersion minRange = 2;minRangeProbab = 0.3; //For AI, the minimum engagement range with this weapon midRange = 300;midRangeProbab = 0.7; //For AI, the medium engagement range with this weapon maxRange = 600;maxRangeProbab = 0.04; //For AI, the maximum engagement range with this weapon }; class Burst: Mode_Burst { begin1[] = {"ca\sounds\weapons\rifles\AK74_single2",1.77828,1,1000}; soundBegin[] = {"begin1",1}; soundBurst = 0; reloadTime = 0.1; ffCount = 3; recoil = "recoil_auto_primary_3outof10"; recoilProne = "recoil_auto_primary_prone_3outof10"; dispersion = 0.00125; minRange = 50;minRangeProbab = 0.3; midRange = 200;midRangeProbab = 0.7; maxRange = 500;maxRangeProbab = 0.05; }; class FullAuto: Mode_FullAuto { begin1[] = {"ca\sounds\weapons\rifles\AK74_single2",1.77828,1,1000}; soundBegin[] = {"begin1",1}; reloadTime = 0.1; ffCount = 30; recoil = "recoil_auto_primary_4outof10"; recoilProne = "recoil_auto_primary_prone_4outof10"; dispersion = 0.00125; minRange = 0;minRangeProbab = 0.1; midRange = 150;midRangeProbab = 0.7; maxRange = 300;maxRangeProbab = 0.05; }; }; }; WOW! D@V€, you really did it! D*mn it feels good !! Well, I only have to add a HUGE quantity of detail to my weapon (that incudes changing the ugly model), change the inherit from AK to M8 and turn the model 90 degrees You rock. This post has been edited by SGJackson: Nov 9 2010, 20:50 |
|
|
Nov 9 2010, 22:30
Post
#6
|
|
Member Group: Members Posts: 131 Joined: 22-May 10 Member No.: 7,651 |
Hey, and how to make the animation of the magazine going down when reloading and the aiming and that the little handle on the breech of the weapon moves back and foward when shooting?
Also, I noticed a bug! I've already rotated the weapon, due to it was oriented to the right of the payer and now, it's oriented to the front like all the others... But the aiming bar (remember that there are 3 bars, 2 curved and a straigh one that points where the bullet's going) is still oriented to the right :S That means that I have my weapon oriented foward and the 2 curved bars, but the straight one is still to the right of the player, witch means that I fire to the right D:! What to do ? EDIT: Sorry for posting new post, I totally forgot about it :S This post has been edited by SGJackson: Nov 9 2010, 22:36 |
|
|
Lo-Fi Version | Time is now: 30th May 2024 - 12:52 |