Jump to content
Sign in to follow this  
Gwa

How to make config file

Recommended Posts

Hello,everyone i learn make use of oxygen and buldozer.i make a soldier.but i don't know about how to create config file,which is last stage,i read and see many but it did't work.help me.

Share this post


Link to post
Share on other sites

A template-like, in this example it is adding 3 soldiers that are on the west side (side=1) , so you see how it is done and by testing around you will understand how to add more soldiers.

Read carefully, and compare with some other soldiers config.cpp to understand more :

// some basic defines
#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// dummy weapons
#define WeaponSlotPrimary		1// primary weapons
#define WeaponSlotSecondary	16// secondary weapons
#define WeaponSlotItem			256// items
#define WeaponSlotBinocular	4096// binocular
#define WeaponHardMounted		65536

class CfgPatches
{

class THE NAME OF THE ADDON THAT WILL APPEAR IN MISSIONSQM REQUIRED ADDON
	{
	units[]={"NAMEOFSOLDIERCLASS1","NAMEOFSOLDIERCLASS2","NAMEOFSOLDIERCLASS3"};
	weapons[]={};
	requiredAddons[]= {"BIS_Resistance","BIS_WeaponPack","ANY OTHER NAME OF ADDON REQUIRED BY YOUR SOLDIERS"};
	requiredVersion=1.85;
	};
};


class CfgModels
{

class Default
	{
	sections[]={};
	sectionsInherit="";
	};

class Head:Default
	{
	sections[]={"osobnost","brejle"};
	};

class Man:Default
	{
	sections[]={"head injury","body injury","l arm injury","r arm injury","p arm injury","l leg injury","r leg injury","p leg injury","medic","hlava","krk","zasleh"};
	sectionsInherit="Head";
	};

class NAME OF YOUR P3D1:Man 
	{
	sections[]={"head injury","body injury","l arm injury","r arm injury","p arm injury","l leg injury","r leg injury","p leg injury","medic","hlava","krk","zasleh","zadni svetlo","facenull"};
	sectionsInherit="Head";		
	};

class NAME OF YOUR P3D2:Man
	{
sections[]={"head injury","body injury","l arm injury","r arm injury","p arm injury","l leg injury","r leg injury","p leg injury","medic","hlava","krk","zasleh","zadni svetlo","facenull"};
	sectionsInherit="Head";	
	};

class NAME OF YOUR P3D3:Man 
	{
sections[]={"head injury","body injury","l arm injury","r arm injury","p arm injury","l leg injury","r leg injury","p leg injury","medic","hlava","krk","zasleh","zadni svetlo","facenull"};
	sectionsInherit="Head";	
	};

};

class CfgVehicles
{

class All
	{
	};

class AllVehicles:All
	{
	};

class Land:AllVehicles
	{
	};

class Man:Land
	{
	};

class Soldier:Man
	{
	};

class SoldierWB:Soldier
	{
	};

class NAMEOFSOLDIERCLASS1:SoldierWB
	{
	model="\NAME OF YOUR PBO\NAME OF YOUR P3D1.p3d";
	hiddenSelections[]={"medic"};
	scope=2;
	side=1;
	weapons[]={"M16","Throw","Put"};
	magazines[]={"M16","M16","M16","M16","HandGrenade","HandGrenade"};
	};
class NAMEOFSOLDIERCLASS2:SoldierWB
	{
	model="\NAME OF YOUR PBO\NAME OF YOUR P3D2.p3d";
	hiddenSelections[]={"medic"};
	scope=2;
	side=1;
	weapons[]={"M16","Throw","Put"};
	magazines[]={"M16","M16","M16","M16","HandGrenade","HandGrenade"};
	};

class NAMEOFSOLDIERCLASS3:SoldierWB
	{
	model="\NAME OF YOUR PBO\NAME OF YOUR P3D3.p3d";
	hiddenSelections[]={"medic"};
	scope=2;
	side=1;
	weapons[]={"M16","Throw","Put"};
	magazines[]={"M16","M16","M16","M16","HandGrenade","HandGrenade"};
	};
};

Edited by Sanctuary

Share this post


Link to post
Share on other sites

