Jump to content
Sign in to follow this  
FobiaBG

Config File for a scope not showing model

Recommended Posts

I have a scope and I tried to test it in arma... But I in the arsenal is shown the optic to be equiped but model is not shown. I can see it in the Object Builder but I dont know why in game cant be seen. Heres the config file...

 

#include "basicDefines_A3.hpp"

class CfgPatches
{
    class taqs_scope_v1
    {
        weapons[] =
        {
            "taqs_scope_v1_virtual",
        };
        units[] = {};
        author = "TaquitoDeAsada";
        requiredVersion = 0.1;
        requiredAddons[] = { "A3_Weapons_F", "cba_jr" };
        scopeCurator = 2;
        scopeArsenal = 2;
    };
};

class cfgWeapons
{
    class ItemCore;
    class InventoryItem_Base_F;
    class InventoryOpticsItem_Base_F;
    class taqs_scope_v1_base: ItemCore
    {
        displayName="ADO (Black)";
        author="TaquitoDeAsada";
        picture="\ScopePack\ADO\UI\cultSign_CA.paa";
        model="\ScopePack\ADO\ADO.p3d";
        scope=2;
        descriptionShort="Prototype Sight";
        weaponInfoType="RscWeaponZeroing";
        class ItemInfo: InventoryOpticsItem_Base_F
        {
            mass=8;
            opticType=0;
            weaponInfoType="RscWeaponRangeZeroingFOV";
            modelOptics="\ScopePack\ADO\ADO.p3d";
            optics=1;
            class OpticsModes
            {
                class taqs_scope_base
                {
                    opticsID=1;
                    opticsDisplayName="WFOV";
                    useModelOptics=1;
                    opticsPPEffects[]=
                    {
                        "OpticsCHAbera1",
                        "OpticsBlur1"
                    };
                    opticsZoomMin=0.0020000001;
                    opticsZoomMax=0.039999999;
                    opticsZoomInit=0.039999999;
                    discreteDistance[]={300,400,500,600,700,800,900,1000};
                    discreteDistanceInitIndex=2;
                    distanceZoomMin=200;
                    distanceZoomMax=400;
                    discretefov[]={0.039999999,0.0020000001};
                    discreteInitIndex=0;
                    memoryPointCamera="opticView";
                    modelOptics[]=
                    {
                        "\ScopePack\ADO\data\Reticles\ADOreticle.paa",
                        "\ScopePack\ADO\data\Reticles\ADOreticleZ.paa"
                    };
                    visionMode[] = {};
                    opticsFlare=1;
                    opticsDisablePeripherialVision=0;
                    cameraDir="";
                };
            };
        };
        inertia=0.1;
    };
    class taqs_scope_v1_virtual: taqs_scope_v1_base
    {
        scope=2;
        scopeArsenal=2;
        author="TaquitoDeAsada";
    };
};

class asdg_OpticRail;    // External class reference

class asdg_OpticRail1913 : asdg_OpticRail
{
    class compatibleItems
    {
        taqs_scope_v1_virtual = 2;
    };
};

class cfgMods
{
    author="TaquitoDeAsada";
};

 

 

Dunno what is causing an error, is my first mod.

 

Share this post


Link to post
Share on other sites

Its possible its the position of the scope itself in the X/Y/Z axis of the model. As such the scope may well be showing, just not attached to the weapon and may be floating around somewhere...

  • Like 1

Share this post


Link to post
Share on other sites
7 hours ago, Jackal326 said:

Its possible its the position of the scope itself in the X/Y/Z axis of the model. As such the scope may well be showing, just not attached to the weapon and may be floating around somewhere...


I resize it it blender as the size of the 3d scope example found in arma 3 samples. Also applied scale, location and position transform. Or should I get the weapon sample and position the scope where I want it to be(according the weapon model)? (cuz when importing the scope sample, it is on XYZ = 0 in blender) Or I need it to correct its position with any line on the config file?

 

Also, in the arsenal... If I choose any optic and then the mine, game still shows the scope I choose after my scope selection.

Share this post


Link to post
Share on other sites

OK so the only other issue I can see at a glance is the modelOptics path is the same as the model path.

These two parameters do two different things: model defines the model to use as the main appearance of the attachment and modelOptics is used to define a 2d plane model that simulates looking through a scope.

Then within the scope subclass you have an array for modelOptics presumably defining different reticles, but they're textures and not models? Might be confusing the game doing that...

