# Newbie having Trouble With simple Config File edits

## Recommended Posts

I got interested in creating my own weapon as a starter project since I enjoy the realism of this game. However, I run into more problems than I seem to handle.

My goal right now is to simply take the model I edited, from the Arma 1 sample models, and implement it into Arma 2. I have tried at least a dozen ways to try and get the model into the game and edit the name, but I keep getting errors. The tutorials I've seen dont cover weapons and dont go in depth on the config file so I'm not sure what do at the moment.

When I change the displaymodelname= the weapon disappears in game or arma wont load it at all

If i change the model p3d file to the G36 sample model, or anyother, arma says it cannot be loaded into the game or it is invisible.

I do not binarize any of my files, If that's of any help.

I have also tried just swapping models from within arma 2 (e.g. tell the cfg file to get the m107 model instead of m1014) but this also just creates an invisible gun.

I'm sure the config file has stupid mistakes, but I'm clueless since every little tweak I make seems to ruin it.

Here is my most basic/recent cfg file which made

////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////

#define _ARMA_

//Class weapons2 : huntingrifle\config.bin{
class CfgPatches
{
class CAWeapons2_ANDY
{
units[] = {};
weapons[] = {};
requiredVersion = 0.1;
};
};
class CfgMagazines
{
class CA_Magazine;
class 5x_22_LR_17_HMR: CA_Magazine
{
scope = 2;
displayName = "$STR_MN_5x_22_LR_17_HMR"; picture = "\Ca\weapons\Data\Equip\m_M24_CA.paa"; count = 5; ammo = "B_762x51_noTracer"; initSpeed = 870; sound[] = {"Ca\sounds\Weapons\rifles\M24_single3",10.0,1,1800}; reloadMagazineSound[] = {"Ca\sounds\Weapons\rifles\M1014-reload",0.01,1,20}; descriptionShort = "$STR_DSS_5Rnd_CZ_550";
};
};
class CfgWeapons
{
class M24;
class huntingrifle: M24
{
scope = 2;
displayName = "$STR_DN_huntingrifleANDY"; model = "\ca\weapons2\huntingrifle\G36"; magazines[] = {"5x_22_LR_17_HMR"}; picture = "\Ca\weapons2\huntingrifle\data\equip\W_huntingrifle_CA.paa"; modelOptics = "\ca\weapons\2Dscope_Hunter_12"; opticsPPEffects[] = {"OpticsCHAbera2","OpticsBlur2"}; opticsZoomInit = 0.083; opticsZoomMin = 0.0208; opticsZoomMax = 0.083; distanceZoomMin = 300; distanceZoomMax = 100; minRange = 2; minRangeProbab = 0.1; midRange = 300; midRangeProbab = 0.7; maxRange = 600; maxRangeProbab = 0.05; dispersion = 0.00045; handAnim[] = {"OFP2_ManSkeleton","\Ca\weapons\data\Anim\M24.rtm"}; class Library { libTextDesc = "$STR_LIB_ANDY";
};
descriptionShort = "$STR_DSS_ANDY"; }; }; //}; Edited by W0lle added code tags to make it readable #### Share this post ##### Link to post ##### Share on other sites First, you should use your own class name instead overwriting the default "huntingrifle class". Second, the path to model is wrong: model = "\ca\weapons2\huntingrifle\G36"; simply does not exist. If you want to add your own weapon, you need to create your own folder/pbo for it. 1) Create a folder on your p: drive (if you have the BI tools installed) and give it a name you want, e.g. ANDY_G36 2) In that folder you place the model and the required textures 3) The config.cpp you also place in that folder and should look like this: class CfgPatches { class ANDY_G36 { units[] = {}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = {"CAweapons2"}; }; }; class CfgWeapons { class G36; class ANDY_G36 : G36 { scope = 2; displayName = "$STR_DN_huntingrifleANDY";
model = "\ANDY_G36\G36";
descriptionShort = "$STR_DSS_ANDY"; class Library { libTextDesc = "$STR_LIB_ANDY";
};
};
};


Above config takes the default G36 with all its values as basis and only changes important lines like model and description to the new one. So you don't have to add all values again - except you want to modify them of course. The cfgMagazines you don't need if you don't really add a new magazine.

