Jump to content
Sign in to follow this  
liukang168

Custom weapon - attachments don't work

Recommended Posts

Hello,

I am having trouble creating a new weapon. The gun works in the game, shoots etc. but for some reasons I cant get the attachments to work. Sorry for asking but I am a bit new in all this development.

I made some pictures:

LOD1

plasma.jpg

MEMORY LOD

plasma2.jpg

Here is the config.cpp

/*
M95 PlasmaRifle for TR T-Series 101, 600 and 800
*/


#define _ARMA_
class CfgPatches
{
class SKY_m95
{
	units[] = {};
	weapons[] = {"SKY_m95_irn","SKY_m95_ns","SKY_m95_holo","SKY_m95_holo_laser","SKY_m95_arco_laser","SKY_m95_arco","SKY_m95_arco_flash","SKY_m95_holo_flash","SKY_m95_aco","SKY_m95_aco_laser","SKY_m95_aco_flash","SKY_m95_ns_flash","SKY_m95_ns_laser","SKY_m95_acog_laser","SKY_m95_acog_flash","SKY_m95_acog","SKY_m95_hamr","SKY_m95_hamr_flash","SKY_m95_hamr_laser"};
	requiredVersion = 0.52;
	requiredAddons[] = {"A3_Data_F"};
};
};
class CfgAmmo
{
/*extern*/ class default;
/*extern*/ class BulletBase;

class SKY_m95150: BulletBase
{
	/*hit = 50;
	indirectHit = 15;
	indirectHitRange = 1.000000;
	visibleFire = 100;
	audibleFire = 100;
	visibleFireTime = 10;
	cost = 2;
	airLock = 1;
	explosive = 0.001;
	caliber=0.8;
	model="\A3\Weapons_f\Data\bullettracer\tracer_yellow";
	tracerScale=1;
	tracerStartTime=0.000000001;
	tracerEndTime=5;
	};	*/
	hit=25;
	indirectHit=15;
	indirectHitRange=1.0;
	cartridge="SKY_m95150";
	visibleFire=100;
	audibleFire=100;
	visibleFireTime=10;
	cost=2;
	airLock=1;
	explosive = 0.00001;
	typicalSpeed=9000;
	caliber=1.80000001;
	model="\A3\Weapons_f\Data\bullettracer\tracer_red";
	tracerScale=2.5;
	tracerStartTime=0.000000001;
	tracerEndTime=5;
	airFriction=-0.0;
	class CamShakeFire
	{
		power=0;
		duration=0;
		frequency=0;
		distance=0;
	};
	class CamShakePlayerFire
	{
		power=0;
		duration=0;
		frequency=0;
		distance=0;
	};		
 }; 
};

class CfgMagazines
{
class CA_Magazine;
class SKY_m95150: CA_Magazine
{
	scope = 2;
	displayName = M95x150;
	ammo = SKY_m95150;
	count=150;
	initSpeed = 9000;
	picture="\A3\weapons_F\data\UI\m_30stanag_CA.paa";
	tracersEvery=1;
	lastRoundsTracer=4;
};

};
class Mode_SemiAuto;
class Mode_Burst;
class Mode_FullAuto;
class SlotInfo;

class CowsSlot : SlotInfo
{
	// targetProxy
	linkProxy = "\A3\data_f\proxies\weapon_slots\TOP";

	// display name
	displayName = $STR_A3_CowsSlot0;

	// class names with items supported by weapon 
	compatibleItems[] = {"optic_Arco","optic_aco", "optic_ACO_grn","optic_hamr","optic_Holosight", "optic_Nightstalker"};
}; 
class PointerSlot : SlotInfo
{
	// targetProxy
	linkProxy = "\A3\data_f\proxies\weapon_slots\SIDE";

	// display name
	displayName = $STR_A3_PointerSlot0;