I trying to understand

Share this post


Link to post
Share on other sites

Oops, i typed an error in the template , i typed "class class" at the CfgModel section, i edited it.

Another example so you can compare with the template :

I have 3 models :

Mysoldier1.p3d

Mysoldier2.p3d

Mysoldier3.p3d

I put them into a file named : mytroopers.PBO

I want them on the East side (side=0) and instead of a BIS M16 , i give them a BIS AK74 and 4 AK74 ammo.

Here is what the config.cpp would then look like :

// some basic defines
#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// dummy weapons
#define WeaponSlotPrimary		1// primary weapons
#define WeaponSlotSecondary	16// secondary weapons
#define WeaponSlotItem			256// items
#define WeaponSlotBinocular	4096// binocular
#define WeaponHardMounted		65536

class CfgPatches
{

class SANC_ADDONTROOPERS
	{
	units[]={"SANC_EASTSOLDIER1","SANC_EASTSOLDIER2","SANC_EASTSOLDIER3"};
	weapons[]={};
	requiredAddons[]= {"BIS_Resistance","BIS_WeaponPack"};
	requiredVersion=1.85;
	};
};


class CfgModels
{

class Default
	{
	sections[]={};
	sectionsInherit="";
	};

class Head:Default
	{
	sections[]={"osobnost","brejle"};
	};

class Man:Default
	{
	sections[]={"head injury","body injury","l arm injury","r arm injury","p arm injury","l leg injury","r leg injury","p leg injury","medic","hlava","krk","zasleh"};
	sectionsInherit="Head";
	};

class Mysoldier1:Man 
	{
	sections[]={"head injury","body injury","l arm injury","r arm injury","p arm injury","l leg injury","r leg injury","p leg injury","medic","hlava","krk","zasleh","zadni svetlo","facenull"};
	sectionsInherit="Head";		
	};

class Mysoldier2:Man
	{
sections[]={"head injury","body injury","l arm injury","r arm injury","p arm injury","l leg injury","r leg injury","p leg injury","medic","hlava","krk","zasleh","zadni svetlo","facenull"};
	sectionsInherit="Head";	
	};

class Mysoldier3:Man 
	{
sections[]={"head injury","body injury","l arm injury","r arm injury","p arm injury","l leg injury","r leg injury","p leg injury","medic","hlava","krk","zasleh","zadni svetlo","facenull"};
	sectionsInherit="Head";	
	};

};

class CfgVehicles
{

class All
	{
	};

class AllVehicles:All
	{
	};

class Land:AllVehicles
	{
	};

class Man:Land
	{
	};

class Soldier:Man
	{
	};

class SoldierEB:Soldier
	{
	};

class SANC_EASTSOLDIER1:SoldierEB
	{
	model="\mytroopers\Mysoldier1.p3d";
	hiddenSelections[]={"medic"};
	scope=2;
	side=0;
	weapons[]={"AK74","Throw","Put"};
	magazines[]={"AK74","AK74","AK7"4,"AK74","HandGrenade","HandGrenade"};
	};

class SANC_EASTSOLDIER2:SoldierEB
	{
	model="\mytroopers\Mysoldier2.p3d";
	hiddenSelections[]={"medic"};
	scope=2;
	side=0;
	weapons[]={"AK74","Throw","Put"};
	magazines[]={"AK74","AK74","AK74","AK74","HandGrenade","HandGrenade"};
	};

class SANC_EASTSOLDIER3:SoldierEB
	{
	model="\mytroopers\Mysoldier3.p3d";
	hiddenSelections[]={"medic"};
	scope=2;
	side=0;
	weapons[]={"AK74","Throw","Put"};
	magazines[]={"AK74","AK74","AK74","AK74","HandGrenade","HandGrenade"};
	};
};

Share this post


Link to post
Share on other sites

I found in some addons there is only config file like soldier.sanctuary do you have an idea.

Share this post


Link to post
Share on other sites

You can put a config.cpp alone in a single PBO, it does not need to be in the same PBO as the models and textures.

Look into the config you found alone in a PBO , and search the line :

model=....

It will tell you were the models are located :

