Jump to content
SterlingC

Weapon Inventory Icon (RHS)

Recommended Posts

Hello,

 

I'm reskinning a rifle from the RHS mod and almost everything is going fine. My problem is with my new inventory image—Everything is great and I can see the new image, but if I attach an RHS bipod or forward grip then the original (old) inventory image returns. If I take the attachment off, or replace it with a vanilla one, the new (correct) image is again visible. I've tried everything I can think of and learned quite a bit, but it hasn't helped with my problem.  Any help or insights would be appreciated.

 

Here is my config file:

 

class CfgPatches
{
class MBS_RHS_Rifle
{
    units[] = {};
    weapons[] = {};
    Version = 0.1;
    requiredVersion = 0.1;
    requiredAddons[] = {"A3_Characters_F_BLUFOR","Extended_EventHandlers","cba_main","rhsusf_c_weapons"};
};
};
class Mode_SemiAuto;
class Mode_Burst;
class cfgWeapons
{
    class Default {};

    class RifleCore : Default {};

    class Rifle : RifleCore {};

    class arifle_MX_Base_F : Rifle {};

    class rhs_weap_m4_Base : arifle_MX_Base_F {};

    class rhs_weap_m4a1 : rhs_weap_m4_Base {};

    class rhs_weap_hk416d145_d_2 : rhs_weap_m4a1
    {
                baseWeapon = "rhs_weap_hk416d145_d_2";
        model = "\mbs_Rifle\mbs_Rifle.p3d";
                displayName = "MBS Rifle";
        picture = "\mbs_rifle\ui\Data\rhs_weap_rifle_d_2_ca.paa";
                UiPicture = "\A3\weapons_f\data\UI\icon_regular_CA.paa";
        deployedPivot="bipod";
        hasBipod="true";
        descriptionShort="Assault rifle<br/>Caliber: 5.56 mm";
        magazineReloadSwitchPhase=0.25000001;
        cameraDir = "eye";
            memorypointcamera = "eye";
            opticsPPEffects[] = {};
            opticsDisablePeripherialVision = 0.67;
            discreteDistanceCameraPoint[]={"eye","eye","eye","eye","eye","eye","eye"};
            discretedistance[] = {25,100,200,300,400,500,600};
        weaponInfoType="RscWeaponZeroing";

modes[]=
        {
            "Single",
            "Burst"
        };
        class Single: Mode_SemiAuto
        {
            class BaseSoundModeType
            {
            };
            class StandardSound: BaseSoundModeType
            {
                soundSetShot[]=
                {
                    "RHSUSF_m16_Closure_SoundSet",
                    "RHSUSF_m16_Shot_SoundSet",
                    "RHSUSF_rifle1_Tail_SoundSet"
                };
            };
            class SilencedSound: BaseSoundModeType
            {
                soundSetShot[]=
                {
                    "RHSUSF_m16_Closure_SoundSet",
                    "RHSUSF_m16_ShotSD_SoundSet",
                    "RHSUSF_rifle1_SD_Tail_SoundSet"
                };
            };
        };
        class Burst: Mode_Burst
        {
            class BaseSoundModeType
            {
            };
            class StandardSound: BaseSoundModeType
            {
                soundSetShot[]=
                {
                    "RHSUSF_m16_Closure_SoundSet",
                    "RHSUSF_m16_Shot_SoundSet",
                    "RHSUSF_rifle1_Tail_SoundSet"
                };
            };
            class SilencedSound: BaseSoundModeType
            {
                soundSetShot[]=
                {
                    "RHSUSF_m16_Closure_SoundSet",
                    "RHSUSF_m16_ShotSD_SoundSet",
                    "RHSUSF_rifle1_SD_Tail_SoundSet"
                };
            };
        };
    };

};
};


 

Share this post


Link to post
Share on other sites

I think the attachment subclasses in either ItemInfo or directly in the weapons class each have their own inventory icon.

Share this post


Link to post
Share on other sites

Thank you Dedmen. I was thinking it could be something like that, but haven't been able to find enough documentation about it. One thread had made reference to adding a specific suffix like _x_ca.paa or _m_ca.paa to the weapon picture, which I tried but probably in the wrong part of the config. If that does sound like the issue, maybe someone can point me in the right direction or share an example. 

 

I think some weapons are able to show various attachments sort of overlayed on the weapon as an icon—I am simply trying to have one consistent image no matter what is attached, without the icon overlays. 

 

For clarity, I'll explain the issue again: 

 

For simplicity, let's say I am changing the RHS M14 for a retextured M16. Everything works fine, except that when I attach an RHS grip or bipod (vanilla does not cause a problem) then the image of the retextured M16 in my inventory is changed back to an M14. If I take the RHS bipod or grip off, then the M16 image reappears. 

 

I believe the image would defined in the weapon somewhere, since the RHS original (the M14 in my example) is a camouflaged variant and the inventory image shows the specific camouflage. Could be wrong though. I'm still getting a handle on configs. 

 

Thanks again for any help. 

Share this post


Link to post
Share on other sites
1 hour ago, SterlingC said:

I believe the image would defined in the weapon somewhere

 

5 hours ago, Dedmen said:

I think the attachment subclasses in either ItemInfo or directly in the weapons class

 

Share this post


Link to post
Share on other sites

Took me a little while to understand. Everything works now. Here is what I ended up with:

 


 