	// class names with items supported by weapon 
	compatibleItems[] = {"acc_flashlight","acc_pointer_IR"}; 
};
class CfgWeapons
{
class Rifle;
class Rifle_Base_F: Rifle
{
	class WeaponSlotsInfo;
	class GunParticles;
};
class UGL_F;
class SKY_m95_Base: Rifle_Base_F
{
	magazines[] = {"SKY_m95150"};
	reloadAction = "GestureReloadKhaybar";
	handAnim[] = {"OFP2_ManSkeleton","\A3\Weapons_F\Rifles\Khaybar\data\anim\khaybar.rtm"};
	class WeaponSlotsInfo: WeaponSlotsInfo
	{
		class WeaponSlotsInfo
		{
			mass = 4; /// default mass of a weapon
			class MuzzleSlot: SlotInfo
			{
			  // targetProxy
			  linkProxy = "\A3\data_f\proxies\weapon_slots\MUZZLE";

			  // display name
			  displayName = "Muzzle Slot";

			  // class names with items supported by weapon
			  compatibleItems[] = {}; // moved to each weapon
			};
			class CowsSlot: CowsSlot {};
			class PointerSlot: PointerSlot {};
			allowedSlots[] = {901}; // you simply cannot put this into your pants
		};
	};
	class GunParticles: GunParticles
	{
		class SecondEffect
		{
			positionName = "Nabojnicestart";
			directionName = "Nabojniceend";
		};
	};
	opticsZoomMin = 0.375;
	opticsZoomMax = 1.1;
	opticsZoomInit = 0.75;
	distanceZoomMin = 300;
	distanceZoomMax = 300;
	bullet1[] = {"\A3\sounds_f\weapons\shells\5_56\metal_556_01.wav",0.1,1,15};
	bullet2[] = {"A3\sounds_f\weapons\shells\5_56\metal_556_02.wav",0.1,1,15};
	bullet3[] = {"A3\sounds_f\weapons\shells\5_56\metal_556_03.wav",0.17782794,1,15};
	bullet4[] = {"A3\sounds_f\weapons\shells\5_56\metal_556_04.wav",0.17782794,1,15};
	bullet5[] = {"A3\sounds_f\weapons\shells\5_56\asphlat_556_01.wav",0.1,1,15};
	bullet6[] = {"A3\sounds_f\weapons\shells\5_56\asphlat_556_02.wav",0.1,1,15};
	bullet7[] = {"A3\sounds_f\weapons\shells\5_56\asphlat_556_03.wav",0.1,1,15};
	bullet8[] = {"A3\sounds_f\weapons\shells\5_56\asphlat_556_04.wav",0.1,1,15};
	bullet9[] = {"A3\sounds_f\weapons\shells\5_56\grass_556_01.wav",0.01,1,15};
	bullet10[] = {"A3\sounds_f\weapons\shells\5_56\grass_556_02.wav",0.01,1,15};
	bullet11[] = {"A3\sounds_f\weapons\shells\5_56\grass_556_03.wav",0.01,1,15};
	bullet12[] = {"A3\sounds_f\weapons\shells\5_56\grass_556_04.wav",0.01,1,15};
	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","Burst","FullAuto","single_medium_optics1","single_far_optics2","fullauto_medium"};
	class Single: Mode_SemiAuto
	{
		begin1[] = {"\SKY_weapons\SKY_m95\sounds\PlasmaRifle.wss",1.0,1,900};
		begin2[] = {"\SKY_weapons\SKY_m95\sounds\PlasmaRifle.wss",1.0,1,900};
		soundBegin[] = {"begin1",0.5,"begin2",0.5};
		weaponSoundEffect = "DefaultRifle";
		reloadTime = 0.065;
		recoil = "recoil_single_trg";
		recoilProne = "recoil_single_prone_trg";
		dispersion = 0.00093;
		minRange = 2;
		minRangeProbab = 0.3;
		midRange = 250;
		midRangeProbab = 0.7;
		maxRange = 500;
		maxRangeProbab = 0.2;
	};
	class Burst: Mode_Burst
	{
		begin1[]=
		{
			"\SKY_weapons\SKY_m95\sounds\PlasmaRifle.wss",
			1.7782794,
			1,
			900
		};
		begin2[]=
		{
			"\SKY_weapons\SKY_m95\sounds\PlasmaRifle.wss",
			1.7782794,
			1,
			900
		};
		begin3[]=
		{
			"\SKY_weapons\SKY_m95\sounds\PlasmaRifle.wss",
			1.7782794,
			1,
			900
		};
		soundBegin[]=
		{
			"begin1",
			0.33000001,
			"begin2",
			0.33000001,
			"begin3",
			0.34
		};
		soundBurst=0;
		burst=3;
		reloadTime=0.090000004;
		recoil="recoil_burst_sdar";
		recoilProne="recoil_burst_prone_sdar";
		dispersion=0.015;
		minRange=1;
		minRangeProbab=0.30000001;
		midRange=10;
		midRangeProbab=0.69999999;
		maxRange=30;
		maxRangeProbab=0.050000001;
		aiRateOfFire=1;
		aiRateOfFireDistance=10;
	};
	class FullAuto: Mode_FullAuto
	{
		begin1[] = {"\SKY_weapons\SKY_m95\sounds\PlasmaRifle.wss",1.0,1,900};
		begin2[] = {"\SKY_weapons\SKY_m95\sounds\PlasmaRifle.wss",1.0,1,900};
		soundBegin[] = {"begin1",0.5,"begin2",0.5};
		weaponSoundEffect = "DefaultRifle";
		reloadTime = 0.07;
		recoil = "recoil_auto_trg";
		recoilProne = "recoil_auto_prone_trg";
		dispersion = 0.00093;
		minRange = 0;
		minRangeProbab = 0.9;
		midRange = 15;
		midRangeProbab = 0.7;
		maxRange = 30;
		maxRangeProbab = 0.1;
		aiRateOfFire = 1e-006;
	};
	class single_medium_optics1: Single
	{
		requiredOpticType = 1;
		showToPlayer = 0;
		minRange = 2;
		minRangeProbab = 0.2;
		midRange = 550;
		midRangeProbab = 0.7;
		maxRange = 700;
		maxRangeProbab = 0.1;
		aiRateOfFire = 6;
		aiRateOfFireDistance = 600;
	};
	class single_far_optics2: single_medium_optics1
	{
		requiredOpticType = 2;
	};
	class fullauto_medium: FullAuto
	{
		showToPlayer = 0;
		burst = 3;
		minRange = 2;
		minRangeProbab = 0.5;
		midRange = 75;
		midRangeProbab = 0.7;
		maxRange = 150;
		maxRangeProbab = 0.05;
		aiRateOfFire = 2.0;
	};
	class EGLM: UGL_F
	{
		useModelOptics = 0;
		useExternalOptic = 0;
		cameraDir = "OP_look";
		discreteDistance[] = {100,200,300,400};
		discreteDistanceCameraPoint[] = {"OP_eye","OP_eye2","OP_eye3","OP_eye4"};
		discreteDistanceInitIndex = 1;
	};
	aiDispersionCoefY = 10;
	aiDispersionCoefX = 8;
	drySound[] = {"A3\sounds_f\weapons\Other\dry_1.wav",0.01,1,10};
	reloadMagazineSound[] = {"A3\Sounds_F\weapons\Khaybar\reload_khaibar.wav",1.0,1,50};
};
class SKY_m95_irn: SKY_m95_Base
{
	scope = 2;
	displayName = "M95 Plasma Rifle";
	descriptionShort = "Skynet M95 Plasma Rifle - Bulky, Heavy and not usable by humans";
	class Library
	{
		libTextDesc = "The M95 is fully automatic, but is usually used by Terminators in short, controlled bursts, due to the high amount of recoil and heat it generates.";
	};
	model = "\SKY_weapons\SKY_m95\SKY_m95.p3d";
	picture = "\SKY_weapons\SKY_m95\Ico\PlasmaRifleIco.paa";
	UiPicture = "\SKY_weapons\SKY_m95\Ico\PlasmaRifleIco.paa";
	class WeaponSlotsInfo: WeaponSlotsInfo
	{
		mass = 4;
	};
};
class SKY_m95_ns_laser: SKY_m95_irn
{
	class LinkedItems
	{
		class LinkedItemsOptic
		{
			slot = "CowsSlot";
			item = "optic_Nightstalker";
		};
		class LinkedItemsAcc
		{
			slot = "PointerSlot";
			item = "acc_pointer_IR";
		};
	};
};
class SKY_m95_ns_flash: SKY_m95_irn
{
	class LinkedItems
	{
		class LinkedItemsOptic
		{
			slot = "CowsSlot";
			item = "optic_Nightstalker";
		};
		class LinkedItemsAcc
		{
			slot = "PointerSlot";
			item = "acc_flashlight";
		};
	};
};
class SKY_m95_ns: SKY_m95_irn
{
	class LinkedItems
	{
		class LinkedItemsOptic
		{
			slot = "CowsSlot";
			item = "optic_Nightstalker";
		};
	};
};
class SKY_m95_holo: SKY_m95_irn
{
	class LinkedItems
	{
		class LinkedItemsOptic
		{
			slot = "CowsSlot";
			item = "optic_HoloSight";
		};
	};
};
class SKY_m95_holo_laser: SKY_m95_irn
{
	class LinkedItems
	{
		class LinkedItemsOptic
		{
			slot = "CowsSlot";
			item = "optic_HoloSight";
		};
		class LinkedItemsAcc
		{
			slot = "PointerSlot";
			item = "acc_pointer_IR";
		};
	};
};
class SKY_m95_holo_flash: SKY_m95_irn
{
	class LinkedItems
	{
		class LinkedItemsOptic
		{
			slot = "CowsSlot";
			item = "optic_HoloSight";
		};
		class LinkedItemsAcc
		{
			slot = "PointerSlot";
			item = "acc_flashlight";
		};
	};
};
class SKY_m95_arco_laser: SKY_m95_irn
{
	class LinkedItems
	{
		class LinkedItemsOptic
		{
			slot = "CowsSlot";
			item = "optic_arco";
		};
		class LinkedItemsAcc
		{
			slot = "PointerSlot";
			item = "acc_pointer_IR";
		};
	};
};
class SKY_m95_arco_flash: SKY_m95_irn
{
	class LinkedItems
	{
		class LinkedItemsOptic
		{
			slot = "CowsSlot";
			item = "optic_arco";
		};
		class LinkedItemsAcc
		{
			slot = "PointerSlot";
			item = "acc_flashlight";
		};
	};
};
class SKY_m95_arco: SKY_m95_irn
{
	class LinkedItems
	{
		class LinkedItemsOptic
		{
			slot = "CowsSlot";
			item = "optic_arco";
		};
	};
};
class SKY_m95_aco_laser: SKY_m95_irn
{
	class LinkedItems
	{
		class LinkedItemsOptic
		{
			slot = "CowsSlot";
			item = "optic_aco";
		};
		class LinkedItemsAcc
		{
			slot = "PointerSlot";
			item = "acc_pointer_IR";
		};
	};
};
class SKY_m95_aco_flash: SKY_m95_irn
{
	class LinkedItems
	{
		class LinkedItemsOptic
		{
			slot = "CowsSlot";
			item = "optic_aco";
		};
		class LinkedItemsAcc
		{
			slot = "PointerSlot";
			item = "acc_flashlight";
		};
	};
};
class SKY_m95_aco: SKY_m95_irn
{
	class LinkedItems
	{
		class LinkedItemsOptic
		{
			slot = "CowsSlot";
			item = "optic_aco";
		};
	};
};
class SKY_m95_acog: SKY_m95_irn
{
	class LinkedItems
	{
		class LinkedItemsOptic
		{
			slot = "CowsSlot";
			item = "optic_aco_grn";
		};
	};
};
class SKY_m95_acog_flash: SKY_m95_irn
{
	class LinkedItems
	{
		class LinkedItemsOptic
		{
			slot = "CowsSlot";
			item = "optic_aco";
		};
		class LinkedItemsAcc
		{
			slot = "PointerSlot";
			item = "acc_flashlight";
		};
	};
};
class SKY_m95_acog_laser: SKY_m95_irn
{
	class LinkedItems
	{
		class LinkedItemsOptic
		{
			slot = "CowsSlot";
			item = "optic_aco";
		};
		class LinkedItemsAcc
		{
			slot = "PointerSlot";
			item = "acc_pointer_IR";
		};
	};
};
class SKY_m95_hamr_laser: SKY_m95_irn
{
	class LinkedItems
	{
		class LinkedItemsOptic
		{
			slot = "CowsSlot";
			item = "optic_hamr";
		};
		class LinkedItemsAcc
		{
			slot = "PointerSlot";
			item = "acc_pointer_IR";
		};
	};
};
class SKY_m95_hamr_flash: SKY_m95_irn
{
	class LinkedItems
	{
		class LinkedItemsOptic
		{
			slot = "CowsSlot";
			item = "optic_hamr";
		};
		class LinkedItemsAcc
		{
			slot = "PointerSlot";
			item = "acc_flashlight";
		};
	};
};
class SKY_m95_hamr: SKY_m95_irn
{
	class LinkedItems
	{
		class LinkedItemsOptic
		{
			slot = "CowsSlot";
			item = "optic_hamr";
		};
	};
};
};

