Page 1 of 1

Class Customizer Can't Remove Pistols From Allowed Primarys

Posted: Tue Sep 01, 2020 3:41 pm
by ThePrimePillow
Hello, I am using "class-customization-v1.6" and I am unable to remove pistols from the allowed primary weapons in "Bl_Class Custimze." I am able to toggle them off but in the class custimzer scene I can still select them as a primary. Also clicking the change button on "Secondary" doesn't pull up the available weapons. For some reason pistols don't appear on the list of weapons in the secondary category. Also I noticed that there is no toggle for launcher weapon types.

Re: Class Customizer Can't Remove Pistols From Allowed Primarys

Posted: Tue Sep 01, 2020 4:49 pm
by Lovatto
I can replicate the problem with the pistol,
the problem is that the GunType of the example pistol in the GameData is set as Machinegun when it should be Pistol,
so simply make sure your pistols have the right type in GameData.

For active/disable launcher type as a different category, you will need some code modifications:

in ClassKey.cs -> ClassAllowedWeaponsType -> add this line:

Code: Select all

 [LovattoToogle] public bool AllowLaunchers = true;
ireplace the function in bl_ClassCustomize.cs -> isAllowedWeapon(...) with this:

Code: Select all

private bool isAllowedWeapon(bl_GunInfo info, int slot)
        {
            ClassAllowedWeaponsType rules = PrimaryAllowedWeapons;
            if (slot == 1) { rules = SecondaryAllowedWeapons; }
            else if (slot == 2) { rules = KnifeAllowedWeapons; }
            else if (slot == 3) { rules = GrenadesAllowedWeapons; }

            if ((rules.AllowMachineGuns && (info.Type == GunType.Machinegun || info.Type == GunType.Burst)) ||
                (rules.AllowPistols && info.Type == GunType.Pistol) || 
                (rules.AllowShotguns && info.Type == GunType.Shotgun) || 
                (rules.AllowKnifes && info.Type == GunType.Knife) || 
                (rules.AllowGrenades && (info.Type == GunType.Grenade || info.Type == GunType.Grenade)) || 
                (rules.AllowSnipers && info.Type == GunType.Sniper) ||
                (rules.AllowLaunchers && info.Type == GunType.Launcher))
            {
                return true;
            }
            return false;
        }

Re: Class Customizer Can't Remove Pistols From Allowed Primarys

Posted: Tue Sep 01, 2020 5:19 pm
by ThePrimePillow
Thank you, it works now.