Jump to content

Problem with weapon parts


BudeRoy

Recommended Posts

As the title tells, i have an issue with weapon parts.

 

I've made copy from vanilla Pistol, SilencedPistol. I have LUA for reloading and everything else's working perfectly except when i want to add same vanilla weapon parts for the SilencedPistol, i never get the upgrade option.

 

Codes:

    item RedDot    {        Type = WeaponPart,        DisplayName = Red Dot,        Icon = RedDot,        Weight = 0.2,        WeightModifier = 0.2,        AimingTimeModifier = 5,        MountOn = Pistol; SilencedPistol,        PartType = Scope,        Tooltip = Tooltip_RedDot,    }        item Laser    {        Type = WeaponPart,        DisplayName = Laser,        Icon = HandgunLaser,        Weight = 0.2,        WeightModifier = 0.2,        HitChanceModifier = 5,        MountOn = Pistol; SilencedPistol,        PartType = Canon,        Tooltip = Tooltip_Laser,    }        item IronSight    {        Type = WeaponPart,        DisplayName = Iron Sight,        Icon = ScopeIronSight,        Weight = 0.1,        WeightModifier = 0.1,        MaxRangeModifier = 3,        MountOn = HuntingRifle; VarmintRifle; Pistol; SilencedPistol,        PartType = Scope,        Tooltip = Tooltip_IronSight,    }

So these are the vanilla weapon parts i want to add as upgrade parts for my modded SilencedPistol just like the vanilla Pistol has them. I'am able to create whole new weapon parts which can be upgraded for the mod pistol, so how i break this lock so i can get the vanilla modifiers for modded weapon?

Link to comment
Share on other sites

So, i managed to deal with this problem completely and ignore the hardcode.

 

What i basicly did was: Copied all the vanilla weapon parts to my mod items script (didn't make any changes to them, only thing changes is module from Base. to PZExanded.), then i made a SuburbsDistributions copy to my mods LUA and removed all the Base.*weaponpartX* lines.

Then at very bottom of SuburbsDistributions there's still all weapons and weapon parts listed, what i did was changed all the Base. to PZExpanded. and added extra line

SilencedPistol = {"PZExpanded.Laser", "PZExpanded.RedDot", "PZExpanded.IronSight"}
.

 

Now vanilla modifiers won't spawn anywhere in the map.

 

Then i simply added "PZExpanded.WeaponPartX"s in my PZESuburbsDistributions lua which adds all mod items on spawnlist and Voilá! All weapon parts spawns in containers and weapons like before and can be attached to the new weapon(s) too.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...