class CfgPatches
{
class MBS_RHS_Rifle
{
    units[] = {};
    weapons[] = {};
    Version = 0.1;
    requiredVersion = 0.1;
    requiredAddons[] = {"A3_Characters_F_BLUFOR","Extended_EventHandlers","cba_main","rhsusf_weapons","rhsusf_c_weapons","rhsusf_weapons2",};
};
};
class SlotInfo;
class Mode_SemiAuto;
class Mode_Burst;
class cfgWeapons
{

    class Default {};

    class RifleCore : Default {};

    class Rifle : RifleCore {};

    class arifle_MX_Base_F : Rifle {};

    class rhs_weap_m4_Base : arifle_MX_Base_F {};

    class rhs_weap_m4a1 : rhs_weap_m4_Base {class WeaponSlotsInfo;};

    class rhs_weap_hk416d145_d_2 : rhs_weap_m4a1
    {
         baseWeapon = "rhs_weap_hk416d145_d_2";
        model = "\mbs_rifle\mbs_rifle.p3d";
       displayName = "MBS Rifle";
        picture = "\mbs_rifle\ui\Data\mbs_rifle_ca.paa";
        UiPicture = "\mbs_Rifle\ui\Data\mbs_rifle_ca.paa";
        deployedPivot="bipod";
        hasBipod="true";
        descriptionShort="Assault rifle<br/>Caliber: 5.56 mm";
        magazineReloadSwitchPhase=0.25000001;
        cameraDir = "eye";
            memorypointcamera = "eye";
            opticsPPEffects[] = {};
            opticsDisablePeripherialVision = 0.67;
            discreteDistanceCameraPoint[]={"eye","eye","eye","eye","eye","eye","eye"};
            discretedistance[] = {25,100,200,300,400,500,600};
        weaponInfoType="RscWeaponZeroing";

modes[]=
        {
            "Single",
            "Burst"
        };
        class Single: Mode_SemiAuto
        {
            class BaseSoundModeType
            {
            };
            class StandardSound: BaseSoundModeType
            {
                soundSetShot[]=
                {
                    "RHSUSF_m16_Closure_SoundSet",
                    "RHSUSF_m16_Shot_SoundSet",
                    "RHSUSF_rifle1_Tail_SoundSet"
                };
            };
            class SilencedSound: BaseSoundModeType
            {
                soundSetShot[]=
                {
                    "RHSUSF_m16_Closure_SoundSet",
                    "RHSUSF_m16_ShotSD_SoundSet",
                    "RHSUSF_rifle1_SD_Tail_SoundSet"
                };
            };
        };
        class Burst: Mode_Burst
        {
            class BaseSoundModeType
            {
            };
            class StandardSound: BaseSoundModeType
            {
                soundSetShot[]=
                {
                    "RHSUSF_m16_Closure_SoundSet",
                    "RHSUSF_m16_Shot_SoundSet",
                    "RHSUSF_rifle1_Tail_SoundSet"
                };
            };
            class SilencedSound: BaseSoundModeType
            {
                soundSetShot[]=
                {
                    "RHSUSF_m16_Closure_SoundSet",
                    "RHSUSF_m16_ShotSD_SoundSet",
                    "RHSUSF_rifle1_SD_Tail_SoundSet"
                };
            };
        };
    };

    class rhs_weap_hk416d145_d_2_grip: rhs_weap_hk416d145_d_2
    {
        author="$STR_RHSUSF_AUTHOR_FULL";
        picture="\mbs_rifle\ui\Data\mbs_rifle_ca.paa";
        handAnim[]=
        {
            "OFP2_ManSkeleton",
            "\rhsusf\addons\rhsusf_c_weapons\anims\rhs_hand_m16a4.rtm"
        };
        class LinkedItems
        {
            class LinkedItemsUnder
            {
                item="rhsusf_acc_grip1";
                slot="UnderBarrelSlot";
            };
        };
    };
    class rhs_weap_hk416d145_d_2_grip2: rhs_weap_hk416d145_d_2_grip
    {
        author="$STR_RHSUSF_AUTHOR_FULL";
        picture="\mbs_rifle\ui\Data\mbs_rifle_ca.paa";
        handAnim[]=
        {
            "OFP2_ManSkeleton",
            "\rhsusf\addons\rhsusf_c_weapons\anims\rhs_hand_m4a1_afg.rtm"
        };
        class LinkedItems
        {
            class LinkedItemsUnder
            {
                item="rhsusf_acc_grip2";
                slot="UnderBarrelSlot";
            };
        };
    };
    class rhs_weap_hk416d145_d_2_grip3: rhs_weap_hk416d145_d_2_grip2
    {
        author="$STR_RHSUSF_AUTHOR_FULL";
        picture="\mbs_rifle\ui\Data\mbs_rifle_ca.paa";
        handAnim[]=
        {
            "OFP2_ManSkeleton",
            "\rhsusf\addons\rhsusf_c_weapons\anims\rhs_hand_m16a4.rtm"
        };
        class LinkedItems
        {
            class LinkedItemsUnder
            {
                item="rhsusf_acc_grip3";
                slot="UnderBarrelSlot";
            };
        };
    };

};
};

 

 

Thanks!

Share this post


Link to post
Share on other sites

You don't need to reimplement Single/Burst

Share this post


Link to post
Share on other sites
On 8/21/2018 at 2:10 AM, Dedmen said:

You don't need to reimplement Single/Burst

Not for the icon change, that's true, but I was changing the weapon from fully automatic to three round burst. Not sure if it was necessary to reimplement single. Perhaps not. This project is kind of my way of learning how configs and inheritance work, so I am continuing to tinker with it. 

 

Thanks again the help! 

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

×