Jump to content
Sign in to follow this  
solviper

Weapon icon not showing

Recommended Posts

I made a simple retexture to one of the RHS M4A1's and created an icon for it that works perfectly fine in the virtual arsenal, but once equipped the weapon rectangle is blank. Any help is appreciated thanks.

Share this post


Link to post
Share on other sites

When you have it equipped (in your inventory) do you have any attachments equipped as well?

Share this post


Link to post
Share on other sites

When you have it equipped (in your inventory) do you have any attachments equipped as well?

Yes.

 

Ok this is my first time doing this and just noticed there's some complicated UI stuff you have to do for the weapon and the attachment overlay spots so I'll go figure this stuff out.

Share this post


Link to post
Share on other sites

Its not that complicated, once you know what you need to do. You can either use the old way of doing things (with the _x_ca.paa suffix/extension for an attachment-free base weapon image, _m_ca.paa for a base weapon with a muzzle attachment etc), or you can use the following:

		class WeaponSlotsInfo: WeaponSlotsInfo
		{
			mass = xxx;

			icon = "\SSQN_DMRs\Data\inv\ssqn_l115a1w_x_ca.paa"; /// this stays the same as before and is used as a base layer

			class MuzzleSlot: SlotInfo
			{
                   		iconPosition[] = {0.21, 0.465}; /// position of the slot icon inside of the weapon icon, relative to top-left corner in {right, down} format
                  		iconScale = 0.2; /// scale of icon described in iconPicture
                   		iconPicture = "\A3\Weapons_F\Data\UI\attachment_muzzle.paa"; /// icon for selected slot
                   		iconPinpoint = "Right"; /// top, bottom, left, right, center alignment of the icon on snap point
				linkProxy = "\A3\data_f\proxies\weapon_slots\MUZZLE";
				compatibleItems[] = {ARRAY OF ATTACHMENTS GOES HERE};
			};
			class CowsSlot: CowsSlot
			{
                   		iconPosition[] = {0.68, 0.45}; /// position of the slot icon inside of the weapon icon, relative to top-left corner in {right, down} format
                  		iconScale = 0.15; /// scale of icon described in iconPicture
                   		iconPicture = "\A3\Weapons_F\Data\UI\attachment_top.paa"; /// icon for selected slot
                   		iconPinpoint = "Bottom"; /// top, bottom, left, right, center alignment of the icon on snap point
				linkProxy = "\A3\data_f\proxies\weapon_slots\TOP";
				compatibleItems[] = {ARRAY OF ATTACHMENTS GOES HERE};
			};
			class PointerSlot: PointerSlot
			{
                   		iconPosition[] = {0.455, 0.513}; /// position of the slot icon inside of the weapon icon, relative to top-left corner in {right, down} format
                  		iconScale = 0.3; /// scale of icon described in iconPicture
                   		iconPicture = "\SSQN_DMRs\Data\inv\icon_ghilliewrap_ca.paa"; /// icon for selected slot
                   		iconPinpoint = "Center"; /// top, bottom, left, right, center alignment of the icon on snap point
				linkProxy = "\A3\data_f\proxies\weapon_slots\SIDE";
				compatibleItems[] = {ARRAY OF ATTACHMENTS GOES HERE};
			};

			class UnderBarrelSlot: UnderBarrelSlot
			{
                   		iconPosition[] = {0.517, 0.523}; /// position of the slot icon inside of the weapon icon, relative to top-left corner in {right, down} format
                  		iconScale = 0.3; /// scale of icon described in iconPicture
                   		iconPinpoint = "Top"; /// top, bottom, left, right, center alignment of the icon on snap point
				linkProxy = "\A3\Data_F_Mark\Proxies\Weapon_Slots\UNDERBARREL";
				compatibleItems[] = {"bipod_01_F_snd","bipod_01_F_blk","bipod_01_F_mtp"};
			};
		};

Its a rough example, but the notations will help, as will the full examples I hope. If not, I'm sure it may be of help to others as will the below note, which wont apply to you as you're re-texturing ODOL p3ds (for personal use only I hope unless you have permission obviously) and as such Binarize won't play a part.

 

If you intend to Binarize the addon, you will obviously need to have extracted 'A3_Data_F.pbo' as well as have created a 'dummy' UNDERBARREL proxy at the path indicated in your P:/ drive (just create a text file, and rename it from 'New Text Document.txt' to 'UNDERBARREL.p3d'

Share this post


Link to post
Share on other sites

Thank you! I'll try this out.

 

 

Edit: Ok so I got it to work so thank you for that. Just a quick question, is there a way to allow all available attachments to be used instead of listing them all individually?

Share this post


Link to post
Share on other sites

Not that I know of. There could be a trick to it using the newer versions of CBA (which have now integrated ASDG Joint Rails as far as I'm aware), but as to how you'd go about doing it I've no idea.

Share this post


Link to post
Share on other sites

I don't think you've handled your class inheritances properly if you're losing things like the weaponSlotsInfo

Literally all you should have to do to retexture something like the RHS M4A1 is this:
 

	class rhs_weap_m4a1; //External Class Reference

	class my_rhs_weap_m4a1 : rhs_weap_m4a1 {
		scope = 2;
		author = "Me, RHS";
		displayName = "My M4A1 Reskin";
		picture = "inventory pic";
		hiddenSelectionsTextures[] = {"\rhsusf\addons\rhsusf_weapons\m4\data\m4a1_actual_co.paa", "\rhsusf\addons\rhsusf_weapons\m4\data\magazine_co.paa", "\rhsusf\addons\rhsusf_weapons\m4\data\m4acc_co.paa", "\rhsusf\addons\rhsusf_weapons\m4\data\kacrailcover_co.paa", "\rhsusf\addons\rhsusf_weapons\acc\grips\grippod\data\acc_co.paa", "\rhsusf\addons\rhsusf_weapons\m4\data\magpulstock_co.paa", "\rhsusf\addons\rhsusf_weapons\m4\data\m203_co.paa", "\rhsusf\addons\rhsusf_weapons\m4\data\kacleaf_co.paa", "\rhsusf\addons\rhsusf_weapons\m320\data\m320_co.paa", "\rhsusf\addons\rhsusf_weapons\m4\data\m4a1_actual_co.paa"};
		hiddenSelectionsMaterials[] = {"\rhsusf\addons\rhsusf_weapons\m4\data\m4a1_actual.rvmat", "\rhsusf\addons\rhsusf_weapons\m4\data\magazine.rvmat", "\rhsusf\addons\rhsusf_weapons\m4\data\m4acc_co.rvmat", "\rhsusf\addons\rhsusf_weapons\m4\data\kacrailcover.rvmat", "\rhsusf\addons\rhsusf_weapons\acc\grips\grippod\data\acc_co.rvmat", "\rhsusf\addons\rhsusf_weapons\m4\data\magpulstock.rvmat", "\rhsusf\addons\rhsusf_weapons\m4\data\m203.rvmat", "\rhsusf\addons\rhsusf_weapons\m4\data\kacleaf.rvmat", "\rhsusf\addons\rhsusf_weapons\m320\data\M320.rvmat", "\rhsusf\addons\rhsusf_weapons\m4\data\m4a1_actual.rvmat"};
	};

And swap the texture paths under hiddenSelectionsTextures and hiddenSelectionsMaterials for your own where you have made new ones. If you haven't made any new .rvmats then you don't need the hiddenSelectionsMaterials[] array.

 

You can do the same for the other variants (UGL etc.) or set up your own class tree patterned after the one in the RHS config, but starting from class my_rhs_weap_m4a1 so that they inherit the changes hiddenSelections line.

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  

×