If all is done and works as supposed, you can binarize the ANDY_G36 folder and are done.

##### Share on other sites

Thanks a ton for the clarification! I will try again as soon as I get home from work. I have yet to make new texture files, so could the model be loaded as blank white and function without any textures while i test it in the mean time?

##### Share on other sites

Sure, or you use the A2 textures in the beginning.

##### Share on other sites

sorry, for the string of newbie questions. In the past I have been just adding the files i created directly into addons. Does the virtual p drive do the same or is it just a temporary workspace

I copy and pasted the pbo containing your edited cfg, the G36 model from Arma 1 Sample Weapons, but no data file with the texture. Nothing pops up under armory, so now I'm still confused since your cfg clearly gives a name for arma to recognize.

Edited by dinoboy123

##### Share on other sites

Instead checking the armory, place a unit in the editor and give him your G36 and some ammo by pasting below to the initialization line:

removeAllWeapons this; this addMagazine "30Rnd_556x45_G36"; this addMagazine "30Rnd_556x45_G36"; this addWeapon "ANDY_G36";

If everything is alright, he will now carry your G36 plus 2 Magazines. If not, he will carry no weapon at all.

The P: drive you only need when you want to modify the model using Oxygen2. Yes, it's a virtual drive used by the BI tools for storing the files you work on. If you don't plan to edit the weapon though but only add new textures and config values, there's no need to use it. You should install BinPBO from the tools suite though so you're able to binarize the model when you are done.

##### Share on other sites

Hi mate, take a look at the files in the link might help you with BIS retextures and config. This is my M4 version. Any questions PM me.

##### Share on other sites

thanks to both you guys! Im attempting the model again using the editor and will let you know how it goes

---------- Post added at 00:12 ---------- Previous post was at 00:05 ----------

using the init I receive message "No entry 'bin\config.bin/CfgWeaons.ANDY_G36'.

guessing this means I put the pbo in the wrong spot where arma cannot find it, or messed up the config file but I'll keep messing around. Sorry that I keep getting more errors than solutions lol

##### Share on other sites