model="\NAME OF THE PBO THAT CONTAIN THE MODEL\NAME OF THE MODEL.p3d";

Share this post


Link to post
Share on other sites

Ok i try to do it.it is also necassary that mention pbo is also in addon folder.

Share this post


Link to post
Share on other sites
You can put a config.cpp alone in a single PBO, it does not need to be in the same PBO as the models and textures.

Look into the config you found alone in a PBO , and search the line :

model=....

It will tell you were the models are located :

model="\NAME OF THE PBO THAT CONTAIN THE MODEL\NAME OF THE MODEL.p3d";

i want to make a config file.my made soldier name is rambo1(i want that he have G36),but now i did't know to work in config file.please help.what is config file of it should be.

Share this post


Link to post
Share on other sites

For the BRDM question that you sent me a PM with, i put the reply there instead as it could be helpfull for everyone wanting to customise some vehicle armor.

To modify the BRDM armor :

-Make a backup of the Brmd.pbo (locate in the ...\Res\Addons\ )

-Get and install

BINVIEW

-Get CPP2BIN

-Open and extract the Brmd.pbo with any PBO opening utility, you will obtain a Brmd folder containing everything the Brmd.pbo has.

Put that folder in your desktop by example (just do not leave it inside the \Res\Addons\ folder )

-in the Brmd folder you will find a config.bin file, double click on it.

It will open with Binview automatically, click on File and Save on the binview window , click Ok and then Ok , it will save the config.bin into a config.cpp.

You can now close binview.

-Delete the config.bin from the Brmd folder and open the config.cpp with any text editor.

The armor value for a wheeled class of vehicle like the BRDM is defined by those :

armor=80;
armorGlass=0.5;
armorWheels=0.15;
armorBody=0.4;
armorFuel=1.4;
armorLights=0.4;

there is another value not in this BRDM config, but it is inherited from a parent class, and so if you want to modify it too, add it in the config

armorStructural=1.0;

Now to understand what those things are, give a look to the CAVS page and especially this part :

About : you have different parts on an OFP tank, described in the hitHull, hitEngine, etc... part of the config.cpp. Each has its own "hitpoints". The tank also has a global "health point" value, set in the "armor" parameter in the config. Each localized hitPoints are calculated from the global armor, by multiplying it by the number found in the hitHull section under armorHull, armorEngine, etc...500 armor, 0.7 armorEngine means the "engine" selection in the hit LOD of the P3D model will have 500*0.7=250 hitpoints.

When hit, a tank will give damage to every part hit. If hit for 300 in Hull and Engine, hitHull and hitEngine will be reduced by 300 each. In addition, the global armor will be decreased by the sum of damages done to localized parts, divided by the armorStructural parameter. In my example,300 + 300 = 600, divided by 2 armorStructural = 300 hit to global armor

Note when making your modifcations that a default BIS RPG or a BIS LAW is making 500 damage by hit.

-Once you have done your modifications transform the config.cpp you have modified into a config.bin by using CPP2BIN

-Then using a PBO packing utility transform the folder Brmd into a Brmd.pbo

-DO NOT REPLACE the original Brmd.pbo in the ..\Res\Addons\ folder, but either put it into a WHATEVERMOD\Addons\ folder or create your own mod folder to use it.

Launch OFP with your shortcut modified to point to the mod folder featuring your new modified Brmd.pbo and test to see if your modification fits your needs.

Share this post


Link to post
Share on other sites

Thanks helpful sanctuary.

I will try this when i done BRDM feature i will response you.

whats about the side(like east BRDM is already there for east) of brdm sanctuary

Edited by riffleman
re

Share this post


Link to post
Share on other sites

help me i want put bizon in russian soldier hand,what i do in config file for that,help

Share this post


Link to post
Share on other sites
For the BRDM question that you sent me a PM with, i put the reply there instead as it could be helpfull for everyone wanting to customise some vehicle armor.

To modify the BRDM armor :

-Make a backup of the Brmd.pbo (locate in the ...\Res\Addons\ )

-Get and install

BINVIEW

-Get CPP2BIN

-Open and extract the Brmd.pbo with any PBO opening utility, you will obtain a Brmd folder containing everything the Brmd.pbo has.