Below is some code that is less janky and I know works, in case you want to test if its broken code that may be causing the issue:

	class SJB_AR_AimpointCompM4: ItemCore
	{
		scope = 2;
		displayName = "Aimpoint Comp M4";
		model = "\SJB_A3_WeaponsCore\data\attachments\Rifles\Aimpoint_COMPM4.p3d";
		picture = "\SJB_A3_WeaponsCore\data\inventory\sjb_acc_compm4_ca.paa";

		descriptionShort = "Red dot sight";
		weaponInfoType = "RscWeaponZeroing";
		class ItemInfo: InventoryOpticsItem_Base_F
		{
			opticType = 1;
			mass = 7.4;
			RMBhint = "Optical Sight";
			optics = 1;

			modelOptics="\A3\Weapons_F\empty";
			class OpticsModes
			{
				class ACO
				{
					opticsID = 1;
					useModelOptics = 0;
					opticsZoomMin = 0.1875; // was 0.375
					opticsZoomMax = 0.505;	// was 1.1
					opticsZoomInit = 0.375;	// was 0.75
					memoryPointCamera = "eye"; // memory point simulating the user's "eye" position when aiming
					opticsFlare = 0;
					opticsDisablePeripherialVision = 0;
					distanceZoomMin = 200;
					distanceZoomMax = 200;
					cameraDir = "";
					visionMode[] = {};
					opticsPPEffects[] = 
					{
						"OpticsBlur1"
					};
				};
			};
		};
	};

Granted that is for a red-dot scope but I I am that confused by what you're trying to code it may or may not help you...

 

 

 

 

Share this post


Link to post
Share on other sites
On 10/22/2023 at 8:54 AM, Jackal326 said:

OK so the only other issue I can see at a glance is the modelOptics path is the same as the model path.

These two parameters do two different things: model defines the model to use as the main appearance of the attachment and modelOptics is used to define a 2d plane model that simulates looking through a scope.

Then within the scope subclass you have an array for modelOptics presumably defining different reticles, but they're textures and not models? Might be confusing the game doing that...

Below is some code that is less janky and I know works, in case you want to test if its broken code that may be causing the issue:


	class SJB_AR_AimpointCompM4: ItemCore
	{
		scope = 2;
		displayName = "Aimpoint Comp M4";
		model = "\SJB_A3_WeaponsCore\data\attachments\Rifles\Aimpoint_COMPM4.p3d";
		picture = "\SJB_A3_WeaponsCore\data\inventory\sjb_acc_compm4_ca.paa";

		descriptionShort = "Red dot sight";
		weaponInfoType = "RscWeaponZeroing";
		class ItemInfo: InventoryOpticsItem_Base_F
		{
			opticType = 1;
			mass = 7.4;
			RMBhint = "Optical Sight";
			optics = 1;

			modelOptics="\A3\Weapons_F\empty";
			class OpticsModes
			{
				class ACO
				{
					opticsID = 1;
					useModelOptics = 0;
					opticsZoomMin = 0.1875; // was 0.375
					opticsZoomMax = 0.505;	// was 1.1
					opticsZoomInit = 0.375;	// was 0.75
					memoryPointCamera = "eye"; // memory point simulating the user's "eye" position when aiming
					opticsFlare = 0;
					opticsDisablePeripherialVision = 0;
					distanceZoomMin = 200;
					distanceZoomMax = 200;
					cameraDir = "";
					visionMode[] = {};
					opticsPPEffects[] = 
					{
						"OpticsBlur1"
					};
				};
			};
		};
	};

Granted that is for a red-dot scope but I I am that confused by what you're trying to code it may or may not help you...

 

 

 

 


Yeah, also I have my own reticle as PAA and changed it to use it in modelOptics and did not work. And I want to make a scope that works like LRPS (2 diferent magnifications with a 2d view).

I'm really out of ideas, all I did was follow the steps from this tutorial



And tried to apply all the 3d model (texturing was made with belnder) to my scope (without adding the things from head tags and things I know it was for cloth and no scopes).

And bro... Did you made all the stuff from SJB mod? Can you help me with a tutorial about making scopes and implementing it in arma 3? I can pay you for it, I'm really frustrated since I cant find good information about scopes and I really like to model scopes  😞

Share this post


Link to post
Share on other sites
On 10/24/2023 at 7:02 PM, FobiaBG said:


Yeah, also I have my own reticle as PAA and changed it to use it in modelOptics and did not work. And I want to make a scope that works like LRPS (2 diferent magnifications with a 2d view).
[...]
And bro... Did you made all the stuff from SJB mod? Can you help me with a tutorial about making scopes and implementing it in arma 3? I can pay you for it, I'm really frustrated since I cant find good information about scopes and I really like to model scopes  😞

 

The modelOptics parameter as I've explained is not for what you're trying to accomplish.

Your best bet for 2-step magnification scopes would be to code it like the HAMR or similar scope that has back-up iron sights, except instead of coding BUIS you code a second scope-view with higher (or lower) magnification.

