warlord554 2065 Posted December 4, 2013 (edited) I have a custom M40A5 I've been working on and finally want to get it in game for testing. I used the BIS LRR .408 config.bin file as a baseline because I want it simulated as if it were chambered in .300WinMag. Anyways I surely have messed up the config file as I can't seem to get it to work in game, HotShotMike1001 has been nice enough to take the time to look into it but we still haven't figured it out. I had to put a link because I don't know how to paste without taking up the whole page. Does anyone see any obvious errors??? http://pastebin.com/raw.php?i=yNixvUFr Edited December 4, 2013 by WarLord554 Share this post Link to post Share on other sites
p1nga 23 Posted December 4, 2013 (edited) I have a custom M40A5 I've been working on and finally want to get it in game for testing. I used the BIS LRR .408 config.bin file as a baseline because I want it simulated as if it were chambered in .300WinMag. Anyways I surely have messed up the config file as I can't seem to get it to work in game, HotShotMike1001 has been nice enough to take the time to look into it but we still haven't figured it out. I had to put a link because I don't know how to paste without taking up the whole page. Does anyone see any obvious errors???http://pastebin.com/raw.php?i=yNixvUFr What exactly is not working, does it give an error of any kind? does it work in Buldozer etc. A few things i noticed/would do differently. When creating a base class for your custom weapon i normally take an existing weapon class from the game that is closest and inherit from that and only change what i need to change. Where you inherit the class "Rifle_Long_Base_F", you could just inherit "srifle_LRR_F" that means you can cut the length of the config down as you don't need to re-create the entire class and leaves less room for mistakes. I quickly made the following in notepad so not sure if it is 100% correct. But in general try to do as little as possible in the config at first and then make the changes to the 'CJM40SF_base_F' base class as needed. It should give you a clone of the L44 .408 that just uses a different model. class CfgPatches { class A3_Weapons_F_CJM40SF { units[] = {}; weapons[] = {"CJM40SF", "CJM40SF_SOS"}; requiredVersion = 0.1; requiredAddons[] = {"A3_Weapons_F"}; }; }; class Mode_SemiAuto; // External class reference class Mode_Burst; // External class reference class Mode_FullAuto; // External class reference class Slotinfo; // External class reference class CfgWeapons { class srifle_LRR_F; //Use The LRR As Base Class class CJM40SF_base_F: srifle_LRR_F { scope = 1; }; class CJM40SF: CJM40SF_base_F { scope = 2; model = "\CJM40\M40.p3d"; displayName = "M40A5 MOD 1"; picture = "\CJM40\data\UI\gear_CJM40_x_ca.paa"; UiPicture = "\A3\weapons_f\data\UI\icon_sniper_CA.paa"; }; class CJM40SF_SOS: CJM40SF { scope = 2; class LinkedItems { class LinkedItemsOptic { slot = "CowsSlot"; item = "optic_SOS"; }; }; }; }; Edited December 4, 2013 by pastor399 Share this post Link to post Share on other sites
warlord554 2065 Posted December 4, 2013 Yes the model and textures are fully functional and look great in bulldozer. It simply gives me a 'bin\config.bin\CfgWeapon.CJM40SF error when I attempt to equip it via classname. I also was wondering about what your suggesting, I have been working on it for a while today with no luck. I will check your config out. Thanks!!! Share this post Link to post Share on other sites
surpher 1 Posted December 5, 2013 You have the lines scope = private; and scope = public; in your config but private and public are never defined. Use scope = 0; and scope = 2; instead. You can use the [noParse] paste code in here [/noParse] tags to post your config.cpp. class CfgPatches { class A3_Weapons_F_CJM40SF { units[] = {}; weapons[] = {"CJM40SF", "CJM40SF_SOS"}; requiredVersion = 0.1; requiredAddons[] = {"A3_Weapons_F"}; }; }; class Mode_SemiAuto; // External class reference class Mode_Burst; // External class reference class Mode_FullAuto; // External class reference class Slotinfo; // External class reference class CfgWeapons { class Rifle_Base_F; // External class reference class Rifle_Long_Base_F : Rifle_Base_F { class WeaponSlotsInfo; // External class reference }; class UGL_F; // External class reference class CJM40SF_base_F : Rifle_Long_Base_F { scope = 0; // Private magazines[] = {"7Rnd_408_Mag"}; reloadAction = "GestureReloadLRR"; cursor = "srifle"; dexterity = 1.2; initSpeed = 910; handAnim[] = {"OFP2_ManSkeleton", "\A3\Weapons_F\LongRangeRifles\M320\data\Anim\m320.rtm"}; opticsPPEffects[] = {}; opticsFlare = true; opticsDisablePeripherialVision = true; class GunParticles { class FirstEffect { effectName = "SniperCloud"; positionName = "Usti hlavne"; directionName = "Konec hlavne"; }; }; opticsZoomMin = 0.375; opticsZoomMax = 1.1; opticsZoomInit = 0.75; distanceZoomMin = 300; distanceZoomMax = 300; bullet1[] = {"A3\sounds_f\weapons\shells\7_62\metal_762_01", 0.891251, 1, 25}; bullet2[] = {"A3\sounds_f\weapons\shells\7_62\metal_762_02", 0.891251, 1, 25}; bullet3[] = {"A3\sounds_f\weapons\shells\7_62\metal_762_03", 0.891251, 1, 25}; bullet4[] = {"A3\sounds_f\weapons\shells\7_62\metal_762_04", 0.891251, 1, 25}; bullet5[] = {"A3\sounds_f\weapons\shells\7_62\dirt_762_01", 0.794328, 1, 25}; bullet6[] = {"A3\sounds_f\weapons\shells\7_62\dirt_762_02", 0.794328, 1, 25}; bullet7[] = {"A3\sounds_f\weapons\shells\7_62\dirt_762_03", 0.794328, 1, 25}; bullet8[] = {"A3\sounds_f\weapons\shells\7_62\dirt_762_04", 0.794328, 1, 25}; bullet9[] = {"A3\sounds_f\weapons\shells\7_62\grass_762_01", 0.707946, 1, 25}; bullet10[] = {"A3\sounds_f\weapons\shells\7_62\grass_762_02", 0.707946, 1, 25}; bullet11[] = {"A3\sounds_f\weapons\shells\7_62\grass_762_03", 0.707946, 1, 25}; bullet12[] = {"A3\sounds_f\weapons\shells\7_62\grass_762_04", 0.707946, 1, 25}; soundBullet[] = {"bullet1", 0.083, "bullet2", 0.083, "bullet3", 0.083, "bullet4", 0.083, "bullet5", 0.083, "bullet6", 0.083, "bullet7", 0.083, "bullet8", 0.083, "bullet9", 0.083, "bullet10", 0.083, "bullet11", 0.083, "bullet12", 0.083}; modes[] = {"Single", "far_optic1", "medium_optic2", "far_optic2"}; class Single : Mode_SemiAuto { dispersion = 0.00018; soundContinuous = 0; reloadTime = 1.5; recoil = "recoil_single_gm6"; recoilProne = "recoil_single_prone_gm6"; begin1[] = {"A3\sounds_f\weapons\M320\M320_st_1", 1.77828, 1, 1200}; begin2[] = {"A3\sounds_f\weapons\M320\M320_st_2", 1.77828, 1, 1200}; soundBegin[] = {"begin1", 0.5, "begin2", 0.5}; closure1[] = {"A3\sounds_f\weapons\closure\closure_rifle_2", 1.77828, 1, 10}; closure2[] = {"A3\sounds_f\weapons\closure\closure_rifle_3", 1.77828, 1, 10}; soundClosure[] = {"closure1", 0.5, "closure2", 0.5}; weaponSoundEffect = "DefaultRifle"; minRange = 2; minRangeProbab = 0.1; midRange = 250; midRangeProbab = 0.7; maxRange = 350; maxRangeProbab = 0.05; aiRateOfFire = 3; // delay between shots at given distance aiRateOfFireDistance = 500; }; class far_optic1 : Single { showToPlayer = false; minRange = 150; minRangeProbab = 0.1; midRange = 500; midRangeProbab = 0.7; maxRange = 1000; maxRangeProbab = 0.3; aiRateOfFire = 5; // delay between shots at given distance aiRateOfFireDistance = 700; requiredOpticType = 1; }; class medium_optic2 : Single { showToPlayer = false; minRange = 250; minRangeProbab = 0.1; midRange = 750; midRangeProbab = 0.7; maxRange = 1000; maxRangeProbab = 0.3; aiRateOfFire = 6.0; // delay between shots at given distance aiRateOfFireDistance = 1000; requiredOpticType = 2; }; class far_optic2 : far_optic1 { minRange = 500; minRangeProbab = 0.1; midRange = 1050; midRangeProbab = 0.7; maxRange = 2000; maxRangeProbab = 0.3; aiRateOfFire = 8; // delay between shots at given distance aiRateOfFireDistance = 2000; requiredOpticType = 2; }; reloadMagazineSound[] = {"A3\Sounds_F\weapons\M320\M320_reload", 0.501187, 1, 10}; drySound[] = {"A3\sounds_f\weapons\Other\dry_1", 0.501187, 1, 20}; }; class CJM40SF : CJM40SF_base_F { scope = 2; // Public model = "\CJM40\M40.p3d"; dexterity = 1.68; displayName = "M40A5 MOD 1"; picture = "\CJM40\data\UI\gear_CJM40_x_ca.paa"; UiPicture = "\A3\weapons_f\data\UI\icon_sniper_CA.paa"; class Library { libTextDesc = "$STR_A3_CfgWeapons_srifle_LRR_Library0"; }; descriptionShort = "$STR_A3_CfgWeapons_srifle_LRR1"; class WeaponSlotsInfo : WeaponSlotsInfo { mass = 140; class PointerSlot {}; }; class ItemInfo { priority = 1; }; }; class CJM40SF_SOS : CJM40SF { class LinkedItems { class LinkedItemsOptic { slot = "CowsSlot"; item = "optic_SOS"; }; }; }; }; Share this post Link to post Share on other sites
da12thMonkey 1943 Posted December 5, 2013 Yes, some people miss the fact that certain values that you find in BIS config parameters (such as "private", "public", "true", "false" etc.) are macros that actually relate to numeric values. You have to copy the set of #define tagged variables that appear at the top of the config, in order for them to work with the macros. BIS have included them in the basicDefines_A3.hpp that came with the A3 example models. So if you want, you can just copy that file into all your addon projects next to the config.cpp and on the very first line of your config.cpp, add this: #include "basicdefines_A3.hpp" Should save space when writing your config.cpp and avoid any problems you might otherwise have by copy+pasting class parameters from BIS' configs. Share this post Link to post Share on other sites
warlord554 2065 Posted December 6, 2013 Hey thank you all been very helpful. Thanks guys :D Share this post Link to post Share on other sites
warlord554 2065 Posted December 6, 2013 I have gotten the config to work. The Rifle shows up in my UI Inventory menu, however it is not showing up in game. My unit has a perfect "holding rifle" stance but my weapon is invisible. The textured model showed up perfectly in bulldozer, it is giving me a cfg error fireLightDiffuse. Share this post Link to post Share on other sites