(Sorry for digging up the thread again, can't find any other threads with my problem other than this! >: D)

thanks to both you guys! Im attempting the model again using the editor and will let you know how it goes

---------- Post added at 00:12 ---------- Previous post was at 00:05 ----------

using the init I receive message "No entry 'bin\config.bin/CfgWeaons.ANDY_G36'.

guessing this means I put the pbo in the wrong spot where arma cannot find it, or messed up the config file but I'll keep messing around. Sorry that I keep getting more errors than solutions lol

I get that error too, "No entry 'Bin\Config.bin/CfgWeapons.Remington'."

FIXED IT!

UPDATE

##### Share on other sites
(Sorry for digging up the thread again, can't find any other threads with my problem other than this! >: D)

Hello everyone,

I am a newbie to making config scripts, too. I hope you guys don't mind another question in here. I may have to make a new topic but I don't think it will be necessary.

What I am trying to do is take an existing Arma 2 OA model, add new textures to it that I've modified from the originals, then put it all back in the game as a new unit. I am working with the UAZ UN model. I've used the latest BIS tools 2.5.1 and have been trying to get the config file to work. I may be biting off more than I can chew, or (far more likely!) putting a lot of unnecessary things in the config file.

This is my first attempt at something like this and I'm just not sure what's all needed in the config file. In my pbo, I've put the UAZ model, textures I've modified, sounds, destruction models, animation, signs, and kitchen sink.

Here's my code (I cringe that it's probably very ugly, I apologize in advance..)

Code:

////////////////////////////////////////////////////////////////////
//DeRap: Produced from mikero's Dos Tools Dll version 4.06
//Sat May 25 13:02:16 2013
//http://dev-heaven.net/projects/list_files/mikero-pbodll
////////////////////////////////////////////////////////////////////

#define _ARMA_

//ndefs=4
enum {
stabilizedinaxisx = 1,
stabilizedinaxisy = 2,
stabilizedinaxesboth = 3,
stabilizedinaxesnone = 0
};

//Class C:/Users/HixRa/Blackline/config.bin{
class CfgPatches
{
class blackline_UAZ
{
units[] = {"blackline_UAZ};
weapons[] = {};
requiredVersion = 1.00;
};
};
class CfgVehicles
{
{
htMin = 60;
htMax = 1800;
afMax = 200;
mfMax = 100;
mFact = 0;
tBody = 0;
};
class Sounds: Sounds
{
class Engine;
class Movement;
};
};
class blackline_uaz: UAZ
{
expansion = 1;
scope = 2;
side = 2;
accuracy = 0.3;
faction = "BIS_UN";
class TransportMagazines
{
class _xx_30Rnd_545x39_AK
{
magazine = "30Rnd_545x39_AK";
count = 15;
};
{
count = 2;
};
};
class TransportWeapons{};
model = "\blackline_uaz\uaz";
picture = "\blackline_uaz\data\ico\uaz_CA.paa";
Icon = "\blackline_uaz\data\map_ico\icomap_Uaz_CA.paa";
mapSize = 4;
displayName = "\$Blackline_UAZ";
vehicleClass = "Blackline Car";
accuracy = 0.25;
terrainCoef = 2.5;
wheelCircumference = 2.51;
turnCoef = 1.5;
unitInfoType = "UnitInfoShip";
driverAction = "UAZ_Driver";
cargoAction[] = {"UAZ_Cargo01","UAZ_Cargo01","UAZ_Cargo01","UAZ_Cargo02","UAZ_Cargo01","UAZ_Cargo02"};
transportSoldier = 6;
transportAmmo = 0;
maxSpeed = 90;
armor = 40;
damageResistance = 0.00845;
armorWheels = 0.12;
transportMaxBackpacks = 7;
outsideSoundFilter = 1;
insideSoundCoef = 0.8;
soundGear[] = {"",5.6234134e-005,1};
threat[] = {0,0,0};
brakeDistance = 7;
class Turrets{};
class Damage
{
tex[] = {};
mat[] = {"blackline_uaz\data\detailmapy\uaz_main_metal.rvmat","blackline_uaz\data\detailmapy\uaz_main_metal_damage.rvmat","blackline_uaz\data\detailmapy\uaz_main_metal_destruct.rvmat","blackline_uaz\data\detailmapy\uaz_other_metal.rvmat","blackline_uaz\data\detailmapy\uaz_other_metal_damage.rvmat","blackline_uaz\data\detailmapy\uaz_other_metal_destruct.rvmat","blackline_uaz\data\detailmapy\uaz_skla.rvmat","blackline_uaz\data\detailmapy\uaz_skla_damage.rvmat","blackline_uaz\data\detailmapy\uaz_skla_destruct.rvmat","blackline_uaz\data\detailmapy\uaz_skla_in.rvmat","blackline_uaz\data\detailmapy\uaz_skla_in_damage.rvmat","blackline_uaz\data\detailmapy\uaz_skla_in_damage.rvmat"};
};
soundGetIn[] = {"ca\Sounds_E\Wheeled_E\SUV\SUV_ext_door",0.56234133,1};
soundGetOut[] = {"ca\Sounds_E\Wheeled_E\SUV\SUV_ext_door",0.56234133,1,20};
soundEngineOnInt[] = {"ca\Sounds_E\Wheeled_E\UAZ\uaz_int_start1",0.17782794,1.0};
soundEngineOnExt[] = {"ca\Sounds_E\Wheeled_E\UAZ\uaz_ext_start1",0.17782794,1.0,100};
soundEngineOffInt[] = {"ca\Sounds_E\Wheeled_E\UAZ\uaz_int_stop1",0.17782794,1.0};
soundEngineOffExt[] = {"ca\Sounds_E\Wheeled_E\UAZ\uaz_ext_stop1",0.17782794,1.0,100};
buildCrash0[] = {"Ca\sounds\Vehicles\Crash\crash_building_01",0.70794576,1,200};
buildCrash1[] = {"Ca\sounds\Vehicles\Crash\crash_building_02",0.70794576,1,200};
buildCrash2[] = {"Ca\sounds\Vehicles\Crash\crash_building_03",0.70794576,1,200};
buildCrash3[] = {"Ca\sounds\Vehicles\Crash\crash_building_04",0.70794576,1,200};
soundBuildingCrash[] = {"buildCrash0",0.25,"buildCrash1",0.25,"buildCrash2",0.25,"buildCrash3",0.25};
WoodCrash0[] = {"Ca\sounds\Vehicles\Crash\crash_mix_wood_01",0.70794576,1,200};
WoodCrash1[] = {"Ca\sounds\Vehicles\Crash\crash_mix_wood_02",0.70794576,1,200};
WoodCrash2[] = {"Ca\sounds\Vehicles\Crash\crash_mix_wood_03",0.70794576,1,200};
WoodCrash3[] = {"Ca\sounds\Vehicles\Crash\crash_mix_wood_04",0.70794576,1,200};
WoodCrash4[] = {"Ca\sounds\Vehicles\Crash\crash_mix_wood_05",0.70794576,1,200};
WoodCrash5[] = {"Ca\sounds\Vehicles\Crash\crash_mix_wood_06",0.70794576,1,200};
soundWoodCrash[] = {"woodCrash0",0.166,"woodCrash1",0.166,"woodCrash2",0.166,"woodCrash3",0.166,"woodCrash4",0.166,"woodCrash5",0.166};
ArmorCrash0[] = {"Ca\sounds\Vehicles\Crash\crash_vehicle_01",0.70794576,1,200};
ArmorCrash1[] = {"Ca\sounds\Vehicles\Crash\crash_vehicle_02",0.70794576,1,200};
ArmorCrash2[] = {"Ca\sounds\Vehicles\Crash\crash_vehicle_03",0.70794576,1,200};
ArmorCrash3[] = {"Ca\sounds\Vehicles\Crash\crash_vehicle_04",0.70794576,1,200};
soundArmorCrash[] = {"ArmorCrash0",0.25,"ArmorCrash1",0.25,"ArmorCrash2",0.25,"ArmorCrash3",0.25};
hiddenSelections[] = {"blackline"};
hiddenSelectionsTextures[] = {"\blackline_uaz\Data\Uaz_main_UN_CO.paa","\blackline_uaz\Data\uaz_other_co.paa"};
class SoundEvents
{
class AccelerationIn
{
sound[] = {"ca\Sounds_E\Wheeled_E\UAZ\uaz_int_acceleration",0.56234133,1.0};
limit = "0.4";
expression = "(engineOn*(1-camPos))*gmeterZ";
};
class AccelerationOut
{
sound[] = {"ca\Sounds_E\Wheeled_E\UAZ\uaz_ext_acceleration",0.56234133,1.0,200};
limit = "0.4";
expression = "(engineOn*camPos)*gmeterZ";
};
};
class Sounds: Sounds
{
class Engine: Engine
{
sound[] = {"ca\Sounds_E\Wheeled_E\UAZ\uaz_ext_low1",0.17782794,0.9,100};
frequency = "(randomizer*0.05+0.95)*rpm";
volume = "camPos*engineOn*((rpm factor[0.3, 0.5]) min (rpm factor[0.7, 0.55]))";
};
class EngineHighOut
{
sound[] = {"ca\Sounds_E\Wheeled_E\UAZ\uaz_ext_high1",1.0,0.8,300};
frequency = "(randomizer*0.05+0.95)*rpm";
volume = "camPos*engineOn*(rpm factor[0.6, 1.0])";
};
class IdleOut
{
sound[] = {"ca\Sounds_E\Wheeled_E\UAZ\uaz_ext_idle",0.56234133,1.0,100};
frequency = "1";
volume = "engineOn*camPos*(rpm factor[0.5, 0])";
};
class TiresRockOut
{
sound[] = {"\ca\SOUNDS\Vehicles\Wheeled\Tires\ext\ext-tires-rock2",0.31622776,1.0,30};
frequency = "1";
volume = "camPos*rock*(speed factor[2, 20])";
};
class TiresSandOut
{
sound[] = {"\ca\SOUNDS\Vehicles\Wheeled\Tires\ext\ext-tires-sand2",0.31622776,1.0,30};
frequency = "1";
volume = "camPos*sand*(speed factor[2, 20])";
};
class TiresGrassOut
{
sound[] = {"\ca\SOUNDS\Vehicles\Wheeled\Tires\ext\ext-tires-grass2",0.31622776,1.0,30};
frequency = "1";
volume = "camPos*grass*(speed factor[2, 20])";
};
class TiresMudOut
{
sound[] = {"\ca\SOUNDS\Vehicles\Wheeled\Tires\ext\ext-tires-mud2",0.31622776,1.0,30};
frequency = "1";
volume = "camPos*mud*(speed factor[2, 20])";
};
class TiresGravelOut
{
sound[] = {"\ca\SOUNDS\Vehicles\Wheeled\Tires\ext\ext-tires-gravel2",0.31622776,1.0,30};
frequency = "1";
volume = "camPos*gravel*(speed factor[2, 20])";
};
class TiresAsphaltOut
{
sound[] = {"\ca\SOUNDS\Vehicles\Wheeled\Tires\ext\ext-tires-asphalt3",0.31622776,1.0,30};
frequency = "1";
volume = "camPos*asphalt*(speed factor[2, 20])";
};
class NoiseOut
{
sound[] = {"\ca\SOUNDS\Vehicles\Wheeled\Noises\ext\noise2",0.31622776,1.0,30};
frequency = "1";
volume = "camPos*(damper0 max 0.03)*(speed factor[0, 8])";
};
class EngineLowIn
{
sound[] = {"ca\Sounds_E\Wheeled_E\UAZ\uaz_int_low1",0.31622776,0.7};
frequency = "(randomizer*0.05+0.95)*rpm";
volume = "(1-camPos)*engineOn*((rpm factor[0.3, 0.5]) min (rpm factor[0.7, 0.55]))";
};
class EngineHighIn
{
sound[] = {"ca\Sounds_E\Wheeled_E\UAZ\uaz_int_high1",1.0,0.8};
frequency = "(randomizer*0.05+0.95)*rpm";
volume = "(1-camPos)*engineOn*(rpm factor[0.6, 1.0])";
};
class IdleIn
{
sound[] = {"ca\Sounds_E\Wheeled_E\UAZ\uaz_int_idle",0.31622776,1.0};
frequency = "1";
volume = "engineOn*(rpm factor[0.5, 0])*(1-camPos)";
};
class TiresRockIn
{
sound[] = {"\ca\SOUNDS\Vehicles\Wheeled\Tires\int\int-tires-rock2",0.31622776,1.0};
frequency = "1";
volume = "(1-camPos)*rock*(speed factor[2, 20])";
};
class TiresSandIn
{
sound[] = {"\ca\SOUNDS\Vehicles\Wheeled\Tires\int\int-tires-sand2",0.31622776,1.0};
frequency = "1";
volume = "(1-camPos)*sand*(speed factor[2, 20])";
};
class TiresGrassIn
{
sound[] = {"\ca\SOUNDS\Vehicles\Wheeled\Tires\int\int-tires-grass2",0.31622776,1.0};
frequency = "1";
volume = "(1-camPos)*grass*(speed factor[2, 20])";
};
class TiresMudIn
{
sound[] = {"\ca\SOUNDS\Vehicles\Wheeled\Tires\int\int-tires-mud2",0.31622776,1.0};
frequency = "1";
volume = "(1-camPos)*mud*(speed factor[2, 20])";
};
class TiresGravelIn
{
sound[] = {"\ca\SOUNDS\Vehicles\Wheeled\Tires\int\int-tires-gravel2",0.31622776,1.0};
frequency = "1";
volume = "(1-camPos)*gravel*(speed factor[2, 20])";
};
class TiresAsphaltIn
{
sound[] = {"\ca\SOUNDS\Vehicles\Wheeled\Tires\int\int-tires-asphalt3",0.31622776,1.0};
frequency = "1";
volume = "(1-camPos)*asphalt*(speed factor[2, 20])";
};
class NoiseIn
{
sound[] = {"\ca\SOUNDS\Vehicles\Wheeled\Noises\int\noise2",0.56234133,1.0};
frequency = "1";
volume = "(damper0 max 0.03)*(speed factor[0, 8])*(1-camPos)";
};
class Movement: Movement
{
sound = "soundEnviron";
frequency = "1";
volume = "0";
};
};
};
};

Again, sorry for the potato..