Jump to content
Sign in to follow this  
tpw

PIP scopes: how to make discrete magnification stick?

Recommended Posts

Hi all

 

I've been playing around with a config to add CBA PIP functionality to the default Arma3 scopes such as the MRCO, ERCO etc. Just because I can, I want to extend the scope functionality so a scope may offer different magnification levels.  I've got 3 classes of scopes:

 

1 - Fixed magnification. PIP works great, and scope zeroing works and is remembered

2 - Variable magnification (eg 1x --> 6x). Scopes can be zoomed in/out with numpad +/-,  and the zoom sticks and  is remembered. Zeroing works and is remembered

 the next time the scope is used

3 - Discrete  magnification (eg 1x, 2x, 4x, 6x). Scope's magnification can be incremented/decremented with numpad +/-, but the magnification doesn't stick. The next time the scope is used it will use the default magnification. Zeroing is fine.

 

So I've looked at plenty of other scope configs in which the discrete zoom is remembered, and can't for the life of me figure out why mine doesn't work. If anyone could cast an eye over my sample config I'd be very grateful!

 

Cheers

 

Spoiler

class CfgPatches
{
	class TPW_PIP_CFG
	{
		units[]=
		{
		"Item_TPW_ERCO_PIP",
		};
		weapons[] =
		{
		"TPW_ERCO_PIP"
		};
		requiredVersion=2;
		requiredAddons[]=
		{
			"A3_Data_F",
			"cba_main",
		};		
		
	};	
};

class CfgVehicles
{
	class Item_Base_F;
	class Item_TPW_ERCO: Item_Base_F
	{
		scope=2;
		scopeCurator=2;
		displayName="TPW ERCO PIP";
		author="TPW";
		editorCategory="EdCat_WeaponAttachments";
		editorSubcategory="EdSubcat_TopSlot_Optics";
		vehicleClass="WeaponAccessories";
		class TransportItems
		{
			class TPW_ERCO
			{
				name="TPW_ERCO";
				count=1;
			};
		};
	};		
};	

class asdg_OpticRail
{
	class compatibleItems;
};

class asdg_OpticRail1913: asdg_OpticRail
{
	class compatibleItems
	{
		TPW_ERCO=1;
		TPW_ERCO_PIP=1;			
	};
};

class CfgWeapons
{
	class ItemCore;
	class InventoryOpticsItem_Base_F;
	class TPW_ERCO: itemcore
	{
		scope=1;
		scopeArsenal=1;
		author="TPW";
		displayname="TPW ERCO";
		descriptionShort="ERCO with PIP optics";
		picture = "\a3\Weapons_F_Exp\Acc\Data\UI\icon_optic_ERCO_blk_F_ca.paa";
		ACE_ScopeHeightAboveRail=4.8000002;
		ACE_ScopeAdjust_Vertical[]={-4,20};
		ACE_ScopeAdjust_Horizontal[]={-6,6};
		ACE_ScopeAdjust_VerticalIncrement=0.1;
		ACE_ScopeAdjust_HorizontalIncrement=0.1;
		inertia=0.052000001;
		model = "\A3\Weapons_F_Exp\Acc\acco_erco_blk_F.p3d";
		class CBA_ScriptedOptic
		{
			opticsPPEffects[]=
			{
				"CBA_OpticsRadBlur1"
			};
			reticleTexture="\TPW_PIP\Optics\data\reticle_arco_ca.paa";
			reticleTextureNight="\TPW_PIP\Optics\data\reticle_arco_ca.paa";
			reticleTextureSize=0.5;
			manualReticleNightSwitch=0;
			bodyTexture="\TPW_PIP\Optics\data\Scope_ca.paa";
			bodyTextureSize=1.1;	
		};
		weaponInfoType="CBA_ScriptedOptic_zooming";
		manualReticleNightSwitch = 0;
		class ItemInfo:InventoryOpticsItem_Base_F
		{
			mass=8;
			opticType=1;
			optics=1;
			modelOptics = "\x\cba\addons\optics\cba_optic_small_70.p3d";
			class OpticsModes
			{
				class Scope
				{
					opticsID = 1;
					useModelOptics = 1;
					opticsPPEffects[] = {"OpticsCHAbera1", "OpticsBlur1", "rhs_ERCO_Blur"};
					opticsFlare = 1;
					opticsDisablePeripherialVision = 1;
					opticsZoomMin = "4 call (uiNamespace getVariable 'cba_optics_fnc_setOpticMagnificationHelper')";
					opticsZoomMax = "2 call (uiNamespace getVariable 'cba_optics_fnc_setOpticMagnificationHelper')";
					opticsZoomInit = "2 call (uiNamespace getVariable 'cba_optics_fnc_setOpticMagnificationHelper')";
					discretefov[] = {"2 call (uiNamespace getVariable 'cba_optics_fnc_setOpticMagnificationHelper')","4 call (uiNamespace getVariable 'cba_optics_fnc_setOpticMagnificationHelper')"};
					discreteInitIndex=0;
					memoryPointCamera = "opticView";
					distanceZoomMin = 100;
					distanceZoomMax = 1000;
					discreteDistance[] = {100,200,300,400,500,600,700,800,900,1000};
					discreteDistanceInitIndex = "2 call (uiNamespace getVariable 'cba_optics_fnc_setOpticMagnificationHelperZeroing')";
					visionMode[] = {};
				};
				class collimator 
				{
					opticsID = 1;
					useModelOptics = 0;
					opticsPPEffects[] = {"Default"};
					opticsFlare = 0;
					opticsDisablePeripherialVision = 0;
					opticsZoomMin = 0.5;
					opticsZoomMax = 1;
					opticsZoomInit = 0.75;
					memoryPointCamera = "eye";
					visionMode[] = {};
					distanceZoomMin = 200;
					distanceZoomMax = 200;
					cameraDir = "";
				};			
			};
		};
	};
	class TPW_ERCO_PIP: TPW_ERCO
	{
		class ItemInfo: ItemInfo 
		{
			modelOptics = "\x\cba\addons\optics\cba_optic_small_pip.p3d";
		};
	};
};	

class CBA_PIPItems
{
	TPW_ERCO="TPW_ERCO_PIP";	
};
	

 

 

 

 

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  

×