Jump to content
-GMS- Eliree

Custom weapons on table

Recommended Posts

Heya there guys,

 

i am building my mission with my custom weapons in it which are saved in a seperate PBO however when i try to search them up in the editor they are not listed in the weapons and if i change the classname in the mission.sqm to my custom classnames it simply says that it cannot find the vehicle class.

 

now i tried makign a vehicle class and then putting all the vehicle class in the weapons config however they still do not show.

 

any1 got an idea ?

 

the weaponconfig is an HPP file which comes together in a CPP both the sample of the hpp and cpp are attached below.

Weapons.hpp

class hlc_rifle_m4m203;

class ST1_SL_M4: hlc_rifle_m4m203
	{
		displayName = M4A1 - M203;
		vehicleclass = "ST1_Weapons";
		class LinkedItems
		{
			class LinkedItemsOptic
			{
				slot = "CowsSlot";
				item = "FHQ_optic_ACOG";
			};
			class LinkedItemsAcc
			{
				slot = "CowsSlot";
				item = "CUP_acc_ANPEQ_2";
			}
			class LinkedItemsMuzzle
			{
				slot = "MuzzleSlot";
				item = "muzzle_snds_M";
			};
		};
	};

and the config.cpp:

class CfgPatches 
{
	class ST1_Units
	{
weapons[] = 
		{
			"ST1_SL_M4"
		};
		requiredVersion = 0.1;
	};
};

class CfgFactionClasses
{
	class ST1
	{
		displayname = "Seal Team 1";
		author = "Eliree";
		priority = 1;
		side = 1;
	};
};

class CfgVehicleClasses
{
class ST1_Weapons
	{
		displayName = "Weapons";
	}
};

class CfgWeapons
{
	#include "Weapons\Weapons.hpp"
};

class CfgVehicles
{
	class B_Soldier_base_F;
	class B_Soldier_F;
	#include "Weapons\Weapons.hpp"

is this in the config or is it in the mission ? cause i can't see mto find it

Share this post


Link to post
Share on other sites

This will do the trick, just change the class names and categories

class CfgVehicles
{
	class Weapon_Base_F;
	class bnae_trg42_editor : Weapon_Base_F
	{
		scope=2;
		scopeCurator=2;
		displayName="TRG-42 .338";
		editorCategory="EdCat_Weapons";
		editorSubcategory="EdSubcat_SniperRifles";
		vehicleClass="WeaponsPrimary";
		faction="BLU_F";
		author="BNAE";
		class TransportWeapons
		{
			class bnae_trg42_virtual
			{
				weapon="bnae_trg42_virtual";
				count=1;
			};
		};
		class TransportMagazines
		{
			class 7Rnd_B_338_lapua
			{
				magazine="7Rnd_B_338_lapua";
				count=1;
			};
		};
	};
};

 

Share this post


Link to post
Share on other sites
1 hour ago, Bnae said:

This will do the trick, just change the class names and categories


class CfgVehicles
{
	class Weapon_Base_F;
	class bnae_trg42_editor : Weapon_Base_F
	{
		scope=2;
		scopeCurator=2;
		displayName="TRG-42 .338";
		editorCategory="EdCat_Weapons";
		editorSubcategory="EdSubcat_SniperRifles";
		vehicleClass="WeaponsPrimary";
		faction="BLU_F";
		author="BNAE";
		class TransportWeapons
		{
			class bnae_trg42_virtual
			{
				weapon="bnae_trg42_virtual";
				count=1;
			};
		};
		class TransportMagazines
		{
			class 7Rnd_B_338_lapua
			{
				magazine="7Rnd_B_338_lapua";
				count=1;
			};
		};
	};
};

 

 

do i put this in the general config . cpp or in a seperate hpp file and then link that into the general cpp ?

 

 

Share this post


Link to post
Share on other sites

It's really up to you. I usually prefer having everything on one config file.

Share this post


Link to post
Share on other sites
49 minutes ago, Bnae said:

It's really up to you. I usually prefer having everything on one config file.

 

not to keep annoying you but this config is basicly for every weapon ? or is it 1 general config and then different parts in it??

i am talking about this part :

 

class ST1_Weapons_editor : Weapon_Base_F
	{
		scope=2;
		scopeCurator=2;
		displayName="TRG-42 .338";
		editorCategory="EdCat_Weapons";
		editorSubcategory="EdSubcat_SniperRifles";
		vehicleClass="WeaponsPrimary";
		faction="BLU_F";
		author="Eliree";
		class TransportWeapons
		{
			class bnae_trg42_virtual
			{
				weapon="bnae_trg42_virtual";
				count=1;
			};
		};
	};

if i am correct the basic class which i named ST1_Weapons_editor is the basic class and then under the Transportweapons i list all the different weapons correct ?

Share this post


Link to post
Share on other sites
class CfgVehicles
{
	class Weapon_Base_F;
	class ST1_SL_M4_editor : Weapon_Base_F         //custom class name
	{
		scope=2;                                   //Can be seen in editor
		scopeCurator=2;                            //Can be seen in zeus
		displayName="M4A1 - M203";                 //Name to be seen in editor
		editorCategory="EdCat_Weapons";            //Under EMPTY weapons in editor
		editorSubcategory="EdSubcat_AssaultRifles";//Under assault rifles
		vehicleClass="WeaponsPrimary";             //It is primary weapon
		faction="BLU_F";                           //Blufor classed weapon
		author="Eliree";                           //Authors name
		class TransportWeapons
		{
			class ST1_SL_M4                        //Weapons class name in CfgWeapons
			{
				weapon="ST1_SL_M4";                //Weapons class name in CfgWeapons
				count=1;                           //Amount
			};
		};
		class TransportMagazines
		{
			class class_name_of_magazine           //Magazine used by the weapon, will be attached
			{
				magazine="class_name_of_magazine"; //Magazine used by the weapon
				count=1;                           //Amount
			};
		};
	};
};

For one weapon

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

×