Jump to content
Sign in to follow this  
greywolf907

How to attach default scope to re textured rifle

Recommended Posts

So I have created a re textured rifle and can not figure out how to have a default scope attached to it through the config.cpp file. I would like to link a RCO scope to the rifle so that if I spawn in a unit with Zeus the AI will have a scope or if I play as one of my custom units on a mission that uses the re textured rifle I have a scope to use. Thanks for any help

Share this post


Link to post
Share on other sites

Ok well I can get it to work but then I can't see my 2nd weapons in the virtual arsenal how can I incorporate it into my config and make it work how it does now but with the attachments and also so I can have different attachments on the second weapon? thanks.

 

Here is what I have for the config.cpp

 

class CfgPatches {
class T1_WEAPONS {
units[] = {};
weapons[] = {};
requiredVersion = 0.1;
};
};
 
class cfgWeapons 
    //********************************************************************************************************************************************************************************************
    //*****            Rifles             *****************************************************************************************************************************************************
    //********************************************************************************************************************************************************************************************
    class arifle_MXM_F;
 
    class T1_MD_KRIP_W: arifle_MXM_F
    {
baseWeapon = "T1_MD_KRIPT_W";
displayName = "MXM MANDRAKE [TIER1]";
hiddenSelections[] = {"camo1"};
hiddenSelectionsTextures[] = {"T1_WEAPONS\Data\T1_MXM_MDK.paa"};
picture = "\T1_WEAPONS\UI\MD_MXM.paa";
scopeCurator = 2;
    };
 
    class arifle_MXM_F_1;
 
class T1_MDN_KRIP_W: arifle_MXM_F
    {
baseWeapon = "T1_MDN_KRIPT_W";
displayName = "MXM MANDRAKE NET [TIER1]";
hiddenSelections[] = {"camo1"};
hiddenSelectionsTextures[] = {"T1_WEAPONS\Data\T1_MXM_MD_N.paa"};
picture = "\T1_WEAPONS\UI\MD_MXM.paa";
scopeCurator = 2;
    };
 };

Share this post


Link to post
Share on other sites

Well even without the line scopeArsenal = 2; my weapons show up in the arsenal but when I add the lines to attach the scope and suppressor the weapon I add the lines to in the config no longer shows up in the arsenal even with the scopeArsenal line. Can you please take my config above and show me how to make it work with the attachments and arsenal? Thanks for the help

Share this post


Link to post
Share on other sites

I think you need to add the following. Note the attachments here are RH's...you just need to change out the class names;

	{
		class LinkedItems
		{
			class LinkedItemsOptic
			{
				slot = "CowsSlot";
				item = "optic_hamr";
			};

			class LinkedItemsAcc
			{
				slot = "PointerSlot";
				item = "RH_peq2";
			};
			
			class LinkedItemsMuzzle
			{
				slot = "MuzzleSlot";
				item = "RH_qdss_nt4";
			};
		};
	};

Share this post


Link to post
Share on other sites

So where do I add this into my config above? At the end or in the field of the rifles or what? Everything I try seems to give me a error or messes up the second gun being in the arsenal. Thanks

Share this post


Link to post
Share on other sites

You add it like this.

class CfgPatches {
	class ELG_HLC_replacement_AAF {
		units[] = {};
		weapons[] = {"AAF_hlc_rifle_G36C"};
		requiredVersion = 0.1;
		requiredAddons[] = {"hlcweapons_g36", "RH_acc"};
	};
};

class CfgVehicles {
	class I_Soldier_base_F;
	
	class I_Soldier_lite_F : I_Soldier_base_F {
		weapons[] = {"AAF_hlc_rifle_G36C", "hgun_ACPC2_F", "Throw", "Put"};
		respawnWeapons[] = {"AAF_hlc_rifle_G36C", "hgun_ACPC2_F", "Throw", "Put"};
		magazines[] = {"hlc_30rnd_556x45_EPR_G36", "hlc_30rnd_556x45_EPR_G36", "hlc_30rnd_556x45_EPR_G36", "hlc_30rnd_556x45_EPR_G36", "9Rnd_45ACP_Mag", "9Rnd_45ACP_Mag", "9Rnd_45ACP_Mag", "SmokeShell", "SmokeShellGreen", "Chemlight_green", "Chemlight_green"};
		respawnMagazines[] = {"hlc_30rnd_556x45_EPR_G36", "hlc_30rnd_556x45_EPR_G36", "hlc_30rnd_556x45_EPR_G36", "hlc_30rnd_556x45_EPR_G36", "9Rnd_45ACP_Mag", "9Rnd_45ACP_Mag", "9Rnd_45ACP_Mag", "SmokeShell", "SmokeShellGreen", "Chemlight_green", "Chemlight_green"};
	};
	

class CfgWeapons {
	class hlc_rifle_G36C;
	
	class AAF_hlc_rifle_G36C : hlc_rifle_G36C {
		scope = protected;
		
		class LinkedItems {
			class LinkedItemsOptic {
				slot = "asdg_OpticRail_G36C";
				item = "RH_eothhs1";
			};
			
			class LinkedItemsAcc {
				slot = "asdg_fsr_36C"; 
				item = "acc_pointer_IR";
			};
		};
	};
};
  • Like 1

Share this post


Link to post
Share on other sites

What is the line scope = protected; for? Also is there not a way to just do this within my weapons config as I have my different re textured addons separated in different files weapons, NATO units,  Ghillie Units, ETC... Really did not want to add my weapons code line into my units config. Thanks  

Share this post


Link to post
Share on other sites

"scope=protected" comes from a macro 

#define private    0
#define protected  1
#define public     2

and it means this:

2 = class is available in the editor; 1 = class is unavailable in the editor, but can be accessed via a macro; 0 = class is unavailable (and used for inheritance only).

 

 Also is there not a way to just do this within my weapons config as I have my different re textured addons separated in different files weapons, NATO units,  Ghillie Units, ETC... Really did not want to add my weapons code line into my units config. Thanks  

 

If you want your units to spawn with your custom rifle, you need to add it in their class, but you can do it in another config file, where you just define the "weapons" and "respawnWeapons" parameters. 

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  

×