Put that folder in your desktop by example (just do not leave it inside the \Res\Addons\ folder )

-in the Brmd folder you will find a config.bin file, double click on it.

It will open with Binview automatically, click on File and Save on the binview window , click Ok and then Ok , it will save the config.bin into a config.cpp.

You can now close binview.

-Delete the config.bin from the Brmd folder and open the config.cpp with any text editor.

The armor value for a wheeled class of vehicle like the BRDM is defined by those :

armor=80;
armorGlass=0.5;
armorWheels=0.15;
armorBody=0.4;
armorFuel=1.4;
armorLights=0.4;

there is another value not in this BRDM config, but it is inherited from a parent class, and so if you want to modify it too, add it in the config

armorStructural=1.0;

Now to understand what those things are, give a look to the CAVS page and especially this part :

Note when making your modifcations that a default BIS RPG or a BIS LAW is making 500 damage by hit.

-Once you have done your modifications transform the config.cpp you have modified into a config.bin by using CPP2BIN

-Then using a PBO packing utility transform the folder Brmd into a Brmd.pbo

-DO NOT REPLACE the original Brmd.pbo in the ..\Res\Addons\ folder, but either put it into a WHATEVERMOD\Addons\ folder or create your own mod folder to use it.

Launch OFP with your shortcut modified to point to the mod folder featuring your new modified Brmd.pbo and test to see if your modification fits your needs.

now i tried it,i got a error of

error on property armor - BRDM: landVechicle - CfgVehicles.

Share this post


Link to post
Share on other sites
help me i want put bizon in russian soldier hand,what i do in config file for that,help

Put the folowing in the config:

weapons[]={"Bizon","GlockS","Throw","Put"}; magazines[]={"BizonMag","BizonMag","BizonMag","BizonMag","HandGrenade","HandGrenade","GlockSMag","GlockSMag","GlockSMag","GlockSMag"};

That will give him Bizon,four Bizon Magazines,Silenced Glock,5 Silenced Glock Magazines and two hand Grenades

---------- Post added at 11:05 AM ---------- Previous post was at 10:58 AM ----------

now i tried it,i got a error of

error on property armor - BRDM: landVechicle - CfgVehicles.

What you have changed.Post the modified config.

Share this post


Link to post
Share on other sites

@sanctuary

if u read it make a response,i tried ur advice,but still 1 law get rid of that brdm.help man?

Share this post


Link to post
Share on other sites

What advice have you "tried" ?

If it is about the armor value from previous post, you have not tried hard enough, increase those until you see the LAW not destroying your brdm in 1 shot.

Share this post


Link to post
Share on other sites

you mean that increase that armor structure value more than 1.

Share this post


Link to post
Share on other sites

This i told you already previously :

armor=80;

armorGlass=0.5;

armorWheels=0.15;

armorBody=0.4;

armorFuel=1.4;

armorLights=0.4;

armorStructural=1.0;

and

About : you have different parts on an OFP tank, described in the hitHull, hitEngine, etc... part of the config.cpp. Each has its own "hitpoints". The tank also has a global "health point" value, set in the "armor" parameter in the config. Each localized hitPoints are calculated from the global armor, by multiplying it by the number found in the hitHull section under armorHull, armorEngine, etc...500 armor, 0.7 armorEngine means the "engine" selection in the hit LOD of the P3D model will have 500*0.7=250 hitpoints.

When hit, a tank will give damage to every part hit. If hit for 300 in Hull and Engine, hitHull and hitEngine will be reduced by 300 each. In addition, the global armor will be decreased by the sum of damages done to localized parts, divided by the armorStructural parameter. In my example,300 + 300 = 600, divided by 2 armorStructural = 300 hit to global armor

Increase values, experiment around it considering that a LAW/RPG does 500 damage in direct hit and 150 damage in indirect hit.

Your BRDM has 80 * 1.0 = 80 hit points, that's why a LAW/RPG destroy it in 1 hit.

Share this post


Link to post
Share on other sites

I find in a addon that east side units speaking west type english and face looking like west soldiers like james pound etc.what i have to alter in config file.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×