CfgVehicleClasses: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
Line 25: Line 25:
== Example Config ==
== Example Config ==


Here is an example config.cpp with correct use of cfgVehicelClasses:
Here is an example config.cpp with correct use of cfgVehicleClasses:


<pre>// some basic defines
<pre>// some basic defines
Line 88: Line 88:
};</pre>
};</pre>


Here is an example config.cpp with simplified & safer use of cfgVehicleClasses (ArmA):
<pre>// 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 MySoldier
{
units[] = {"MySoldier"};
requiredAddons[] = {};
weapons[] = {};
requiredVersion = 1.00;
};
};
class CfgVehicleClasses
{
class MySoldierClass
{
displayName = "My Soldiers";
};
};
class cfgVehicles
{
class SoldierWB;
class MySoldier: SoldierWB
{
displayName="My Soldier";
vehicleClass = "MySoldierClass";
weapons[]={"M4AIM","M9","Throw","Put"};
magazines[]={"30Rnd_556x45_Stanag","15Rnd_9x19_M9","15Rnd_9x19_M9"};
};
};</pre>
Second example shows safer and easier way to describe parent class in vehicle config - addonmaker doesn't have to know the whole parency tree.


== Result ==
== Result ==

Revision as of 22:41, 15 July 2008

cfgVehicleClasses is the new way of using custom vehicleClasses in Armed Assault.

The cfgVehicleClasses entry

The way this functions is by a seperate cfgVehicleClasses entry, somewhere before the cfgVehicles.

It would appear like so:

class cfgVehicleClasses
{
	class MyClass
	{
		displayName = "My Addons";
	};
};

The vehicleClass entry

In the cfgVehicleClasses entry for your addon, you would insert


vehicleClass = "MyClass";


Example Config

Here is an example config.cpp with correct use of cfgVehicleClasses:

// 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 MySoldier
	{
		units[] = {"MySoldier"};
		requiredAddons[] = {};
		weapons[] = {};
		requiredVersion = 1.00;
	};
};
class CfgVehicleClasses
{
	class MySoldierClass
	{
		displayName = "My Soldiers";
	};
};

class cfgVehicles
{
	class All {};
	class AllVehicles: All {};
	class Land: AllVehicles {};
	class Man:Land {};
	class CAManBase: Man {};
	class SoldierWB: CAManBase {};
	class MySoldier: SoldierWB
	{
		displayName="My Soldier";
		vehicleClass = "MySoldierClass";
		weapons[]={"M4AIM","M9","Throw","Put"};
		magazines[]={"30Rnd_556x45_Stanag","15Rnd_9x19_M9","15Rnd_9x19_M9"};
		
	};
};


Here is an example config.cpp with simplified & safer use of cfgVehicleClasses (ArmA):

// 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 MySoldier
	{
		units[] = {"MySoldier"};
		requiredAddons[] = {};
		weapons[] = {};
		requiredVersion = 1.00;
	};
};
class CfgVehicleClasses
{
	class MySoldierClass
	{
		displayName = "My Soldiers";
	};
};

class cfgVehicles
{
	class SoldierWB;
	class MySoldier: SoldierWB
	{
		displayName="My Soldier";
		vehicleClass = "MySoldierClass";
		weapons[]={"M4AIM","M9","Throw","Put"};
		magazines[]={"30Rnd_556x45_Stanag","15Rnd_9x19_M9","15Rnd_9x19_M9"};
		
	};
};

Second example shows safer and easier way to describe parent class in vehicle config - addonmaker doesn't have to know the whole parency tree.

Result

The end result would appear somewhat like this:

cfgVehicleClasses Result