Something like the following (though I've just written this now so its untested):

		class ItemInfo: InventoryOpticsItem_Base_F
		{
			mass = 8; // whatever "Weight" you want...its mass/encumberance but whatever
			opticType = 1;
			optics = 1;
			modelOptics = "path_to_your_optic_view_model\2dscopeview.p3d";
			class OpticsModes
			{
				class LowMagnification
				{
					opticsID = 1;
					useModelOptics = 1;
					opticsPPEffects[] = {"OpticsRadialBlur1","OpticsBlur1"};
					opticsFlare = 1;
					opticsDisablePeripherialVision = 1;
					opticsZoomMin = 0.0623;
					opticsZoomMax = 0.0623;
					opticsZoomInit = 0.125;
					memoryPointCamera = "opticView";
					distanceZoomMin = 500;
					distanceZoomMax = 500;
				};
				class HighMagnification
				{
					opticsID = 2;
					useModelOptics = 1;
					opticsPPEffects[] = {"OpticsRadialBlur1","OpticsBlur1"};
					opticsFlare = 1;
					opticsDisablePeripherialVision = 1;
					opticsZoomMin = 0.125;
					opticsZoomMax = 0.125;
					opticsZoomInit = 0.125;
					memoryPointCamera = "opticView";
					distanceZoomMin = 300;
					distanceZoomMax = 300;
				};
			};
		};

Like I said above, that is untested code I can't guarantee will work...

 

I didn't make all the stuff in the SJB weapons packs, many of the models were donated by other authors and were then imported/converted/tweaked by me. I wrote all of the code though...

As far as tutorials go, I'm far from the most knowledgeable when it comes to weapons/optic configuration so I doubt I'd ever go so far as to write a tutorial on the subject. The best I can offer is this page on the BIKI which has a few helpful tips I've used in the past.

 

Share this post


Link to post
Share on other sites
22 hours ago, Jackal326 said:

 

The modelOptics parameter as I've explained is not for what you're trying to accomplish.

Your best bet for 2-step magnification scopes would be to code it like the HAMR or similar scope that has back-up iron sights, except instead of coding BUIS you code a second scope-view with higher (or lower) magnification.

Something like the following (though I've just written this now so its untested):


		class ItemInfo: InventoryOpticsItem_Base_F
		{
			mass = 8; // whatever "Weight" you want...its mass/encumberance but whatever
			opticType = 1;
			optics = 1;
			modelOptics = "path_to_your_optic_view_model\2dscopeview.p3d";
			class OpticsModes
			{
				class LowMagnification
				{
					opticsID = 1;
					useModelOptics = 1;
					opticsPPEffects[] = {"OpticsRadialBlur1","OpticsBlur1"};
					opticsFlare = 1;
					opticsDisablePeripherialVision = 1;
					opticsZoomMin = 0.0623;
					opticsZoomMax = 0.0623;
					opticsZoomInit = 0.125;
					memoryPointCamera = "opticView";
					distanceZoomMin = 500;
					distanceZoomMax = 500;
				};
				class HighMagnification
				{
					opticsID = 2;
					useModelOptics = 1;
					opticsPPEffects[] = {"OpticsRadialBlur1","OpticsBlur1"};
					opticsFlare = 1;
					opticsDisablePeripherialVision = 1;
					opticsZoomMin = 0.125;
					opticsZoomMax = 0.125;
					opticsZoomInit = 0.125;
					memoryPointCamera = "opticView";
					distanceZoomMin = 300;
					distanceZoomMax = 300;
				};
			};
		};

Like I said above, that is untested code I can't guarantee will work...

 

I didn't make all the stuff in the SJB weapons packs, many of the models were donated by other authors and were then imported/converted/tweaked by me. I wrote all of the code though...

As far as tutorials go, I'm far from the most knowledgeable when it comes to weapons/optic configuration so I doubt I'd ever go so far as to write a tutorial on the subject. The best I can offer is this page on the BIKI which has a few helpful tips I've used in the past.

 

Thanks bro! I looked at the wiki article and maybe the problem is with the rvmats since I'm not using the respective one for all the lens named int he wiki. For that... How do you assign the alpha for each lens?

Share this post


Link to post
Share on other sites
On 10/26/2023 at 5:28 PM, FobiaBG said:

Thanks bro! I looked at the wiki article and maybe the problem is with the rvmats since I'm not using the respective one for all the lens named int he wiki. For that... How do you assign the alpha for each lens?

Sorry about the late reply, I thought I'd posted one but apparently hadn't hit "post"

 

Anyway, the alphas for lens textures is determined by the alpha channel in the texture itself. The RVMAT has little/no bearing on the alpha and is only used to simulate reflectiveness and/or slight curvature of the lenses with normal maps and smdi textures.

Share this post


Link to post
Share on other sites
On 11/20/2023 at 6:23 AM, Jackal326 said:

Sorry about the late reply, I thought I'd posted one but apparently hadn't hit "post"

 

Anyway, the alphas for lens textures is determined by the alpha channel in the texture itself. The RVMAT has little/no bearing on the alpha and is only used to simulate reflectiveness and/or slight curvature of the lenses with normal maps and smdi textures.

 

No worries! Finally solved everything! As soon I can finish a scope pack I'll publish it on workshop!

Thansk for the help buddy!!! 😄

  • Like 1

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  

×