Class Customization (choice gun)

Support for MFPS 2.0 (for verified users)
Forum rules
To request support/assistance for MFPS, you first have to verify your purchase by sending your purchase invoice number to Lovatto in a PM.
Post Reply
User avatar
Oggy
Contributor
Contributor
Posts: 79
Joined: Fri Oct 13, 2017 2:53 am

How to fix script that secondary slots can only carry pistols!?? and certainly primary slots not use pistol!
Thanks
User avatar
chrisb
Contributor
Contributor
Posts: 57
Joined: Sun Apr 05, 2015 9:12 am

In the method ShowList of bl_ClassCustomize script you'll need to add something like the following if statements to each class type and slot type, here's mine from the support class:

case PlayerClass.Support://-----------------------------------------------------------------------------------------------------
for (int i = 0; i < SupportClass.Count; i++)
{
switch (slot)
{
case 0://Primary
if (SupportClass.Info.Type == GunType.Smg) // cab
{
GameObject b = Instantiate(GunSelectPrefabs) as GameObject;
bl_ClassInfoUI iui = b.GetComponent<bl_ClassInfoUI>();
iui.GetInfo(SupportClass, 0, i);
b.transform.SetParent(PanelWeaponList, false);
}
break;
case 1://Secondary
if (SupportClass.Info.Type == GunType.Pistol) // cab
{
GameObject b = Instantiate(GunSelectPrefabs) as GameObject;
bl_ClassInfoUI iui = b.GetComponent<bl_ClassInfoUI>();
iui.GetInfo(SupportClass, 1, i);
b.transform.SetParent(PanelWeaponList, false);
}
break;


Similarily do the same for slots 3 and 4 but change the if statement to == GunType.Knife and Grenade for example.
(GunType.Smg doesn't exist in the standard code, that's one I've added but you could also say GunType.MachineGun here just to list the machineguns)
Watch out for guns with a type of GunType.Burst (I don't use it at the moment so haven't dealt with it. I personally don't think it should be defined as a gun type, it's a firing type like single shot etc, so I don't know why it's in the GunType enum?? Seems odd to me, for now none of my guns are marked as being able to Burst fire, but I guess one day I'm going to have to deal with it.

But in game if the player picks up a pistol while holding the primary weapon, then the picked up pistol will end up in their primary slot, so you might want to look at the logic in bl_Pickup script, I just haven't looked at it yet. :D

It might be better to put a new post in the bugs forum, and hope Lovatto implements a fix for this in the next update, as this really is a bug in the code rather than a support request.
User avatar
Oggy
Contributor
Contributor
Posts: 79
Joined: Fri Oct 13, 2017 2:53 am

Thank you very much!
Post Reply