Project Zomboid

Project Zomboid

Gunsmith
This topic has been locked
KarpJoe 23 Dec, 2023 @ 5:30pm
How to get Generic Parts?
I'm trying to repair a weapon (W1866 Carbine) from VFE and it says I need generic parts to repair it. I assume this is because it isn't auto-classified by the mod as any of the normal categories.
How do I get more generic parts?
Do I have to just hope I find another weapon that isn't classified properly?
Is there some way to convert other weapon parts into generic parts?
If not would that be something you could add?
< >
Showing 1-1 of 1 comments
Dismellion  [developer] 1 Jan, 2024 @ 2:05pm 
Originally posted by FrancisPJ:
I'm trying to repair a weapon (W1866 Carbine) from VFE and it says I need generic parts to repair it. I assume this is because it isn't auto-classified by the mod as any of the normal categories.
How do I get more generic parts?
Do I have to just hope I find another weapon that isn't classified properly?
Is there some way to convert other weapon parts into generic parts?
If not would that be something you could add?

Yes you are right, this is a fallback mechanics in case weapon has no type. And so, unfortunately same type of weapon has to be disassembled to get parts. If this is not a generic problem of the weapon mod I would ask mod maker to fix that issue.

Code below describes the way the gun part type is determined
function GSmith:getPartType(weapon) local weaponType = weapon:getWeaponReloadType(); local fireModes = weapon:getFireModePossibilities(); local isFullAuto = fireModes and fireModes:get(0) == "Auto"; if weaponType == "handgun" then return "Base.WeaponPartsHandgun"; end if weaponType == "revolver" then return "Base.WeaponPartsRevolver"; end if weaponType == "shotgun" or weaponType == "doublebarrelshotgun" then return "Base.WeaponPartsShotgun"; end if weaponType == "boltactionnomag" then return "Base.WeaponPartsRifle"; end if weaponType == "boltaction" then if isFullAuto then return "Base.WeaponPartsAuto"; else return "Base.WeaponPartsRifle"; end end return "Base.WeaponPartsGeneric"; -- I have no idea what that is, just in case end
< >
Showing 1-1 of 1 comments
Per page: 1530 50