and here the model.cfg

class CfgModels
{
class Default
{
	sections[]={};
	sectionsInherit="";
	skeletonName="";
};
class Weapon: Default
{
	sections[]=
	{
		"zasleh"
	};
	skeletonName="Weapon";
	class Animations
	{
		class magazine_hide
		{
			type="hide";
			source="reloadMagazine";
			selection="magazine";
			minValue=0;
			maxValue=1;
			hideValue=0.22;
			unhideValue=0.55000001;
		};	
	};
};
class SKY_m95: Weapon
{
	skeletonName="SKY_m95Skeleton";
	class Animations
	{
		class magazine_hide
		{
			type="hide";
			source="reloadMagazine";
			selection="magazine";
			minValue=0;
			maxValue=1;
			hideValue=0.22;
			unhideValue=0.55000001;
		};	
	};
};
};
class CfgSkeletons
{
class Default
{
	isDiscrete=1;
	skeletonInherit="";
	skeletonBones[]={};
};
class Weapon: Default
{
	isDiscrete = 0;
	skeletonInherit = "Default";
	skeletonBones[]=
	{
		"magazine",
		"",
		"ammo_belt",
		"",
		"ammo_belt_bottom",
		""
	};
};
class SKY_m95Skeleton: Weapon
{
	skeletonInherit="Weapon";
	skeletonBones[]=
	{
		"magazine",
		""
	};
	sections[] = {"magazine"};
};
};

I just can't see the error.

Well thanks to anyone taking his time into helping me.

Share this post


Link to post
Share on other sites

What do you mean with "they don't work"? You cannot attach them, or they don't appear?

Share this post


Link to post
Share on other sites
What do you mean with "they don't work"? You cannot attach them, or they don't appear?

They do not appear in game. As I lack of knowledge how to create a weapon, it might be that a wrong lod setup is responsible.

Share this post


Link to post
Share on other sites

Well if there was an arma3 sample weapon, that I can reverse engineer myself ...

Share this post


Link to post
Share on other sites

I cite the former because SITREP #0005 specifically cited it for Kiory having "released all sources for others to learn from, making this an exemplary approach to modding" and even having livestreamed the modeling of that weapon, though this month about a week ago he began livestreaming the modeling of a SCAR "Mk13".

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  

×