THIS MOD DOES NOTHING ON IT'S OWN! IT'S DESIGNED FOR CUSTOM WEAPON CREATORS!
This mod allows you to create and/or edit the positions of attachment points on weapons and then use them in the a_obj of an attachment. This is probably useless on it's own but should be useful for custom weapons if the developers have included support in order to re-position stock sights or define their own attachment points for custom attachments.
Requires BeardLib for auto-updating!
Put it into mods folder.
Preview of using a custom attachment point vs moving the model in a model editor:
Developer Information
Note: This does not actually add any objects to the guns unit. I may add further functionality in order to expand how much object functionality this provides.
-- Normal Attachment Point
Hooks:PostHook( WeaponTweakData, "init", "SuperUniqueHook", function(self)
-- Use one function for each attachment point.
self:SetupAttachmentPoint( "g36", {
name = "a_gl", -- Name of Attachment Point ( This can be a preexisting one or a new one. )
base_a_obj = "a_fl", -- Attachment point position to base the attachment point off of.
position = Vector3( -3, 8.5, -2.4 ), -- Position to offset from the base_a_obj. ( Default: Vector3( 0, 0, 0 ) )
rotation = RotationCAP( 0, 0, 0 ) -- Rotation to offset from the base_a_obj. ( Default: Rotation( 0, 0, 0 ) )
})
end )
-- Part Attachment Point
Hooks:PostHook( WeaponTweakData, "init", "SuperUniqueHook", function(self)
-- Use one function for each attachment point.
self:SetupAttachmentPoint( "par", {
name = "a_gl", -- Name of Attachment Point ( This can be a preexisting one or a new one. )
base_a_obj = "a_fl", -- ( Optional ) Attachment point position to base the attachment point off of.
part_attach_data = {
{"wpn_fps_lmg_par_upper_reciever"}, -- Attachments to attach to. ( Supports multiple if the attachment has multiple variants. )
"g_cover" -- The object on the attachment to attach to. ( If this object is animated 90% of the time it should move with it. )
},
position = Vector3( -3, 8.5, -2.4 ), -- Position to offset from the part object. ( Default: Vector3( 0, 0, 0 ) )
rotation = RotationCAP( 0, 0, 0 ) -- Rotation to offset from the part object. ( Default: Rotation( 0, 0, 0 ) )
})
end )